From 0ee7d23208f3cee6e35feae8b6fa092fc2bcb1b0 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Mon, 7 Aug 2006 09:03:48 +0000 Subject: [PATCH] Port procmail to -ng SVN-Revision: 4498 --- utils/procmail/Makefile | 45 +++++++++++++++++ utils/procmail/patches/promail_openwrt.patch | 51 ++++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 utils/procmail/Makefile create mode 100644 utils/procmail/patches/promail_openwrt.patch diff --git a/utils/procmail/Makefile b/utils/procmail/Makefile new file mode 100644 index 000000000..efe9ec67c --- /dev/null +++ b/utils/procmail/Makefile @@ -0,0 +1,45 @@ +# +# Copyright (C) 2006 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# $Id$ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=procmail +PKG_VERSION:=3.22 +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=http://www.procmail.org/ +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_MD5SUM:=1678ea99b973eb77eda4ecf6acae53f1 +PKG_CAT:=zcat + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/procmail + SECTION:=utils + CATEGORY:=Utilities + TITLE:=mail processing tool + DESCRIPTION:=Procmail is able to process and classify incoming mail into\\\ + different mail boxes.\\\ + Very useful in conjunction with mutt.\\\ + URL:=http://www.procmail.org +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR)/src -f ../Makefile.openwrt \ + CC=$(TARGET_CC) +endef + +define Package/procmail/install + mkdir -p $(1)/usr/bin + $(CP) $(PKG_BUILD_DIR)/src/procmail $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/src/formail $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,procmail)) diff --git a/utils/procmail/patches/promail_openwrt.patch b/utils/procmail/patches/promail_openwrt.patch new file mode 100644 index 000000000..c33d82605 --- /dev/null +++ b/utils/procmail/patches/promail_openwrt.patch @@ -0,0 +1,51 @@ +This patch is required to make procmail cross compile - it tries to run some automatic tests which +obviously do not work in a cross compiled environment. + + +diff -Naur procmail-3.22_orig/autoconf.h procmail-3.22/autoconf.h +--- procmail-3.22_orig/autoconf.h 1970-01-01 10:00:00.000000000 +1000 ++++ procmail-3.22/autoconf.h 2006-03-23 12:15:36.000000000 +1100 +@@ -0,0 +1,21 @@ ++/* This file was automagically generated by autoconf */ ++ ++/* 5 moves in 64 steps of size 16384 when reallocing */ ++#define NOpw_class ++#define NOstrlcat ++#define NOsetrgid ++#define MAX_argc 7588 ++/* Your system's strstr() is 1.12 times FASTER than my C-routine */ ++#define UDP_protocolno 17 ++#define BIFF_serviceport "512" ++#define IP_localhost {127,0,0,1} ++#define MAILSPOOLDIR "/var/spool/mail/" ++#define SENDMAIL "/usr/sbin/sendmail" ++#define CF_no_procmail_yet ++#define buggy_SENDMAIL ++#define defPATH "PATH=$HOME/bin:/bin:/usr/bin:/usr/local/bin:/usr/bin/X11" ++#define defSPATH "PATH=/bin:/usr/bin:/usr/local/bin:/usr/bin/X11" ++#define PM_VERSION "3.22" ++/* Hotwire LOCKINGTEST=100 */ ++/* Procmail will lock via: dotlocking, fcntl() */ ++/* autoconf completed */ +diff -Naur procmail-3.22_orig/Makefile.openwrt procmail-3.22/Makefile.openwrt +--- procmail-3.22_orig/Makefile.openwrt 1970-01-01 10:00:00.000000000 +1000 ++++ procmail-3.22/Makefile.openwrt 2006-03-23 12:15:36.000000000 +1100 +@@ -0,0 +1,18 @@ ++PM_OBJ=cstdio.o common.o exopen.o goodies.o locking.o \ ++ mailfold.o foldinfo.o misc.o pipes.o regexp.o robust.o \ ++ sublib.o acommon.o mcommon.o lastdirsep.o authenticate.o \ ++ lmtp.o memblk.o variables.o from.o comsat.o ++ ++FM_OBJ=common.o fields.o formisc.o sublib.o ecommon.o \ ++ acommon.o ++ ++LDFLAGS = -lm -lnsl -ldl -lc ++CFLAGS = -Os -DPROCMAIL ++ ++all: procmail formail ++ ++procmail: procmail.o $(PM_OBJ) ++ $(CC) $(CFLAGS) $@.o $(PM_OBJ) -o $@ $(LDFLAGS) ++ ++formail: formail.o $(FM_OBJ) ++ $(CC) $(CFLAGS) $@.o $(FM_OBJ) -o $@ $(LDFLAGS) -- 2.30.2