# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-mail/qpopper/qpopper-4.0.5-r3.ebuild,v 1.2 2005/06/05 18:04:06 langthang Exp $ inherit eutils flag-o-matic MY_P="${PN}${PV}" IUSE="debug gdbm mailbox pam ssl xinetd apop" S=${WORKDIR}/${MY_P} DESCRIPTION="A POP3 Server" SRC_URI="ftp://ftp.qualcomm.com/eudora/servers/unix/popper/${MY_P}.tar.gz ftp://ftp.qualcomm.com/eudora/servers/unix/popper/GUIDE.pdf" HOMEPAGE="http://www.eudora.com/products/unsupported/qpopper/index.html" DEPEND="virtual/mta xinetd? ( virtual/inetd ) gdbm? ( sys-libs/gdbm ) !gdbm? ( ~sys-libs/db-1.85 ) pam? ( >=sys-libs/pam-0.72 >=net-mail/mailbase-0.00-r8 ) ssl? ( dev-libs/openssl )" SLOT="0" LICENSE="qpopper" KEYWORDS="~amd64 sparc x86" pkg_setup() { enewuser pop } src_unpack() { unpack ${MY_P}.tar.gz cd ${S} } src_compile() { append-ldflags $(bindnow-flags) sed -i -e 's:-o popauth:& ${LDFLAGS}:' popper/Makefile.in econf \ $(use_enable !xinetd standalone) \ $(use_enable debug debugging) \ $(use_with ssl openssl) \ $(use_with gdbm) \ $(use_with pam pam pop3) \ $(use_enable apop apop /etc/pop.auth) \ $(use_enable mailbox home-dir-mail Mailbox) \ --enable-shy \ --enable-popuid=pop \ --enable-log-login \ --enable-specialauth \ --enable-log-facility=LOG_MAIL \ --enable-uw-kludge-flag \ || die "econf failed" if use ssl; then umask 077 PEM1=`/bin/mktemp ${T}/openssl.XXXXXX` PEM2=`/bin/mktemp ${T}/openssl.XXXXXX` /usr/bin/openssl req -newkey rsa:1024 -keyout $$PEM1 \ -nodes -x509 -days 365 -out $$PEM2 << EOF -- SomeState SomeCity SomeOrganization SomeOrganizationalUnit localhost.localdomain root@localhost.localdomain EOF cat $$PEM1 > cert.pem echo "" >> cert.pem cat $$PEM2 >> cert.pem rm $$PEM1 $$PEM2 umask 022 fi if ! use gdbm; then sed -i -e 's|#define HAVE_GDBM_H|//#define HAVE_GDBM_H|g' ${S}/config.h || \ die "sed failed" fi emake -j1 || die } src_install() { if use apop; then dosbin popper/popauth fowners pop:root /usr/sbin/popauth fperms 4110 /usr/sbin/popauth doman man/popauth.8 fi dosbin popper/popper doman man/popper.8 insinto /etc doins ${FILESDIR}/qpopper.conf if use ssl; then dodir /etc/mail/certs fowners root:mail /etc/mail/certs fperms 660 /etc/mail/certs mv cert.pem ${D}/etc/mail/certs fperms 600 /etc/mail/certs/cert.pem fowners root:0 /etc/mail/certs/cert.pem sed -i -e 's:^# set tls-server-cert-file:set tls-server-cert-file:' \ -e 's:^# set tls-support.*$:set tls-support = stls:' \ ${D}/etc/qpopper.conf fi dodoc ${S}/GUIDE.pdf docinto rfc dodoc doc/rfc*.txt if use xinetd; then insinto /etc/xinetd.d newins ${FILESDIR}/pop3.xinetd pop-3 else newinitd ${FILESDIR}/qpopper.init qpopper fi } pkg_postinst () { if use apop; then einfo "To authenticate the users with APOP " einfo "you have to follow these steps:" einfo "" einfo "1) initialize the authentication database:" einfo " # popauth -init" einfo "2) new users can be added by root:" einfo " # popauth -user " einfo " or removed:" einfo " # popauth -delete " einfo " Other users can add themeselves or change their" einfo " password with the command popauth" einfo "3) scripts or other non-interactive processes can add or change" einfo " the passwords with the following command:" einfo " # popauth -user " einfo "" fi }