diff options
-rw-r--r-- | .SRCINFO | 7 | ||||
-rw-r--r-- | PKGBUILD | 48 | ||||
-rw-r--r-- | mongodb.conf | 43 | ||||
-rw-r--r-- | mongodb.service | 37 |
4 files changed, 36 insertions, 99 deletions
@@ -1,12 +1,13 @@ pkgbase = mongodb-bin pkgdesc = A high-performance, open source, schema-free document-oriented database pkgver = 6.0.1 - pkgrel = 1 + pkgrel = 2 url = https://www.mongodb.com/ arch = x86_64 arch = aarch64 license = custom:SSPLv1 license = Apache + makedepends = chrpath depends = mongosh-bin depends = curl optdepends = mongodb-tools: The MongoDB tools provide import, export, and diagnostic capabilities. @@ -16,13 +17,9 @@ pkgbase = mongodb-bin noextract = mongodb-org-server_6.0.1_x86_64.deb noextract = mongodb-org-mongos_6.0.1_x86_64.deb backup = etc/mongodb.conf - source = mongodb.conf - source = mongodb.service source = mongodb.sysusers source = mongodb.tmpfiles source = LICENSE - sha256sums = f2a79c7fcd75253ab1cb888541a0c0678bf3bb78700c79996e24a678f1e42850 - sha256sums = de4f6770c45bc5418883659c479783c0184a6057df1c405a7933637984f82f0a sha256sums = 47b884569102f7c79017ee78ef2e98204a25aa834c0ee7d5d62c270ab05d4e2b sha256sums = 51ee1e1f71598aad919db79a195778e6cb6cfce48267565e88a401ebc64497ac sha256sums = 09d99ca61eb07873d5334077acba22c33e7f7d0a9fa08c92734e0ac8430d6e27 @@ -5,12 +5,13 @@ pkgname="mongodb-bin" pkgver="6.0.1" _basever="6.0" _basedist="focal" -pkgrel="1" +pkgrel="2" pkgdesc="A high-performance, open source, schema-free document-oriented database" arch=("x86_64" "aarch64") url="https://www.mongodb.com/" license=("custom:SSPLv1" "Apache") depends=(mongosh-bin curl) +makedepends=(chrpath) optdepends=("mongodb-tools: The MongoDB tools provide import, export, and diagnostic capabilities.") provides=("mongodb=$pkgver") conflicts=("mongodb" "mongodb-shell-bin") @@ -18,8 +19,6 @@ backup=("etc/mongodb.conf") _repo_url=https://repo.mongodb.org/apt/ubuntu/dists/${_basedist}/mongodb-org/${_basever}/multiverse source=( - "mongodb.conf" - "mongodb.service" "mongodb.sysusers" "mongodb.tmpfiles" "LICENSE" @@ -36,9 +35,7 @@ noextract=( mongodb-org-server_${pkgver}_${CARCH}.deb mongodb-org-mongos_${pkgver}_${CARCH}.deb ) -sha256sums=('f2a79c7fcd75253ab1cb888541a0c0678bf3bb78700c79996e24a678f1e42850' - 'de4f6770c45bc5418883659c479783c0184a6057df1c405a7933637984f82f0a' - '47b884569102f7c79017ee78ef2e98204a25aa834c0ee7d5d62c270ab05d4e2b' +sha256sums=('47b884569102f7c79017ee78ef2e98204a25aa834c0ee7d5d62c270ab05d4e2b' '51ee1e1f71598aad919db79a195778e6cb6cfce48267565e88a401ebc64497ac' '09d99ca61eb07873d5334077acba22c33e7f7d0a9fa08c92734e0ac8430d6e27') sha256sums_x86_64=('8f1d8abd3cacdee1f9cd3ad444cf060a3e804e2354eff7f943bc942089ed059b' @@ -50,15 +47,38 @@ prepare() { mkdir -p output bsdtar -O -xf mongodb-org-server_${pkgver}_${CARCH}.deb data.tar.xz | bsdtar -C output -xJf - #server extracted bsdtar -O -xf mongodb-org-mongos_${pkgver}_${CARCH}.deb data.tar.xz | bsdtar -C output -xJf - #mongos extracted + + # Remove insecure RUNPATH '$ORIGIN/../lib' as reported by namcap + chrpath -d output/usr/bin/mongos + + # Keep historical Arch dbPath + sed -i 's|dbPath: /var/lib/mongo$|dbPath: /var/lib/mongodb|' output/etc/mongod.conf + + # Keep historical Arch conf file name + sed -i 's|/etc/mongod.conf|/etc/mongodb.conf|' output/lib/systemd/system/mongod.service + + # Keep historical Arch user name (no need for separate daemon group name) + sed -i 's/User=mongod$/User=mongodb/' output/lib/systemd/system/mongod.service + sed -i 's/Group=mongod$/Group=mongodb/' output/lib/systemd/system/mongod.service + + # Avoid legacy PID filepath + sed -i 's|/var/run/|/var/|' output/lib/systemd/system/mongod.service + + # Remove sysconfig file, used by upstream's init.d script not used on Arch + sed -i '/^EnvironmentFile=/d' output/lib/systemd/system/mongod.service + + # Make systemd wait as long as it takes for MongoDB to start + # If MongoDB needs a long time to start, prevent systemd from restarting it every 90 seconds + # See: https://jira.mongodb.org/browse/SERVER-38086 + sed -i 's/\[Service]/[Service]\nTimeoutStartSec=infinity/' output/lib/systemd/system/mongod.service } package() { - mkdir -p "$pkgdir/usr/share/man" - cp -r "output/usr/bin" "$pkgdir/usr/" - cp -r "output/usr/share/man/man1" "$pkgdir/usr/share/man/" - install -Dm644 "mongodb.conf" "$pkgdir/etc/mongodb.conf" - install -Dm644 "mongodb.service" "$pkgdir/usr/lib/systemd/system/mongodb.service" - install -Dm644 "mongodb.sysusers" "$pkgdir/usr/lib/sysusers.d/mongodb.conf" - install -Dm644 "mongodb.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/mongodb.conf" - install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" + install -Dm644 output/etc/mongod.conf "$pkgdir/etc/mongodb.conf" + install -Dm644 output/lib/systemd/system/mongod.service "$pkgdir/usr/lib/systemd/system/mongodb.service" + install -Dm755 output/usr/bin/* -t "$pkgdir/usr/bin" + install -Dm644 output/usr/share/man/man1/* -t "$pkgdir/usr/share/man/man1" + install -Dm644 mongodb.sysusers "$pkgdir/usr/lib/sysusers.d/mongodb.conf" + install -Dm644 mongodb.tmpfiles "$pkgdir/usr/lib/tmpfiles.d/mongodb.conf" + install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" } diff --git a/mongodb.conf b/mongodb.conf deleted file mode 100644 index 4a82d14d95ab..000000000000 --- a/mongodb.conf +++ /dev/null @@ -1,43 +0,0 @@ -# mongod.conf - -# for documentation of all options, see: -# http://docs.mongodb.org/manual/reference/configuration-options/ - -# Where and how to store data. -storage: - dbPath: /var/lib/mongodb - journal: - enabled: true -# engine: -# mmapv1: -# wiredTiger: - -# where to write logging data. -systemLog: - destination: file - logAppend: true - path: /var/log/mongodb/mongod.log - -# network interfaces -net: - port: 27017 - bindIp: 127.0.0.1 - - -# how the process runs -processManagement: - timeZoneInfo: /usr/share/zoneinfo - -#security: - -#operationProfiling: - -#replication: - -#sharding: - -## Enterprise-Only Options: - -#auditLog: - -#snmp: diff --git a/mongodb.service b/mongodb.service deleted file mode 100644 index 1f0fbdaed76c..000000000000 --- a/mongodb.service +++ /dev/null @@ -1,37 +0,0 @@ -[Unit] -Description=MongoDB Database Server -Documentation=https://docs.mongodb.org/manual -After=network-online.target -Wants=network-online.target - -[Service] -User=mongodb -Group=mongodb -ExecStart=/usr/bin/mongod --config /etc/mongodb.conf -PIDFile=/run/mongodb/mongod.pid -# file size -LimitFSIZE=infinity -# cpu time -LimitCPU=infinity -# virtual memory size -LimitAS=infinity -# open files -LimitNOFILE=64000 -# processes/threads -LimitNPROC=64000 -# locked memory -LimitMEMLOCK=infinity -# total threads (user+kernel) -TasksMax=infinity -TasksAccounting=false -# Make systemd wait as long as it takes for MongoDB to start -# If MongoDB needs a long time to start, prevent systemd from -# restarting it every 90 seconds -# See: https://jira.mongodb.org/browse/SERVER-38086 -TimeoutStartSec=infinity - -# Recommended limits for mongod as specified in -# https://docs.mongodb.com/manual/reference/ulimit/#recommended-ulimit-settings - -[Install] -WantedBy=multi-user.target |