summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorwitit2016-03-15 07:55:51 +0700
committerwitit2016-03-15 07:55:51 +0700
commit5d65d23a81dc62a9c38c2c012d0cc9939c5e2271 (patch)
treed2a40a64a00ab4b95576793a4fb43f08ef8a0803
parentf66ac59f10f5ab6d231f1212b95a38b0b0382cc7 (diff)
downloadaur-5d65d23a81dc62a9c38c2c012d0cc9939c5e2271.tar.gz
correct and tidy up PKGBUILD
-rw-r--r--.SRCINFO5
-rw-r--r--PKGBUILD28
2 files changed, 25 insertions, 8 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 819a1e6c04f1..ac5f5433d464 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -6,7 +6,8 @@ pkgbase = invoiceplane
arch = any
license = MIT
depends = php
- source = https://invoiceplane.com/download/v1.4.6
- md5sums = 6e4fc1bb5446accc6ae2b1907cf1e974
+ source = https://github.com/InvoicePlane/InvoicePlane/archive/v1.4.6.tar.gz
+ sha512sums = 6bd57bb0ec2c5d04e0ac815bd1da75c175bf50597d5dae7b3b04f8eecd1035f65217e09c56114e930df2219f478df3bea11546ab2003e80d405739bf5f29c9d3
+
pkgname = invoiceplane
diff --git a/PKGBUILD b/PKGBUILD
index 145ab1858477..44a9304b1313 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -15,10 +15,26 @@ source=("https://github.com/InvoicePlane/InvoicePlane/archive/v1.4.6.tar.gz")
sha512sums=('6bd57bb0ec2c5d04e0ac815bd1da75c175bf50597d5dae7b3b04f8eecd1035f65217e09c56114e930df2219f478df3bea11546ab2003e80d405739bf5f29c9d3')
package() {
- cd ${srcdir}
- install -vdm0755 $pkgdir/usr/share/webapps
- mkdir -p $pkgdir/etc/webapps/invoiceplane
- cp -a "${_pkgname}-${pkgver}" ${pkgdir}/usr/share/webapps/invoiceplane
- sudo ln -s "/etc/webapps/invoiceplane/database.php" "/usr/share/webapps/invoiceplane/application/config/database.php"
- install -D "${_pkgname}-${pkgver}/license.txt" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ # Each of these functions start in the $srcdir already.
+
+ # Quote variables to prevent word splitting.
+ # See <http://mywiki.wooledge.org/Quotes#When_Should_You_Quote.3F>
+
+ install -d "$pkgdir"/usr/share/webapps
+
+ # Consistency.
+ install -d "$pkgdir"/etc/webapps/invoiceplane
+
+ # Note that -a with --preserve=all only works here as package() is run
+ # under fakeroot, otherwise you'd use -dr --no-preserve=ownership
+ cp -a "$_pkgname-$pkgver" "$pkgdir"/usr/share/webapps/invoiceplane
+
+ # This is temporarily a broken symlink but will be correct once installed.
+ file=""$pkgdir"/usr/share/webapps/invoiceplane/application/config/database.php"
+ if [ -f $file ] ; then
+ rm $file
+ fi
+ ln -s /etc/webapps/invoiceplane/database.php "$pkgdir"/usr/share/webapps/invoiceplane/application/config/database.php
+
+ install -Dm644 "$_pkgname-$pkgver"/license.txt "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE
}