summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD78
-rw-r--r--wesnoth-1.10.appdata.xml4
-rw-r--r--wesnothd-1.10.service39
4 files changed, 83 insertions, 42 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 9ecac69a32bc..e82d462c9d8a 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -27,8 +27,8 @@ pkgbase = wesnoth-1.10
source = wesnoth-1.10.appdata.xml
md5sums = fe8278239945d0c69d686bf70b8362e0
md5sums = 6c139ff1ccb6f30a375d6fea6d7049a2
- md5sums = e184c3ab305faffb3ec6a9203bfcde7a
- md5sums = a9085aef6abd6cae39059ac83f7dd687
+ md5sums = 1a2eca33a8305f912b0f7db46abefff2
+ md5sums = 96f06b5eb48a9537f68b74c199a7b383
pkgname = wesnoth-1.10
diff --git a/PKGBUILD b/PKGBUILD
index 10645ead8683..6591e44c7591 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,6 +1,13 @@
-# Maintainer Severin Glöckner <severin dot gloeckner at stud dot htwk minus leipzig dot de>
+# Maintainer Severin Glöckner <severin.gloeckner@stud.htwk-leipzig.de>
+
+# This script contains as well instructions for other Linux systems.
+
+# On other systems, ignore the used variables like $pkgdir, $srcdir or $startdir
+# (there $pkgdir would be the same as an undefined variable (empty),
+# and $srcdir as well as $stardir would be the place where you have your files)
+
+# skip right below to the interesting part in the functions() { … }
-_suffix=-1.10
pkgname=wesnoth-1.10
pkgver=1.10.7+dev
pkgrel=6
@@ -13,15 +20,15 @@ makedepends=('boost' 'cmake' 'git')
# package names on Debian / Ubuntu / Mint:
# libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl-net1.2-dev libboost-iostreams-dev libboost-regex-dev libboost-serialization-dev libboost-program-options-dev libboost-system-dev libboost-thread-dev zlib1g-dev libpango1.0-dev libcairo2-dev libfontconfig1-dev libdbus-1-dev libfribidi-dev gettext-base cmake make pkgconf gcc g++ git
options=('!emptydirs')
-source=("wesnoth$_suffix.desktop"
- "wesnothd$_suffix.tmpfiles.conf"
- "wesnothd$_suffix.service"
- "wesnoth$_suffix.appdata.xml")
+source=("wesnoth-1.10.desktop"
+ "wesnothd-1.10.tmpfiles.conf"
+ "wesnothd-1.10.service"
+ "wesnoth-1.10.appdata.xml")
md5sums=('fe8278239945d0c69d686bf70b8362e0'
'6c139ff1ccb6f30a375d6fea6d7049a2'
- 'e184c3ab305faffb3ec6a9203bfcde7a'
- 'a9085aef6abd6cae39059ac83f7dd687')
+ '1a2eca33a8305f912b0f7db46abefff2'
+ '96f06b5eb48a9537f68b74c199a7b383')
PKGEXT='.pkg.tar'
@@ -29,12 +36,15 @@ prepare() {
cd "$startdir"
# get a shallow clone of the git repo and store it outside the srcdir
- if [ ! -d "$pkgname-git" ] ; then
- git clone https://github.com/wesnoth/wesnoth -b 1.10 --shallow-exclude=1.10.7 $pkgname-git
+ if [ ! -d "wesnoth-1.10-git" ] ; then
+ git clone https://github.com/wesnoth/wesnoth -b 1.10 --shallow-exclude=1.10.7 wesnoth-1.10-git
msg "Git checkout done (or server timeout)"
fi
- ln -sf "$startdir/$pkgname-git" "$srcdir/$pkgname-git"
+ # Archlinux specific (hide the usage of the $startdir variable)
+ if [ ! -e "$srcdir/wesnoth-1.10-git" ] ; then
+ ln -s "$startdir/wesnoth-1.10-git" "$srcdir/wesnoth-1.10-git"
+ fi
}
build() {
@@ -46,13 +56,18 @@ build() {
export CFLAGS="$CFLAGS -w"
export CXXFLAGS="$CXXFLAGS -w"
+ # 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.10.service.
+
rm -rf build && mkdir -p build && cd build
- cmake ../$pkgname-git \
+ cmake ../wesnoth-1.10-git \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBINARY_SUFFIX=-1.10 \
-DDATADIRNAME=wesnoth-1.10 \
-DDOCDIR=share/doc/wesnoth-1.10 \
- -DFIFO_DIR=/run/wesnoth-1.10 \
+ -DFIFO_DIR=/run/wesnothd-1.10 \
-DPREFERENCES_DIR=.local/share/wesnoth/1.10 \
-DENABLE_OMP=ON \
-DENABLE_DESKTOP_ENTRY=OFF \
@@ -67,32 +82,39 @@ build() {
# For the Archlinux package this is no problem because the files are installed
# into the empty $pkgdir, and it's content is copied later to the system.
+# Thes commands below have to be run with root privileges.
+# E.g. by prefixing them with "sudo ".
package() {
cd build
+ # On Debian / Ubuntu / Mint / Fedora / Suse, just "make install"
make DESTDIR="$pkgdir" install
- # add suffix to manpages
- cd "$pkgdir/usr/share/man"
- for filename in */man6/wesnoth.6 man6/wesnoth.6 */man6/wesnothd.6 man6/wesnothd.6
+ # add suffix to manpages (this is a single command) (.6 is the file extension)
+ for filename in "$pkgdir"/usr/share/man/{,*/}man6/wesnoth{,d}.6
do
- mv "$filename" $(dirname $filename)/$(basename $filename .6)-1.10.6
+ mv $filename $(dirname $filename)/$(basename $filename .6)-1.10.6
done
- # better use the tools from a recent version of wesnoth
- rm -r "$pkgdir/usr/share/wesnoth$_suffix/data/tools"
+ # better use the pacthed tools from a recent version of wesnoth
+ rm -r "$pkgdir/usr/share/wesnoth-1.10/data/tools"
- # these translation files are not needed
- find "$pkgdir/usr/share/wesnoth$_suffix/translations" -name wesnoth-manpages.mo -delete
- find "$pkgdir/usr/share/wesnoth$_suffix/translations" -name wesnoth-manual.mo -delete
+ # these files are not needed
+ find "$pkgdir/usr/share/wesnoth-1.10/translations" -name wesnoth-manpages.mo -delete
+ find "$pkgdir/usr/share/wesnoth-1.10/translations" -name wesnoth-manual.mo -delete
+ find "$pkgdir/usr/share/wesnoth-1.10" -name .gitignore -delete
# placing relevant packaging files (launcher, icons, systemd and appdata files)
- install -D -m644 "$srcdir/wesnoth$_suffix.desktop" "$pkgdir/usr/share/applications/wesnoth$_suffix.desktop"
- install -D -m644 "$srcdir/$pkgname-git/images/game-icon.png" "$pkgdir/usr/share/icons/hicolor/64x64/apps/$pkgname-icon.png"
- install -D -m644 "$srcdir/$pkgname-git/data/core/images/wesnoth-icon.png" "$pkgdir/usr/share/icons/hicolor/128x128/apps/$pkgname-icon.png"
+ install -D -m644 "$srcdir/wesnoth-1.10.desktop" "$pkgdir/usr/share/applications/wesnoth-1.10.desktop"
+ install -D -m644 "$srcdir/wesnoth-1.10-git/images/game-icon.png" "$pkgdir/usr/share/icons/hicolor/64x64/apps/wesnoth-1.10-icon.png"
+ install -D -m644 "$srcdir/wesnoth-1.10-git/data/core/images/wesnoth-icon.png" "$pkgdir/usr/share/icons/hicolor/128x128/apps/wesnoth-1.10-icon.png"
+
+ install -D -m644 "$srcdir/wesnoth-1.10.appdata.xml" "$pkgdir/usr/share/metainfo/wesnoth-1.10.appdata.xml"
- install -D -m644 "$srcdir/wesnothd$_suffix.tmpfiles.conf" "$pkgdir/usr/lib/tmpfiles.d/wesnothd$_suffix.conf"
- install -D -m644 "$srcdir/wesnothd$_suffix.service" "$pkgdir/usr/lib/systemd/system/wesnothd$_suffix.service"
+ # On other Linux systems, use /etc instead of /usr/lib for these two files
+ install -D -m644 "$srcdir/wesnothd-1.10.tmpfiles.conf" "$pkgdir/usr/lib/tmpfiles.d/wesnothd-1.10.conf"
+ install -D -m644 "$srcdir/wesnothd-1.10.service" "$pkgdir/usr/lib/systemd/system/wesnothd-1.10.service"
- install -D -m644 "$srcdir/wesnoth$_suffix.appdata.xml" "$pkgdir/usr/share/metainfo/wesnoth$_suffix.appdata.xml"
+ # All done, but it doesn't show up? Try that:
+ # update-desktop-database
}
diff --git a/wesnoth-1.10.appdata.xml b/wesnoth-1.10.appdata.xml
index 16f3fa24ecc0..ec772543828f 100644
--- a/wesnoth-1.10.appdata.xml
+++ b/wesnoth-1.10.appdata.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
- <id>wesnoth-1.10.desktop</id>
+ <id>wesnoth-1.10</id>
<metadata_license>GFDL-1.3</metadata_license>
<project_license>GPL-2.0-or-later</project_license>
<name>Battle for Wesnoth (1.10)</name>
@@ -81,7 +81,7 @@
<category>Game</category>
<category>StrategyGame</category>
</categories>
- <launchable type="desktop-id">wesnoth-1.10.desktop</launchable>
+ <launchable type="desktop-id">wesnoth-1.10</launchable>
<url type="homepage">https://www.wesnoth.org</url>
<url type="faq">https://wiki.wesnoth.org/Play</url>
<url type="help">https://wiki.wesnoth.org/WesnothManual</url>
diff --git a/wesnothd-1.10.service b/wesnothd-1.10.service
index 73d1e90976f9..7a8a26fda111 100644
--- a/wesnothd-1.10.service
+++ b/wesnothd-1.10.service
@@ -3,26 +3,44 @@ Description=Wesnoth-1.10 Server Daemon
Documentation=https://www.wesnoth.org/wiki/ServerAdministration
Documentation=man:wesnothd-1.10(6)
After=network.target
-# They use by default the same port
-Conflicts=wesnothd.service wesnothd-1.6.service wesnothd-1.8.service wesnothd-1.12.service wesnothd-1.14.service wesnothd-devel.service wesnothd-git.service
+# They use by default the same port, may be changed with the -p option.
+Conflicts=wesnothd.service wesnothd-1.0.service wesnothd-1.2.service wesnothd-1.4.service wesnothd-1.6.service wesnothd-1.8.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.10/socket
+
ExecStart=/usr/bin/wesnothd-1.10 -t 2 -T 5
-# you can use -c to specify the same configuration file
-# which is used when starting wensothd from the wesnoth UI
-# (and make sure wesnothd has the required access permissions)
+# You can use -c to specify a same configuration file
+# (and make sure wesnothd has the required access permissions).
SyslogIdentifier=Wesnothd-1.10
User=nobody
-Group=nobody
-ExecStopPost=/usr/bin/rm -f /run/wesnothd-1.10/socket
+Group=users
+
+# Remove remaining administration pipe:
+ExecStopPost=/bin/rm -f /run/wesnothd-1.10/socket
-# Additional security-related features
-ProtectSystem=yes
+# Additional security-related features:
PrivateTmp=yes
PrivateDevices=yes
+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.10
+InaccessiblePaths=/usr/include
+InaccessiblePaths=/usr/src
+InaccessiblePaths=/boot
+InaccessiblePaths=/media
+InaccessiblePaths=/mnt
+InaccessiblePaths=/srv
+InaccessiblePaths=/opt
+InaccessiblePaths=/var
NoNewPrivileges=yes
-RestrictAddressFamilies=AF_INET
+RestrictAddressFamilies=AF_INET AF_UNIX
RestrictRealtime=yes
MemoryDenyWriteExecute=yes
SystemCallArchitectures=native
@@ -30,6 +48,7 @@ ProtectControlGroups=yes
ProtectKernelTunables=yes
ProtectKernelModules=yes
RestrictNamespaces=yes
+LockPersonality=yes
[Install]
WantedBy=multi-user.target