Subject: [alpine-devel] [PATCH] testing/sword: add sword group for installing modules systemwide.

From: Isaac Dunham <[email-masked]>
Date: Wed, 23 Jul 2014 06:05:54 -0700

installmgr was trying to install into /usr/share/sword without permissions,
resulting in great confusion.
This change lets all members of the 'sword' group install modules systemwide.
---
 testing/sword/APKBUILD          | 11 +++++++++--
 testing/sword/sword.pre-install |  3 +++
 2 files changed, 12 insertions(+), 2 deletions(-)
 create mode 100755 testing/sword/sword.pre-install

diff --git a/testing/sword/APKBUILD b/testing/sword/APKBUILD
index 468fae2..10611e6 100644
--- a/testing/sword/APKBUILD
+++ b/testing/sword/APKBUILD
@@ -2,7 +2,7 @@
 # Maintainer: Isaac Dunham <[email-masked]>
 pkgname=sword
 pkgver=1.7.3
-pkgrel=0
+pkgrel=1
 pkgdesc="Library for free Bible software"
 url="http://www.crosswire.org/sword/"
 arch="all"
@@ -18,7 +18,8 @@ depends=""
 # curl-dev is needed for standard packages.
 depends_dev="zlib-dev icu-dev curl-dev clucene-dev"
 makedepends="$depends_dev"
-install=""
+pkggroups="sword"
+install="$pkgname.pre-install"
 subpackages="$pkgname-dev $pkgname-doc $pkgname-lang $pkgname-utils"
 source="http://www.crosswire.org/ftpmirror/pub/sword/source/v1.7/sword-$pkgver.tar.gz
 	00-fflush.patch
@@ -55,6 +56,12 @@ build() {
 package() {
 	cd "$_builddir"
 	make DESTDIR="$pkgdir" install || return 1
+	mkdir -p -m775 "$pkgdir/var/lib/sword/modules"  && \
+	mv "$pkgdir/usr/share/sword/mods.d" "$pkgdir/var/lib/sword/" && \
+	chown root:sword "$pkgdir"/var/lib/sword/mod*		&& \
+	chmod -R 0775 "$pkgdir/var/lib/sword/mods.d"  	&& \
+	sed -e 's|\(DataPath=\).*|\1/var/lib/sword/|g' 	   \
+	-i "$pkgdir/etc/sword.conf" || return 1
 	rm -f "$pkgdir"/usr/lib/*.la
 	install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
 	for i in INSTALL README ChangeLog; do
diff --git a/testing/sword/sword.pre-install b/testing/sword/sword.pre-install
new file mode 100755
index 0000000..0ab0d71
--- /dev/null
+++ b/testing/sword/sword.pre-install
@@ -0,0 +1,3 @@
+#!/bin/sh
+echo "Adding 'sword' group for installing SWORD modules systemwide"
+addgroup sword 2>/dev/null >&2 || true
-- 
2.0.2

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---