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

Alexander Rødseth arodseth at archlinux.org
Mon Jul 2 16:14:57 UTC 2018


    Date: Monday, July 2, 2018 @ 16:14:57
  Author: arodseth
Revision: 349905

upgpkg: dopewars 1.5.12-10

Modified:
  dopewars/trunk/PKGBUILD
  dopewars/trunk/dopewars.service
Deleted:
  dopewars/trunk/dopewars.install

------------------+
 PKGBUILD         |   59 +++++++++++++++++++++++++++--------------------------
 dopewars.install |   20 -----------------
 dopewars.service |   26 ++++++++++++++++++++---
 3 files changed, 54 insertions(+), 51 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2018-07-02 16:10:16 UTC (rev 349904)
+++ PKGBUILD	2018-07-02 16:14:57 UTC (rev 349905)
@@ -1,47 +1,50 @@
 # $Id$
+# Maintainer: schuay <jakob.gruber at gmail.com>
+# Maintainer: Alexander F. Rødseth <xyproto at archlinux.org>
 # Contributor: Tom Newsom <Jeepster at gmx.co.uk>
 # Contributor: Jeff Mickey <jeff at archlinux.org>
 # Contributor: Thayer Williams <thayer at archlinux.org>
-# Maintainer: schuay <jakob.gruber at gmail.com
 
 pkgname=dopewars
 pkgver=1.5.12
-pkgrel=9
-pkgdesc="A drug dealing game set in New York"
-url="http://dopewars.sourceforge.net/"
+pkgrel=10
+pkgdesc='Drug dealing game set in New York'
+url='https://dopewars.sourceforge.net/'
 license=('GPL')
 arch=('x86_64')
-depends=('gtk2' 'alsa-lib' 'audiofile' 'sdl_mixer' 'ncurses')
-install='dopewars.install'
-source=("http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz")
-sha512sums=('cfabaf9326c847aed6210a852ace64c697df5845a66b3179b8dc8dea7b99a11e1f91358d4ee54929a56c70d5f3a76f9f7bb4079fdef765601f165b4cd06cba5a')
+depends=('alsa-lib' 'audiofile' 'gtk2' 'ncurses' 'sdl_mixer')
+backup=('srv/dopewars/dopewars.sco')
+source=("https://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz"
+        'dopewars.service')
+sha256sums=('23059dcdea96c6072b148ee21d76237ef3535e5be90b3b2d8239d150feee0c19'
+            'b81fe5156d1a0f650f9005bd9c7f92cb531817c2f9adc0b48d36834aacd9101f')
 
 build() {
-    cd "$srcdir/$pkgname-$pkgver"
+  cd "$pkgname-$pkgver"
 
-    ./configure --prefix=/usr --localstatedir=/var/games \
-        --mandir=/usr/share/man
-    make
+  ./configure \
+    --prefix=/usr \
+    --localstatedir=/srv/dopewars \
+    --mandir=/usr/share/man
+  make
 }
 
 package() {
-    cd "$srcdir/$pkgname-$pkgver"
+  make -C "$pkgname-$pkgver" \
+    DESKTOPDIR="$pkgdir/usr/share/applications" \
+    DESTDIR="$pkgdir" \
+    install
 
-    make DESTDIR="$pkgdir" install
+  # fix permissions
+  chmod 0755 "$pkgdir/usr/bin/dopewars"
+  chmod 0775 "$pkgdir/srv/dopewars"
+  chmod 0664 "$pkgdir/srv/dopewars/dopewars.sco"
+  chown root:root "$pkgdir/usr/bin/dopewars"
+  chown root:root "$pkgdir/srv/dopewars"
+  chown root:root "$pkgdir/srv/dopewars/dopewars.sco"
 
-    # setup shortcut menu entries
-    mkdir -p "$pkgdir/usr/share/applications"
-    mv "$pkgdir/usr/share/gnome/apps/Games/dopewars.desktop" \
-       "$pkgdir/usr/share/applications"
-    rm -r "$pkgdir/usr/share/gnome"
-
-    # set appropriate permissions and destinations
-    chown root:games "$pkgdir/usr/bin/dopewars"
-    chmod 2755 "$pkgdir/usr/bin/dopewars"
-    chown root:games "$pkgdir/var/games"
-    chmod 775 "$pkgdir/var/games"
-
-    # Handle the scores file creation in the install script
-    rm "$pkgdir/var/games/dopewars.sco"
+  install -Dm644 dopewars.service \
+    "$pkgdir/usr/lib/systemd/system/dopewars.service"
 }
 
+# vim: ts=2 sw=2 et:

Deleted: dopewars.install
===================================================================
--- dopewars.install	2018-07-02 16:10:16 UTC (rev 349904)
+++ dopewars.install	2018-07-02 16:14:57 UTC (rev 349905)
@@ -1,20 +0,0 @@
-post_install() {
-  if [ ! -e /var/games/dopewars.sco ]; then
-    mkdir -p /var/games
-    touch /var/games/dopewars.sco
-    chown root:games /var/games/dopewars.sco
-    chmod 664 /var/games/dopewars.sco
-  fi
-}
-
-post_upgrade() {
-  post_install
-}
-
-post_remove() {
-  if [ -e /var/games/dopewars.sco ]; then
-    rm /var/games/dopewars.sco
-  fi
-}
-
-# vim:set ts=2 sw=2 et:

Modified: dopewars.service
===================================================================
--- dopewars.service	2018-07-02 16:10:16 UTC (rev 349904)
+++ dopewars.service	2018-07-02 16:14:57 UTC (rev 349905)
@@ -1,13 +1,33 @@
 [Unit]
 Description=Dopewars Server
+Documentation=https://dopewars.sourceforge.io/docs/server.html
 After=network.target
+Wants=network-online.target systemd-networkd-wait-online.service
 
 [Service]
 Type=oneshot
-ExecStart=/usr/bin/dopewars -S -r /var/run/dw.pid -l /var/log/dw.log
-PIDFile=/var/run/dw.pid
+ExecStart=/usr/bin/dopewars -S -r /run/dw/dw.pid -l /var/log/dw/dw.log
+PIDFile=/run/dw/dw.pid
 RemainAfterExit=yes
-ExecStop=/usr/bin/pkill -F /var/run/dw.pid
+ExecStop=/usr/bin/pkill -F /run/dw/dw.pid
+User=dopewars
+Group=games
+DynamicUser=yes
+PrivateDevices=true
+KillMode=mixed
+KillSignal=SIGQUIT
+TimeoutStopSec=5s
+ProtectSystem=full
+ProtectHome=true
+ReadOnlyPaths=/usr/bin
+ReadWritePaths=/srv/dopewars
+LogsDirectory=dw
+RuntimeDirectory=dw
+CapabilityBoundingSet=CAP_NET_BIND_SERVICE
+AmbientCapabilities=CAP_NET_BIND_SERVICE
+NoNewPrivileges=true
+MemoryDenyWriteExecute=true
+Nice=5
 
 [Install]
 WantedBy=multi-user.target



More information about the arch-commits mailing list