summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEray Aslan <eras@gentoo.org>2013-01-04 11:46:38 +0000
committerEray Aslan <eras@gentoo.org>2013-01-04 11:46:38 +0000
commitce97cfd34d06b31bbbfa992ddf840c2b3e04cc70 (patch)
tree292b44f25d533d878fd9946f662d28968e692dbc /mail-filter/sid-milter
parentclean up (diff)
downloadgentoo-2-ce97cfd34d06b31bbbfa992ddf840c2b3e04cc70.tar.gz
gentoo-2-ce97cfd34d06b31bbbfa992ddf840c2b3e04cc70.tar.bz2
gentoo-2-ce97cfd34d06b31bbbfa992ddf840c2b3e04cc70.zip
EAPI bump. Create socket dir if necessary - bug #449664
(Portage version: 2.2.0_alpha149/cvs/Linux x86_64, signed Manifest commit with key 0x77F1F175586A3B1F)
Diffstat (limited to 'mail-filter/sid-milter')
-rw-r--r--mail-filter/sid-milter/ChangeLog11
-rwxr-xr-xmail-filter/sid-milter/files/sid-filter.init-r189
-rw-r--r--mail-filter/sid-milter/sid-milter-1.0.0-r6.ebuild65
3 files changed, 162 insertions, 3 deletions
diff --git a/mail-filter/sid-milter/ChangeLog b/mail-filter/sid-milter/ChangeLog
index 2357c9f4fe03..622d961fa2dc 100644
--- a/mail-filter/sid-milter/ChangeLog
+++ b/mail-filter/sid-milter/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for mail-filter/sid-milter
-# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/mail-filter/sid-milter/ChangeLog,v 1.18 2012/06/05 00:05:52 zmedico Exp $
+# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/sid-milter/ChangeLog,v 1.19 2013/01/04 11:46:38 eras Exp $
+
+*sid-milter-1.0.0-r6 (04 Jan 2013)
+
+ 04 Jan 2013; Eray Aslan <eras@gentoo.org> +files/sid-filter.init-r1,
+ +sid-milter-1.0.0-r6.ebuild:
+ EAPI bump. Create socket dir if necessary - bug #449664
05 Jun 2012; Zac Medico <zmedico@gentoo.org> sid-milter-1.0.0-r5.ebuild:
inherit user for enewgroup and enewuser
@@ -83,4 +89,3 @@
+files/sid-filter.init, +files/site.config.m4, +metadata.xml,
+sid-milter-0.2.13.ebuild:
Initial import
-
diff --git a/mail-filter/sid-milter/files/sid-filter.init-r1 b/mail-filter/sid-milter/files/sid-filter.init-r1
new file mode 100755
index 000000000000..2891878be35c
--- /dev/null
+++ b/mail-filter/sid-milter/files/sid-filter.init-r1
@@ -0,0 +1,89 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/sid-milter/files/sid-filter.init-r1,v 1.1 2013/01/04 11:46:38 eras Exp $
+
+depend() {
+ # need net
+ use dns logger net
+}
+
+parse_opts() {
+ local filter_opt filter_flag=
+ for filter_opt in ${SID_FILTER_OPTS}; do
+ case "${filter_flag}" in
+ -u) filter_user=${filter_opt}
+ ;;
+ -P) filter_pid=${filter_opt}
+ ;;
+ esac
+ [ -n "${filter_user}" -a -n "${filter_pid}" ] && break
+ filter_flag=${filter_opt}
+ done
+
+ if [ -z "${filter_user}" ]; then
+ filter_user=milter
+ SID_FILTER_OPTS="${SID_FILTER_OPTS} -u ${filter_user}"
+ fi
+ if [ -z "${filter_pid}" ]; then
+ filter_pid="/var/run/sid-filter.pid"
+ SID_FILTER_OPTS="${SID_FILTER_OPTS} -P ${filter_pid}"
+ fi
+}
+
+clean_socket() {
+ local socket_file= svc_pid=
+
+ socket_file="$(echo ${SID_FILTER_OPTS} | sed -e 's/.*local:\(.*\) .*/\1/' | awk '{print $1}')"
+ svc_pid="$(ps -C sid-filter -o pid=)"
+ if [[ -z "${svc_pid}" ]] && [[ ! -z "${socket_file}" ]] && [[ -S "${socket_file}" ]]; then
+ ewarn "Strange, the socket file already exist in \"${socket_file}\""
+ ewarn "it will be removed now and re-created by the sid-filter server"
+ ewarn "BUT please make your checks."
+ rm -f "${socket_file}"
+ fi
+}
+
+check_socketdir() {
+ local socket_dir
+ case "${SOCKETSPEC}" in
+ local:*) socket_dir="$(echo ${SOCKETSPEC} | sed -e 's~^local:\(.*\)/.*$~\1~')"
+ if [[ ! -d ${socket_dir} ]]; then
+ checkpath -q -d -o ${filter_user}:${filter_user} -m 0755 ${socket_dir} || return 1
+ fi ;;
+ inet:*) ;;
+ *) eerror "Unknown socket spec. Please check your /etc/conf.d/sid-milter file."
+ return 1 ;;
+ esac
+}
+
+
+start() {
+ local filter_user= filter_pid=
+
+ clean_socket
+ parse_opts
+ check_socketdir || return 1
+ if ! (touch ${filter_pid} && chown ${filter_user} ${filter_pid}) ; then
+ eerror "Failed to create pidfile"
+ return 1
+ fi
+
+ ebegin "Starting Sender-ID Filter"
+ start-stop-daemon --start --exec /usr/bin/sid-filter -- ${SID_FILTER_OPTS}
+ eend $?
+}
+
+stop() {
+ local filter_user= filter_pid=
+
+ parse_opts
+
+ ebegin "Stopping Sender-ID Filter"
+ start-stop-daemon --stop --quiet --name sid-filter --pidfile ${filter_pid}
+ eend $?
+
+ if [ $? = 0 -a -f "${filter_pid}" ]; then
+ rm ${filter_pid}
+ fi
+}
diff --git a/mail-filter/sid-milter/sid-milter-1.0.0-r6.ebuild b/mail-filter/sid-milter/sid-milter-1.0.0-r6.ebuild
new file mode 100644
index 000000000000..dc197cf550c6
--- /dev/null
+++ b/mail-filter/sid-milter/sid-milter-1.0.0-r6.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/sid-milter/sid-milter-1.0.0-r6.ebuild,v 1.1 2013/01/04 11:46:38 eras Exp $
+
+EAPI=4
+
+inherit eutils toolchain-funcs user
+
+DESCRIPTION="A milter-based application to provide Sender-ID verification service"
+HOMEPAGE="http://sourceforge.net/projects/sid-milter/"
+SRC_URI="mirror://sourceforge/sid-milter/${P}.tar.gz"
+
+LICENSE="Sendmail-Open-Source"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="ipv6"
+
+DEPEND="dev-libs/openssl
+ >=sys-libs/db-3.2
+ || ( mail-filter/libmilter mail-mta/sendmail )"
+RDEPEND="${DEPEND}
+ sys-apps/openrc"
+
+pkg_setup() {
+ enewgroup milter
+ # mail-milter/spamass-milter creates milter user with this home directory
+ # For consistency reasons, milter user must be created here with this home directory
+ # even though this package doesn't need a home directory for this user (#280571)
+ enewuser milter -1 -1 /var/lib/milter milter
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-nopra_on_spf1.patch
+ epatch "${FILESDIR}"/${P}-as-needed.patch
+
+ local CC="$(tc-getCC)"
+ local ENVDEF=""
+ use ipv6 && ENVDEF="${ENVDEF} -DNETINET6"
+ sed -e "s:@@CC@@:${CC}:" \
+ -e "s:@@CFLAGS@@:${CFLAGS}:" \
+ -e "s:@@LDFLAGS@@:${LDFLAGS}:" \
+ -e "s:@@ENVDEF@@:${ENVDEF}:" \
+ "${FILESDIR}/gentoo-config.m4" > "${S}/devtools/Site/site.config.m4" \
+ || die "failed to generate site.config.m4"
+}
+
+src_compile() {
+ emake -j1
+}
+
+src_install() {
+ dodir /usr/bin
+ emake -j1 DESTDIR="${D}" SUBDIRS=sid-filter \
+ SBINOWN=root SBINGRP=root UBINOWN=root UBINGRP=root \
+ install
+
+ newinitd "${FILESDIR}/sid-filter.init-r1" sid-filter
+ newconfd "${FILESDIR}/sid-filter.conf" sid-filter
+
+ # man build is broken; do man page installation by hand
+ doman */*.8
+
+ # some people like docs
+ dodoc RELEASE_NOTES *.txt sid-filter/README
+}