[arch-commits] Commit in mosquitto/trunk (PKGBUILD mosquitto.service)

David Runge dvzrv at gemini.archlinux.org
Sat Dec 11 20:01:49 UTC 2021


    Date: Saturday, December 11, 2021 @ 20:01:49
  Author: dvzrv
Revision: 1068319

upgpkg: mosquitto 2.0.14-2: Rebuild to switch build system.

Switch to cmake as build system.
Ensure to link against system provided libwebsockets, systemd and c-ares.
Change systemd service to be of Type=Notify (due to libsystemd.so dep).
Simplify quoting in file.
Remove unneeded prepare().

Modified:
  mosquitto/trunk/PKGBUILD
  mosquitto/trunk/mosquitto.service

-------------------+
 PKGBUILD          |   57 +++++++++++++++++++++++++++-------------------------
 mosquitto.service |    2 +
 2 files changed, 32 insertions(+), 27 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-12-11 19:32:55 UTC (rev 1068318)
+++ PKGBUILD	2021-12-11 20:01:49 UTC (rev 1068319)
@@ -1,48 +1,51 @@
 # Maintainer: Jelle van der Waa <jelle at archlinux.org>
+# Contributor: David Runge <dvzrv at archlinux.org>
 # Contributor: Radek Podgorny <radek at podgorny.cz>
 # Contributor: Dan Anderson <dan-anderson at cox dptnet>
 
 pkgname=mosquitto
 pkgver=2.0.14
-pkgrel=1
+pkgrel=2
 pkgdesc="An Open Source MQTT Broker"
-arch=('x86_64')
+arch=(x86_64)
 url="https://mosquitto.org/"
-depends=('openssl' 'c-ares' 'util-linux-libs' 'cjson')
-makedepends=('docbook-xsl' 'c-ares' 'libwebsockets')
-license=('BSD')
-source=(https://mosquitto.org/files/source/mosquitto-$pkgver.tar.gz{,.asc}
-        "$pkgname.service"
-        "sysusers_mosquitto.conf")
+license=(BSD)
+depends=(cjson openssl util-linux-libs)
+makedepends=(c-ares cmake docbook-xsl libwebsockets systemd uthash)
+source=(
+  https://mosquitto.org/files/source/mosquitto-$pkgver.tar.gz{,.asc}
+  "$pkgname.service"
+  "sysusers_mosquitto.conf"
+)
 backup=("etc/$pkgname/$pkgname.conf")
 sha512sums=('a9e4f41b9af679b30318570e86a465546024651373df10e3b132f4593b89d22d0dbac01bb7371a57132ba030a2e73971c612acb5c9ac12f5ccd06aa38d9444c2'
             'SKIP'
-            '7dd86bb454e6df45e609fc3cb53d3cae8cc1c36d459b1e23be9ab10c9770c7a406fbd34e47703b0db3056f4bc8550994666b8a398d4506f786bf274e4618b7e9'
+            '4789e8ee42f4a8e3ca8e7fd21cb551b5e34991e6ca1750533bbfa555260e20e8ea167bd69b99b407237bcc8969157eee792fdcf3844b839d73310a6c59e5f045'
             '21848b890c2db258138795ec21a009e022b6a8369217eb31939f976ad434229dd9f61d33e8109ade7bc001e8668e9d42b59c1ab079753860417961e102356f0e')
 validpgpkeys=('A0D6EEA1DCAE49A635A3B2F0779B22DFB3E717B7')
 
-prepare() {
-  cd "$pkgname-$pkgver"
-  # FIX upstream by making SBINDIR=foo or use CMAKE
-  sed -i 's|/sbin|/bin|g' src/Makefile
-}
-
 build() {
-  cd "$pkgname-$pkgver"
-  make WITH_WEBSOCKETS=yes
+  cmake -DCMAKE_INSTALL_PREFIX=/usr \
+        -DCMAKE_INSTALL_SBINDIR=bin \
+        -DCMAKE_INSTALL_SYSCONFDIR=/etc \
+        -DCMAKE_BUILD_TYPE=None \
+        -DWITH_BUNDLED_DEPS=OFF \
+        -DWITH_SRV=ON \
+        -DWITH_SYSTEMD=ON \
+        -DWITH_WEBSOCKETS=ON \
+        -Wno-dev \
+        -B build \
+        -S "$pkgname-$pkgver"
+  make VERBOSE=1 -C build
 }
 
 package() {
-  depends+=('libwebsockets.so')
-  cd "$pkgname-$pkgver"
+  depends+=(libcares.so libsystemd.so libwebsockets.so)
 
-  make prefix=/usr DESTDIR="$pkgdir/" install
+  make DESTDIR="$pkgdir/" install -C build
 
-  # Shipped in git.
-  install -Dm644 "$srcdir/$pkgname.service" "$pkgdir/usr/lib/systemd/system/$pkgname.service"
-  install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
-
-  mv "$pkgdir/etc/$pkgname/$pkgname.conf.example" "$pkgdir/etc/$pkgname/$pkgname.conf"
-
-  install -D -m644 "${srcdir}"/sysusers_mosquitto.conf "${pkgdir}"/usr/lib/sysusers.d/mosquitto.conf
+  # TODO: upstream a better systemd service file
+  install -vDm 644 "$pkgname.service" -t "$pkgdir/usr/lib/systemd/system/"
+  install -vDm 644 "$pkgname-$pkgver/LICENSE.txt" -t "$pkgdir/usr/share/licenses/$pkgname/"
+  install -vDm 644 sysusers_mosquitto.conf "${pkgdir}"/usr/lib/sysusers.d/mosquitto.conf
 }

Modified: mosquitto.service
===================================================================
--- mosquitto.service	2021-12-11 19:32:55 UTC (rev 1068318)
+++ mosquitto.service	2021-12-11 20:01:49 UTC (rev 1068319)
@@ -3,6 +3,8 @@
 Requires=network.target
 
 [Service]
+Type=notify
+NotifyAccess=main
 User=mosquitto
 ExecStart=/usr/bin/mosquitto -c /etc/mosquitto/mosquitto.conf
 ExecReload=/bin/kill -HUP $MAINPID



More information about the arch-commits mailing list