summaryrefslogtreecommitdiff
path: root/recipes/postfix/postfix.inc
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/postfix/postfix.inc
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/postfix/postfix.inc')
-rw-r--r--recipes/postfix/postfix.inc81
1 files changed, 81 insertions, 0 deletions
diff --git a/recipes/postfix/postfix.inc b/recipes/postfix/postfix.inc
new file mode 100644
index 0000000000..0371f62957
--- /dev/null
+++ b/recipes/postfix/postfix.inc
@@ -0,0 +1,81 @@
+SECTION = "console/network"
+DEPENDS = "virtual/db libpcre postfix-native"
+LICENSE = "IPL"
+
+SRC_URI = "ftp://ftp.porcupine.org/mirrors/postfix-release/official/postfix-${PV}.tar.gz \
+ file://${FILESDIR}/makedefs.patch;patch=1 \
+ file://${FILESDIR}/install.patch;patch=1 \
+ file://main.cf_2.0 \
+ file://volatiles \
+ file://postfix \
+ file://internal_recipient \
+ "
+
+S = "${WORKDIR}/postfix-${PV}"
+
+inherit update-rc.d
+
+INITSCRIPT_NAME = "postfix"
+INITSCRIPT_PARAMS = "start 58 3 4 5 . stop 13 0 1 6 ."
+
+#FIXME: this is broken because the native build won't work on systems where
+# native bdb does not require libpthread. ARM doesn't require libpthread
+# because it uses an assembler mutex implementation.
+LIBBDB_EXTRA = "-lpthread"
+LIBBDB_EXTRA_arm = ""
+LIBBDB_EXTRA_armeb = ""
+
+export SYSLIBS = "-lpcre -ldb ${LIBBDB_EXTRA} -lnsl -lresolv ${LDFLAGS}"
+export EXPORT = "AUXLIBS='-lpcre' CCARGS='-DHAS_PCRE ${CFLAGS}' OPT='' DEBUG='-g'"
+export CC_append = " -DHAS_PCRE ${CFLAGS}"
+export EXTRA_OEMAKE = "-e"
+export POSTCONF = "${STAGING_BINDIR_NATIVE}/postconf"
+
+do_compile () {
+ unset CFLAGS CPPFLAGS CXXFLAGS
+ oe_runmake makefiles
+ oe_runmake
+}
+
+do_install () {
+ sh ./postfix-install 'install_root=${D}' -non-interactive
+ rm -rf ${D}${localstatedir}/spool/postfix
+ mv ${D}${sysconfdir}/postfix/main.cf ${D}${sysconfdir}/postfix/sample-main.cf
+ install -d ${D}${localstatedir}/tmp
+ install -d ${D}${sysconfdir}/default/volatiles
+ install -d ${D}${sysconfdir}/init.d
+ install -m 755 ${WORKDIR}/main.cf_2.0 ${D}${localstatedir}/tmp/main_cf.sh
+ install -m 644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/01_postfix
+ install -m 755 ${WORKDIR}/postfix ${D}${sysconfdir}/init.d/postfix
+ install -m 644 ${WORKDIR}/internal_recipient ${D}${sysconfdir}/postfix/internal_recipient
+ mv ${D}${sbindir}/sendmail ${D}${sbindir}/sendmail.${PN}
+}
+
+pkg_postinst () {
+ update-alternatives --install ${sbindir}/sendmail sendmail sendmail.${PN} 40
+ grep postfix /etc/group || addgroup postfix
+ grep postdrop /etc/group || addgroup postdrop
+ grep vmail /etc/group || addgroup vmail
+ grep postfix /etc/passwd || adduser --disabled-password --home=/var/spool/postfix --ingroup postfix -g "Postfix" postfix
+ grep vmail /etc/passwd || adduser --disabled-password --home=/var/spool/vmail --ingroup vmail -g "Postfix" vmail
+ chgrp postdrop /usr/sbin/postqueue
+ chgrp postdrop /usr/sbin/postdrop
+ chmod g+s /usr/sbin/postqueue
+ chmod g+s /usr/sbin/postdrop
+ /var/tmp/main_cf.sh >/etc/postfix/main.cf
+ rm -f /var/tmp/main_cf.sh
+ chmod 644 /etc/postfix/main.cf
+ [ -d /var/spool/postfix ] && rmdir /var/spool/postfix
+ /etc/init.d/populate-volatile.sh update
+ touch /etc/aliases
+ newaliases
+}
+
+pkg_postrm () {
+ update-alternatives --remove sendmail sendmail.${PN}
+}
+
+# Exclude .debug directories from the main package
+FILES_${PN} = "${sysconfdir} ${localstatedir} ${bindir}/* ${sbindir}/* \
+ ${libexecdir}/postfix/*"
+FILES_${PN}-dbg += "${libexecdir}/postfix/.debug"