wok-4.x annotate cyrus-imapd/receipt @ rev 1659
cyrus-imapd: update DEPENDS
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Nov 08 13:49:06 2008 +0000 (2008-11-08) |
parents | 65d3dfc87776 |
children | bd6010223726 |
rev | line source |
---|---|
pascal@1210 | 1 # SliTaz package receipt. |
pascal@1210 | 2 |
pascal@1210 | 3 PACKAGE="cyrus-imapd" |
pascal@1210 | 4 VERSION="2.2.12" |
pascal@1210 | 5 CATEGORY="network" |
pascal@1210 | 6 SHORT_DESC="IMAP server." |
pascal@1210 | 7 MAINTAINER="pascal.bellard@slitaz.org" |
pascal@1210 | 8 TARBALL="$PACKAGE-$VERSION.tar.gz" |
pascal@1210 | 9 WEB_SITE="http://cyrusimap.web.cmu.edu/" |
pascal@1210 | 10 WGET_URL="ftp://ftp.andrew.cmu.edu/pub/cyrus/$TARBALL" |
pascal@1210 | 11 BUILD_DEPENDS="libcomerr-dev cyrus-sasl cyrus-sasl-dev openssl-dev db-dev" |
pascal@1659 | 12 DEPENDS="libcomerr cyrus-sasl openssl db perl libwrap" |
pascal@1210 | 13 CONFIG_FILES="/etc/imapd.conf /etc/cyrus.conf" |
pascal@1210 | 14 |
pascal@1210 | 15 # Rules to configure and make the package. |
pascal@1210 | 16 compile_rules() |
pascal@1210 | 17 { |
pascal@1210 | 18 cd $src |
pascal@1553 | 19 while read arg file; do |
pascal@1553 | 20 [ -f done.$file ] && continue |
pascal@1553 | 21 echo "Apply $file..." |
pascal@1553 | 22 patch $arg < ../stuff/$file |
pascal@1553 | 23 touch done.$file |
pascal@1553 | 24 done << EOT |
pascal@1553 | 25 -p1 50-FTBFS-gcc-4.0-fix.dpatch |
pascal@1553 | 26 -p0 p1.patch |
pascal@1553 | 27 -p0 p2.patch |
pascal@1553 | 28 EOT |
pascal@1210 | 29 ./configure --prefix=/usr --infodir=/usr/share/info \ |
pascal@1553 | 30 --mandir=/usr/share/man $CONFIGURE_ARGS && |
pascal@1553 | 31 make && |
pascal@1210 | 32 make DESTDIR=$PWD/_pkg install |
pascal@1210 | 33 } |
pascal@1210 | 34 |
pascal@1210 | 35 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@1210 | 36 genpkg_rules() |
pascal@1210 | 37 { |
pascal@1210 | 38 mkdir -p $fs/usr/lib $fs/var/imap $fs/var/spool/imap/stage. |
pascal@1210 | 39 cp -a $_pkg/usr/bin $fs/usr |
pascal@1210 | 40 cp -a $_pkg/usr/cyrus $fs/usr |
pascal@1210 | 41 cp -a $_pkg/usr/lib/perl5 $fs/usr/lib |
pascal@1210 | 42 strip -s $fs/usr/cyrus/bin/* |
pascal@1210 | 43 cp $src/tools/mkimap $fs/usr/cyrus/bin |
pascal@1210 | 44 cp -a stuff/etc $fs |
pascal@1210 | 45 cp $src/master/conf/small.conf $fs/etc/cyrus.conf |
pascal@1210 | 46 for i in proc db socket log msg ptclient; do |
pascal@1210 | 47 mkdir -m 755 $fs/var/imap/$i |
pascal@1210 | 48 done |
pascal@1210 | 49 } |
pascal@1210 | 50 |
pascal@1210 | 51 # Pre and post install commands for Tazpkg. |
pascal@1210 | 52 post_install() |
pascal@1210 | 53 { |
pascal@1210 | 54 ( cd $1/ ; cpio -o -H newc | gzip -9 ) > \ |
pascal@1210 | 55 $1/$INSTALLED/$PACKAGE/volatile.cpio.gz <<EOT |
pascal@1210 | 56 etc/cyrus.conf |
pascal@1210 | 57 etc/imapd.conf |
pascal@1210 | 58 EOT |
pascal@1210 | 59 # adduser cyrus if needed |
pascal@1210 | 60 if ! grep -q cyrus $1/etc/passwd; then |
pascal@1210 | 61 echo -n "Adding user cyrus..." |
pascal@1210 | 62 chroot $1/ adduser cyrus -D -H -S -h /tmp |
pascal@1210 | 63 echo "cyrus:cyrus" | chpasswd > /dev/null |
pascal@1210 | 64 status |
pascal@1210 | 65 fi |
pascal@1210 | 66 # addgroup mail if needed |
pascal@1210 | 67 if ! grep -q mail $1/etc/group; then |
pascal@1210 | 68 echo -n "Adding group mail..." |
pascal@1210 | 69 chroot $1/ addgroup mail && addgroup cyrus mail |
pascal@1210 | 70 status |
pascal@1210 | 71 fi |
pascal@1210 | 72 chown -R cyrus.mail /var/spool/imap /var/imap |
pascal@1210 | 73 while read name port end; do |
pascal@1210 | 74 grep -q $port /etc/services || \ |
pascal@1210 | 75 echo "$name $port $end" >> /etc/services |
pascal@1210 | 76 done <<EOF |
pascal@1210 | 77 pop3 110/tcp pop-3 |
pascal@1210 | 78 nntp 119/tcp readnews untp |
pascal@1210 | 79 imap 143/tcp imap2 imap4 |
pascal@1210 | 80 imsp 406/tcp |
pascal@1210 | 81 nntps 563/tcp snntp |
pascal@1210 | 82 acap 674/tcp |
pascal@1210 | 83 imaps 993/tcp |
pascal@1210 | 84 pop3s 995/tcp |
pascal@1210 | 85 kpop 1109/tcp |
pascal@1210 | 86 sieve 2000/tcp |
pascal@1210 | 87 lmtp 2003/tcp |
pascal@1210 | 88 fud 4201/udp |
pascal@1210 | 89 EOF |
pascal@1659 | 90 [ -z "$1" ] && /etc/init.d/$PACKAGE start |
pascal@1659 | 91 if [ -z "$1" -a -f /etc/init.d/postfix ]; then |
pascal@1210 | 92 if ! grep -v ^# /etc/postfix/main.cf | grep -q lmtp:unix; then |
pascal@1210 | 93 echo "Append to /etc/postfix/main.cf:" |
pascal@1210 | 94 echo -n " " |
pascal@1210 | 95 echo "mailbox_transport = lmtp:unix:/var/imap/socket/lmtp" | \ |
pascal@1210 | 96 tee -a /etc/postfix/main.cf |
pascal@1210 | 97 /etc/init.d/postfix start || /etc/init.d/postfix reload |
pascal@1210 | 98 fi |
pascal@1210 | 99 fi |
pascal@1210 | 100 msg="Creating mailbox for" |
pascal@1659 | 101 [ -z "$1" ] && |
pascal@1210 | 102 for i in root $(awk -F: '{ if ($3 >= 1000) print $1 }' < /etc/passwd); do |
pascal@1210 | 103 echo -n "$msg $i" |
pascal@1210 | 104 msg="," |
pascal@1210 | 105 done |
pascal@1210 | 106 echo "" |
pascal@1659 | 107 [ -z "$1" ] && |
pascal@1210 | 108 for i in root $(awk -F: '{ if ($3 >= 1000) print $1 }' < /etc/passwd); do |
pascal@1210 | 109 echo "createmailbox user.$i" |
pascal@1210 | 110 done | cyradm -u cyrus -w cyrus 127.0.0.1 >/dev/null 2>&1 |
pascal@1210 | 111 su -c "/usr/cyrus/bin/reconstruct" cyrus >/dev/null 2>&1 |
pascal@1210 | 112 cat <<EOF |
pascal@1210 | 113 ---- |
pascal@1210 | 114 Users must have a password to access the mailbox. |
pascal@1210 | 115 To start $PACKAGE server you can run : |
pascal@1210 | 116 |
pascal@1210 | 117 /etc/init.d/$PACKAGE start |
pascal@1210 | 118 |
pascal@1210 | 119 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf |
pascal@1210 | 120 ---- |
pascal@1210 | 121 EOF |
pascal@1210 | 122 } |
pascal@1210 | 123 |
pascal@1210 | 124 post_remove() |
pascal@1210 | 125 { |
pascal@1210 | 126 deluser cyrus |
pascal@1210 | 127 delgroup mail |
pascal@1210 | 128 } |
pascal@1210 | 129 |
pascal@1210 | 130 repack_cleanup() |
pascal@1210 | 131 { |
pascal@1210 | 132 zcat $INSTALLED/$PACKAGE/volatile.cpio.gz | ( cd $1 ; cpio -id ) |
pascal@1210 | 133 } |