| 1 | # Description: Postfix Mail Transport Agent (MTA) |
| 2 | # URL: http://www.postfix.org |
| 3 | # Packager: Victor, victord at users dot berlios dot de |
| 4 | # Maintainer: Thomas Penteker, tek at serverop dot de |
| 5 | # Arch Maintainer: CRUX-ARM System Team, devel at crux-arm dot nu |
| 6 | # Depends on: cyrus-sasl openssl db |
| 7 | |
| 8 | name=postfix |
| 9 | version=2.5.10 |
| 10 | release=1 |
| 11 | source=(ftp://ftp.porcupine.org/mirrors/postfix-release/official/$name-$version.tar.gz |
| 12 | aliases postfix.rc postfix.patch) |
| 13 | |
| 14 | build() { |
| 15 | cd $name-$version |
| 16 | |
| 17 | patch -p1 < $SRC/postfix.patch |
| 18 | |
| 19 | # build native tools |
| 20 | export SAVED_CC="$CC" SAVED_CXX="$CXX" |
| 21 | export SAVED_CFLAGS="$CFLAGS" SAVED_CXXFLAGS="$CXXFLAGS" |
| 22 | unset CC CXX CFLAGS CXXFLAGS |
| 23 | |
| 24 | make DEBUG="" OPT="" |
| 25 | install -D -m 0755 bin/postconf aux/postconf-host |
| 26 | |
| 27 | # now crossbuild |
| 28 | make clean |
| 29 | |
| 30 | export CC="$SAVED_CC" CXX="$SAVED_CXX" |
| 31 | export CFLAGS="$SAVED_CFLAGS" CXXFLAGS="$SAVED_CXXFLAGS" |
| 32 | |
| 33 | _CCARGS="$CCARGS -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I$CLFS/usr/include/sasl -DUSE_TLS -I$CLFS/usr/include/openssl" |
| 34 | _AUXLIBS="-L$CLFS/usr/lib -lsasl2 -lssl -lcrypto" |
| 35 | |
| 36 | make tidy |
| 37 | make makefiles DEBUG="" OPT="$CFLAGS" CCARGS="$_CCARGS" AUXLIBS="$_AUXLIBS" |
| 38 | make DEBUG="" OPT="$CFLAGS" CCARGS="$_CCARGS" AUXLIBS="$_AUXLIBS" AR="$AR" RANLIB="$RANLIB" |
| 39 | |
| 40 | sed -i postfix-install \ |
| 41 | -e 's|bin/postconf|aux/postconf-host|' |
| 42 | |
| 43 | make non-interactive-package \ |
| 44 | install_root=$PKG \ |
| 45 | mail_owner=mail \ |
| 46 | setgid_group=postdrop \ |
| 47 | config_directory=/etc/postfix \ |
| 48 | manpage_directory=/usr/man \ |
| 49 | daemon_directory=/usr/lib/postfix \ |
| 50 | data_directory=/var/lib/postfix \ |
| 51 | command_directory=/usr/sbin \ |
| 52 | queue_directory=/var/spool/postfix \ |
| 53 | sendmail_path=/usr/sbin/sendmail \ |
| 54 | newaliases_path=/usr/bin/newaliases \ |
| 55 | mailq_path=/usr/bin/mailq |
| 56 | |
| 57 | # |
| 58 | # Set proper permissions |
| 59 | # |
| 60 | ( cd $PKG/var/spool/postfix |
| 61 | chown mail * |
| 62 | chgrp postdrop public maildrop ) |
| 63 | |
| 64 | ( cd $PKG/usr/sbin |
| 65 | chgrp postdrop postqueue postdrop |
| 66 | chmod g+s postqueue postdrop ) |
| 67 | |
| 68 | ( cd $PKG/var/lib |
| 69 | chown mail postfix ) |
| 70 | |
| 71 | # |
| 72 | # Add .gz extensions to manpages (pkgmk compresses them) |
| 73 | # Remove LICENSE (will be removed) |
| 74 | # |
| 75 | ( cd $PKG/etc/postfix |
| 76 | cp postfix-files temp-files |
| 77 | grep -v LICENSE temp-files | sed 's#\(/man[0-9]/[a-zA-Z0-9_-]\+\.[0-9]\):#\1\.gz:#' > postfix-files |
| 78 | rm -f temp-files LICENSE ) |
| 79 | |
| 80 | install -D -m 00644 ../aliases $PKG/etc/postfix/aliases |
| 81 | install -D -m 00755 ../postfix.rc $PKG/etc/rc.d/postfix |
| 82 | |
| 83 | touch $PKG/etc/postfix/{aliases,access,canonical,relocated,transport,virtual}.db |
| 84 | touch $PKG/etc/postfix/{relay_domains,body_checks,mime_header_checks} |
| 85 | } |