Subject: [alpine-devel] [PATCH] testing/exim: post-install add SUID bit for correct --signal HUP reload

From: Valery Kartel <[email-masked]>
Date: Fri, 5 Dec 2014 14:28:11 +0200

---
 testing/exim/APKBUILD          | 83 ++++++++++++++++++++++--------------------
 testing/exim/exim.Makefile     |  6 +--
 testing/exim/exim.logrotate    |  2 +-
 testing/exim/exim.post-install |  5 +++
 4 files changed, 53 insertions(+), 43 deletions(-)
 create mode 100644 testing/exim/exim.post-install

diff --git a/testing/exim/APKBUILD b/testing/exim/APKBUILD
index a93813c..006b65b 100644
--- a/testing/exim/APKBUILD
+++ b/testing/exim/APKBUILD
@@ -2,75 +2,77 @@
 # Maintainer: Jesse Young <[email-masked]>
 pkgname=exim
 pkgver=4.84
-pkgrel=2
+pkgrel=3
 pkgdesc="A Message Transfer Agent"
 url="http://www.exim.org/"
 arch="all"
 license="GPL2"
 depends=
+pkgusers="mail"
+pkggroups="mail"
 depends_dev="db-dev pcre-dev openssl-dev libspf2-dev mysql-dev postgresql-dev sqlite-dev"
 makedepends="bash gawk perl $depends_dev"
-install=
-subpackages="$pkgname-cdb $pkgname-doc $pkgname-dnsdb $pkgname-passwd $pkgname-sqlite $pkgname-mysql $pkgname-postgresql $pkgname-utils $pkgname-scripts"
+install="exim.pre-install exim.post-install"
+subpackages="$pkgname-cdb  $pkgname-dnsdb $pkgname-passwd $pkgname-sqlite $pkgname-mysql $pkgname-postgresql $pkgname-utils $pkgname-scripts $pkgname-doc"
 source="ftp://exim.inode.at/exim/exim4/$pkgname-$pkgver.tar.bz2
 	exim.Makefile
 	exim.confd
 	exim.initd
 	exim.logrotate
-	exim.pre-install"
+	exim.pre-install
+	exim.post-install"
 
-_builddir=$srcdir/$pkgname-$pkgver
+_builddir="$srcdir"/$pkgname-$pkgver
 
 prepare() {
-	cd $_builddir
-	# apply patches here
+	cd "$_builddir"
 	cp "$srcdir/$pkgname.Makefile" Local/Makefile
-	sed -e 's/^LIBS = -lnsl/LIBS =/g' \
+	sed	-e 's/^LIBS = -lnsl/LIBS =/g' \
 		-e 's/^HAVE_ICONV=yes/#HAVE_ICONV=yes/' \
 		-i OS/Makefile-Linux
 }
 
 build() {
-	cd $_builddir
-	make makefile
-	make -j1
+	cd "$_builddir"
+	make makefile || return 1
+	make -j1 || return 1
 }
 
 package() {
-	cd $_builddir
-	make DESTDIR=$pkgdir INSTALL_ARG="-no_symlink -no_chown exim" install
-	install -D -m644 doc/exim.8 $pkgdir/usr/share/man/man8/exim.8
-	cd $pkgdir/usr/sbin
+	cd "$_builddir"
+	make DESTDIR="$pkgdir" INSTALL_ARG="-no_symlink -no_chown exim" install || return 1
+	install -D -m644 doc/exim.8 "$pkgdir"/usr/share/man/man8/exim.8
+	cd "$pkgdir"/usr/sbin
 	mv exim-${pkgver}-* exim
-	for i in mailq rmail rsmtp runq sendmail; do
+	for i in mailq rmail rsmtp runq sendmail newaliases; do
 		ln -s exim $i
 	done
-	install -m644 -D $srcdir/$pkgname.logrotate $pkgdir/etc/logrotate.d/$pkgname
-	install -m644 -D $srcdir/$pkgname.confd $pkgdir/etc/conf.d/$pkgname
-	install -m755 -D $srcdir/$pkgname.initd $pkgdir/etc/init.d/$pkgname
-	install -m750 -D -g mail -d $pkgdir/usr/lib/exim
-	install -m750 -D -o mail -d $pkgdir/var/log/exim
+	install -m644 -D "$srcdir"/$pkgname.logrotate "$pkgdir"/etc/logrotate.d/$pkgname
+	install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
+	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
+	install -m750 -D -g mail -d "$pkgdir"/usr/lib/exim
+	install -m750 -D -o mail -d "$pkgdir"/var/log/exim
 }
 
 scripts() {
 	pkgdesc="exim scripts"
 	depends="exim perl"
 	arch="noarch"
-	cd $_builddir
-	make	DESTDIR=$subpkgdir \
+	cd "$_builddir"
+	make	DESTDIR="$subpkgdir" \
 		INSTALL_ARG="exicyclog exim_checkaccess eximstats exiqgrep exigrep exinext exiqsumm exipick exiwhat" \
-		install
-	rm -fr $subpkgdir/etc
+		install || return 1
+	rm -fr "$subpkgdir"/etc
 }
 
 utils() {
 	pkgdesc="exim utils"
 	depends="exim"
-	cd $_builddir
-	make	DESTDIR=$subpkgdir \
+	cd "$_builddir"
+	make	DESTDIR="$subpkgdir" \
 		INSTALL_ARG="exim_dbmbuild exim_dumpdb exim_tidydb exim_fixdb exim_lock" \
-		install
-	rm -fr $subpkgdir/etc
+		install || return 1
+	rm -fr "$subpkgdir"/etc
 }
 
 sqlite() {
@@ -110,24 +112,27 @@ passwd() {
 }
 
 _inst_lookup() {
-	install -D -m755 $_builddir/build-Linux-*/lookups/$1.so $subpkgdir/usr/lib/exim/$1.so
+	install -D -m755 "$_builddir"/build-Linux-*/lookups/$1.so "$subpkgdir"/usr/lib/exim/$1.so
 }
 
 md5sums="3d14522e604b687b9e515f5aa739b2c0  exim-4.84.tar.bz2
-8b2190d4169850f667250acdd13d6d06  exim.Makefile
+950c23ffa293dd50a50fc12664f62566  exim.Makefile
 f442b68d435598831bab8536ade071b8  exim.confd
 6ba3c29545484c152df7ac8656943891  exim.initd
-8e8003542b9b8cd6300e46c24c302802  exim.logrotate
-a58ceadf9f3fa8b06bbadb01bc731dc8  exim.pre-install"
+e55ed3d9343a6f6cf6f65b2ae2de3fed  exim.logrotate
+a58ceadf9f3fa8b06bbadb01bc731dc8  exim.pre-install
+e063c06928185f75aa3f3378291efdf5  exim.post-install"
 sha256sums="78ea22be87fb6df880e7fd482f3bec9ef6ceca0c9dedd50f8a26cae0b38b9e9c  exim-4.84.tar.bz2
-a64a2eb7c1d17d2734604bcea7422b2110bab94d0b70606b68cf3f4300753284  exim.Makefile
+43ec8f9f24017eec90225678dcc13181cb7831a403773eb92b7400d396d94077  exim.Makefile
 668f912565a59926957090c6143f669f0e9de2cf441507d3c05fcd046865b401  exim.confd
 46869c47ff928c5628113e4a76ea469e8202339305b781ada0e37dcf6cd5bf76  exim.initd
-49b4d81d6823057c89f7734b2d76de389d427af56164faad32ec883f8ca9e804  exim.logrotate
-3470a7f2860b0c01549577edf446fc13cdcf3e10e1b52875eee666017227db03  exim.pre-install"
+790f2cc0cc1afa4feb4d18fa4701a223e0f15056be1b308b2169ddfbe05549a4  exim.logrotate
+3470a7f2860b0c01549577edf446fc13cdcf3e10e1b52875eee666017227db03  exim.pre-install
+2bb44577dd7bad59a8af7fac4d4a02867ee835736e878c39105ba07a175e40e5  exim.post-install"
 sha512sums="3cd41af6d57e5f0377fc93367753eae6cb6bf835803e8608c44e1da5acefce1ed8886f4fe7536950de072bfed6e927afe1536c1e6466cf3121dd352b69a68039  exim-4.84.tar.bz2
-4ec2b7a5e2c99cf0fb8dc4cd7684a86e8667e57c3ebb7beab8cd24322ab0d876fc27dd6b2d8e5bdfb36f260adaf297ca64cc6623f9e686a2fef3386c0531557a  exim.Makefile
+2329ab156a663c33094f675fb50763123d4f92e402e55ae1d8c21394b14b25b2c05b6bce78dd6a59e623b355304a4523928ec00a6140acd8402712b6508952c8  exim.Makefile
 24bae5bba1b41e59247cd7089c3f9ffcc5f4b26c3da1b21f755724a7ee5c99a05e324437c965ae86170056cc63b9bcdc41f624a747ab31b887d69cff620f2155  exim.confd
 aeec8762d1dce4b09049e08d0c275ae475e639c4a3ad667c4208df36eba71c544311f5c175d7f481ea84213cf130da0a77a0e32d3ff7e933a7356deab8c4e850  exim.initd
-665bfa5ced8829f8f199bbcd040c1c667193643c6d902e5412679cf138e4c8cda7ffd0eefc8ff3b76d95202ee52d0c372b7c319746ff590dd6b61b93c1a2fedf  exim.logrotate
-6b6e85f392cd338602653b86f88daedf90a735e04f9bbcbac83df357ec881f436a74aedd91db21bd1e2e510eedea39587ae473efa7be9b75c6e2efe0472cf28d  exim.pre-install"
+3f38c042eee4a5b0f1284d3ee1fd73e43e37b9c91bbf46f73c45640d54685f1af9322f5ff11882bf55d851f5c85d3d1aaa4b61b5de280603abf2f9e273a5091c  exim.logrotate
+6b6e85f392cd338602653b86f88daedf90a735e04f9bbcbac83df357ec881f436a74aedd91db21bd1e2e510eedea39587ae473efa7be9b75c6e2efe0472cf28d  exim.pre-install
+739ca023d1f290f4594b4dc775bf1b2658c786c8b8fff44f7c523420c20a8ebd011e147a3fedfa7b60f9b653058d29aa8a503cd7edde36fc6760288e08ced4c1  exim.post-install"
diff --git a/testing/exim/exim.Makefile b/testing/exim/exim.Makefile
index 270be68..431792d 100644
--- a/testing/exim/exim.Makefile
+++ b/testing/exim/exim.Makefile
@@ -18,13 +18,13 @@ LOOKUP_MODULE_DIR=/usr/lib/exim/
 CFLAGS_DYNAMIC=-shared -rdynamic -fPIC
 LOOKUP_DBM=yes
 LOOKUP_LSEARCH=yes
-LOOKUP_DNSDB=2
-LOOKUP_CDB=2
 LOOKUP_DSEARCH=yes
+LOOKUP_CDB=2
+LOOKUP_DNSDB=2
+LOOKUP_PASSWD=2
 LOOKUP_MYSQL=2
 LOOKUP_MYSQL_INCLUDE=-I/usr/include/mysql
 LOOKUP_MYSQL_LIBS=-lmysqlclient
-LOOKUP_PASSWD=2
 LOOKUP_PGSQL=2
 LOOKUP_PGSQL_INCLUDE=-I/usr/include/postgresql
 LOOKUP_PGSQL_LIBS=-lpq
diff --git a/testing/exim/exim.logrotate b/testing/exim/exim.logrotate
index c923ed1..357652b 100644
--- a/testing/exim/exim.logrotate
+++ b/testing/exim/exim.logrotate
@@ -8,6 +8,6 @@
 	create 640 mail mail
 	sharedscripts
 	postrotate
-		/etc/init.d/exim reload > /dev/null
+		/etc/init.d/exim --quiet reload
 	endscript
 }
diff --git a/testing/exim/exim.post-install b/testing/exim/exim.post-install
new file mode 100644
index 0000000..23cb984
--- /dev/null
+++ b/testing/exim/exim.post-install
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+chmod u+s /usr/sbin/exim
+
+exit 0
-- 
2.2.0

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