summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD35
1 files changed, 25 insertions, 10 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 30c51b92e36..5e9ebe518e6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,6 +1,7 @@
# Contributor: 3ED <krzysztofas@protonmail.com>
pkgname=gz-models
+_trunk=GZ-Models
pkgver=20130109
pkgrel=1
pkgdesc="HiRes 3D Models for GZDoom"
@@ -12,23 +13,37 @@ makedepends=('perl' 'p7zip')
install=gz-models.install
source=("ds-models-${pkgver}.zip::https://storage.googleapis.com/google-code-archive-source/v2/code.google.com/ds-models/source-archive.zip")
sha512sums=('6a3b7b9446d42e12371fab2b25bb2856ca79f5796ecd0c7e6f315ddb56c3eb57a88d406d4aa3b83c2f7bbb8fe04a8670602545b7bb8dbc114da21fc3b7ee6b96')
+noextract=("ds-models-${pkgver}.zip")
prepare() {
cd "$srcdir"
- find "ds-models/trunk/GZ-Models" -type f -iname "*.def" -print0 \
- | xargs -0 perl -p -i -e 's/\xA0/ /g'
-
if [ -d "$pkgname-$pkgver" ]; then
rm -rf "$pkgname-$pkgver"
fi
- install -dm755 "$pkgname-$pkgver/Models"
- mv "ds-models/trunk/GZ-Models"/Build/*/*.def "$pkgname-$pkgver/"
- mv "ds-models/trunk/GZ-Models"/Build/Hires "$pkgname-$pkgver/"
- mv "ds-models/trunk/GZ-Models"/Build/*/*/ "$pkgname-$pkgver/Models/"
+ msg2 "Extracting $_trunk..."
+ bsdtar \
+ --include="ds-models/trunk/$_trunk/*" \
+ --strip-components 2 \
+ -xf "ds-models-${pkgver}.zip"
+
+ cd "$_trunk"
+
+ msg2 "Fixing space chars..."
+ find -type f -iname "*.def" -print0 \
+ | xargs -0 perl -p -i -e 's/\xA0/ /g'
+
+ msg2 "Fixing files paths..."
+ install -dm755 "$srcdir/$pkgname-$pkgver/Models"
+ mv Build/*/*.def "$srcdir/$pkgname-$pkgver/"
+ mv Build/Hires "$srcdir/$pkgname-$pkgver/"
+ mv Build/*/*/ "$srcdir/$pkgname-$pkgver/Models/"
+
+ cd "$srcdir"
- rm -rf "ds-models"
+ msg2 "Cleaning leftovers..."
+ rm -rf "$_trunk"
}
package() {
@@ -38,6 +53,6 @@ package() {
_DESTDIR="$pkgdir"/usr/share/games/gzdoom/
install -dm755 "$_DESTDIR"
- 7za a -bd -tzip "$_DESTDIR"/GZ-Models.pk3 *.def Models Hires
- chmod a=r,u+w "$_DESTDIR"/GZ-Models.pk3
+ 7za a -bd -tzip "$_DESTDIR/${_trunk}.pk3" *
+ chmod a=r,u+w "$_DESTDIR/${_trunk}.pk3"
}