summaryrefslogtreecommitdiff
path: root/package/postfix
diff options
context:
space:
mode:
Diffstat (limited to 'package/postfix')
-rw-r--r--package/postfix/Makefile41
-rw-r--r--package/postfix/files/main.cf13
-rw-r--r--package/postfix/files/postfix.init36
-rw-r--r--package/postfix/files/postfix.postinst9
-rw-r--r--package/postfix/patches/patch-makedefs29
-rw-r--r--package/postfix/patches/patch-src_posttls-finger_posttls-finger_c10
-rw-r--r--package/postfix/patches/patch-src_util_sys_defs_h21
7 files changed, 159 insertions, 0 deletions
diff --git a/package/postfix/Makefile b/package/postfix/Makefile
new file mode 100644
index 000000000..d85399afd
--- /dev/null
+++ b/package/postfix/Makefile
@@ -0,0 +1,41 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(ADK_TOPDIR)/rules.mk
+
+PKG_NAME:= postfix
+PKG_VERSION:= 3.2.0
+PKG_RELEASE:= 1
+PKG_HASH:= 420726e79622620394fd17799e49268dada7041ea067ca3aa1c8bf155b9aa487
+PKG_DESCR:= popular mail transfer agent
+PKG_SECTION:= net/mail
+PKG_BUILDDEP:= tinycdb
+PKG_URL:= http://www.postfix.org/
+PKG_SITES:= http://de.postfix.org/ftpmirror/official/
+
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz
+
+# missing res_send support in resolver
+PKG_LIBC_DEPENDS:= glibc musl
+
+include $(ADK_TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,POSTFIX,postfix,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
+
+CONFIG_STYLE:= manual
+ALL_TARGET:=
+INSTALL_STYLE:= manual
+
+do-configure:
+ (cd $(WRKBUILD) && make -f Makefile.init makefiles "CCARGS=-DNO_PCRE -DNO_NIS -DNO_DB -DHAS_CDB -I$(STAGING_TARGET_DIR)/usr/include" "AUXLIBS=$(STAGING_TARGET_DIR)/usr/lib/libcdb.a")
+
+postfix-install:
+ $(INSTALL_DIR) $(IDIR_POSTFIX)/etc/postfix
+ $(CP) $(WRKBUILD)/conf/* $(IDIR_POSTFIX)/etc/postfix
+ $(CP) ./files/main.cf $(IDIR_POSTFIX)/etc/postfix
+ $(INSTALL_DIR) $(IDIR_POSTFIX)/usr/sbin
+ $(CP) $(WRKBUILD)/bin/* $(IDIR_POSTFIX)/usr/sbin
+ $(INSTALL_DIR) $(IDIR_POSTFIX)/usr/libexec/postfix
+ $(CP) $(WRKBUILD)/libexec/* $(IDIR_POSTFIX)/usr/libexec/postfix
+
+include ${ADK_TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/postfix/files/main.cf b/package/postfix/files/main.cf
new file mode 100644
index 000000000..c2640dc5d
--- /dev/null
+++ b/package/postfix/files/main.cf
@@ -0,0 +1,13 @@
+queue_directory = /var/spool/postfix
+command_directory = /usr/sbin
+daemon_directory = /usr/libexec/postfix
+data_directory = /var/lib/postfix
+mail_owner = postfix
+unknown_local_recipient_reject_code = 550
+debug_peer_level = 2
+debugger_command =
+ PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
+ ddd $daemon_directory/$process_name $process_id & sleep 5
+
+sendmail_path = /usr/sbin/sendmail
+setgid_group = postdrop
diff --git a/package/postfix/files/postfix.init b/package/postfix/files/postfix.init
new file mode 100644
index 000000000..e0067404a
--- /dev/null
+++ b/package/postfix/files/postfix.init
@@ -0,0 +1,36 @@
+#!/bin/sh
+#PKG postfix
+#INIT 80
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${postfix:-NO}" = x"NO" && exit 0
+ test x"$postfix" = x"DAEMON" && test -x /bin/mksh && exec mksh -T- $0 start
+ exec sh $0 start
+ ;;
+start)
+ [ -d /var/spool/postfix ] || mkdir -p /var/spool/postfix
+ [ -d /var/lib/postfix ] || mkdir -p /var/lib/postfix
+ chown postfix /var/lib/postfix
+ mount -o remount,rw /
+ chgrp postdrop /usr/sbin/postqueue
+ chgrp postdrop /usr/sbin/postdrop
+ chmod 2755 /usr/sbin/postqueue /usr/sbin/postdrop
+ mount -o remount,ro /
+ postfix start
+ ;;
+stop)
+ postfix stop
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/postfix/files/postfix.postinst b/package/postfix/files/postfix.postinst
new file mode 100644
index 000000000..2d9a719a3
--- /dev/null
+++ b/package/postfix/files/postfix.postinst
@@ -0,0 +1,9 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf postfix NO
+gid=$(get_next_gid)
+add_group postfix $gid
+add_user postfix $(get_next_uid) $gid /etc/postfix
+gid=$(get_next_gid)
+add_group postdrop $gid
+add_service smtp 25/tcp
diff --git a/package/postfix/patches/patch-makedefs b/package/postfix/patches/patch-makedefs
new file mode 100644
index 000000000..ec81d4c40
--- /dev/null
+++ b/package/postfix/patches/patch-makedefs
@@ -0,0 +1,29 @@
+--- postfix-3.1.0.orig/makedefs 2016-02-21 23:39:45.000000000 +0100
++++ postfix-3.1.0/makedefs 2016-03-24 08:18:54.455960613 +0100
+@@ -455,7 +455,7 @@ case "$SYSTEM.$RELEASE" in
+ SYSLIBS="-ldb"
+ ;;
+ esac
+- for name in nsl resolv $GDBM_LIBS
++ for name in resolv $GDBM_LIBS
+ do
+ for lib in /usr/lib64 /lib64 /usr/lib /lib
+ do
+@@ -534,7 +534,7 @@ EOF
+ SYSLIBS="-ldb"
+ ;;
+ esac
+- for name in nsl resolv
++ for name in resolv
+ do
+ for lib in /usr/lib64 /lib64 /usr/lib /usr/lib/* /lib /lib/*
+ do
+@@ -572,7 +572,7 @@ EOF
+ SYSLIBS="-ldb"
+ ;;
+ esac
+- for name in nsl resolv
++ for name in resolv
+ do
+ for lib in /usr/lib64 /lib64 /usr/lib /lib
+ do
diff --git a/package/postfix/patches/patch-src_posttls-finger_posttls-finger_c b/package/postfix/patches/patch-src_posttls-finger_posttls-finger_c
new file mode 100644
index 000000000..5eb622e9b
--- /dev/null
+++ b/package/postfix/patches/patch-src_posttls-finger_posttls-finger_c
@@ -0,0 +1,10 @@
+--- postfix-3.1.0.orig/src/posttls-finger/posttls-finger.c 2016-01-04 13:26:16.000000000 +0100
++++ postfix-3.1.0/src/posttls-finger/posttls-finger.c 2016-03-24 08:14:21.995964563 +0100
+@@ -307,6 +307,7 @@
+ */
+ #include <sys_defs.h>
+ #include <stdarg.h>
++#include <stdio.h>
+ #include <string.h>
+ #include <ctype.h>
+ #include <stdlib.h>
diff --git a/package/postfix/patches/patch-src_util_sys_defs_h b/package/postfix/patches/patch-src_util_sys_defs_h
new file mode 100644
index 000000000..874c4f1be
--- /dev/null
+++ b/package/postfix/patches/patch-src_util_sys_defs_h
@@ -0,0 +1,21 @@
+--- postfix-3.1.0.orig/src/util/sys_defs.h 2016-02-06 14:30:39.000000000 +0100
++++ postfix-3.1.0/src/util/sys_defs.h 2016-03-24 08:14:21.999964563 +0100
+@@ -47,7 +47,7 @@
+ #define HAS_FSYNC
+ #define HAS_DB
+ #define HAS_SA_LEN
+-#define NATIVE_DB_TYPE "hash"
++#define NATIVE_DB_TYPE "cdb"
+ #if (defined(__NetBSD_Version__) && __NetBSD_Version__ >= 104250000)
+ #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/mail/aliases" /* sendmail 8.10 */
+ #endif
+@@ -55,7 +55,8 @@
+ #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/mail/aliases" /* OpenBSD 2.7 */
+ #endif
+ #ifndef ALIAS_DB_MAP
+-#define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/aliases"
++#define DEF_DB_TYPE "cdb"
++#define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/postfix/aliases"
+ #endif
+ #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
+ #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin"