From 87239ae6b56c9bdac3676c2e7c11bc5aedb9855d Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 19 Aug 2009 07:45:34 +0000 Subject: main/amavisd-new: create users in pre-install, set perms in post-install remove use of users in APKBUILD, we still dont support this, but will later --- extra/amavisd-new/amavisd-new.pre-install | 4 ---- main/amavisd-new/APKBUILD | 17 ++++++----------- main/amavisd-new/amavisd-new.post-install | 15 +++------------ main/amavisd-new/amavisd-new.pre-install | 4 ++++ 4 files changed, 13 insertions(+), 27 deletions(-) delete mode 100755 extra/amavisd-new/amavisd-new.pre-install create mode 100755 main/amavisd-new/amavisd-new.pre-install diff --git a/extra/amavisd-new/amavisd-new.pre-install b/extra/amavisd-new/amavisd-new.pre-install deleted file mode 100755 index aaaa763c..00000000 --- a/extra/amavisd-new/amavisd-new.pre-install +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -addgroup amavis -adduser -D -S -G amavis -h /var/amavis -s /bin/false amavis diff --git a/main/amavisd-new/APKBUILD b/main/amavisd-new/APKBUILD index c6c79173..10d98696 100644 --- a/main/amavisd-new/APKBUILD +++ b/main/amavisd-new/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Leonardo Arena pkgname=amavisd-new pkgver=2.6.3 -pkgrel=0 +pkgrel=1 pkgdesc="High-performance interface between mailer (MTA) and content checkers" url="http://www.ijs.si/software/amavisd" license="GPL-2" @@ -10,10 +10,9 @@ depends="uclibc sed file perl perl-archive-zip perl-convert-tnef perl-convert-uulib perl-mime-tools perl-mail-tools perl-net-server perl-io-stringy perl-unix-syslog perl-db perl-mail-dkim" makedepends="" -install="$pkgname.post-install" +install="$pkgname.post-install $pkgname.pre-install" subpackages="" -source="http://www.ijs.si/software/amavisd/$pkgname-$pkgver.tar.gz -$pkgname.post-install" +source="http://www.ijs.si/software/amavisd/$pkgname-$pkgver.tar.gz" build() { cd "$srcdir/$pkgname-$pkgver" @@ -27,10 +26,7 @@ build() { for dir in $DIRS do - if [ ! -d "${pkgdir}$dir" ]; then - mkdir -p ${pkgdir}$dir - fi - chown -R amavis.amavis $HOME + mkdir -p ${pkgdir}$dir done install -m 755 -o root -D amavisd $pkgdir/usr/sbin/amavisd @@ -42,10 +38,9 @@ build() { -e "s:^.*\$QUARANTINEDIR = .*$:\$QUARANTINEDIR = '$QUARANTINE';:" \ -e "s:^.*\$daemon_user = 'vscan';\(.*\)$:\$daemon_user = 'amavis';\1:" \ -e "s:^.*\$daemon_group = 'vscan';\(.*\)$:\$daemon_group = 'amavis';\1:" < amavisd.conf > amavisd.conf.alpine - install -m 640 -o root -g amavis -D amavisd.conf.alpine ${pkgdir}${CONFIG} + install -m 640 -o root -D amavisd.conf.alpine ${pkgdir}${CONFIG} install -m 755 -D ../../amavisd.init $pkgdir/etc/init.d/amavisd ) } -md5sums="02b0bd38b40258841c60479603dc6842 amavisd-new-2.6.3.tar.gz -4b5cb0c750ab11d9d211a4e389545d6d amavisd-new.post-install" +md5sums="02b0bd38b40258841c60479603dc6842 amavisd-new-2.6.3.tar.gz" diff --git a/main/amavisd-new/amavisd-new.post-install b/main/amavisd-new/amavisd-new.post-install index 56cad39f..2c5ea2cf 100755 --- a/main/amavisd-new/amavisd-new.post-install +++ b/main/amavisd-new/amavisd-new.post-install @@ -1,14 +1,5 @@ #!/bin/sh -HOME=/var/amavis -QUARANTINE=$HOME/quarantine -USER=amavis -GROUP=amavis -DIRS="$HOME $HOME/tmp $HOME/var $HOME/db $HOME/home $QUARANTINE" -CONFIG=/etc/amavisd.conf - -addgroup $USER -adduser -h $HOME -s /bin/false -G $GROUP -D $USER -chown -R $USER:$GROUP $HOME -chmod -R 750 $HOME -chown root:$GROUP $CONFIG +chown -R amavis:amavis /var/amavis +chmod -R 750 /var/amavis +chown root:amavis /etc/amavisd.conf diff --git a/main/amavisd-new/amavisd-new.pre-install b/main/amavisd-new/amavisd-new.pre-install new file mode 100755 index 00000000..aaaa763c --- /dev/null +++ b/main/amavisd-new/amavisd-new.pre-install @@ -0,0 +1,4 @@ +#!/bin/sh + +addgroup amavis +adduser -D -S -G amavis -h /var/amavis -s /bin/false amavis -- cgit v1.2.3