# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ # Author Micha Glave EAPI=5 PYTHON_COMPAT=( python2_7 ) inherit eutils python-r1 user DESCRIPTION="spf policy server written in python for Postfix" HOMEPAGE="http://www.tummy.com/Community/software/tumgreyspf/" SRC_URI="https://github.com/linsomniac/tumgreyspf/releases/download/release-${PV}/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86 ~amd64" IUSE="" DEPEND="=dev-lang/python-2*" RDEPEND="${DEPEND} dev-python/pyspf >=mail-mta/postfix-2.1" # TODO # example for master.cf # make sure it works(!) src_unpack() { unpack ${A} cd ${S} # fix invalid path in sources sed -i \ -e "s!/usr/bin/env python!/usr/bin/env python2!g" \ -e "s!/usr/local/lib/tumgreyspf/spfquery!/usr/bin/spfquery.py!g" \ -e "s!/usr/lib/tumgreyspf/tumgreyspf!/usr/bin/tumgreyspf!g" \ -e "s!/usr/local/lib/tumgreyspf!/usr/bin!g" \ -e "s!/var/local/lib/tumgreyspf/config/!/etc/tumgreyspf/!g" \ -e "s!/var/local/lib/!/var/lib/!g" \ -e "s!tumgreyspf_user = 'nobody'!tumgreyspf_user = '${PN}'!" \ * || die "fixing pathnames failed" } src_install() { local MY_FILES local MY_FILE MY_FILES="TODO LICENSE README WHATSNEW README.performance README.QuickStart" for MY_FILE in $MY_FILES; do dodoc $MY_FILE done doman tumgreyspf.8 insinto /etc/${PN} doins tumgreyspf.conf newins __default__.dist __default__ MY_FILES="tumgreyspf tumgreyspf-clean tumgreyspf-configtest tumgreyspf-install tumgreyspf-stat tumgreyspfsupp.py" for MY_FILE in $MY_FILES; do dobin $MY_FILE done } pkg_preinst() { enewgroup ${PN} enewuser ${PN} -1 -1 /var/lib/${PN} ${PN} dodir /var/lib/${PN}/data dodir /var/lib/${PN}/data/blackhole fowners ${PN}:${PN} /var/lib/${PN}/data fperms 700 /var/lib/${PN}/data }