summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeverin Glöckner2018-12-26 16:06:20 +0100
committerSeverin Glöckner2018-12-26 16:06:20 +0100
commit1cc738059ad48ec007977f622b2a062fa914ff76 (patch)
treeb5ee785b4a5d097ea9cdb519647ea75a5e2eee2b
parentbdd46bc2e49854997b1454c2404468721e97d5a8 (diff)
downloadaur-1cc738059ad48ec007977f622b2a062fa914ff76.tar.gz
comments on the same line are not allowed in service files
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD16
-rw-r--r--wesnothd-1.2.service27
3 files changed, 32 insertions, 13 deletions
diff --git a/.SRCINFO b/.SRCINFO
index fa5806486c65..6883d35f70a6 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -19,7 +19,7 @@ pkgbase = wesnoth-1.2
source = wesnoth-1.2.appdata.xml
md5sums = c3ba9b84c818bba105b0ea236b1d3744
md5sums = d23cafae5c732d6bf10a836bdabd15b9
- md5sums = a1831302d36c5d5ddffcf76c42483e1d
+ md5sums = 64a072ffd085f2b5af5110fc5b41ab37
md5sums = b6dfb0e146e6ac3a265487b6e32e9766
pkgname = wesnoth-1.2
diff --git a/PKGBUILD b/PKGBUILD
index c3e4d0795d70..a2a5b7382706 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -20,7 +20,7 @@ source=("wesnoth-1.2.desktop"
md5sums=('c3ba9b84c818bba105b0ea236b1d3744'
'd23cafae5c732d6bf10a836bdabd15b9'
- 'a1831302d36c5d5ddffcf76c42483e1d'
+ '64a072ffd085f2b5af5110fc5b41ab37'
'b6dfb0e146e6ac3a265487b6e32e9766')
PKGEXT='.pkg.tar'
@@ -58,6 +58,10 @@ build() {
export CC=gcc-4.3
export CXX=g++-4.3
+ # It's a convention to use /usr/local when installing by hand, it allows you
+ # to keep easier track of what was installed.
+ # Feel free to replace ALL occurences of /usr with /usr/local in the commands
+ # below, and edit the start command in the file wesnothd-1.2.service.
./autogen.sh
./configure --with-freetype-prefix=/usr/lib --prefix=/usr --with-preferences-dir=.local/share/wesnoth/1.2 --program-suffix=-1.2 --with-datadir-name=wesnoth-1.2 --enable-editor --enable-server --with-fifodir=/run/wesnothd-1.2
make -j4
@@ -76,6 +80,7 @@ package() {
# (or delete) them.
# Note that you can do this only the installation step shown above, as the
# command will fail if it doesn't find these files.
+
for filename in "$pkgdir"/usr/share/man/{,*/}man6/wesnoth{,d,_editor}.6
do
mv "$filename" $(dirname $filename)/$(basename $filename .6)-1.2.6
@@ -92,15 +97,12 @@ package() {
install -D -m644 "$srcdir/wesnoth-1.2-git/icons/wesnoth-icon.png" "$pkgdir/usr/share/icons/hicolor/64x64/apps/wesnoth-1.2-icon.png"
install -D -m644 "$srcdir/wesnoth-1.2-git/icons/wesnoth-icon-Mac.png" "$pkgdir/usr/share/icons/hicolor/128x128/apps/wesnoth-1.2-icon.png"
- # On Debian / Ubuntu / Mint, the two files go into /etc instead of /usr/lib
+ install -D -m644 "$srcdir/wesnoth-1.2.appdata.xml" "$pkgdir/usr/share/metainfo/wesnoth-1.2.appdata.xml"
+
+ # On other Linux systems, the two files go into /etc instead of /usr/lib
install -D -m644 "$srcdir/wesnothd-1.2.tmpfiles.conf" "$pkgdir/usr/lib/tmpfiles.d/wesnothd-1.2.conf"
- # On Debian / Ubuntu / Mint, edit the file and change:
- # Group=nobody to Group=nogroup
- # /usr/bin/rm to /bin/rm
install -D -m644 "$srcdir/wesnothd-1.2.service" "$pkgdir/usr/lib/systemd/system/wesnothd-1.2.service"
- install -D -m644 "$srcdir/wesnoth-1.2.appdata.xml" "$pkgdir/usr/share/metainfo/wesnoth-1.2.appdata.xml"
-
# All done, but it doesn't show up? Try that:
# update-desktop-database
}
diff --git a/wesnothd-1.2.service b/wesnothd-1.2.service
index c0b057d7897a..c948a2b0b067 100644
--- a/wesnothd-1.2.service
+++ b/wesnothd-1.2.service
@@ -7,19 +7,36 @@ After=network.target
Conflicts=wesnothd.service wesnothd-1.0.service wesnothd-1.4.service wesnothd-1.6.service wesnothd-1.8.service wesnothd-1.10.service wesnothd-1.12.service wesnothd-1.14.service wesnothd-devel.service wesnothd-git.service
[Service]
+# If wesnothd is started from within the game it runs under a different user
+# Deleting the pipe resets owner, group and mode
+ExecStopPre=/bin/rm -f /run/wesnothd-1.2/socket
+
ExecStart=/usr/bin/wesnothd-1.2 -t 2 -T 5
-# you can use -c to specify the same configuration file
-# which is used when starting wensothd from the wesnoth UI
+# you can use -c to specify a configuration file
# (and make sure wesnothd has the required access permissions)
SyslogIdentifier=Wesnothd-1.2
User=nobody
Group=users
-ExecStopPost=/usr/bin/rm -f /run/wesnothd-1.2/socket
+
+# Remove remaining administration pipe
+ExecStopPost=/bin/rm -f /run/wesnothd-1.2/socket
# Additional security-related features
-ProtectSystem=yes
-ProtectHome=yes # disable this if using the -c option
+ProtectSystem=strict
+ProtectHome=yes
+# When specifying with the -c option a file in the home directory,
+# set ProtectHome=read-only and whitelist the directory or file with
+# ReadWritePaths.
+ReadWritePaths=/run/wesnothd-1.2
+InaccessiblePaths=/usr/include
+InaccessiblePaths=/usr/src
+InaccessiblePaths=/boot
+InaccessiblePaths=/media
+InaccessiblePaths=/mnt
+InaccessiblePaths=/srv
+InaccessiblePaths=/opt
+InaccessiblePaths=/var
PrivateTmp=yes
PrivateDevices=yes
NoNewPrivileges=yes