wok-current annotate dovecot/receipt @ rev 12060

Up: dovecot (2.1.1) + improve receipt
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Thu Mar 08 14:32:42 2012 +0100 (2012-03-08)
parents d635a5200162
children 7f0d30db2f42
rev   line source
pascal@11220 1 # SliTaz package receipt.
pascal@11220 2
pascal@11220 3 PACKAGE="dovecot"
erjo@12060 4 VERSION="2.1.1"
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"
pascal@11220 9 WEB_SITE="www.dovecot.org"
erjo@12060 10 WGET_URL="http://www.dovecot.org/releases/${VERSION%.*}/$TARBALL"
pascal@11220 11 BUILD_DEPENDS="openssl-dev libcap-dev openldap-dev \
gokhlayeh@11431 12 libmysqlclient mysql-dev sqlite-dev pam-dev postgresql-dev"
pascal@11220 13 DEPENDS="libssl libcap"
pascal@11220 14
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 \
erjo@12060 21 --sysconfdir=/etc \
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 &&
erjo@12060 31 make && make install
erjo@12060 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@12060 68
erjo@12060 69
erjo@12060 70 sed -i -e "s!^#log_path =.*!log_path = /var/log/dovecot/dovecot.log"! \
erjo@12060 71 $fs/etc/dovecot/conf.d/10-logging.conf
erjo@12060 72
erjo@12060 73 sed -i -e "s/^#listen.*/listen = *"/ \
erjo@12060 74 $fs/etc/dovecot/dovecot.conf
pascal@11220 75 }
erjo@12043 76
erjo@12043 77 #nd post install commands for Tazpkg.
erjo@12043 78 post_install()
erjo@12043 79 {
erjo@12043 80 local user
erjo@12043 81 local group
erjo@12043 82
erjo@12043 83 user=dovecot
erjo@12043 84 group=dovecot
erjo@12043 85
erjo@12043 86 if ! grep -q $user $1/etc/passwd; then
erjo@12043 87 echo -n "Adding user/group $user..."
erjo@12043 88 chroot $1/ addgroup -S $group
erjo@12043 89 chroot $1/ adduser -S -D -H -G $group $user
erjo@12060 90 chroot $1/ adduser -S -D -H -G nogroup dovenull
erjo@12043 91 status
erjo@12043 92 fi
erjo@12043 93
erjo@12043 94
erjo@12043 95 # Set perms for files and directories
erjo@12043 96 chroot $1/ chown -R ${user}.${group} /var/log/${user} \
erjo@12043 97 /var/run/${user}
erjo@12043 98
erjo@12043 99 cat <<EOF
erjo@12043 100 ----
erjo@12043 101 To start $PACKAGE server you can run :
erjo@12043 102
erjo@12043 103 /etc/init.d/$PACKAGE start
erjo@12043 104
erjo@12043 105 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
erjo@12043 106 ----
erjo@12043 107 EOF
erjo@12043 108 }
erjo@12043 109
erjo@12043 110
erjo@12043 111 post_remove()
erjo@12043 112 {
erjo@12043 113 echo "Removing stalled files..."
erjo@12043 114 test -d /var/log/dovecot && rm -rf /var/log/dovecot
erjo@12043 115 test -d /var/run/dovecot && rm -rf /var/run/dovecot
erjo@12043 116
erjo@12043 117 echo "Removing user/group daemon"
erjo@12043 118 deluser dovecot
erjo@12060 119 deluser dovenull
erjo@12043 120 }