~alpine/devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
8 4

[alpine-devel] [PATCH] testing/sword: add new package

Isaac Dunham <ibid.ag@gmail.com>
Details
Message ID
<1405457044-3186-1-git-send-email-ibid.ag@gmail.com>
Sender timestamp
1405457044
DKIM signature
missing
Download raw message
Patch: +114 -0
Sword is a library for free Bible software.
It can also be used for other books.

sword-utils contains a number of tools, including installmgr to add "modules"
(books), diatheke to display them, and numerous file format converters.

sword-lang contains config files to translate the names of the books
of the Bible from English into various languages.
---
 testing/sword/00-fflush.patch       | 12 ++++++
 testing/sword/01-corediatheke.patch | 18 ++++++++
 testing/sword/APKBUILD              | 84 +++++++++++++++++++++++++++++++++++++
 3 files changed, 114 insertions(+)
 create mode 100644 testing/sword/00-fflush.patch
 create mode 100644 testing/sword/01-corediatheke.patch
 create mode 100644 testing/sword/APKBUILD

diff --git a/testing/sword/00-fflush.patch b/testing/sword/00-fflush.patch
new file mode 100644
index 0000000..79f0649
--- /dev/null
+++ b/testing/sword/00-fflush.patch
@@ -0,0 +1,12 @@
diff --git a/utilities/installmgr.cpp b/utilities/installmgr.cpp
index b705c25..132314a 100644
--- a/utilities/installmgr.cpp
+++ b/utilities/installmgr.cpp
@@ -73,6 +73,7 @@ virtual bool isUserDisclaimerConfirmed() const {
 		cout << "If you understand this and are willing to enable remote source features\n";
 		cout << "then type yes at the prompt\n\n";
 		cout << "enable? [no] ";
+		fflush(stdout);
 
 		char prompt[10];
 		fgets(prompt, 9, stdin);
diff --git a/testing/sword/01-corediatheke.patch b/testing/sword/01-corediatheke.patch
new file mode 100644
index 0000000..1db160b
--- /dev/null
+++ b/testing/sword/01-corediatheke.patch
@@ -0,0 +1,18 @@
diff --git a/utilities/diatheke/corediatheke.cpp b/utilities/diatheke/corediatheke.cpp
index 6e05e7c..c2b6efb 100644
--- a/utilities/diatheke/corediatheke.cpp
+++ b/utilities/diatheke/corediatheke.cpp
@@ -454,7 +454,6 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI
 						if (font) { *output << "style=\"font:\""  << font << ";\" " ;}
 						if (strcmp(modlocale,locale) !=0 ) { *output << "lang=\"" << modlocale << "\"";}
 						*output << ">";
-					}
 				}	
 
 				if (font && (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI)) {
@@ -498,4 +497,4 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI
 		}
 
 	}
-
+}
diff --git a/testing/sword/APKBUILD b/testing/sword/APKBUILD
new file mode 100644
index 0000000..468fae2
--- /dev/null
+++ b/testing/sword/APKBUILD
@@ -0,0 +1,84 @@
# Contributor: Isaac Dunham <ibid.ag@gmail.com>
# Maintainer: Isaac Dunham <ibid.ag@gmail.com>
pkgname=sword
pkgver=1.7.3
pkgrel=0
pkgdesc="Library for free Bible software"
url="http://www.crosswire.org/sword/"
arch="all"
license="GPL2"
depends=""
# all are optional but desireable; clucene-dev could be replaced with
# new --with-cxx11regex or --with-internalregex,
# but currently c++11 regex leads to this error in diatheke:
# terminate called after throwing an instance of 'std::runtime_error'
#  what():  locale::facet::_S_create_c_locale name not valid
# Aborted
# This might be fixed by the musl locale rework.
# curl-dev is needed for standard packages.
depends_dev="zlib-dev icu-dev curl-dev clucene-dev"
makedepends="$depends_dev"
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
	01-corediatheke.patch"

_builddir="$srcdir"/sword-$pkgver
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--with-icu --with-zlib \
		--with-curl --with-curl_sftp \
		--with-clucene=/usr \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
	rm -f "$pkgdir"/usr/lib/*.la
	install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
	for i in INSTALL README ChangeLog; do
		install -Dm644 $i "$pkgdir"/usr/share/doc/sword/$i
	done
}

lang() {
	mkdir -p "$subpkgdir"/usr/share/sword/
	mv "$pkgdir"/usr/share/sword/locales.d "$subpkgdir"/usr/share/sword/
}

utils() {
	cd "$pkgdir"
	mkdir -p "$subpkgdir"/usr/bin
	mv usr/bin/* "$subpkgdir"/usr/bin
}

md5sums="bd2ffadaa9f92f7b6e657e323e27a028  sword-1.7.3.tar.gz
cce51448f99b7253a502266e268386b6  00-fflush.patch
25a3a3118835150c84471dea439e8c33  01-corediatheke.patch"
sha256sums="5a3d87ff155d5ecb0cfec052ba333b2b74d9273e2cc66fb1ca75747dfd8ea9ea  sword-1.7.3.tar.gz
4c6000d94428cb5150b7debc5a180c17e455ba718b6ef54fa937e9bb4f8c1b80  00-fflush.patch
7ea0e188ae0d8dcfbd2833bf14d98edcfbea99eacf432c7bc5a3df59c9f72e60  01-corediatheke.patch"
sha512sums="4805215954211584ed6b00869a31e1d317d9fa460db2d2e8c5c396f0154979949ec8b770ac8c6ff20106d8beea75d2a824c7e6b6ce5138fc3e558ab4b5614f2a  sword-1.7.3.tar.gz
6f6c13e7d04458e73d36c114017ad9e76e04c991adb8e457a0b55ce09fcaa95f33b2c26b73c2fd28591f07b69d3d03c1db6d08676001b3a45e0b66b22cb47dc0  00-fflush.patch
177081a73de62f798f1cd2654a7f74d5626aac11a67b110e262e74b1c0d04b1e313ddb2dfbcaf6907c405b65ef82a94fd45c64d1dda66be51138a6ed78b79df6  01-corediatheke.patch"
-- 
2.0.1



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Natanael Copa <ncopa@alpinelinux.org>
Details
Message ID
<20140715162818.0f5adca9@ncopa-desktop.alpinelinux.org>
In-Reply-To
<1405457044-3186-1-git-send-email-ibid.ag@gmail.com> (view parent)
Sender timestamp
1405434498
DKIM signature
missing
Download raw message
On Tue, 15 Jul 2014 13:44:04 -0700
Isaac Dunham <ibid.ag@gmail.com> wrote:

> Sword is a library for free Bible software.
> It can also be used for other books.
...

> +++ b/testing/sword/01-corediatheke.patch
> @@ -0,0 +1,18 @@
> +diff --git a/utilities/diatheke/corediatheke.cpp b/utilities/diatheke/corediatheke.cpp
> +index 6e05e7c..c2b6efb 100644
> +--- a/utilities/diatheke/corediatheke.cpp
> ++++ b/utilities/diatheke/corediatheke.cpp
> +@@ -454,7 +454,6 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI
> + 						if (font) { *output << "style=\"font:\""  << font << ";\" " ;}
> + 						if (strcmp(modlocale,locale) !=0 ) { *output << "lang=\"" << modlocale << "\"";}
> + 						*output << ">";
> +-					}
> + 				}	
> + 
> + 				if (font && (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI)) {
> +@@ -498,4 +497,4 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI
> + 		}
> + 
> + 	}
> +-
> ++}

I saw your work with upstream to get this fixed. What I find
interesting is that they didn't catch an error like this upstream. Why
didn't the problem show up on glibc?

musl again causes hidden bugs bubble up to the surface.

Good job!

Applied. Thanks!

-nc


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
William Pitcock <nenolod@dereferenced.org>
Details
Message ID
<CA+T2pCEbZcdwnXgZfUKLqBWc20MAmj-FtOqdvkuEx=UnR-2A_g@mail.gmail.com>
In-Reply-To
<20140715162818.0f5adca9@ncopa-desktop.alpinelinux.org> (view parent)
Sender timestamp
1405489881
DKIM signature
missing
Download raw message
Hello!

On Tue, Jul 15, 2014 at 9:28 AM, Natanael Copa <ncopa@alpinelinux.org> wrote:
> On Tue, 15 Jul 2014 13:44:04 -0700
> Isaac Dunham <ibid.ag@gmail.com> wrote:
>
>> Sword is a library for free Bible software.
>> It can also be used for other books.
> ...
>
>> +++ b/testing/sword/01-corediatheke.patch
>> @@ -0,0 +1,18 @@
>> +diff --git a/utilities/diatheke/corediatheke.cpp b/utilities/diatheke/corediatheke.cpp
>> +index 6e05e7c..c2b6efb 100644
>> +--- a/utilities/diatheke/corediatheke.cpp
>> ++++ b/utilities/diatheke/corediatheke.cpp
>> +@@ -454,7 +454,6 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI
>> +                                             if (font) { *output << "style=\"font:\""  << font << ";\" " ;}
>> +                                             if (strcmp(modlocale,locale) !=0 ) { *output << "lang=\"" << modlocale << "\"";}
>> +                                             *output << ">";
>> +-                                    }
>> +                             }
>> +
>> +                             if (font && (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI)) {
>> +@@ -498,4 +497,4 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI
>> +             }
>> +
>> +     }
>> +-
>> ++}
>
> I saw your work with upstream to get this fixed. What I find
> interesting is that they didn't catch an error like this upstream. Why
> didn't the problem show up on glibc?
>
> musl again causes hidden bugs bubble up to the surface.
>
> Good job!
>
> Applied. Thanks!
>
> -nc

Since this package was added to testing, there was a discussion on an
IRC channel where this software became interesting to test, as I
wanted to factcheck some things being claimed on it.

Unfortunately, I discovered that after installing sword and
sword-utils, and then running:

user$ installmgr -init
[...]
user$ installmgr -r CrossWire
user$ installmgr -ri CrossWire KJV

Then doing a query using diatheke:

user$ diatheke -b KJV -k ...

Nothing came up.  Running strace(1) on diatheke showed it required the
data files to be installed as root before the software would function
correctly.

With the software configured as root, it functions correctly, however
I believe this is a policy violation as software is typically supposed
to be accessible to the user without configuration systemwide, and
installmgr does *something* with the data it downloads when running as
a user.

I am not sure about why it is malfunctioning, if you have any feedback
let me know.

- kaniini


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Isaac Dunham <ibid.ag@gmail.com>
Details
Message ID
<20140716212248.GA1780@newbook>
In-Reply-To
<CA+T2pCEbZcdwnXgZfUKLqBWc20MAmj-FtOqdvkuEx=UnR-2A_g@mail.gmail.com> (view parent)
Sender timestamp
1405545769
DKIM signature
missing
Download raw message
On Wed, Jul 16, 2014 at 12:51:21AM -0500, William Pitcock wrote:
> Hello!
> 
> On Tue, Jul 15, 2014 at 9:28 AM, Natanael Copa <ncopa@alpinelinux.org> wrote:
> > On Tue, 15 Jul 2014 13:44:04 -0700
> > Isaac Dunham <ibid.ag@gmail.com> wrote:
> >
> >> Sword is a library for free Bible software.
> >> It can also be used for other books.
> > ...
> >
> 
> Since this package was added to testing, there was a discussion on an
> IRC channel where this software became interesting to test, as I
> wanted to factcheck some things being claimed on it.
> 
> Unfortunately, I discovered that after installing sword and
> sword-utils, and then running:
> 
> user$ installmgr -init
> [...]
> user$ installmgr -r CrossWire
> user$ installmgr -ri CrossWire KJV
> 
> Then doing a query using diatheke:
> 
> user$ diatheke -b KJV -k ...
> 
> Nothing came up.  Running strace(1) on diatheke showed it required the
> data files to be installed as root before the software would function
> correctly.
> 
> With the software configured as root, it functions correctly, however
> I believe this is a policy violation as software is typically supposed
> to be accessible to the user without configuration systemwide, and
> installmgr does *something* with the data it downloads when running as
> a user.

installmgr installs "modules" to a configured location.
This location is set by DataPath and extended by AddDataPath in the
[INSTALL] section.
/etc/sword.conf points it at /usr/share/sword; this is not writeable.
I'm not aware of any way to point it at a sane default that everyone can use.
If there are NO config files, it will look for ~/.sword/mods.d, and install
into ~/.sword/modules.

installmgr won't work right unless it can find mods.conf or a writeable
mods.d directory in the DataPath.
If it can figure out where it /should/ put modules, it will run,
downloading the modules to a per-repository location.
Then it will move them into location or silently delete them.

Now I need to figure out what's the right fix.
I guess installmgr should error out if it can't write somewhere.
Debian's approach is to require at least one package containing a
SWORD module.

Thanks,
Isaac Dunham


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
William Pitcock <nenolod@dereferenced.org>
Details
Message ID
<CA+T2pCGSxa0LBHj6J8swRkMr9nTiTh5GHu640uXKcDzRxdXy0A@mail.gmail.com>
In-Reply-To
<20140716212248.GA1780@newbook> (view parent)
Sender timestamp
1405573594
DKIM signature
missing
Download raw message
Hello!

On Wed, Jul 16, 2014 at 4:22 PM, Isaac Dunham <ibid.ag@gmail.com> wrote:
> installmgr installs "modules" to a configured location.
> This location is set by DataPath and extended by AddDataPath in the
> [INSTALL] section.
> /etc/sword.conf points it at /usr/share/sword; this is not writeable.
> I'm not aware of any way to point it at a sane default that everyone can use.
> If there are NO config files, it will look for ~/.sword/mods.d, and install
> into ~/.sword/modules.

Why not patch it to prefer ~/.sword/mods.d by default?  I could
imagine the upstream developers finding that useful too.

> installmgr won't work right unless it can find mods.conf or a writeable
> mods.d directory in the DataPath.
> If it can figure out where it /should/ put modules, it will run,
> downloading the modules to a per-repository location.
> Then it will move them into location or silently delete them.
>
> Now I need to figure out what's the right fix.
> I guess installmgr should error out if it can't write somewhere.
> Debian's approach is to require at least one package containing a
> SWORD module.

I don't like this, simply because it's creating a package for some
datafiles, which in this case seems odd to me since installmgr is
available.

One thing we could do is simply have a prompt in the post-install
script saying that you must install the modules you want as root.  A
couple of other packages do this when they require post-install
configuration.

- kaniini


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Natanael Copa <ncopa@alpinelinux.org>
Details
Message ID
<20140722142728.6a7efbbe@ncopa-desktop.alpinelinux.org>
In-Reply-To
<20140716212248.GA1780@newbook> (view parent)
Sender timestamp
1406032048
DKIM signature
missing
Download raw message
On Wed, 16 Jul 2014 14:22:49 -0700
Isaac Dunham <ibid.ag@gmail.com> wrote:

> On Wed, Jul 16, 2014 at 12:51:21AM -0500, William Pitcock wrote:
> > Hello!
> > 
> > On Tue, Jul 15, 2014 at 9:28 AM, Natanael Copa <ncopa@alpinelinux.org> wrote:
> > > On Tue, 15 Jul 2014 13:44:04 -0700
> > > Isaac Dunham <ibid.ag@gmail.com> wrote:
> > >
> > >> Sword is a library for free Bible software.
> > >> It can also be used for other books.
> > > ...
> > >
> > 
> > Since this package was added to testing, there was a discussion on an
> > IRC channel where this software became interesting to test, as I
> > wanted to factcheck some things being claimed on it.
> > 
> > Unfortunately, I discovered that after installing sword and
> > sword-utils, and then running:
> > 
> > user$ installmgr -init
> > [...]
> > user$ installmgr -r CrossWire
> > user$ installmgr -ri CrossWire KJV
> > 
> > Then doing a query using diatheke:
> > 
> > user$ diatheke -b KJV -k ...
> > 
> > Nothing came up.  Running strace(1) on diatheke showed it required the
> > data files to be installed as root before the software would function
> > correctly.
> > 
> > With the software configured as root, it functions correctly, however
> > I believe this is a policy violation as software is typically supposed
> > to be accessible to the user without configuration systemwide, and
> > installmgr does *something* with the data it downloads when running as
> > a user.
> 
> installmgr installs "modules" to a configured location.
> This location is set by DataPath and extended by AddDataPath in the
> [INSTALL] section.
> /etc/sword.conf points it at /usr/share/sword; this is not writeable.
> I'm not aware of any way to point it at a sane default that everyone can use.
> If there are NO config files, it will look for ~/.sword/mods.d, and install
> into ~/.sword/modules.
> 
> installmgr won't work right unless it can find mods.conf or a writeable
> mods.d directory in the DataPath.
> If it can figure out where it /should/ put modules, it will run,
> downloading the modules to a per-repository location.
> Then it will move them into location or silently delete them.
> 
> Now I need to figure out what's the right fix.
> I guess installmgr should error out if it can't write somewhere.
> Debian's approach is to require at least one package containing a
> SWORD module.

How about using /var/lib/sword as default and have a
'sword' group with write permissions there?

They you can just add your users to the sword group to be able to
install the data files.

-nc



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Isaac Dunham <ibid.ag@gmail.com>
Details
Message ID
<20140723040141.GA3905@newbook>
In-Reply-To
<20140722142728.6a7efbbe@ncopa-desktop.alpinelinux.org> (view parent)
Sender timestamp
1406088102
DKIM signature
missing
Download raw message
On Tue, Jul 22, 2014 at 02:27:28PM +0200, Natanael Copa wrote:
> On Wed, 16 Jul 2014 14:22:49 -0700
> Isaac Dunham <ibid.ag@gmail.com> wrote:
> > installmgr installs "modules" to a configured location.
> > This location is set by DataPath and extended by AddDataPath in the
> > [INSTALL] section.
> > /etc/sword.conf points it at /usr/share/sword; this is not writeable.
> > I'm not aware of any way to point it at a sane default that everyone can use.
> > If there are NO config files, it will look for ~/.sword/mods.d, and install
> > into ~/.sword/modules.
> > 
> > installmgr won't work right unless it can find mods.conf or a writeable
> > mods.d directory in the DataPath.
> > If it can figure out where it /should/ put modules, it will run,
> > downloading the modules to a per-repository location.
> > Then it will move them into location or silently delete them.
> > 
> > Now I need to figure out what's the right fix.
> > I guess installmgr should error out if it can't write somewhere.
> > Debian's approach is to require at least one package containing a
> > SWORD module.
> 
> How about using /var/lib/sword as default and have a
> 'sword' group with write permissions there?
> 
> They you can just add your users to the sword group to be able to
> install the data files.
> 
That should work.
One question/minor issue:

abuild warns about chown in the post-install script.

But it would seem that there's no other sane way to make sure that
/var/lib/sword belongs to the "sword" group: to make it belong to
root:sword in the package, this group must exist when the package is
built and when it is extracted.
I presume pre-install could do the latter, but manipulating groups in
a build script is insanity.

If I can ignore that warning (assuming it belongs in abuild), I have a
script ready to go.

What's the preferred approach?

Thanks,
Isaac Dunham


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Isaac Dunham <ibid.ag@gmail.com>
Details
Message ID
<20140723055044.GA17046@newbook>
In-Reply-To
<20140723081936.2ca2eb87@vostro> (view parent)
Sender timestamp
1406094645
DKIM signature
missing
Download raw message
On Wed, Jul 23, 2014 at 08:19:36AM +0300, Timo Teras wrote:
> On Tue, 22 Jul 2014 21:01:42 -0700
> Isaac Dunham <ibid.ag@gmail.com> wrote:
> 
> > On Tue, Jul 22, 2014 at 02:27:28PM +0200, Natanael Copa wrote:
> > > How about using /var/lib/sword as default and have a
> > > 'sword' group with write permissions there?
> > > 
> > > They you can just add your users to the sword group to be able to
> > > install the data files.
> > > 
> > That should work.
> > One question/minor issue:
> > 
> > abuild warns about chown in the post-install script.
> > 
> > But it would seem that there's no other sane way to make sure that
> > /var/lib/sword belongs to the "sword" group: to make it belong to
> > root:sword in the package, this group must exist when the package is
> > built and when it is extracted.
> > I presume pre-install could do the latter, but manipulating groups in
> > a build script is insanity.
> > 
> > If I can ignore that warning (assuming it belongs in abuild), I have a
> > script ready to go.
> > 
> > What's the preferred approach?
> 
> Use pkgusers and pkggroups in APKBUILD, and do chown in the package()
> or subpkg split function. See 'transmission' or any other package with
> pkgusers in it for an example. And create the user in pre-install
> script.
> 
> This allows apk to keep track of the file permissions properly.
> Doing chown in post-install would make the file permissions mismatch
> with what is in the apk database, and thus make 'apk audit' give
> spurious results.

Ok, thanks for the explanation. Patch should be incoming as soon as I've
built and tested it.

...
I might drop clucene as a build dependency, since sword seems to pick up
the libc regex interface. But I'd rather not do that right now.

Thanks,
Isaac Dunham



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Timo Teras <timo.teras@iki.fi>
Details
Message ID
<20140723081936.2ca2eb87@vostro>
In-Reply-To
<20140723040141.GA3905@newbook> (view parent)
Sender timestamp
1406092776
DKIM signature
missing
Download raw message
On Tue, 22 Jul 2014 21:01:42 -0700
Isaac Dunham <ibid.ag@gmail.com> wrote:

> On Tue, Jul 22, 2014 at 02:27:28PM +0200, Natanael Copa wrote:
> > How about using /var/lib/sword as default and have a
> > 'sword' group with write permissions there?
> > 
> > They you can just add your users to the sword group to be able to
> > install the data files.
> > 
> That should work.
> One question/minor issue:
> 
> abuild warns about chown in the post-install script.
> 
> But it would seem that there's no other sane way to make sure that
> /var/lib/sword belongs to the "sword" group: to make it belong to
> root:sword in the package, this group must exist when the package is
> built and when it is extracted.
> I presume pre-install could do the latter, but manipulating groups in
> a build script is insanity.
> 
> If I can ignore that warning (assuming it belongs in abuild), I have a
> script ready to go.
> 
> What's the preferred approach?

Use pkgusers and pkggroups in APKBUILD, and do chown in the package()
or subpkg split function. See 'transmission' or any other package with
pkgusers in it for an example. And create the user in pre-install
script.

This allows apk to keep track of the file permissions properly.
Doing chown in post-install would make the file permissions mismatch
with what is in the apk database, and thus make 'apk audit' give
spurious results.

- Timo


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Reply to thread Export thread (mbox)