wok-6.x annotate dovecot/receipt @ rev 14575

eet-dev: Up to 1.7.7
author Dominique Corbex <domcox@slitaz.org>
date Sat May 25 12:38:44 2013 +0200 (2013-05-25)
parents 7f0d30db2f42
children 10e6c72b2c15
rev   line source
pascal@11220 1 # SliTaz package receipt.
pascal@11220 2
pascal@11220 3 PACKAGE="dovecot"
slaxemulator@12767 4 VERSION="2.1.6"
pascal@11220 5 CATEGORY="network"
pascal@11220 6 SHORT_DESC="Dovecot IMAP and POP3 Server."
pascal@11220 7 MAINTAINER="l.lemarinel@gmail.com"
pascal@11220 8 TARBALL="$PACKAGE-$VERSION.tar.gz"
slaxemulator@12767 9 WEB_SITE="http://dovecot.org"
slaxemulator@12767 10 WGET_URL="http://www.dovecot.org/releases/${VERSION:0:3}/$TARBALL"
slaxemulator@12767 11
slaxemulator@12767 12 DEPENDS="libssl libcap openldap pam postgresql libmysqlclient"
pascal@11220 13 BUILD_DEPENDS="openssl-dev libcap-dev openldap-dev \
gokhlayeh@11431 14 libmysqlclient mysql-dev sqlite-dev pam-dev postgresql-dev"
pascal@11220 15
pascal@11220 16 # Rules to configure and make the package.
pascal@11220 17 compile_rules()
pascal@11220 18 {
pascal@11220 19 cd $src
pascal@11220 20 ./configure --prefix=/usr \
slaxemulator@12767 21 --sysconfdir=/etc/dovecot \
erjo@12060 22 --localstatedir=/var \
pascal@11220 23 --libexecdir=/usr/lib/$PACKAGE \
pascal@11220 24 --with-ssl=openssl \
pascal@11220 25 --with-ldap=plugin \
pascal@11220 26 --with-sql=plugin \
pascal@11220 27 --with-mysql \
pascal@11220 28 --with-pgsql \
gokhlayeh@11573 29 --with-sqlite \
gokhlayeh@11573 30 $CONFIGURE_ARGS &&
slaxemulator@12767 31 make &&
slaxemulator@12767 32 make DESTDIR=$DESTDIR install
pascal@11220 33
pascal@11220 34 }
pascal@11220 35
pascal@11220 36 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@11220 37 genpkg_rules()
pascal@11220 38 {
erjo@12043 39 mkdir -p $fs/usr/lib \
erjo@12043 40 $fs/var/log/dovecot \
erjo@12060 41 $fs/var/run/dovecot \
erjo@12060 42 $fs/etc/ssl/misc
erjo@12060 43
pascal@11220 44
pascal@11220 45 cp -a $install/usr/sbin $fs/usr
erjo@12060 46 cp -a $install/usr/bin $fs/usr
pascal@11220 47 cp -a $install/usr/lib $fs/usr
pascal@11220 48 cp -a $install/etc $fs/
pascal@11220 49
erjo@12043 50 cp -pa $stuff/init.d $fs/etc
erjo@12043 51
erjo@12060 52 #cp -pa $fs/etc/dovecot/dovecot-example.conf $fs/etc/dovecot/dovecot.conf
erjo@12060 53 cp -pa $install/usr/share/doc/dovecot/example-config/* $fs/etc/dovecot/
erjo@12060 54 #cp -pa $src/doc/example-config/conf.d/*.conf $fs/etc/dovecot/conf.d
erjo@12060 55 #cp -pa $src/doc/example-config/conf.d/*.ext $fs/etc/dovecot/conf.d
erjo@12060 56 cp -pa $src/doc/*.cnf $fs/etc/ssl
erjo@12060 57 cp -pa $src/doc/mkcert.sh $fs/etc/ssl/misc/dovmkcert.sh
erjo@12043 58
pascal@11220 59 # Remove archive file *.*a
pascal@11220 60 find $fs -name "*.*a" -exec rm -f {} \;
pascal@11220 61
erjo@12060 62 # Fix perms
erjo@12060 63 chmod 755 $fs/etc/ssl/misc/*
erjo@12060 64
erjo@12060 65 # Customising config.
erjo@12060 66 sed -i -e "s/^#default_vsz_limit.*/default_vsz_limit = 50M"/ \
erjo@12060 67 $fs/etc/dovecot/conf.d/10-master.conf
erjo@12149 68
erjo@12060 69 sed -i -e "s!^#log_path =.*!log_path = /var/log/dovecot/dovecot.log"! \
erjo@12060 70 $fs/etc/dovecot/conf.d/10-logging.conf
erjo@12060 71
erjo@12060 72 sed -i -e "s/^#listen.*/listen = *"/ \
erjo@12060 73 $fs/etc/dovecot/dovecot.conf
pascal@11220 74 }
erjo@12043 75
erjo@12043 76 #nd post install commands for Tazpkg.
erjo@12043 77 post_install()
erjo@12043 78 {
erjo@12043 79 local user
erjo@12043 80 local group
erjo@12043 81
erjo@12043 82 user=dovecot
erjo@12043 83 group=dovecot
erjo@12043 84
erjo@12043 85 if ! grep -q $user $1/etc/passwd; then
erjo@12043 86 echo -n "Adding user/group $user..."
slaxemulator@12767 87 chroot $1/ addgroup -g 76 -S $group
slaxemulator@12767 88 chroot $1/ adduser -u 76 -S -D -H -G $group $user
slaxemulator@12767 89 chroot $1/ adduser -u 74 -S -D -H -G nogroup dovenull
erjo@12043 90 status
erjo@12043 91 fi
erjo@12043 92
erjo@12043 93
erjo@12043 94 # Set perms for files and directories
erjo@12043 95 chroot $1/ chown -R ${user}.${group} /var/log/${user} \
erjo@12043 96 /var/run/${user}
erjo@12043 97
erjo@12043 98 cat <<EOF
erjo@12043 99 ----
erjo@12043 100 To start $PACKAGE server you can run :
erjo@12043 101
erjo@12043 102 /etc/init.d/$PACKAGE start
erjo@12043 103
erjo@12043 104 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
erjo@12043 105 ----
erjo@12043 106 EOF
erjo@12043 107 }
erjo@12043 108
erjo@12043 109
erjo@12043 110 post_remove()
erjo@12043 111 {
erjo@12043 112 echo "Removing stalled files..."
slaxemulator@12767 113 test -d $1/var/log/dovecot && rm -rf $1/var/log/dovecot
slaxemulator@12767 114 test -d $1/var/run/dovecot && rm -rf $1/var/run/dovecot
erjo@12043 115
erjo@12043 116 echo "Removing user/group daemon"
slaxemulator@12767 117 chroot "$1/" deluser dovecot
slaxemulator@12767 118 chroot "$1/" deluser dovenull
erjo@12043 119 }