]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/postfix/postfix_2.0.20.bb
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / postfix / postfix_2.0.20.bb
1 SECTION = "console/network"
2 DEPENDS = "db3 pcre postfix-native"
3 LICENSE = "IPL"
4 PR = "r7"
5
6 SRC_URI = "ftp://ftp.porcupine.org/mirrors/postfix-release/official/postfix-${PV}.tar.gz \
7            file://${FILESDIR}/makedefs.patch;patch=1 \
8            file://${FILESDIR}/install.patch;patch=1 \
9            file://main.cf_2.0 \
10            file://volatiles \
11            file://postfix \
12            "
13
14 S = "${WORKDIR}/postfix-${PV}"
15
16 inherit update-rc.d
17
18 INITSCRIPT_NAME = "postfix"
19 INITSCRIPT_PARAMS = "start 58 3 4 5 . stop 13 0 1 6 ."
20
21 export SYSLIBS = "-lpcre -ldb -lnsl -lresolv ${LDFLAGS}"
22 export EXPORT = "AUXLIBS='-lpcre' CCARGS='-DHAS_PCRE ${CFLAGS}' OPT='' DEBUG='-g'"
23 export CC_append = " -DHAS_PCRE ${CFLAGS}"
24 export EXTRA_OEMAKE = "-e"
25 export POSTCONF = "${STAGING_BINDIR}/postconf"
26
27 do_compile () {
28         unset CFLAGS CPPFLAGS CXXFLAGS
29         oe_runmake makefiles
30         oe_runmake
31 }
32
33 do_install () {
34         sh ./postfix-install 'install_root=${D}' -non-interactive
35         rm -rf ${D}${localstatedir}/spool/postfix
36         mv ${D}${sysconfdir}/postfix/main.cf ${D}${sysconfdir}/postfix/sample-main.cf
37         install -d ${D}${localstatedir}/tmp
38         install -d ${D}${sysconfdir}/default/volatiles
39         install -d ${D}${sysconfdir}/init.d
40         install -m 755 ${WORKDIR}/main.cf_2.0 ${D}${localstatedir}/tmp/main_cf.sh
41         install -m 644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/01_postfix
42         install -m 755 ${WORKDIR}/postfix ${D}${sysconfdir}/init.d/postfix
43         mv ${D}${sbindir}/sendmail ${D}${sbindir}/sendmail.${PN}
44 }
45
46 pkg_postinst () {
47         grep postfix /etc/group || addgroup postfix
48         grep postdrop /etc/group || addgroup postdrop
49         grep vmail /etc/group || addgroup vmail
50         grep postfix /etc/passwd || adduser --disabled-password --home=/var/spool/postfix --ingroup postfix -g "Postfix" postfix
51         grep vmail /etc/passwd || adduser --disabled-password --home=/var/spool/vmail --ingroup vmail -g "Postfix" vmail
52         chgrp postdrop /usr/sbin/postqueue
53         chgrp postdrop /usr/sbin/postdrop
54         chmod g+s /usr/sbin/postqueue
55         chmod g+s /usr/sbin/postdrop
56         /var/tmp/main_cf.sh >/etc/postfix/main.cf
57         rm -f /var/tmp/main_cf.sh
58         chmod 644 /etc/postfix/main.cf
59         [ -d /var/spool/postfix ] && rmdir /var/spool/postfix
60         /etc/init.d/populate-volatile.sh
61         touch /etc/aliases
62         newaliases
63         update-alternatives --install sendmail sendmail ${sbindir}/sendmail.${PN} 40
64 }
65
66 pkg_postrm () {
67         update-alternatives --remove sendmail ${sbindir}/sendmail 
68 }