public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [RFC] qmail.eclass draft
@ 2007-07-13 11:37 Benedikt Boehm
  2007-07-13 12:34 ` Michael Hanselmann
  2007-07-20  9:52 ` Michael Hanselmann
  0 siblings, 2 replies; 27+ messages in thread
From: Benedikt Boehm @ 2007-07-13 11:37 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 607 bytes --]

Hi all,

due to massive code duplication in netqmail, qmail-ldap, qmail-mysql,
mini-qmail and other 3-rd party applications for qmail i have started
to move functionality into a first qmail.eclass draft.

It is basically netqmail split into much smaller chunks so they can be
reused by other qmail variants as well. Additionally configuration
files supplied by gentoo have been moved from $FILESDIR to a seperate
tarball. [1]

Attached is the eclass and a sample how to use it with netqmail.

Comments and suggestions are more than welcome!

Bene

[1] http://dev.gentoo.org/~hollow/genqmail-20070713.tar.bz2

[-- Attachment #2: prime.eclass --]
[-- Type: application/octet-stream, Size: 982 bytes --]

# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

# Original Author: Michael Hanselmann <hansmi@gentoo.org>
# Purpose: Functions for prime numbers

# Prints a list of primes between min and max inclusive
#
# Note: this functions gets very slow when used with large numbers.
#
# Syntax: primes <min> <max>
primes() {
	local min=${1} max=${2}
	local result= primelist=2 i p

	[[ ${min} -le 2 ]] && result="${result} 2"

	for ((i = 3; i <= max; i += 2))
	do
		for p in ${primelist}
		do
			[[ $[i % p] == 0 || $[p * p] -gt ${i} ]] && \
				break
		done
		if [[ $[i % p] != 0 ]]
		then
			primelist="${primelist} ${i}"
			[[ ${i} -ge ${min} ]] && \
				result="${result} ${i}"
		fi
	done

	echo ${result}
}

# Checks wether a number is a prime number
#
# Syntax: is_prime <number>
is_prime() {
	local number=${1} i
	for i in $(primes ${number} ${number})
	do
		[[ ${i} == ${number} ]] && return 0
	done
	return 1
}

[-- Attachment #3: qmail.eclass --]
[-- Type: application/octet-stream, Size: 14361 bytes --]

# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.285 2007/07/07 17:30:45 vapier Exp $

# @ECLASS: qmail.eclass
# @MAINTAINER: qmail@gentoo.org
# @BLURB: some common and ugly qmail functions

inherit flag-o-matic prime toolchain-funcs
DESCRIPTION="Based on the ${ECLASS} eclass"

# env vars
GENQMAIL_F=genqmail-${GENQMAIL_PV}.tar.bz2
GENQMAIL_S="${WORKDIR}"/genqmail-${GENQMAIL_PV}

QMAIL_F=qmail-${QMAIL_PV}.tar.gz
QMAIL_S="${WORKDIR}"/qmail-${QMAIL_PV}

NETQMAIL_F=netqmail-${NETQMAIL_PV}.tar.gz
NETQMAIL_S="${WORKDIR}"/netqmail-${NETQMAIL_PV}/netqmail-${NETQMAIL_PV}

QMAIL_SPP_F=qmail-spp-${QMAIL_SPP_PV}.tar.gz
QMAIL_SPP_S="${WORKDIR}"/qmail-spp-${QMAIL_SPP_PV}

QMAIL_TLS_F=netqmail-${NETQMAIL_PV}-tls-smtpauth-${QMAIL_TLS_PV}.patch
QMAIL_BIGTODO_F=big-todo.${QMAIL_BIGTODO_PV}.patch

# TODO: ucscpi.eclass?
TCPRULES_DIR=/etc/tcprules.d

# @FUNCTION: qmail_mini
# @DESCRIPTION:
# Check if the current ebuild is mini-qmail
qmail_mini() {
	test "${PN}" == "mini-qmail"
}

# common sources and patches
SRC_URI="${SRC_URI} mirror://gentoo/${GENQMAIL_F}"

if [[ -n ${NETQMAIL_PV} ]]; then
	SRC_URI="${SRC_URI} mirror://qmail/${NETQMAIL_F}"
fi

if [[ -n ${QMAIL_PV} ]]; then
	SRC_URI="${SRC_URI} mirror://qmail/${QMAIL_F}"
fi

if [[ -n ${QMAIL_SPP_PV} ]]; then
	SRC_URI="${SRC_URI}
		!vanilla? (
			qmail-spp? (
				mirror://sourceforge/qmail-spp/${QMAIL_SPP_F}
			)
		)"
fi

if [[ ${QMAIL_TLS_PV:-0} -ne 0 ]]; then
	SRC_URI="${SRC_URI}
		!vanilla? (
			ssl? (
				http://shupp.org/patches/${QMAIL_TLS_F}
			)
		)"
fi

if [[ ${QMAIL_BIGTODO_PV:-0} -ne 0 ]]; then
	SRC_URI="${SRC_URI}
		!vanilla? (
			highvolume? (
				mirror://qmail/${QMAIL_BIGTODO_F}
			)
		)"
fi

# use flags
IUSE="${IUSE} mailwrapper"

if ! qmail_mini; then
	IUSE="${IUSE} gencertdaily vanilla"

	if [[ -n ${QMAIL_SPP_PV} ]]; then
		IUSE="${IUSE} qmail-spp"
	fi

	if [[ -n ${QMAIL_TLS_PV} ]]; then
		IUSE="${IUSE} ssl"
	fi

	if [[ -n ${QMAIL_BIGTODO_PV} ]]; then
		IUSE="${IUSE} highvolume"
	fi
fi

# depend atoms
if ! qmail_mini; then
	DEPEND="${DEPEND} net-mail/queue-repair"

	if [[ -n ${QMAIL_TLS_PV} ]]; then
		DEPEND="${DEPEND} ssl? ( dev-libs/openssl )"
	fi

	RDEPEND="${DEPEND}
		sys-apps/ucspi-tcp
		sys-process/daemontools
		net-mail/dot-forward"
fi

RDEPEND="${RDEPEND}
	!mailwrapper? ( !virtual/mta )
	mailwrapper? ( net-mail/mailwrapper )"

PROVIDE="${PROVIDE} virtual/mta virtual/mda"

# set qmail home directory
if qmail_mini; then
	QMAIL_HOME=/var/mini-qmail
else
	QMAIL_HOME=/var/qmail
fi

# @FUNCTION: qmail_set_cc
# @DESCRIPTION:
# The following commands patch the conf-{cc,ld} files to use the user's
# specified CFLAGS and LDFLAGS. These rather complex commands are needed
# because a user supplied patch might apply changes to these files, too.
# @SEE: #165981
qmail_set_cc() {
	append-ldflags $(bindnow-flags)
	cc=$(head -n 1 ./conf-cc | sed -e "s#^g\?cc\s\+\(-O2\)\?#$(tc-getCC) #")
	ld=$(head -n 1 ./conf-ld | sed -e "s#^g\?cc\s\+\(-s\)\?#$(tc-getCC) #")

	echo "${cc} ${CFLAGS}"  > ./conf-cc || die 'Patching conf-cc failed.'
	echo "${ld} ${LDFLAGS}" > ./conf-ld || die 'Patching conf-ld failed.'
}

# @FUNCTION: qmail_create_users
# @DESCRIPTION:
# Keep qmail users and groups in sync across ebuilds
qmail_create_users() {
	einfo "Creating groups and users"
	enewgroup nofiles 200
	enewgroup qmail 201
	enewuser alias 200 -1  ${QMAIL_HOME}/alias 200
	enewuser qmaild 201 -1 ${QMAIL_HOME} 200
	enewuser qmaill 202 -1 ${QMAIL_HOME} 200
	enewuser qmailp 203 -1 ${QMAIL_HOME} 200
	enewuser qmailq 204 -1 ${QMAIL_HOME} 201
	enewuser qmailr 205 -1 ${QMAIL_HOME} 201
	enewuser qmails 206 -1 ${QMAIL_HOME} 201
}

# @FUNCTION: netqmail_src_unpack
# @DESCRIPTION:
# Unpack and patch netqmail
qmail_src_unpack() {
	cd "${WORKDIR}"

	if [[ -n ${NETQMAIL_PV} ]]; then
		unpack ${NETQMAIL_F}
		cd netqmail-${NETQMAIL_PV}
		./collate.sh || die "patching failed"
		ht_fix_file "${NETQMAIL_S}"/Makefile*
	elif [[ -n ${QMAIL_PV} ]]; then
		unpack ${QMAIL_F}
		ht_fix_file "${QMAIL_S}"/Makefile*
	else
		die "neither qmail or netqmail will be built"
	fi
}

# @FUNCTION: spp_src_unpack
# @DESCRIPTION:
# Unpack qmail spp
qmail_spp_src_unpack() {
	cd "${WORKDIR}"
	use qmail-spp && unpack qmail-spp-${QMAIL_SPP_PV}.tar.gz
}

# @FUNCTION: spp_src_unpack
# @DESCRIPTION:
# Unpack qmail spp
genqmail_src_unpack() {
	cd "${WORKDIR}"
	unpack genqmail-${GENQMAIL_PV}.tar.bz2
}

# @FUNCTION: qmail_src_postunpack
# @DESCRIPTION:
# Unpack common config files, apply custom patches if supplied and
# set built configuration (CFLAGS, LDFLAGS, etc)
qmail_src_postunpack() {
	cd "${S}"

	if [[ -n "${QMAIL_PATCH_DIR}" && -d "${QMAIL_PATCH_DIR}" ]]; then
		echo
		ewarn "You enabled custom patches from ${QMAIL_PATCH_DIR}."
		ewarn "Be warned that you won't get any support when using "
		ewarn "this feature. You're on your own from now!"
		ebeep
		epatch "${QMAIL_PATCH_DIR}/"*
		echo
	fi

	qmail_set_cc

	mysplit="${QMAIL_CONF_SPLIT:-23}"
	is_prime ${mysplit} || die 'QMAIL_CONF_SPLIT is not a prime number.'
	einfo "Using conf-split value of ${mysplit}."
	echo -n "${mysplit}" > ./conf-split
}

# @FUNCTION: qmail_src_install
# @DESCRIPTION:
# This ugly function tries to install qmail binaries, config files and man pages
# with sane permissions in ${QMAIL_HOME}. It will only install a subset of files
# for mini-qmail.
qmail_base_install() {
	einfo "Setting up directory hierarchy ..."
	diropts -m 755 -o root -g qmail
	keepdir ${QMAIL_HOME}/{,control}
	qmail_mini || keepdir ${QMAIL_HOME}/{bin,boot,users}

	diropts -m 755 -o alias -g qmail
	qmail_mini || keepdir ${QMAIL_HOME}/alias

	einfo "Installing the qmail software ..."
	insinto ${QMAIL_HOME}/bin
	insopts -o root -g qmail -m 711

	doins datemail elq forward maildir2mbox maildirmake \
		maildirwatch mailsubj pinq predate qail \
		qmail-{inject,qmqpc,showctl} sendmail

	if qmail_mini; then
		dosym qmail-qmqpc ${QMAIL_HOME}/bin/qmail-queue

		newins config-mini.sh config-mini
		dosed "s:QMAIL:${QMAIL_HOME}:g" ${QMAIL_HOME}/bin/config-mini
	else
		doins bouncesaying condredirect config-fast except \
		preline qbiff qmail-{pop3d,popup,qmqpd,qmtpd,qread} \
		qmail-{qstat,smtpd,tcpok,tcpto} qreceipt qsmhook tcp-env

		insopts -o root -g qmail -m 700
		doins qmail-{lspawn,start,newu,newmrh}

		insopts -o qmailq -g qmail -m 4711
		doins qmail-queue

		insopts -o root -g qmail -m 711
		doins qmail-{getpw,local,remote,rspawn,clean,send,pw2u} splogger

		insinto ${QMAIL_HOME}/boot
		insopts -o root -g qmail -m 755
		doins {home,proc,binm1,binm2,binm3}{,+df}
	fi

	einfo "Installing manpages ..."
	into /usr
	doman *.[1-8]
	dodoc BLURB* CHANGES FAQ INSTALL* PIC* README* REMOVE* SECURITY \
		SENDMAIL SYSDEPS TARGETS TEST* THANKS* THOUGHTS TODO* \
		UPGRADE VERSION*

	einfo "Adding env.d entry for qmail"
	insopts -m 644
	doenvd "${GENQMAIL_S}"/conf/99qmail

	einfo "Creating sendmail replacement ..."
	diropts -m 755
	dodir /usr/sbin /usr/lib

	if use mailwrapper; then
		insinto /etc/mail
		doins "${GENQMAIL_S}"/conf/mailer.conf
	else
		dosym ${QMAIL_HOME}/bin/sendmail /usr/sbin/sendmail
		dosym ${QMAIL_HOME}/bin/sendmail /usr/lib/sendmail
	fi
}

qmail_maildir_install() {
	# use the correct maildirmake
	# the courier-imap one has some extensions that are nicer
	[[ -e /usr/bin/maildirmake ]] && \
		MAILDIRMAKE="/usr/bin/maildirmake" || \
		MAILDIRMAKE="${D}${QMAIL_HOME}/bin/maildirmake"

	einfo "Setting up the default aliases ..."
	diropts -m 700 -o alias -g qmail
	${MAILDIRMAKE} ${D}${QMAIL_HOME}/alias/.maildir
	keepdir ${QMAIL_HOME}/alias/.maildir/{cur,new,tmp}

	for i in ${QMAIL_HOME}/alias/.qmail-{mailer-daemon,postmaster,root}; do
		if [[ ! -f ${i} ]]; then
			touch ${D}${i}
			fowners alias:qmail ${i}
		fi
	done

	einfo "Setting up maildirs by default in the account skeleton ..."
	diropts -m 755 -o root -g root
	insinto /etc/skel
	newins "${GENQMAIL_S}"/control/defaultdelivery .qmail.sample
	fperms 644 /etc/skel/.qmail.sample
	${MAILDIRMAKE} ${D}/etc/skel/.maildir
	keepdir /etc/skel/.maildir/{cur,new,tmp}
}

qmail_supervise_install() {
	einfo "Setting up all services (send, smtp, qmtp, qmqp, pop3) ..."
	insopts -o root -g root -m 755
	diropts -m 755 -o root -g root
	dodir ${QMAIL_HOME}/supervise

	for i in qmail-{send,smtpd,qmtpd,qmqpd,pop3d}; do
		insopts -o root -g root -m 755
		diropts -m 755 -o root -g root

		dodir ${QMAIL_HOME}/supervise/${i}{,/log}
		fperms +t ${QMAIL_HOME}/supervise/${i}{,/log}

		insinto ${QMAIL_HOME}/supervise/${i}
		newins ${GENQMAIL_S}/supervise/${i} run

		insinto ${QMAIL_HOME}/supervise/${i}/log
		newins ${GENQMAIL_S}/supervise/${i}-log run

		diropts -m 755 -o qmaill
		keepdir /var/log/qmail/${i}
	done
}

qmail_config_install() {
	einfo "Installing some stock configuration files"
	insinto ${QMAIL_HOME}/control
	insopts -o root -g root -m 644
	doins "${GENQMAIL_S}"/control/conf-{common,send,qmtpd,qmqpd,pop3d,smtpd}
	doins "${GENQMAIL_S}"/control/defaultdelivery

	einfo "Configuration sanity checker and launcher"
	insinto ${QMAIL_HOME}/bin
	insopts -o root -g root -m 644
	doins "${GENQMAIL_S}"/control/qmail-config-system
}

qmail_spp_install() {
	einfo "Installing files for qmail-spp"
	keepdir ${QMAIL_HOME}/plugins/
	insinto ${QMAIL_HOME}/control/
	insopts -o root -g root -m 644
	doins "${QMAIL_SPP_S}"/samples/smtpplugins
}

qmail_ssl_install() {
	CRON_FOLDER=cron.hourly
	gencertdaily && CRON_FOLDER=cron.daily

	einfo "Installing SSL Certificate creation script"
	insinto ${QMAIL_HOME}/control
	insopts -o root -g root -m 644
	doins "${GENQMAIL_S}"/ssl/servercert.cnf

	insinto ${QMAIL_HOME}/bin
	insopts -o root -g root -m 700
	doins "${GENQMAIL_S}"/ssl/mkservercert

	einfo "Installing RSA key generation cronjob"
	insinto /etc/${CRON_FOLDER}
	insopts -o root -g root -m 755
	doins "${GENQMAIL_S}"/ssl/qmail-genrsacert.sh

	keepdir ${QMAIL_HOME}/control/tlshosts
}

qmail_ssl_generate() {
	CRON_FOLDER=cron.hourly
	gencertdaily && CRON_FOLDER=cron.daily

	ebegin "Generating RSA keys for SSL/TLS, this can take some time"
	${ROOT}/etc/${CRON_FOLDER}/qmail-genrsacert.sh
	eend $?

	einfo "Creating a self-signed ssl-certificate:"
	${ROOT}${QMAIL_HOME}/bin/mkservercert

	einfo "If you want to have a properly signed certificate "
	einfo "instead, do the following:"
	# space at the end of the string because of the current implementation
	# of einfo
	einfo "openssl req -new -nodes -out req.pem \\ "
	einfo "  -config ${QMAIL_HOME}/control/servercert.cnf \\ "
	einfo "  -keyout ${QMAIL_HOME}/control/servercert.pem"
	einfo "Send req.pem to your CA to obtain signed_req.pem, and do:"
	einfo "cat signed_req.pem >> ${QMAIL_HOME}/control/servercert.pem"
}

qmail_tcprules_install() {
	dodir ${TCPRULES_DIR}
	insinto ${TCPRULES_DIR}
	doins "${GENQMAIL_S}"/tcprules/Makefile.qmail
	doins "${GENQMAIL_S}"/tcprules/tcp.qmail-{smtp,qmtp,qmqp,pop3}
}

qmail_tcprules_config() {
	einfo "Accepting relaying by default from all ips configured on this machine."
	LOCALIPS=$(/sbin/ifconfig | grep inet | cut -d' ' -f 12 -s | cut -b 6-20)
	TCPSTRING=":allow,RELAYCLIENT=\"\",RBLSMTPD=\"\""
	for ip in $LOCALIPS; do
		myline="${ip}${TCPSTRING}"
		for proto in smtp qmtp qmqp; do
			f="${ROOT}${TCPRULES_DIR}/tcp.qmail-${proto}"
			egrep -q "${myline}" ${f} || echo "${myline}" >> ${f}
		done
	done
}

qmail_tcprules_build() {
	for f in tcp.qmail-{smtp,qmtp,qmqp,pop3}; do
		# please note that we don't check if it exists
		# as we want it to make the cdb files anyway!
		src=${ROOT}${TCPRULES_DIR}/${f}
		cdb=${ROOT}${TCPRULES_DIR}/${f}.cdb
		tmp=${ROOT}${TCPRULES_DIR}/.${f}.tmp
		[[ -e ${src} ]] && tcprules ${cdb} ${tmp} < ${src}
	done
}

qmail_tcprules_fixup() {
	mkdir -p ${TCPRULES_DIR}
	for f in {smtp,qmtp,qmqp,pop3}{,.cdb}; do
		old="/etc/tcp.${f}"
		new="${TCPRULES_DIR}/tcp.qmail-${f}"
		fail=0
		if [[ -f "$old" && ! -f "$new" ]]; then
			einfo "Moving $old to $new"
			cp $old $new || fail=1
		else
			fail=1
		fi
		if [[ "${fail}" = 1 && -f ${old} ]]; then
			eerror "Error moving $old to $new, be sure to check the"
			eerror "configuration! You may have already moved the files,"
			eerror "in which case you can delete $old"
		fi
	done
}

qmail_rootmail_fixup() {
	local TMPCMD="ln -sf ${QMAIL_HOME}/alias/.maildir/ ${ROOT}/root/.maildir"

	if [[ -d "${ROOT}/root/.maildir" && ! -L "${ROOT}/root/.maildir" ]] ; then
		elog "Previously the qmail ebuilds created /root/.maildir/ but not"
		elog "every mail was delivered there. If the directory does not"
		elog "contain any mail, please delete it and run:"
		elog "${TMPCMD}"
	else
		${TMPCMD}
	fi

	chown -R alias:qmail ${ROOT}${QMAIL_HOME}/alias/.maildir 2>/dev/null
}

qmail_queue_setup() {
	if [[ -n ${QMAIL_BIGTODO_PV} ]] && use highvolume; then
		myconf="--bigtodo"
	else
		myconf="--no-bigtodo"
	fi

	mysplit="${QMAIL_CONF_SPLIT:-23}"
	is_prime ${mysplit} || die 'QMAIL_CONF_SPLIT is not a prime number.'
	einfo "Using conf-split value of ${mysplit}."
	echo -n "${mysplit}" > ./conf-split

	einfo "Setting up the message queue hierarchy ..."

	/usr/bin/queue-repair.py --create ${myconf} \
		--split "${mysplit}" \
		${ROOT}${QMAIL_HOME} >/dev/null || \
		die 'queue-repair failed'
}

qmail_config_notice() {
	elog "To setup qmail to run out-of-the-box on your system, run:"
	elog "emerge --config =${CATEGORY}/${PF}"
	elog
	elog "To start qmail at boot you have to add svscan to your startup"
	elog "and create the following links:"
	elog "ln -s ${QMAIL_HOME}/supervise/qmail-send /service/qmail-send"
	elog "ln -s ${QMAIL_HOME}/supervise/qmail-smtpd /service/qmail-smtpd"
	elog
	elog "To start the pop3 server as well, create the following link:"
	elog "ln -s ${QMAIL_HOME}/supervise/qmail-pop3d /service/qmail-pop3d"
	elog
	elog "Additionally, the QMTP and QMQP protocols are supported, "
	elog "and can be started as:"
	elog "ln -s ${QMAIL_HOME}/supervise/qmail-qmtpd /service/qmail-qmtpd"
	elog "ln -s ${QMAIL_HOME}/supervise/qmail-qmqpd /service/qmail-qmqpd"
	elog
	elog "Additionally, if you wish to run qmail right now, you should "
	elog "run this before anything else:"
	elog "source /etc/profile"
}

qmail_config_fast() {
	if [[ ${ROOT} = / ]] ; then
		if [[ ! -f ${ROOT}${QMAIL_HOME}/control/me ]] ; then
			${ROOT}${QMAIL_HOME}/bin/config-fast $(hostname --fqdn)
		fi
	else
		ewarn "Skipping some configuration as it MUST be run on the final host"
	fi
}

[-- Attachment #4: netqmail-1.05-r9.ebuild --]
[-- Type: application/octet-stream, Size: 2385 bytes --]

# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/mail-mta/netqmail/netqmail-1.05-r8.ebuild,v 1.7 2007/06/30 18:43:11 armin76 Exp $

NETQMAIL_PV=${PV}
GENQMAIL_PV=20070713
QMAIL_SPP_PV=0.42
QMAIL_TLS_PV=20070417
QMAIL_BIGTODO_PV=103

DESCRIPTION="qmail -- a secure, reliable, efficient, simple message transfer agent"
HOMEPAGE="
	http://netqmail.org/
	http://cr.yp.to/qmail.html
	http://qmail.org/
"

LICENSE="as-is"
SLOT="0"
KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
IUSE="noauthcram"
RESTRICT="test"

DEPEND="!mail-mta/qmail"
RDEPEND="${DEPEND}
	!noauthcram? (
		|| ( >=net-mail/checkpassword-0.90 >=net-mail/checkpassword-pam-0.99 )
		>=net-mail/cmd5checkpw-0.30
	)
"

inherit qmail eutils

S="${NETQMAIL_S}"

pkg_setup() {
	qmail_create_users
}

src_unpack() {
	qmail_src_unpack
	qmail_spp_src_unpack
	genqmail_src_unpack

	cd "${S}"

	if ! use vanilla; then
		use ssl        && epatch ${DISTDIR}/${QMAIL_TLSAUTH_F}
		use highvolume && epatch ${DISTDIR}/${QMAIL_BIGTODO_F}

		if use qmail-spp; then
			if use ssl; then
				epatch "${QMAIL_SPP_S}"/qmail-spp-smtpauth-tls-20060105.diff
			else
				epatch "${QMAIL_SPP_S}"/netqmail-spp.diff
			fi
		fi
	fi

	qmail_src_postunpack

	# Fix bug #33818 but for netqmail (Bug 137015)
	if use noauthcram; then
		einfo "Disabled CRAM_MD5 support"
		sed -e 's,^#define CRAM_MD5$,/*&*/,' -i "${S}"/qmail-smtpd.c
	else
		einfo "Enabled CRAM_MD5 support"
	fi
}

src_compile() {
	emake it man || die "make failed"
}

src_install() {
	qmail_base_install
	qmail_config_install
	qmail_maildir_install
	qmail_tcprules_install
	qmail_supervise_install

	use qmail-spp && qmail_spp_install
	use ssl       && qmail_ssl_install
}

pkg_postinst() {
	qmail_queue_setup
	qmail_rootmail_fixup
	qmail_tcprules_build

	# for good measure
	env-update

	qmail_config_notice
	elog
	elog "If you are looking for documentation, check those links:"
	elog "http://www.gentoo.org/doc/en/qmail-howto.xml"
	elog "  -- qmail/vpopmail Virtual Mail Hosting System Guide"
	elog "http://www.lifewithqmail.com/"
	elog "  -- Life with qmail"
}

pkg_preinst() {
	qmail_tcprules_fixup
}

pkg_config() {
	# avoid some weird locale problems
	export LC_ALL=C

	qmail_config_fast
	qmail_tcprules_config
	qmail_tcprules_build
	use ssl && qmail_ssl_generate
}

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [gentoo-dev] [RFC] qmail.eclass draft
  2007-07-13 11:37 [gentoo-dev] [RFC] qmail.eclass draft Benedikt Boehm
@ 2007-07-13 12:34 ` Michael Hanselmann
  2007-07-13 12:53   ` Jakub Moc
                     ` (2 more replies)
  2007-07-20  9:52 ` Michael Hanselmann
  1 sibling, 3 replies; 27+ messages in thread
From: Michael Hanselmann @ 2007-07-13 12:34 UTC (permalink / raw
  To: gentoo-dev

On Fri, Jul 13, 2007 at 01:37:11PM +0200, Benedikt Boehm wrote:
> due to massive code duplication in netqmail, qmail-ldap, qmail-mysql,
> mini-qmail and other 3-rd party applications for qmail i have started
> to move functionality into a first qmail.eclass draft.

I already proposed moving the prime functionality into an eclass and it
was refused back then. qmail-mysql and qmail-ldap may get removed soon.

And as the netqmail ebuild maintainer, I want the ebuild to be as simple
as possible, that is, no external dependencies where possible.

> Attached is the eclass and a sample how to use it with netqmail.

It seems like you aren't interested in communication with the
maintainer, otherwise you would've CC'ed me.

Greets,
Michael

-- 
http://hansmi.ch/
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [gentoo-dev] [RFC] qmail.eclass draft
  2007-07-13 12:34 ` Michael Hanselmann
@ 2007-07-13 12:53   ` Jakub Moc
  2007-07-13 15:22     ` William L. Thomson Jr.
  2007-07-13 13:04   ` Benedikt Boehm
  2007-07-13 14:37   ` Petteri Räty
  2 siblings, 1 reply; 27+ messages in thread
From: Jakub Moc @ 2007-07-13 12:53 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1043 bytes --]

Michael Hanselmann napsal(a):
> On Fri, Jul 13, 2007 at 01:37:11PM +0200, Benedikt Boehm wrote:
>> due to massive code duplication in netqmail, qmail-ldap, qmail-mysql,
>> mini-qmail and other 3-rd party applications for qmail i have started
>> to move functionality into a first qmail.eclass draft.

> And as the netqmail ebuild maintainer, I want the ebuild to be as simple
> as possible, that is, no external dependencies where possible.

I wouldn't exactly call the current netqmail ebuild 'simple', on a quick
look. Hmmm... :)

>> Attached is the eclass and a sample how to use it with netqmail.
> 
> It seems like you aren't interested in communication with the
> maintainer, otherwise you would've CC'ed me.

Erm? This was completely uncalled for, I'd say?!


-- 
Best regards,

 Jakub Moc
 mailto:jakub@gentoo.org
 GPG signature:
 http://subkeys.pgp.net:11371/pks/lookup?op=get&search=0xCEBA3D9E
 Primary key fingerprint: D2D7 933C 9BA1 C95B 2C95  B30F 8717 D5FD CEBA 3D9E

 ... still no signature   ;)


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [gentoo-dev] [RFC] qmail.eclass draft
  2007-07-13 12:34 ` Michael Hanselmann
  2007-07-13 12:53   ` Jakub Moc
@ 2007-07-13 13:04   ` Benedikt Boehm
  2007-07-14 21:02     ` Michael Hanselmann
  2007-07-13 14:37   ` Petteri Räty
  2 siblings, 1 reply; 27+ messages in thread
From: Benedikt Boehm @ 2007-07-13 13:04 UTC (permalink / raw
  To: gentoo-dev

On Fri, 13 Jul 2007 14:34:26 +0200
Michael Hanselmann <hansmi@gentoo.org> wrote:

> On Fri, Jul 13, 2007 at 01:37:11PM +0200, Benedikt Boehm wrote:
> > due to massive code duplication in netqmail, qmail-ldap,
> > qmail-mysql, mini-qmail and other 3-rd party applications for qmail
> > i have started to move functionality into a first qmail.eclass
> > draft.
> 
> I already proposed moving the prime functionality into an eclass and
> it was refused back then. qmail-mysql and qmail-ldap may get removed
> soon.

qmail-ldap will not be removed for sure, since i maintain it currently.

> 
> And as the netqmail ebuild maintainer, I want the ebuild to be as
> simple as possible, that is, no external dependencies where possible.

so, you suggest it is a better way to duplicate tons of code in 4
ebuilds?

> 
> > Attached is the eclass and a sample how to use it with netqmail.
> 
> It seems like you aren't interested in communication with the
> maintainer, otherwise you would've CC'ed me.

appearantly, you are subscribed to gentoo-dev.

> 
> Greets,
> Michael
> 

On a sidenote, qmail has a huge amount of open bugs, and has generally
gotten no love in the past time, so i wonder if it actually was/is
maintained.
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [gentoo-dev] [RFC] qmail.eclass draft
  2007-07-13 12:34 ` Michael Hanselmann
  2007-07-13 12:53   ` Jakub Moc
  2007-07-13 13:04   ` Benedikt Boehm
@ 2007-07-13 14:37   ` Petteri Räty
  2007-07-14 20:52     ` Michael Hanselmann
  2 siblings, 1 reply; 27+ messages in thread
From: Petteri Räty @ 2007-07-13 14:37 UTC (permalink / raw
  To: gentoo-dev

Michael Hanselmann kirjoitti:
> 
> It seems like you aren't interested in communication with the
> maintainer, otherwise you would've CC'ed me.
> 

We are all required to subscribe to this mailing list... Should be easy
enough to spot the thread.

Regards,
Petteri
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [gentoo-dev] [RFC] qmail.eclass draft
  2007-07-13 12:53   ` Jakub Moc
@ 2007-07-13 15:22     ` William L. Thomson Jr.
  2007-07-13 17:05       ` Benedikt Boehm
  2007-07-14 21:09       ` Michael Hanselmann
  0 siblings, 2 replies; 27+ messages in thread
From: William L. Thomson Jr. @ 2007-07-13 15:22 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1313 bytes --]

On Fri, 2007-07-13 at 14:53 +0200, Jakub Moc wrote:
> Michael Hanselmann napsal(a):
> > On Fri, Jul 13, 2007 at 01:37:11PM +0200, Benedikt Boehm wrote:
>
> > It seems like you aren't interested in communication with the
> > maintainer, otherwise you would've CC'ed me.
> 
> Erm? This was completely uncalled for, I'd say?!

Looking at traffic going both ways I don't think it was meant harshly or
etc. More a surprise to the current maintainer. That they weren't
contacted to get their feedback on something they are directly
responsible for. Before going over their heads or around the bush to get
opinions from others.

I don't think it was intentionally done. But usually, not sure if it's
stated in policy, it's best to try to contact a maintainer first,
directly. If one exists, if not the someone maintaining the herd then.
Discussing and ideas, thoughts, issues, etc there. Then based on that,
elevate the conversation to say -dev ml or etc for all to be involved.

I am sure lots of us have lots of ideas about allot of packages. But
only a few of us take enough time to commit to being a packages
maintainer. Those willing to put their neck on the line should be the
first stop, IMHO.

Simple misunderstanding miss-communication. :)

-- 
William L. Thomson Jr.
Gentoo/Java

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [gentoo-dev] [RFC] qmail.eclass draft
  2007-07-13 15:22     ` William L. Thomson Jr.
@ 2007-07-13 17:05       ` Benedikt Boehm
  2007-07-14 20:56         ` Michael Hanselmann
  2007-07-14 21:09       ` Michael Hanselmann
  1 sibling, 1 reply; 27+ messages in thread
From: Benedikt Boehm @ 2007-07-13 17:05 UTC (permalink / raw
  To: gentoo-dev

On Fri, 13 Jul 2007 11:22:47 -0400
"William L. Thomson Jr." <wltjr@gentoo.org> wrote:

> On Fri, 2007-07-13 at 14:53 +0200, Jakub Moc wrote:
> > Michael Hanselmann napsal(a):
> > > On Fri, Jul 13, 2007 at 01:37:11PM +0200, Benedikt Boehm wrote:
> >
> > > It seems like you aren't interested in communication with the
> > > maintainer, otherwise you would've CC'ed me.
> > 
> > Erm? This was completely uncalled for, I'd say?!
> 
> Looking at traffic going both ways I don't think it was meant harshly
> or etc. More a surprise to the current maintainer. That they weren't
> contacted to get their feedback on something they are directly
> responsible for. Before going over their heads or around the bush to
> get opinions from others.

Actually i am qmail maintainer and also been in the qmail herd for
quite some time...

> 
> I don't think it was intentionally done. But usually, not sure if it's
> stated in policy, it's best to try to contact a maintainer first,
> directly. If one exists, if not the someone maintaining the herd then.
> Discussing and ideas, thoughts, issues, etc there. Then based on that,
> elevate the conversation to say -dev ml or etc for all to be involved.
> 
> I am sure lots of us have lots of ideas about allot of packages. But
> only a few of us take enough time to commit to being a packages
> maintainer. Those willing to put their neck on the line should be the
> first stop, IMHO.
> 
> Simple misunderstanding miss-communication. :)
> 
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [gentoo-dev] [RFC] qmail.eclass draft
  2007-07-13 14:37   ` Petteri Räty
@ 2007-07-14 20:52     ` Michael Hanselmann
  0 siblings, 0 replies; 27+ messages in thread
From: Michael Hanselmann @ 2007-07-14 20:52 UTC (permalink / raw
  To: gentoo-dev; +Cc: betelgeuse

[-- Attachment #1: Type: text/plain, Size: 450 bytes --]

On Fri, Jul 13, 2007 at 05:37:16PM +0300, Petteri Räty wrote:
> We are all required to subscribe to this mailing list... Should be easy
> enough to spot the thread.

You know, sometimes I get tired of all the flames and pointless
discussions and mark all mails as read. If something should be read by a
certain person, it's usually better to send it to the list *and* CC the
person in question.

Greets,
Michael

-- 
http://hansmi.ch/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [gentoo-dev] [RFC] qmail.eclass draft
  2007-07-13 17:05       ` Benedikt Boehm
@ 2007-07-14 20:56         ` Michael Hanselmann
  0 siblings, 0 replies; 27+ messages in thread
From: Michael Hanselmann @ 2007-07-14 20:56 UTC (permalink / raw
  To: gentoo-dev; +Cc: hollow

[-- Attachment #1: Type: text/plain, Size: 369 bytes --]

On Fri, Jul 13, 2007 at 07:05:51PM +0200, Benedikt Boehm wrote:
> Actually i am qmail maintainer and also been in the qmail herd for
> quite some time...

No, actually you're in the qmail herd and maintainer of the
net-mail/qmail-ldap package. This doesn't make you a netqmail (the
package I care about) maintainer.

Greets,
Michael

-- 
http://hansmi.ch/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [gentoo-dev] [RFC] qmail.eclass draft
  2007-07-13 13:04   ` Benedikt Boehm
@ 2007-07-14 21:02     ` Michael Hanselmann
  2007-07-15  1:07       ` Benedikt Boehm
  0 siblings, 1 reply; 27+ messages in thread
From: Michael Hanselmann @ 2007-07-14 21:02 UTC (permalink / raw
  To: gentoo-dev; +Cc: hollow

[-- Attachment #1: Type: text/plain, Size: 1094 bytes --]

On Fri, Jul 13, 2007 at 03:04:27PM +0200, Benedikt Boehm wrote:
> qmail-ldap will not be removed for sure, since i maintain it currently.

Okay, my status there was outdated. We were at least discussing it at
some point in history.

> > And as the netqmail ebuild maintainer, I want the ebuild to be as
> > simple as possible, that is, no external dependencies where possible.

> so, you suggest it is a better way to duplicate tons of code in 4
> ebuilds?

I'll think about it.

> appearantly, you are subscribed to gentoo-dev.

… which doesn't necessarily mean I read it.

> On a sidenote, qmail has a huge amount of open bugs, and has generally
> gotten no love in the past time, so i wonder if it actually was/is
> maintained.

qmail != netqmail. To my knowledge, we have only one outstanding bug
there, the one with man pages colliding, nothing critical. Since I also
have other things in life with higher priorities than Gentoo, it has to
wait. However, I should get to it during the week or at latest two
weeks.

Greets,
Michael

-- 
http://hansmi.ch/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [gentoo-dev] [RFC] qmail.eclass draft
  2007-07-13 15:22     ` William L. Thomson Jr.
  2007-07-13 17:05       ` Benedikt Boehm
@ 2007-07-14 21:09       ` Michael Hanselmann
  1 sibling, 0 replies; 27+ messages in thread
From: Michael Hanselmann @ 2007-07-14 21:09 UTC (permalink / raw
  To: gentoo-dev; +Cc: wltjr, jakub

[-- Attachment #1: Type: text/plain, Size: 1025 bytes --]

On Fri, Jul 13, 2007 at 11:22:47AM -0400, William L. Thomson Jr. wrote:
> > > It seems like you aren't interested in communication with the
> > > maintainer, otherwise you would've CC'ed me.

> > Erm? This was completely uncalled for, I'd say?!

To Jakub: It was. Sending such things to a public list is fine, as long
as the affected persons get informed, too. Otherwise it can be seen like
a complaint behind someone's back. I'm sure you've experience with that,
do you?

> Looking at traffic going both ways I don't think it was meant harshly or
> etc. More a surprise to the current maintainer.

Indeed it was surprising. “Who is he to come around with such a thing on
a public list, without CC'ing me?”

> But usually, not sure if it's stated in policy, it's best to try to
> contact a maintainer first, directly.

Such a thing wouldn't even have to be in policy. It's just common sense.

Anyway, let's end it here and get back to technical stuff.

Greets,
Michael

-- 
http://hansmi.ch/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [gentoo-dev] [RFC] qmail.eclass draft
  2007-07-14 21:02     ` Michael Hanselmann
@ 2007-07-15  1:07       ` Benedikt Boehm
  2007-07-15 11:19         ` Michael Hanselmann
  0 siblings, 1 reply; 27+ messages in thread
From: Benedikt Boehm @ 2007-07-15  1:07 UTC (permalink / raw
  To: gentoo-dev; +Cc: hansmi

On Sat, 14 Jul 2007 23:02:00 +0200
Michael Hanselmann <hansmi@gentoo.org> wrote:

> On Fri, Jul 13, 2007 at 03:04:27PM +0200, Benedikt Boehm wrote:
> > qmail-ldap will not be removed for sure, since i maintain it
> > currently.
> 
> Okay, my status there was outdated. We were at least discussing it at
> some point in history.
> 
> > > And as the netqmail ebuild maintainer, I want the ebuild to be as
> > > simple as possible, that is, no external dependencies where
> > > possible.
> 
> > so, you suggest it is a better way to duplicate tons of code in 4
> > ebuilds?
> 
> I'll think about it.
> 
> [...]
>
> > On a sidenote, qmail has a huge amount of open bugs, and has
> > generally gotten no love in the past time, so i wonder if it
> > actually was/is maintained.
> 
> qmail != netqmail. To my knowledge, we have only one outstanding bug
> there, the one with man pages colliding, nothing critical. Since I
> also have other things in life with higher priorities than Gentoo, it
> has to wait. However, I should get to it during the week or at latest
> two weeks.

As it seems, you do not have the time and/or interest to cleanup the
qmail mess, but don't want anyone to touch (net)qmail ebuilds either, i
have put the updated ebuilds for qmail and friends into my overlay. [1]

Maybe we can get them into the tree some time in the future.

Bene

[1]
http://planet.gentoo.org/developers/hollow/2007/07/15/experimental_qmail_ebuilds
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [gentoo-dev] [RFC] qmail.eclass draft
  2007-07-15  1:07       ` Benedikt Boehm
@ 2007-07-15 11:19         ` Michael Hanselmann
  2007-07-15 19:26           ` Benedikt Boehm
  0 siblings, 1 reply; 27+ messages in thread
From: Michael Hanselmann @ 2007-07-15 11:19 UTC (permalink / raw
  To: gentoo-dev; +Cc: hansmi

[-- Attachment #1: Type: text/plain, Size: 1321 bytes --]

On Sun, Jul 15, 2007 at 03:07:28AM +0200, Benedikt Boehm wrote:
> As it seems, you do not have the time and/or interest to cleanup the
> qmail mess, but don't want anyone to touch (net)qmail ebuilds either, i
> have put the updated ebuilds for qmail and friends into my overlay. [1]

You interpret something into it which isn't true. I'm not “holding” it.
Publishing such unverified interpretations publically isn't exactly
nice, too. It's just that I don't have time today or tomorrow to look
more exactly into it, or, more exactly, I have things with higher
priorities to be done first (but also Free Software related!). And as
the current maintainer I just said “no” to your code (for now). There's
nothing wrong with doing that if I'm not accepting it (due to whatever
reason). You didn't ask to take over maintainership.

Doing a change like this to an ebuild has to be well thought, reviewed
and can't be done withing hours. netqmail is rather fragile to breakage
and we don't want our users to loose e-mails due to our failures, do we?

Now, you should correct that blog entry (I'm not going into why moving
topics from MLs to blogs is very bad) to actually state true facts and
then wait a few days. I'll have some time during this week.

Greets,
Michael

-- 
http://hansmi.ch/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [gentoo-dev] [RFC] qmail.eclass draft
  2007-07-15 11:19         ` Michael Hanselmann
@ 2007-07-15 19:26           ` Benedikt Boehm
  0 siblings, 0 replies; 27+ messages in thread
From: Benedikt Boehm @ 2007-07-15 19:26 UTC (permalink / raw
  To: gentoo-dev; +Cc: hansmi

On Sun, 15 Jul 2007 13:19:08 +0200
Michael Hanselmann <hansmi@gentoo.org> wrote:

> On Sun, Jul 15, 2007 at 03:07:28AM +0200, Benedikt Boehm wrote:
> > As it seems, you do not have the time and/or interest to cleanup the
> > qmail mess, but don't want anyone to touch (net)qmail ebuilds
> > either, i have put the updated ebuilds for qmail and friends into
> > my overlay. [1]
> 
> You interpret something into it which isn't true. I'm not “holding”
> it. Publishing such unverified interpretations publically isn't
> exactly nice, too. It's just that I don't have time today or tomorrow
> to look more exactly into it, or, more exactly, I have things with
> higher priorities to be done first (but also Free Software related!).
> And as the current maintainer I just said “no” to your code (for
> now). There's nothing wrong with doing that if I'm not accepting it
> (due to whatever reason). You didn't ask to take over maintainership.

In fact you haven't been that nice either, but honestly i don't care.
Therefore i have just moved the ebuilds to my overlay until you can
review them ...

> Doing a change like this to an ebuild has to be well thought, reviewed
> and can't be done withing hours. netqmail is rather fragile to
> breakage and we don't want our users to loose e-mails due to our
> failures, do we?

... so that it can be tested by those who feel like.

> Now, you should correct that blog entry (I'm not going into why moving
> topics from MLs to blogs is very bad) to actually state true facts and
> then wait a few days. I'll have some time during this week.
> 
> Greets,
> Michael
> 
--
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [gentoo-dev] [RFC] qmail.eclass draft
  2007-07-13 11:37 [gentoo-dev] [RFC] qmail.eclass draft Benedikt Boehm
  2007-07-13 12:34 ` Michael Hanselmann
@ 2007-07-20  9:52 ` Michael Hanselmann
  2007-07-20 20:05   ` Benedikt Boehm
  2007-07-23 19:58   ` Benedikt Boehm
  1 sibling, 2 replies; 27+ messages in thread
From: Michael Hanselmann @ 2007-07-20  9:52 UTC (permalink / raw
  To: gentoo-dev; +Cc: hollow

[-- Attachment #1: Type: text/plain, Size: 816 bytes --]

Hello Benedikt

On Fri, Jul 13, 2007 at 01:37:11PM +0200, Benedikt Boehm wrote:
> It is basically netqmail split into much smaller chunks so they can be
> reused by other qmail variants as well.

Okay, I looked through it and found some things which need
reconsideration. I agree that user creation and such things can be
easily done in an eclass. However, functions like qmail_src_unpack
should be done in the ebuild. Putting them in an eclass and just doing
"if (a) { … } else if (b) { … }" makes it harder to understand and
unneccessarily complicated. qmail_base_install should be split in
smaller functions, maybe with callbacks (if possible in bash). In the
end the ebuild shouldn't contain any package-specific code. Can you look
into it again?

Greets,
Michael

-- 
http://hansmi.ch/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [gentoo-dev] [RFC] qmail.eclass draft
  2007-07-20  9:52 ` Michael Hanselmann
@ 2007-07-20 20:05   ` Benedikt Boehm
  2007-07-20 21:17     ` Michael Hanselmann
  2007-07-23 19:58   ` Benedikt Boehm
  1 sibling, 1 reply; 27+ messages in thread
From: Benedikt Boehm @ 2007-07-20 20:05 UTC (permalink / raw
  To: gentoo-dev; +Cc: hansmi

On Fri, 20 Jul 2007 11:52:02 +0200
Michael Hanselmann <hansmi@gentoo.org> wrote:

> Hello Benedikt
> 
> On Fri, Jul 13, 2007 at 01:37:11PM +0200, Benedikt Boehm wrote:
> > It is basically netqmail split into much smaller chunks so they can
> > be reused by other qmail variants as well.
> 
> Okay, I looked through it and found some things which need
> reconsideration. I agree that user creation and such things can be
> easily done in an eclass. However, functions like qmail_src_unpack
> should be done in the ebuild. Putting them in an eclass and just doing
> "if (a) { … } else if (b) { … }" makes it harder to understand and
> unneccessarily complicated.

I absolutely agree here, it is just too ugly.

> qmail_base_install should be split in
> smaller functions, maybe with callbacks (if possible in bash).

There is now qmail_mini_install (called by every qmail ebuild) and
qmail_{full,man,sendmail}_install for the rest of a full blown install.

I'm not sure what you mean with "callbacks" here, maybe you can
elaborate?

> In the
> end the ebuild shouldn't contain any package-specific code. Can you
> look into it again?

The qmail_*_install changes are already in my overlay, i will look into
removing the unpack stuff from the eclass together with some
DEPEND/IUSE cleanups to get rid of qmail_mini() tomorrow.

HTH,
Bene
--
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [gentoo-dev] [RFC] qmail.eclass draft
  2007-07-20 20:05   ` Benedikt Boehm
@ 2007-07-20 21:17     ` Michael Hanselmann
  2007-07-23 19:55       ` Benedikt Boehm
  0 siblings, 1 reply; 27+ messages in thread
From: Michael Hanselmann @ 2007-07-20 21:17 UTC (permalink / raw
  To: Benedikt Boehm; +Cc: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1304 bytes --]

On Fri, Jul 20, 2007 at 10:05:23PM +0200, Benedikt Boehm wrote:
> > qmail_base_install should be split in smaller functions, maybe with
> > callbacks (if possible in bash).

> There is now qmail_mini_install (called by every qmail ebuild) and
> qmail_{full,man,sendmail}_install for the rest of a full blown install.

> I'm not sure what you mean with "callbacks" here, maybe you can
> elaborate?

If we have a common part which cannot, due to whatever reason, be split
into several functions, but we've to do something package specific in
between, we need callbacks. Just a sample (might not work at all, I'm
not that much into eclasses):

foo.eclass:
foo_src_install() {
    # Some prefix code
    # …

    package_specific_code

    # Some postfix code
    # …
}

foo-simple.ebuild:
src_install() { foo_src_install }
package_specific_code() {
    # code for foo-simple
}

foo-adv.ebuild:
src_install() { foo_src_install }
package_specific_code() {
    # code for foo-adv
}

> The qmail_*_install changes are already in my overlay,

How can I get it using SVN? Looking at the site for more than a minute
shouldn't be required to find it.

Btw.: you didn't correct your blog posting to show the actual facts.

Thanks,
Michael

-- 
http://hansmi.ch/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [gentoo-dev] [RFC] qmail.eclass draft
  2007-07-20 21:17     ` Michael Hanselmann
@ 2007-07-23 19:55       ` Benedikt Boehm
  2007-07-24  9:42         ` Benedikt Boehm
  0 siblings, 1 reply; 27+ messages in thread
From: Benedikt Boehm @ 2007-07-23 19:55 UTC (permalink / raw
  To: gentoo-dev; +Cc: hansmi

On Fri, 20 Jul 2007 23:17:46 +0200
Michael Hanselmann <hansmi@gentoo.org> wrote:

> On Fri, Jul 20, 2007 at 10:05:23PM +0200, Benedikt Boehm wrote:
> > > qmail_base_install should be split in smaller functions, maybe
> > > with callbacks (if possible in bash).
> 
> > There is now qmail_mini_install (called by every qmail ebuild) and
> > qmail_{full,man,sendmail}_install for the rest of a full blown
> > install.
> 
> > I'm not sure what you mean with "callbacks" here, maybe you can
> > elaborate?
> 
> If we have a common part which cannot, due to whatever reason, be
> split into several functions, but we've to do something package
> specific in between, we need callbacks. Just a sample (might not work
> at all, I'm not that much into eclasses):
> 
> foo.eclass:
> foo_src_install() {
>     # Some prefix code
>     # …
> 
>     package_specific_code
> 
>     # Some postfix code
>     # …
> }
> 
> foo-simple.ebuild:
> src_install() { foo_src_install }
> package_specific_code() {
>     # code for foo-simple
> }
> 
> foo-adv.ebuild:
> src_install() { foo_src_install }
> package_specific_code() {
>     # code for foo-adv
> }

i guess this could be done with some "eval" foo... going to run some
tests the next days

> 
> > The qmail_*_install changes are already in my overlay,
> 
> How can I get it using SVN? Looking at the site for more than a minute
> shouldn't be required to find it.

svn co http://overlays.gentoo.org/svn/dev/hollow

> 
> Btw.: you didn't correct your blog posting to show the actual facts.
> 
> Thanks,
> Michael
> 
--
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [gentoo-dev] [RFC] qmail.eclass draft
  2007-07-20  9:52 ` Michael Hanselmann
  2007-07-20 20:05   ` Benedikt Boehm
@ 2007-07-23 19:58   ` Benedikt Boehm
  2007-07-27 11:08     ` Michael Hanselmann
  1 sibling, 1 reply; 27+ messages in thread
From: Benedikt Boehm @ 2007-07-23 19:58 UTC (permalink / raw
  To: gentoo-dev; +Cc: hansmi

On Fri, 20 Jul 2007 11:52:02 +0200
Michael Hanselmann <hansmi@gentoo.org> wrote:

> Hello Benedikt
> 
> On Fri, Jul 13, 2007 at 01:37:11PM +0200, Benedikt Boehm wrote:
> > It is basically netqmail split into much smaller chunks so they can
> > be reused by other qmail variants as well.
> 
> Okay, I looked through it and found some things which need
> reconsideration. I agree that user creation and such things can be
> easily done in an eclass. However, functions like qmail_src_unpack
> should be done in the ebuild. Putting them in an eclass and just doing
> "if (a) { … } else if (b) { … }" makes it harder to understand and
> unneccessarily complicated.

i thought about this, but i'd really like to see things like qmail-spp
and the gentoo qmail tarball be handled by the eclass, on the other
hand i agree that unpacking netqmail or qmail based on $FOO is not the
best idea. any suggestions?

> 
> Greets,
> Michael
> 

Bene
--
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [gentoo-dev] [RFC] qmail.eclass draft
  2007-07-23 19:55       ` Benedikt Boehm
@ 2007-07-24  9:42         ` Benedikt Boehm
  0 siblings, 0 replies; 27+ messages in thread
From: Benedikt Boehm @ 2007-07-24  9:42 UTC (permalink / raw
  To: gentoo-dev; +Cc: hansmi

On Mon, 23 Jul 2007 21:55:16 +0200
Benedikt Boehm <hollow@gentoo.org> wrote:

> On Fri, 20 Jul 2007 23:17:46 +0200
> Michael Hanselmann <hansmi@gentoo.org> wrote:
> 
> > On Fri, Jul 20, 2007 at 10:05:23PM +0200, Benedikt Boehm wrote:
> > > > qmail_base_install should be split in smaller functions, maybe
> > > > with callbacks (if possible in bash).
> > 
[...]
> > 
> > > I'm not sure what you mean with "callbacks" here, maybe you can
> > > elaborate?
> > 
> > If we have a common part which cannot, due to whatever reason, be
> > split into several functions, but we've to do something package
> > specific in between, we need callbacks. Just a sample (might not
> > work at all, I'm not that much into eclasses):
> > 
[...]
> 
> i guess this could be done with some "eval" foo... going to run some
> tests the next days
> 

I figured that we can simply use declare to check if a function exists,
so i implemented hooks for all install functions and provided a
combined qmail_src_install that calls all install functions.

I also moved the unpack stuff back into the ebuilds, only genqmail
and qmail-spp remain with a little unpack function in the eclass...

Bene
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [gentoo-dev] [RFC] qmail.eclass draft
  2007-07-23 19:58   ` Benedikt Boehm
@ 2007-07-27 11:08     ` Michael Hanselmann
  2007-07-28  2:04       ` Marius Mauch
  2007-07-30 11:20       ` [gentoo-dev] " Benedikt Boehm
  0 siblings, 2 replies; 27+ messages in thread
From: Michael Hanselmann @ 2007-07-27 11:08 UTC (permalink / raw
  To: Benedikt Boehm; +Cc: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1923 bytes --]

Hello Benedikt

Sorry for my long response times.

On Mon, Jul 23, 2007 at 09:58:17PM +0200, Benedikt Boehm wrote:
> i thought about this, but i'd really like to see things like qmail-spp
> and the gentoo qmail tarball be handled by the eclass, on the other
> hand i agree that unpacking netqmail or qmail based on $FOO is not the
> best idea. any suggestions?

I really don't see the point of having qmail_spp_src_unpack and all of
these qmail-spp related variables. There have to be different diffs
anyway for other sources, making it more complicated with that many
variables. Aren't you overengineering here?

Now some things I noticed while going through, in no special order:
- Why need_qmail? It slows down cache regeneration and is really unneeded.
- In qmail_man_install you rename some manpages. Can you please add a
  comment on why you do this?
- You're very inconsistent with variable quoting. Please quote them
  everywhere except the places where you're absolutly sure there will be
  no spaces (or other special characters) in them. Maybe the original
  netqmail has some of these issues, too, but now we can fix them.
- Don't align stuff like on the last two lines in qmail_src_install.
- The "use gencertdaily" thing in qmail_ssl_generate works, but doesn't
  look so nice. How about this?
    use gencertdaily && \
        CRON_FOLDER=cron.daily || \
        CRON_FOLDER=cron.hourly
- Limit line length to 80 characters (with tabs at 8 spaces).
- I don't like the custom tarball. How do you want to build and
  redistribute it without depending on a single person? Its sources need
  to reside completly on Gentoo infrastructure.
- If I remember correctly, elog shouldn't be used for empty lines like
  in qmail_supervise_config_notice. Use echo instead for them.

So, now you should have something to chew on again. :-)

Thanks,
Michael

-- 
http://hansmi.ch/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [gentoo-dev] [RFC] qmail.eclass draft
  2007-07-27 11:08     ` Michael Hanselmann
@ 2007-07-28  2:04       ` Marius Mauch
  2007-07-28  5:51         ` [gentoo-dev] " Steve Long
  2007-07-30 11:20       ` [gentoo-dev] " Benedikt Boehm
  1 sibling, 1 reply; 27+ messages in thread
From: Marius Mauch @ 2007-07-28  2:04 UTC (permalink / raw
  To: gentoo-dev

On Fri, 27 Jul 2007 13:08:36 +0200
Michael Hanselmann <hansmi@gentoo.org> wrote:

> - If I remember correctly, elog shouldn't be used for empty lines like
>   in qmail_supervise_config_notice. Use echo instead for them.

You remember incorrectly (though I don't think I ever said anything
about it). You should use elog/ewarn/... without arguments to separate
different message items (with echo it might look better on the console
during the build, but worse in the final log).

Marius
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 27+ messages in thread

* [gentoo-dev]  Re: [RFC] qmail.eclass draft
  2007-07-28  2:04       ` Marius Mauch
@ 2007-07-28  5:51         ` Steve Long
  0 siblings, 0 replies; 27+ messages in thread
From: Steve Long @ 2007-07-28  5:51 UTC (permalink / raw
  To: gentoo-dev

>> - If I remember correctly, elog shouldn't be used for empty lines like
>>   in qmail_supervise_config_notice. Use echo instead for them.
> 
> You remember incorrectly (though I don't think I ever said anything
> about it). You should use elog/ewarn/... without arguments to separate
> different message items (with echo it might look better on the console
> during the build, but worse in the final log).
> 
Is there anything technically wrong with

elog 'message A

message B'

..which is how we'd do a multi-line echo in bash? (I don't know how it
interacts with the log.)


-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [gentoo-dev] [RFC] qmail.eclass draft
  2007-07-27 11:08     ` Michael Hanselmann
  2007-07-28  2:04       ` Marius Mauch
@ 2007-07-30 11:20       ` Benedikt Boehm
  2007-07-30 12:23         ` Michael Hanselmann
  1 sibling, 1 reply; 27+ messages in thread
From: Benedikt Boehm @ 2007-07-30 11:20 UTC (permalink / raw
  To: Michael Hanselmann; +Cc: gentoo-dev

On Fri, 27 Jul 2007 13:08:36 +0200
Michael Hanselmann <hansmi@gentoo.org> wrote:

> Hello Benedikt
> 
> Sorry for my long response times.
> 
> On Mon, Jul 23, 2007 at 09:58:17PM +0200, Benedikt Boehm wrote:
> > i thought about this, but i'd really like to see things like
> > qmail-spp and the gentoo qmail tarball be handled by the eclass, on
> > the other hand i agree that unpacking netqmail or qmail based on
> > $FOO is not the best idea. any suggestions?
> 
> I really don't see the point of having qmail_spp_src_unpack and all of
> these qmail-spp related variables. There have to be different diffs
> anyway for other sources, making it more complicated with that many
> variables. Aren't you overengineering here?

Well, i think the unpack stuff could be handled in the ebuild, but i'd
still like to keep dospp, so ebuilds like vpopmail can install
spp-plugins in a standardized way..

> Now some things I noticed while going through, in no special order:
> - Why need_qmail? It slows down cache regeneration and is really
> unneeded.

yeah. will fix this soon.

> - In qmail_man_install you rename some manpages. Can you please add a
>   comment on why you do this?

done.

> - You're very inconsistent with variable quoting. Please quote them
>   everywhere except the places where you're absolutly sure there will
> be no spaces (or other special characters) in them. Maybe the original
>   netqmail has some of these issues, too, but now we can fix them.

done (at least in the eclass)

> - Don't align stuff like on the last two lines in qmail_src_install.

done

> - The "use gencertdaily" thing in qmail_ssl_generate works, but
> doesn't look so nice. How about this?
>     use gencertdaily && \
>         CRON_FOLDER=cron.daily || \
>         CRON_FOLDER=cron.hourly

done

> - Limit line length to 80 characters (with tabs at 8 spaces).

will look at this later

> - I don't like the custom tarball. How do you want to build and
>   redistribute it without depending on a single person? Its sources
> need to reside completly on Gentoo infrastructure.

yes, i'd suggest to put it in svn, just like we do with the apache
tarball, and create a script for tar/upload etc.. probably most could
be copied from the apache script..

Bene
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [gentoo-dev] [RFC] qmail.eclass draft
  2007-07-30 11:20       ` [gentoo-dev] " Benedikt Boehm
@ 2007-07-30 12:23         ` Michael Hanselmann
  2007-07-30 14:51           ` Benedikt Boehm
  0 siblings, 1 reply; 27+ messages in thread
From: Michael Hanselmann @ 2007-07-30 12:23 UTC (permalink / raw
  To: Benedikt Boehm; +Cc: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 781 bytes --]

On Mon, Jul 30, 2007 at 01:20:43PM +0200, Benedikt Boehm wrote:
> Well, i think the unpack stuff could be handled in the ebuild, but i'd
> still like to keep dospp, so ebuilds like vpopmail can install
> spp-plugins in a standardized way..

dospp is fine. Well, maybe rename it to doqmail-spp to make the name
more clear.

> > - I don't like the custom tarball. How do you want to build and
> >   redistribute it without depending on a single person? Its sources
> > need to reside completly on Gentoo infrastructure.

> yes, i'd suggest to put it in svn, just like we do with the apache
> tarball, and create a script for tar/upload etc.. probably most could
> be copied from the apache script..

Which SVN? svn.g.o?

Greets,
Michael

-- 
http://hansmi.ch/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [gentoo-dev] [RFC] qmail.eclass draft
  2007-07-30 12:23         ` Michael Hanselmann
@ 2007-07-30 14:51           ` Benedikt Boehm
  2007-07-30 15:56             ` Michael Hanselmann
  0 siblings, 1 reply; 27+ messages in thread
From: Benedikt Boehm @ 2007-07-30 14:51 UTC (permalink / raw
  To: gentoo-dev; +Cc: hansmi

On Mon, 30 Jul 2007 14:23:52 +0200
Michael Hanselmann <hansmi@gentoo.org> wrote:

> On Mon, Jul 30, 2007 at 01:20:43PM +0200, Benedikt Boehm wrote:
> > > - I don't like the custom tarball. How do you want to build and
> > >   redistribute it without depending on a single person? Its
> > > sources need to reside completly on Gentoo infrastructure.
> 
> > yes, i'd suggest to put it in svn, just like we do with the apache
> > tarball, and create a script for tar/upload etc.. probably most
> > could be copied from the apache script..
> 
> Which SVN? svn.g.o?

Yep. Maybe it is also a good idea to make a stand-alone ebuild for the
qmail-spp plugins in the tarball i have collected, cleaned up and
tested so far, so we do not need to handle that in the qmail ebuilds..?

> 
> Greets,
> Michael
> 

Bene
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [gentoo-dev] [RFC] qmail.eclass draft
  2007-07-30 14:51           ` Benedikt Boehm
@ 2007-07-30 15:56             ` Michael Hanselmann
  0 siblings, 0 replies; 27+ messages in thread
From: Michael Hanselmann @ 2007-07-30 15:56 UTC (permalink / raw
  To: Benedikt Boehm; +Cc: gentoo-dev

On Mon, Jul 30, 2007 at 04:51:17PM +0200, Benedikt Boehm wrote:
> Yep. Maybe it is also a good idea to make a stand-alone ebuild for the
> qmail-spp plugins in the tarball i have collected, cleaned up and
> tested so far, so we do not need to handle that in the qmail ebuilds..?

That's a great idea. However, can control/smtpplugins take absolute
paths? Otherwise we'd still have to symlink them into
/var/qmail*/plugins.

Greets,
Michael

-- 
http://hansmi.ch/
--
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2007-07-30 16:08 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-13 11:37 [gentoo-dev] [RFC] qmail.eclass draft Benedikt Boehm
2007-07-13 12:34 ` Michael Hanselmann
2007-07-13 12:53   ` Jakub Moc
2007-07-13 15:22     ` William L. Thomson Jr.
2007-07-13 17:05       ` Benedikt Boehm
2007-07-14 20:56         ` Michael Hanselmann
2007-07-14 21:09       ` Michael Hanselmann
2007-07-13 13:04   ` Benedikt Boehm
2007-07-14 21:02     ` Michael Hanselmann
2007-07-15  1:07       ` Benedikt Boehm
2007-07-15 11:19         ` Michael Hanselmann
2007-07-15 19:26           ` Benedikt Boehm
2007-07-13 14:37   ` Petteri Räty
2007-07-14 20:52     ` Michael Hanselmann
2007-07-20  9:52 ` Michael Hanselmann
2007-07-20 20:05   ` Benedikt Boehm
2007-07-20 21:17     ` Michael Hanselmann
2007-07-23 19:55       ` Benedikt Boehm
2007-07-24  9:42         ` Benedikt Boehm
2007-07-23 19:58   ` Benedikt Boehm
2007-07-27 11:08     ` Michael Hanselmann
2007-07-28  2:04       ` Marius Mauch
2007-07-28  5:51         ` [gentoo-dev] " Steve Long
2007-07-30 11:20       ` [gentoo-dev] " Benedikt Boehm
2007-07-30 12:23         ` Michael Hanselmann
2007-07-30 14:51           ` Benedikt Boehm
2007-07-30 15:56             ` Michael Hanselmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox