summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeverin Glöckner2018-12-25 02:06:45 +0100
committerSeverin Glöckner2018-12-26 14:18:07 +0100
commit3ac11c201cbf792e14ee8c02f2246b0bfcd143c7 (patch)
tree7038c3fabb7ab8c230e85be1147f61358456f040
parentd6e56d5b800ec7b07637af31402aa0ca195bc69b (diff)
downloadaur-3ac11c201cbf792e14ee8c02f2246b0bfcd143c7.tar.gz
general readability update
-rw-r--r--.SRCINFO5
-rw-r--r--PKGBUILD71
-rw-r--r--wesnoth-1.6.appdata.xml4
-rw-r--r--wesnothd-1.6.service5
4 files changed, 55 insertions, 30 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 6ef030ebf604..bcc0e3ee901d 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -22,14 +22,15 @@ pkgbase = wesnoth-1.6
depends = dbus
depends = fribidi
options = !emptydirs
+ options = !zipman
source = wesnoth-1.6.desktop
source = wesnothd-1.6.tmpfiles.conf
source = wesnothd-1.6.service
source = wesnoth-1.6.appdata.xml
md5sums = 99f136647c5af1820d0132df08350965
md5sums = ec9cab718ba96b7a4c85c224f6b747c3
- md5sums = 4b18649a4864c0ae9787dc1ee9fc3400
- md5sums = 1018b1fae1a65d49bed1094ba0280d87
+ md5sums = c537d69cb8338594a606ebbc93cbd00e
+ md5sums = 3bf40dd42fb269275bd66ecaf892f3fc
pkgname = wesnoth-1.6
diff --git a/PKGBUILD b/PKGBUILD
index 4e172a8ec431..98e5b9be9c54 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -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.6
pkgname=wesnoth-1.6
pkgver=1.6.5+dev
pkgrel=1
@@ -12,16 +18,16 @@ depends=('sdl' 'sdl_image' 'sdl_mixer' 'sdl_ttf' 'sdl_net' 'boost-libs' 'zlib' '
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 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")
+options=('!emptydirs' '!zipman')
+source=("wesnoth-1.6.desktop"
+ "wesnothd-1.6.tmpfiles.conf"
+ "wesnothd-1.6.service"
+ "wesnoth-1.6.appdata.xml")
md5sums=('99f136647c5af1820d0132df08350965'
'ec9cab718ba96b7a4c85c224f6b747c3'
- '4b18649a4864c0ae9787dc1ee9fc3400'
- '1018b1fae1a65d49bed1094ba0280d87')
+ 'c537d69cb8338594a606ebbc93cbd00e'
+ '3bf40dd42fb269275bd66ecaf892f3fc')
PKGEXT='.pkg.tar'
@@ -29,12 +35,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.6 --shallow-exclude=1.6.5 $pkgname-git
+ if [ ! -d "wesnoth-1.6-git" ] ; then
+ git clone https://github.com/wesnoth/wesnoth -b 1.6 --shallow-exclude=1.6.5 wesnoth-1.6-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.6-git" ] ; then
+ ln -s "$startdir/wesnoth-1.6-git" "$srcdir/wesnoth-1.6-git"
+ fi
}
build() {
@@ -42,8 +51,11 @@ build() {
# If you happen to find a fix, please fill a Pull Request for the 1.6 branch
# at bugs.wesnoth.org
+ # 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 below.
rm -rf build && mkdir -p build && cd build
- cmake ../$pkgname-git \
+ cmake ../wesnoth-1.6-git \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBINARY_SUFFIX=-1.6 \
-DDATADIRNAME=wesnoth-1.6 \
@@ -65,27 +77,38 @@ build() {
# into the empty $pkgdir, and it's content is copied later to the system.
package() {
- cd "$srcdir/build"
+ 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 a suffix to the manpages (using one multi-line command)
+ for filename in "$pkgdir"/usr/share/man/{,*/}man6/wesnoth{,d}.6
do
mv "$filename" $(dirname $filename)/$(basename $filename .6)-1.6.6
done
# better use the tools from a recent version of wesnoth
- rm -r "$pkgdir/usr/share/wesnoth$_suffix/data/tools"
+ rm -r "$pkgdir/usr/share/wesnoth-1.6/data/tools"
+
+ # remove unneeded files
+ 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.6.desktop" "$pkgdir/usr/share/applications/wesnoth-1.6.desktop"
+ install -D -m644 "$srcdir/wesnoth-1.6-git/images/wesnoth-icon-small.png" "$pkgdir/usr/share/icons/hicolor/64x64/apps/wesnoth-1.6-icon.png"
+ install -D -m644 "$srcdir/wesnoth-1.6-git/data/core/images/wesnoth-icon.png" "$pkgdir/usr/share/icons/hicolor/128x128/apps/wesnoth-1.6-icon.png"
+
+ install -D -m644 "$srcdir/wesnoth-1.6.appdata.xml" "$pkgdir/usr/share/metainfo/wesnoth-1.6.appdata.xml"
+
+ # On other Linux systems, use /etc instead of /usr/lib for the files below
+ install -D -m644 "$srcdir/wesnothd-1.6.tmpfiles.conf" "$pkgdir/usr/lib/tmpfiles.d/wesnothd-1.6.conf"
- 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 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.6.service" "$pkgdir/usr/lib/systemd/system/wesnothd-1.6.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.6.appdata.xml b/wesnoth-1.6.appdata.xml
index 2c812e771e52..40c99dd918b5 100644
--- a/wesnoth-1.6.appdata.xml
+++ b/wesnoth-1.6.appdata.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
- <id>wesnoth-1.6.desktop</id>
+ <id>wesnoth-1.6</id>
<metadata_license>GFDL-1.3</metadata_license>
<project_license>GPL-2.0-or-later</project_license>
<name>Battle for Wesnoth (1.6)</name>
@@ -81,7 +81,7 @@
<category>Game</category>
<category>StrategyGame</category>
</categories>
- <launchable type="desktop-id">wesnoth-1.6.desktop</launchable>
+ <launchable type="desktop-id">wesnoth-1.6</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.6.service b/wesnothd-1.6.service
index ab98f1a9e04e..31cb9b2577f7 100644
--- a/wesnothd-1.6.service
+++ b/wesnothd-1.6.service
@@ -4,7 +4,7 @@ Documentation=https://www.wesnoth.org/wiki/ServerAdministration
Documentation=man:wesnothd-1.6(6)
After=network.target
# They use by default the same port
-Conflicts=wesnothd.service wesnothd-1.8.service wesnothd-1.10.service wesnothd-1.12.service wesnothd-1.14.service wesnothd-devel.service wesnothd-git.service
+Conflicts=wesnothd.service wesnothd-1.0.servicewesnothd-1.2.service wesnothd-1.4.service wesnothd-1.8.service wesnothd-1.10.service wesnothd-1.12.service wesnothd-1.14.service wesnothd-devel.service wesnothd-git.service
[Service]
ExecStart=/usr/bin/wesnothd-1.6 -t 2 -T 5
@@ -22,7 +22,7 @@ ProtectSystem=yes
PrivateTmp=yes
PrivateDevices=yes
NoNewPrivileges=yes
-RestrictAddressFamilies=AF_INET
+RestrictAddressFamilies=AF_INET AF_UNIX
RestrictRealtime=yes
MemoryDenyWriteExecute=yes
SystemCallArchitectures=native
@@ -30,6 +30,7 @@ ProtectControlGroups=yes
ProtectKernelTunables=yes
ProtectKernelModules=yes
RestrictNamespaces=yes
+LockPersonality=yes
[Install]
WantedBy=multi-user.target