diff options
author | Severin Glöckner | 2018-12-26 16:35:31 +0100 |
---|---|---|
committer | Severin Glöckner | 2018-12-26 16:35:31 +0100 |
commit | 1543e292573ef74923f8ff93639b5bdd3027f0bb (patch) | |
tree | f1eb2526e87666c29ad73064568d79da2e793f98 | |
parent | 50c7ab4664937b3bbcbfc4df93f6fdb6b9d727d8 (diff) | |
download | aur-1543e292573ef74923f8ff93639b5bdd3027f0bb.tar.gz |
various updates
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 74 | ||||
-rw-r--r-- | wesnoth-1.8.appdata.xml | 4 | ||||
-rw-r--r-- | wesnothd-1.8.service | 39 |
4 files changed, 81 insertions, 40 deletions
@@ -29,8 +29,8 @@ pkgbase = wesnoth-1.8 source = wesnoth-1.8.appdata.xml md5sums = 7fa59aab4ec96e6466dd276a76462e78 md5sums = a3afc892c43bbff72a9b150de513beaf - md5sums = 47fb0b812309ae367744b3306a5a5b84 - md5sums = 46f8e791922b58f4b0cea7bebef511ad + md5sums = 662d5e828bcada131b66820b59210eb1 + md5sums = 84418024db8d66acd2ce2489b5176a9b pkgname = wesnoth-1.8 @@ -1,6 +1,12 @@ -# 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. +# There you have to execute the commands in the functions(){…} below by hand. + +# 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) -_suffix=-1.8 pkgname=wesnoth-1.8 pkgver=1.8.6+dev pkgrel=5 @@ -13,15 +19,17 @@ 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 zlib1g-dev libpango1.0-dev libcairo2-dev libfontconfig1-dev libdbus-1-dev libfribidi-dev liblua5.1.0-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.8.desktop" + "wesnothd-1.8.tmpfiles.conf" + "wesnothd-1.8.service" + "wesnoth-1.8.appdata.xml") +# Not finding the files? https://aur.archlinux.org/packages/wesnoth-1.8/ +# Rest assured, they are optional. Things like a launcher for your convenience… md5sums=('7fa59aab4ec96e6466dd276a76462e78' 'a3afc892c43bbff72a9b150de513beaf' - '47fb0b812309ae367744b3306a5a5b84' - '46f8e791922b58f4b0cea7bebef511ad') + '662d5e828bcada131b66820b59210eb1' + '84418024db8d66acd2ce2489b5176a9b') PKGEXT='.pkg.tar' @@ -29,12 +37,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.8 --shallow-exclude=1.8.6 $pkgname-git + if [ ! -d "wesnoth-1.8-git" ] ; then + git clone https://github.com/wesnoth/wesnoth -b 1.8 --shallow-exclude=1.8.6 wesnoth-1.8-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.8-git" ] ; then + ln -s "$startdir/wesnoth-1.8-git" "$srcdir/wesnoth-1.8-git" + fi } build() { @@ -46,8 +57,12 @@ 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.2.service. rm -rf build && mkdir build && cd build - cmake ../$pkgname-git \ + cmake ../wesnoth-1.8-git \ -DCMAKE_INSTALL_PREFIX=/usr \ -DBINARY_SUFFIX=-1.8 \ -DDATADIRNAME=wesnoth-1.8 \ @@ -66,32 +81,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 (.6 is the file extension for manpages) + for filename in "$pkgdir"/usr/share/man/{,*/}man6/wesnoth{,d}.6 do mv $filename $(dirname $filename)/$(basename $filename .6)-1.8.6 done - # better use the tools from a recent version of wesnoth - rm -r "$pkgdir/usr/share/wesnoth$_suffix/data/tools" + # use the patched tools from a recent version of wesnoth + rm -r "$pkgdir/usr/share/wesnoth-1.8/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.8/translations" -name wesnoth-manpages.mo -delete + find "$pkgdir/usr/share/wesnoth-1.8/translations" -name wesnoth-manual.mo -delete + find "$pkgdir/usr/share" -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/wesnoth-icon-small.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.8.desktop" "$pkgdir/usr/share/applications/wesnoth-1.8.desktop" + install -D -m644 "$srcdir/wesnoth-1.8-git/images/wesnoth-icon-small.png" "$pkgdir/usr/share/icons/hicolor/64x64/apps/wesnoth-1.8-icon.png" + install -D -m644 "$srcdir/wesnoth-1.8-git/data/core/images/wesnoth-icon.png" "$pkgdir/usr/share/icons/hicolor/128x128/apps/wesnoth-1.8-icon.png" + + install -D -m644 "$srcdir/wesnoth-1.8.appdata.xml" "$pkgdir/usr/share/metainfo/wesnoth-1.8.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.8.tmpfiles.conf" "$pkgdir/usr/lib/tmpfiles.d/wesnothd-1.8.conf" + install -D -m644 "$srcdir/wesnothd-1.8.service" "$pkgdir/usr/lib/systemd/system/wesnothd-1.8.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.8.appdata.xml b/wesnoth-1.8.appdata.xml index 65a8e5ce8852..1b650666a903 100644 --- a/wesnoth-1.8.appdata.xml +++ b/wesnoth-1.8.appdata.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <component type="desktop"> - <id>wesnoth-1.8.desktop</id> + <id>wesnoth-1.8</id> <metadata_license>GFDL-1.3</metadata_license> <project_license>GPL-2.0-or-later</project_license> <name>Battle for Wesnoth (1.8)</name> @@ -81,7 +81,7 @@ <category>Game</category> <category>StrategyGame</category> </categories> - <launchable type="desktop-id">wesnoth-1.8.desktop</launchable> + <launchable type="desktop-id">wesnoth-1.8</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.8.service b/wesnothd-1.8.service index 586348f98f05..3f0ba9c9d150 100644 --- a/wesnothd-1.8.service +++ b/wesnothd-1.8.service @@ -3,26 +3,44 @@ Description=Wesnoth-1.8 Server Daemon Documentation=https://www.wesnoth.org/wiki/ServerAdministration Documentation=man:wesnothd-1.8(6) After=network.target -# They use by default the same port -Conflicts=wesnothd.service wesnothd-1.6.service wesnothd-1.10.service wesnothd-1.12.service wesnothd-1.14.service wesnothd-devel.service wesnothd-git.service +# They use by default the same port, which can be changed by the -p option. +Conflicts=wesnothd.service wesnothd-1.0.service wesnothd-1.2.service wesnothd-1.4.service wesnothd-1.6.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.4/socket + ExecStart=/usr/bin/wesnothd-1.8 -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.8 User=nobody -Group=nobody -ExecStopPost=/usr/bin/rm -f /run/wesnothd-1.8/socket +Group=users + +# Remove remaining administration pipe: +ExecStopPost=/bin/rm -f /run/wesnothd-1.8/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.8 +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 |