summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof AS (3ED)2017-07-01 16:27:37 +0200
committerKrzysztof AS (3ED)2017-07-01 16:27:37 +0200
commitcf18bcd133e896ac6d30667e89cf600f2c75af25 (patch)
tree56e4254a80bdb9c7c4e7c8b28b235bceedbd8e35
parent48c679d524d78a1a8507b4c9028ce138b607717f (diff)
downloadaur-cf18bcd133e896ac6d30667e89cf600f2c75af25.tar.gz
Optimize
-rw-r--r--.SRCINFO3
-rw-r--r--PKGBUILD35
2 files changed, 27 insertions, 11 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 6feef34160b..2a36ddbf3d0 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,5 +1,5 @@
# Generated by mksrcinfo v8
-# Sat Jul 1 12:40:45 UTC 2017
+# Sat Jul 1 14:24:58 UTC 2017
pkgbase = gz-models
pkgdesc = HiRes 3D Models for GZDoom
pkgver = 20130109
@@ -11,6 +11,7 @@ pkgbase = gz-models
makedepends = perl
makedepends = p7zip
depends = gzdoom
+ noextract = ds-models-20130109.zip
source = ds-models-20130109.zip::https://storage.googleapis.com/google-code-archive-source/v2/code.google.com/ds-models/source-archive.zip
sha512sums = 6a3b7b9446d42e12371fab2b25bb2856ca79f5796ecd0c7e6f315ddb56c3eb57a88d406d4aa3b83c2f7bbb8fe04a8670602545b7bb8dbc114da21fc3b7ee6b96
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"
}