blob: f36ac77a233e92a2c694961704e32d8cd6712bf6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
# Maintainer: Viech <viech unvanquished net>
pkgname=unvanquished-data
pkgver=0.51.1
pkgrel=1
_gitver="archlinux/${pkgver}-${pkgrel}"
pkgdesc='Game assets for Unvanquished.'
arch=('any')
url='http://www.unvanquished.net'
license=('GPL3')
makedepends=('aria2>=1.18.7-2')
source=("https://github.com/Unvanquished/Unvanquished/raw/${_gitver}/download-dpk-torrent.sh")
# disable package compression since assets are already compressed
PKGEXT='.pkg.tar'
build() {
cd "${srcdir}"
chmod +x download-dpk-torrent.sh
}
package() {
# create installation directory
install -dm755 "${pkgdir}/usr/share/unvanquished/pkg/"
# use package source directory as the cache for the download script
if [ ! -d "${srcdir}/cache" ]; then
mkdir "${srcdir}/cache"
fi
# attempt to copy existing assets from the system, so they aren't redownloaded
if [ -d /usr/share/unvanquished/pkg ]; then
echo "Copying existing assets from the system..."
cp -r /usr/share/unvanquished/pkg/*.dpk "${pkgdir}/usr/share/unvanquished/pkg/" || true
fi
# make the download script aware of copied assets, so it will remove unneeded ones
ls -c1 "${pkgdir}/usr/share/unvanquished/pkg/" > "${srcdir}/cache/last-assets.txt"
# remove old aria2 progress files in case the torrent itself was updated
rm -f "${srcdir}/cache/"*".aria2"
# download new or modified assets
./download-dpk-torrent.sh "${pkgdir}/usr/share/unvanquished/pkg/" "${srcdir}/cache" "${pkgver}"
}
md5sums=('a53bcb79af17ca7b7050a62bd023f814')
|