wok diff cyrus-imapd/receipt @ rev 1461

knock lxml lxtask: update BUILD_DEPENDS
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Oct 03 21:10:30 2008 +0000 (2008-10-03)
parents
children 65d3dfc87776
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/cyrus-imapd/receipt	Fri Oct 03 21:10:30 2008 +0000
     1.3 @@ -0,0 +1,124 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="cyrus-imapd"
     1.7 +VERSION="2.2.12"
     1.8 +CATEGORY="network"
     1.9 +SHORT_DESC="IMAP server."
    1.10 +MAINTAINER="pascal.bellard@slitaz.org"
    1.11 +TARBALL="$PACKAGE-$VERSION.tar.gz"
    1.12 +WEB_SITE="http://cyrusimap.web.cmu.edu/"
    1.13 +WGET_URL="ftp://ftp.andrew.cmu.edu/pub/cyrus/$TARBALL"
    1.14 +BUILD_DEPENDS="libcomerr-dev cyrus-sasl cyrus-sasl-dev openssl-dev db-dev"
    1.15 +DEPENDS="libcomerr cyrus-sasl openssl db postfix perl"
    1.16 +CONFIG_FILES="/etc/imapd.conf /etc/cyrus.conf"
    1.17 +
    1.18 +# Rules to configure and make the package.
    1.19 +compile_rules()
    1.20 +{
    1.21 +	cd $src
    1.22 +	patch -p1 < ../stuff/50-FTBFS-gcc-4.0-fix.dpatch
    1.23 +	patch -p0 < ../stuff/p1.patch
    1.24 +	patch -p0 < ../stuff/p2.patch
    1.25 +	./configure --prefix=/usr --infodir=/usr/share/info \
    1.26 +	--mandir=/usr/share/man $CONFIGURE_ARGS
    1.27 +	make
    1.28 +	make DESTDIR=$PWD/_pkg install
    1.29 +}
    1.30 +
    1.31 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.32 +genpkg_rules()
    1.33 +{
    1.34 +	mkdir -p $fs/usr/lib $fs/var/imap $fs/var/spool/imap/stage.
    1.35 +	cp -a $_pkg/usr/bin $fs/usr
    1.36 +	cp -a $_pkg/usr/cyrus $fs/usr
    1.37 +	cp -a $_pkg/usr/lib/perl5 $fs/usr/lib
    1.38 +	strip -s $fs/usr/cyrus/bin/*
    1.39 +	cp $src/tools/mkimap $fs/usr/cyrus/bin
    1.40 +	cp -a stuff/etc $fs
    1.41 +	cp $src/master/conf/small.conf $fs/etc/cyrus.conf
    1.42 +	for i in proc db socket log msg ptclient; do
    1.43 +		mkdir -m 755 $fs/var/imap/$i
    1.44 +	done
    1.45 +}
    1.46 +
    1.47 +# Pre and post install commands for Tazpkg.
    1.48 +post_install()
    1.49 +{
    1.50 +	( cd $1/ ; cpio -o -H newc | gzip -9 ) > \
    1.51 +		$1/$INSTALLED/$PACKAGE/volatile.cpio.gz <<EOT
    1.52 +etc/cyrus.conf
    1.53 +etc/imapd.conf
    1.54 +EOT
    1.55 +        # adduser cyrus if needed
    1.56 +	if ! grep -q cyrus $1/etc/passwd; then
    1.57 +		echo -n "Adding user cyrus..."
    1.58 +		chroot $1/ adduser cyrus -D -H -S -h /tmp
    1.59 +		echo "cyrus:cyrus" | chpasswd > /dev/null
    1.60 +		status
    1.61 +	fi
    1.62 +	# addgroup mail if needed
    1.63 +	if ! grep -q mail $1/etc/group; then
    1.64 +		echo -n "Adding group mail..."
    1.65 +		chroot $1/ addgroup mail && addgroup cyrus mail
    1.66 +		status
    1.67 +	fi
    1.68 +	chown -R cyrus.mail /var/spool/imap /var/imap
    1.69 +	while read name port end; do
    1.70 +		grep -q $port /etc/services || \
    1.71 +			echo "$name		$port	$end" >> /etc/services
    1.72 +	done <<EOF
    1.73 +pop3 110/tcp pop-3
    1.74 +nntp 119/tcp readnews untp
    1.75 +imap 143/tcp imap2 imap4
    1.76 +imsp 406/tcp 
    1.77 +nntps 563/tcp snntp
    1.78 +acap 674/tcp
    1.79 +imaps 993/tcp
    1.80 +pop3s 995/tcp
    1.81 +kpop 1109/tcp
    1.82 +sieve 2000/tcp
    1.83 +lmtp 2003/tcp
    1.84 +fud 4201/udp
    1.85 +EOF
    1.86 +	/etc/init.d/$PACKAGE start
    1.87 +	if [ -f /etc/init.d/postfix ]; then
    1.88 +		if ! grep -v ^# /etc/postfix/main.cf | grep -q lmtp:unix; then
    1.89 +			echo "Append to /etc/postfix/main.cf:"
    1.90 +			echo -n "    "
    1.91 +			echo "mailbox_transport = lmtp:unix:/var/imap/socket/lmtp" | \
    1.92 +				tee -a /etc/postfix/main.cf
    1.93 +			/etc/init.d/postfix start || /etc/init.d/postfix reload
    1.94 +		fi
    1.95 +	fi
    1.96 +	msg="Creating mailbox for"
    1.97 +	for i in root $(awk -F: '{ if ($3 >= 1000) print $1 }' < /etc/passwd); do
    1.98 +		echo -n "$msg $i"
    1.99 +		msg=","
   1.100 +	done
   1.101 +	echo ""
   1.102 +	for i in root $(awk -F: '{ if ($3 >= 1000) print $1 }' < /etc/passwd); do
   1.103 +		echo "createmailbox user.$i"
   1.104 +	done | cyradm -u cyrus -w cyrus 127.0.0.1 >/dev/null 2>&1
   1.105 +	su -c "/usr/cyrus/bin/reconstruct" cyrus >/dev/null 2>&1
   1.106 +	cat <<EOF
   1.107 +----
   1.108 +Users must have a password to access the mailbox.
   1.109 +To start $PACKAGE server you can run :
   1.110 +
   1.111 +    /etc/init.d/$PACKAGE start
   1.112 +
   1.113 +Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
   1.114 +----
   1.115 +EOF
   1.116 +}
   1.117 +
   1.118 +post_remove()
   1.119 +{
   1.120 +	deluser cyrus
   1.121 +	delgroup mail
   1.122 +}
   1.123 +
   1.124 +repack_cleanup()
   1.125 +{
   1.126 +        zcat $INSTALLED/$PACKAGE/volatile.cpio.gz | ( cd $1 ; cpio -id )
   1.127 +}