diff options
author | brent s | 2017-04-14 09:29:30 -0400 |
---|---|---|
committer | brent s | 2017-04-14 09:29:30 -0400 |
commit | dccca5255f9ec83bef5a52f207c5e023ff5a6212 (patch) | |
tree | 6852e50ab4bdbdad6287fcc4145f4d2ec174ab8a | |
parent | ffcfe277897cdc8aa9ae5fa9f9c8cd48e4847772 (diff) | |
download | aur-dccca5255f9ec83bef5a52f207c5e023ff5a6212.tar.gz |
shit, i need to re-do this as a flat list, not json.
-rw-r--r-- | .SRCINFO | 13 | ||||
-rw-r--r-- | PKGBUILD | 86 | ||||
-rw-r--r-- | README.arch | 27 | ||||
-rw-r--r-- | README.arch.sig | bin | 0 -> 566 bytes | |||
-rw-r--r-- | nquakesv-init.py | 61 | ||||
-rw-r--r-- | nquakesv.install | 31 | ||||
-rw-r--r-- | sv-configs.zip.sig | bin | 0 -> 566 bytes |
7 files changed, 158 insertions, 60 deletions
@@ -1,9 +1,9 @@ # Generated by mksrcinfo v8 -# Wed Nov 2 15:38:37 UTC 2016 +# Fri Apr 14 13:29:30 UTC 2017 pkgbase = nquakesv pkgdesc = The easiest, quickest, and most popular QuakeWorld server. pkgver = 1.4 - pkgrel = 1 + pkgrel = 3 url = http://nquake.com/ install = nquakesv.install arch = any @@ -11,24 +11,33 @@ pkgbase = nquakesv license = custom depends = unzip depends = ezquake + depends = python conflicts = nquake noextract = qsw106.zip noextract = sv-bin-x.zip source = http://fnu.nquake.com/sv-gpl.zip source = http://fnu.nquake.com/sv-non-gpl.zip source = http://fnu.nquake.com/qsw106.zip + source = http://fnu.nquake.com/sv-configs.zip source = CC0-1.0::https://creativecommons.org/publicdomain/zero/1.0/legalcode.txt source = nquakesv.run + source = README.arch source = sv-gpl.zip.sig source = sv-non-gpl.zip.sig source = CC0-1.0.sig source = qsw106.zip.sig + source = sv-configs.zip.sig source = nquakesv.run.sig + source = README.arch.sig sha512sums = 6a07601f56aec5d88b3463c09c4482a2d76e5d7efd8ddc24c1b4e9b662152f62070dbb5409c1a801560872c725b5b8b1d41437b7b99c74bdcc1ae88d2be91121 sha512sums = 21e6ef7a58c03e342b501a345fd777472b9d109a95201fa859c99d626845d01cf90d0ce6c42f76f5878795f1bcd549128250b9f8e82fceedb8b1f6534b9a1e32 sha512sums = 32df717a4a8f121358243333c30d8d0e5d43ee04f3ee8175a894199b8932e90ebedc6b687c25207c6191dbf25363307f09f8c1dc767b58e254e015c150217384 + sha512sums = 93d6879712f7bdd56e3ab8f018810bb66a2d4d89e7dfcabf53668eaf23dd984959a1fbe4ecaa743e98b9be2b65de5b2746529b195c78b0c1ff0996e32d8fdd1b sha512sums = 1eb4436f8d58766cbe99db97e5e8c0db8a706376afd291c337de1ba7a6b066d3791dc85ad034bdd54ea336bed6e6e8e7a037d8b04b2773c9c7517b9d9921d1fa sha512sums = e7dac93556d63c994d37f2361a48408c924426b81395cacb3229acb3020df66dce62e5734686fba44cc7581567e28e5345f6d7a5638c0c97b8effdab78756111 + sha512sums = b083d3884c9885ab402e58c95ec3b5288ee06afce2bab83af1610c9d2ee174ce7b77748647499cb82d9a3f4686d936e9a91b5feccae0818addd236907952c3d1 + sha512sums = SKIP + sha512sums = SKIP sha512sums = SKIP sha512sums = SKIP sha512sums = SKIP @@ -11,11 +11,11 @@ validpgpkeys=('748231EBCBD808A14F5E85D28C004C2F93481F6B') pkgname=('nquakesv') pkgver=1.4 -pkgrel=1 +pkgrel=3 pkgdesc="The easiest, quickest, and most popular QuakeWorld server." url="http://nquake.com/" license=('GPL2' 'custom') -depends=('unzip' 'ezquake') +depends=('unzip' 'ezquake' 'python') conflicts=('nquake') arch=('any') install=nquakesv.install @@ -32,13 +32,17 @@ _nQ_MIRROR="http://fnu.nquake.com" # Uppsala, SE source=("${_nQ_MIRROR}/sv-gpl.zip" "${_nQ_MIRROR}/sv-non-gpl.zip" "${_nQ_MIRROR}/qsw106.zip" + "${_nQ_MIRROR}/sv-configs.zip" "CC0-1.0::https://creativecommons.org/publicdomain/zero/1.0/legalcode.txt" "nquakesv.run" + "README.arch" "sv-gpl.zip.sig" "sv-non-gpl.zip.sig" "CC0-1.0.sig" "qsw106.zip.sig" - "nquakesv.run.sig") + "sv-configs.zip.sig" + "nquakesv.run.sig" + "README.arch.sig") source_x86_64=("${_nQ_MIRROR}/sv-bin-x64.zip" "sv-bin-x64.zip.sig") @@ -59,8 +63,12 @@ noextract=('qsw106.zip' sha512sums=('6a07601f56aec5d88b3463c09c4482a2d76e5d7efd8ddc24c1b4e9b662152f62070dbb5409c1a801560872c725b5b8b1d41437b7b99c74bdcc1ae88d2be91121' '21e6ef7a58c03e342b501a345fd777472b9d109a95201fa859c99d626845d01cf90d0ce6c42f76f5878795f1bcd549128250b9f8e82fceedb8b1f6534b9a1e32' '32df717a4a8f121358243333c30d8d0e5d43ee04f3ee8175a894199b8932e90ebedc6b687c25207c6191dbf25363307f09f8c1dc767b58e254e015c150217384' + '93d6879712f7bdd56e3ab8f018810bb66a2d4d89e7dfcabf53668eaf23dd984959a1fbe4ecaa743e98b9be2b65de5b2746529b195c78b0c1ff0996e32d8fdd1b' '1eb4436f8d58766cbe99db97e5e8c0db8a706376afd291c337de1ba7a6b066d3791dc85ad034bdd54ea336bed6e6e8e7a037d8b04b2773c9c7517b9d9921d1fa' 'e7dac93556d63c994d37f2361a48408c924426b81395cacb3229acb3020df66dce62e5734686fba44cc7581567e28e5345f6d7a5638c0c97b8effdab78756111' + 'b083d3884c9885ab402e58c95ec3b5288ee06afce2bab83af1610c9d2ee174ce7b77748647499cb82d9a3f4686d936e9a91b5feccae0818addd236907952c3d1' + 'SKIP' + 'SKIP' 'SKIP' 'SKIP' 'SKIP' @@ -73,48 +81,57 @@ sha512sums_i686=('c4b32e5f409a603adea54206b0ebbebb1b7907d7a56065e7730ca01931de33 'SKIP') prepare () { - unzip -j "qsw106.zip" "ID1/PAK0.PAK" - unzip -j "qsw106.zip" "LICINFO.TXT" - unzip -j "qsw106.zip" "README.TXT" - unzip -j "qsw106.zip" "SLICNSE.TXT" + unzip -o -j "qsw106.zip" "ID1/PAK0.PAK" + unzip -o -j "qsw106.zip" "LICINFO.TXT" + unzip -o -j "qsw106.zip" "README.TXT" + unzip -o -j "qsw106.zip" "SLICNSE.TXT" # Necessary because bsdtar's absolutely silly and keeps trying to extract the contents of the extracted zip or something. friggin' pacman. - unzip sv-bin-x${BITNESS}.zip + unzip -o sv-bin-x${BITNESS}.zip } package () { -echo pkg ### BASE ## # Most of these files are in gpl.zip install -d -m 0750 ${pkgdir}/opt/quake/{id1,qw} - install -d -m 0750 ${pkgdir}/usr/share/nquake - install -d -m 0750 ${pkgdir}/usr/share/doc/nquake - install -d -m 0750 ${pkgdir}/usr/share/licenses/nquake + install -d -m 0750 ${pkgdir}/usr/share/${pkgname} + install -d -m 0750 ${pkgdir}/usr/share/doc/${pkgname} + install -d -m 0750 ${pkgdir}/usr/share/licenses/${pkgname} install -d -m 0755 ${pkgdir}/usr/bin - # Fix ezquake packages. - install -d -m 0770 ${pkgdir}/opt/quake/ezquake/{sb/cache,temp} # Implement the following in ezQuake #chgrp games ${pkgdir}/usr/bin/ezquake #chmod 0750 ${pkgdir}/usr/bin/ezquake # And the Business-End(TM). Do the thing. - install -D -m 0775 ${srcdir}/nquakesv.run ${pkgdir}/usr/bin/nquakesv - install -D -m 0775 ${srcdir}/mvdsv ${pkgdir}/opt/quake/mvdsv - install -D -m 0775 ${srcdir}/qwfwd/qwfwd.bin ${pkgdir}/opt/quake/qwfwd - install -D -m 0775 ${srcdir}/qtv/qtv.bin ${pkgdir}/opt/quake/quaketv - cp -a ${srcdir}/logs ${pkgdir}/opt/quake/. + install -D -m 0775 ${srcdir}/nquakesv.run ${pkgdir}/usr/bin/${pkgname} + install -D -m 0775 ${srcdir}/mvdsv ${pkgdir}/usr/share/${pkgname}/mvdsv + install -D -m 0775 ${srcdir}/qwfwd/qwfwd.bin ${pkgdir}/usr/share/${pkgname}/qwfwd + install -D -m 0775 ${srcdir}/qtv/qtv.bin ${pkgdir}/usr/share/${pkgname}/quaketv + install -D -m 0644 ${srcdir}/README.arch ${pkgdir}/usr/share/doc/${pkgname}/README.arch + cp -a ${srcdir}/logs ${pkgdir}/usr/share/${pkgname}/. ## DEMO DATA ## - install -D -m 0644 ${srcdir}/PAK0.PAK ${pkgdir}/opt/quake/id1/pak0.pak - install -D -m 0644 ${srcdir}/LICINFO.TXT ${pkgdir}/usr/share/doc/nquake/quake_shareware_license_info.txt - install -D -m 0644 ${srcdir}/README.TXT ${pkgdir}/usr/share/doc/nquake/quake_shareware_readme.txt - install -D -m 0644 ${srcdir}/SLICNSE.TXT ${pkgdir}/usr/share/licenses/nquake/quake_shareware.txt + install -D -m 0644 ${srcdir}/PAK0.PAK ${pkgdir}/opt/quake/id1/pak0.pak.DEMO + install -D -m 0644 ${srcdir}/LICINFO.TXT ${pkgdir}/usr/share/doc/${pkgname}/quake_shareware_license_info.txt + install -D -m 0644 ${srcdir}/README.TXT ${pkgdir}/usr/share/doc/${pkgname}/quake_shareware_readme.txt + install -D -m 0644 ${srcdir}/SLICNSE.TXT ${pkgdir}/usr/share/licenses/${pkgname}/quake_shareware.txt ## NON-FREE ## # Most of these files are in non-gpl.zip - install -d -m 0750 ${pkgdir}/opt/quake/qw/{maps} - cp -a ${srcdir}/CC0-1.0 ${pkgdir}/usr/share/licenses/${_pkgname}/. + install -d -m 0755 ${pkgdir}/usr/share/${pkgname}/qw/maps + cp -a ${srcdir}/qw/maps/* ${pkgdir}/usr/share/${pkgname}/qw/maps/. + install -D -m 0644 ${srcdir}/id1/maps/b_exbox2.bsp ${pkgdir}/usr/share/${pkgname}/id1/maps/b_exbox2.bsp + cp -a ${srcdir}/CC0-1.0 ${pkgdir}/usr/share/licenses/${pkgname}/. # And the Business-End(TM). Do the thing. - cp -a ${srcdir}/README ${pkgdir}/usr/share/doc/nquake/readme.txt # nQuake FAQ, credits, etc. + cp -a ${srcdir}/README ${pkgdir}/usr/share/doc/${pkgname}/readme.txt # nQuake FAQ, credits, etc. + install -d -m 0755 ${pkgdir}/usr/share/${pkgname}/cfgs/ + install -d -m 0755 ${pkgdir}/usr/share/${pkgname}/modes/ + mv ${srcdir}/ktx/configs/* ${pkgdir}/usr/share/${pkgname}/cfgs/. + mv ${srcdir}/ktx/modes/* ${pkgdir}/usr/share/${pkgname}/modes/. + rmdir ${srcdir}/ktx/configs + mv ${srcdir}/ktx/mvdsv.cfg ${pkgdir}/usr/share/${pkgname}/cfgs/mvdsv-server.cfg + mv ${srcdir}/ktx/ktx.cfg ${pkgdir}/usr/share/${pkgname}/cfgs/ktx-server.cfg + mv ${srcdir}/ktx/matchless.cfg ${pkgdir}/usr/share/${pkgname}/cfgs/matchless-server.cfg + find ${pkgdir}/usr/share/${pkgname}/cfgs -type f -exec chmod 0644 '{}' \; ### FORTRESS ## # TODO @@ -136,18 +153,23 @@ echo pkg # cp -a ${srcdir}/prox ${pkgdir}/opt/quake/. # QuakeProxy, I think? ## KTX ## # Most of these files are in sv-gpl.zip and sv-non-gpl.zip. some are in sv-bin-x${BITNESS}.zip - cp -a ${srcdir}/ktx ${pkgdir}/opt/quake/. + cp -a ${srcdir}/ktx ${pkgdir}/usr/share/${pkgname}/. + # Let's clean up a bit. + for f in portx server pwd ban_ip vip_ip; + do + rm ${pkgdir}/usr/share/${pkgname}/ktx/${f}.cfg + done ## QTV ## - cp -a ${srcdir}/qtv/qtv ${pkgdir}/opt/quake/. - install -D -m 0644 ${srcdir}/qtv/qtv.cfg ${pkgdir}/opt/quake/qtv.cfg + cp -a ${srcdir}/qtv/qtv ${pkgdir}/usr/share/${pkgname}/. + install -D -m 0644 ${srcdir}/qtv/qtv.cfg ${pkgdir}/usr/share/${pkgname}/qtv/qtv.cfg ## QWFWD ## - install -D -m 0644 ${srcdir}/qwfwd/qwfwd.cfg ${pkgdir}/opt/quake/qwfwd.cfg + install -D -m 0644 ${srcdir}/qwfwd/qwfwd.cfg ${pkgdir}/usr/share/${pkgname}/qwfwd.d/qwfwd.cfg ## FINISHING TOUCHES ## # Security is worthless without a modicum of usability. We're kind of stepping on other packagers' toes here, but... c'est la vie. # Remind me to submit a patch to https://aur.archlinux.org/packages/ezquake/ (and incorporate into ezquake-git, which I maintain). # Scratch that, ezquake uses "users" group. Works for me! - chgrp -R users ${pkgdir}/opt/quake/ - chgrp users ${pkgdir}/usr/share/nquake + chgrp -R users ${pkgdir}/usr/share/${pkgname}/ + chgrp users ${pkgdir}/usr/share/${pkgname} } diff --git a/README.arch b/README.arch new file mode 100644 index 000000000000..c656b2d6d428 --- /dev/null +++ b/README.arch @@ -0,0 +1,27 @@ +In order to use nquakesv under Arch Linux, you need to create a ~/.nquakesv directory with the following structure: + +~/.nquakesv/ +├── id1 +│ └── maps +├── ktx +│ ├── demos +│ ├── modes +│ ├── progs +│ └── sound +│ ├── misc +│ ├── ra +│ ├── rune +│ └── weapons +├── logs +├── qtv +│ └── levelshots +├── qw +│ └── maps +│ └── ctf +└── qwfwd.d + +This can be set up automatically by running /usr/bin/nquakesv-init. This is the recommended way as it will create necessary symlinks from the ezquake install as well. + +Note that if you wish nquakesv to start on boot, you will need to use a sliced systemd unit: + +systemctl enable nquakesv@<username>.service diff --git a/README.arch.sig b/README.arch.sig Binary files differnew file mode 100644 index 000000000000..56cc71494602 --- /dev/null +++ b/README.arch.sig diff --git a/nquakesv-init.py b/nquakesv-init.py new file mode 100644 index 000000000000..93b60f4405fe --- /dev/null +++ b/nquakesv-init.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python3 + +import os +import pwd +import datetime +import json +import subprocess + +timestamp = datetime.datetime.now().strftime('%Y.%m.%d_%H%M.%S') +user = pwd.getpwuid(os.geteuid()).pw_name +homedir = os.environ['HOME'] +nquakedir = homedir + '/.nquakesv' + +def getVer(): + try: + ver = 'unknown' + pkginfo = subprocess.check_output(['pacman', '-Qi', 'nquakesv']).decode('utf-8').splitlines() + for line in pkginfo: + if line.startswith('Version'): + ver = line.split(':')[1].strip() + break + except: + ver = 'unknown' + return(ver) + +def makeDir(path, dest = False): + pass + +def buildRootdir(ver = False): + if ver == False: + ver = getVer() + # Overwriting is bad, mmk? + if os.path.isdir(nquakedir): + os.move(nquakedir, '{0}.bak_{1}'.format(nquakedir, timestamp)) + os.makedirs(nquakedir, exist_ok = True) + # Generated from a vanilla from-"source" nquakesv install + # and a "tree -d -J -a --noreport" run inside the directory. + # We only fetch the "contents" key as the first level is '.' + with open('/usr/share/nquakesv/dirtree.json', 'r') as raw: + dirtree = json.loads(raw.read())[0]['contents'] + with open(nquakedir + '/VERSION', 'w') as f: + f.write('Generated on nquakesv package version {0}\n'.format(ver)) + # We dont need these dirs. + direxcludes = ['addons', 'run'] + dirlinks = ['id1'] + # Walk the paths and build the tree. + for pathspec in dirtree: + if pathspec['name'] in direxcludes: + continue + if pathspec['name'] in dirlinks: + src = '/usr/share/nquakesv/ + dest = + os.symlink() + if pathspec['type'] == 'link': + + +def main(): + pass + +if __name__ == '__main__': + main() diff --git a/nquakesv.install b/nquakesv.install index e92f4d3a5442..80866a2099fc 100644 --- a/nquakesv.install +++ b/nquakesv.install @@ -1,27 +1,16 @@ post_install() { echo echo '!!! NOTE !!!' - echo 'It is *strongly* encouraged to add users to the "users" group (usermod -aG users <username>) if they will be running ezQuake/nQuake. + echo 'It is *strongly* encouraged to add users to the "users" group (usermod -aG users <username>) if they will be running nQuake. Trust me. If you hit a bug and you are using a user not in the users group, you are testing bad and you should feel bad.' echo echo "nQuake Server has been installed. Please copy the retail pak1.pak files (as exactly that filename) to /opt/quake/id1/ - and do (as root): chmod 0775 /opt/quake/id1/*.pak ; chgrp users /opt/quake/id1/*.pak' - If you do not have the retail pak, copy /usr/share/nquake/gpl_maps.pk3 to /opt/quake/id1/ - and do (as root): chmod 0775 /opt/quake/id1/{*.pak,*.pk3} ; chgrp users /opt/quake/id1/{*.pak,*.pk3)" - echo + and do (as root): chmod 0775 /opt/quake/id1/*.pak ; chgrp users /opt/quake/id1/*.pak'" + echo "Also remember to run nquakesv-init as the user(s) that will be running nquakesv." - if [ -f "/opt/quake/ezquake/pak.lst" ]; + if [ ! -f "/opt/quake/id1/pak0.pak" ]; then - if ! egrep -qE '^nquake_ezquake.pk3' /opt/quake/ezquake/pak.lst; - then - sed -i.no_nquake -e '1s/^/nquake_ezquake.pk3\r\n/' /opt/quake/ezquake/pak.lst - cat -n /opt/quake/ezquake/pak.lst | sort -k2 -k1n | uniq -f1 | sort -nk1,1 | cut -f2- > /tmp/ezquake.tmp - cat /tmp/ezquake.tmp > /opt/quake/ezquake/pak.lst - rm /tmp/ezquake.tmp - fi - else - echo "Whoops. You might be doing something naughty, as I can't inject the nquake-provided ezquake.pk3 into the proper pak.lst." - echo "Things *might* or *might not* work quite as expected." + cp /opt/quake/id1/pak0.pak.DEMO /opt/quake/id1/pak0.pak fi } @@ -32,13 +21,3 @@ post_upgrade() { } -post_remove() { - # Undo our stupid clever little hack. - if [ -f "/opt/quake/ezquake/pak.lst.no_nquake" ]; - then - mv /opt/quake/ezquake/pak.lst.no_nquake /opt/quake/ezquake/pak.lst - else - echo "Weird; I can't seem to remove our injected entry from the proper pak.lst." - echo "You weren't doing something naughty like arbitrarily deleting files from your filesystem, were you?" - fi -} diff --git a/sv-configs.zip.sig b/sv-configs.zip.sig Binary files differnew file mode 100644 index 000000000000..9642b93e24ee --- /dev/null +++ b/sv-configs.zip.sig |