From 19760f48f03025850b7799a8c5f157db13c8b25c Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Mon, 18 Jul 2011 20:55:29 +0000 Subject: - Make qmail use USERS and GROUPS [1] - Add my local_distfiles as a MASTER_SITES to ucspi-ssl PR: ports/157622 [1] Submitted by: crees [1] --- mail/qmail-ldap/Makefile | 3 ++ mail/qmail-spamcontrol/Makefile | 4 ++- mail/qmail/Makefile | 19 ++++++----- mail/qmail/files/patch-Makefile | 31 +++++++++++++++++ mail/qmail/files/patch-auto_uids-c-dist | 16 +++++++++ mail/qmail/files/pkg-install.in | 60 +-------------------------------- 6 files changed, 65 insertions(+), 68 deletions(-) create mode 100644 mail/qmail/files/patch-Makefile create mode 100644 mail/qmail/files/patch-auto_uids-c-dist (limited to 'mail') diff --git a/mail/qmail-ldap/Makefile b/mail/qmail-ldap/Makefile index f5c826f8006d..30eb47ea17ef 100644 --- a/mail/qmail-ldap/Makefile +++ b/mail/qmail-ldap/Makefile @@ -19,6 +19,9 @@ RUN_DEPENDS= ${LOCALBASE}/bin/svscan:${PORTSDIR}/sysutils/daemontools \ CONFLICTS= emboss-[0-9]* digest-[0-9]* qmail-[0-9]* qmail-mysql-[0-9]* \ qmail-spamcontrol-[0-9]* qmail-tls-[0-9]* +EXTRA_PATCHES+= ${MASTERDIR}/files/patch-Makefile \ + ${MASTERDIR}/files/patch-auto_uids-c-dist + USE_OPENLDAP= yes SLAVE_LDAP= yes diff --git a/mail/qmail-spamcontrol/Makefile b/mail/qmail-spamcontrol/Makefile index 4f68fff0ded8..2d6436d167e8 100644 --- a/mail/qmail-spamcontrol/Makefile +++ b/mail/qmail-spamcontrol/Makefile @@ -20,7 +20,9 @@ COMMENT= Qmail MTA with SpamControl patches CONFLICTS= qmail-[0-9]* qmail-ldap-[0-9]* qmail-mysql-[0-9]* qmail-tls-[0-9]* -EXTRA_PATCHES+= ${MASTERDIR}/files/patch-install.c +EXTRA_PATCHES+= ${MASTERDIR}/files/patch-install.c \ + ${MASTERDIR}/files/patch-Makefile \ + ${MASTERDIR}/files/patch-auto_uids-c-dist # Distfiles QMAIL_DIST= ${PORTNAME}-${QMAIL_VERSION}${EXTRACT_SUFX} diff --git a/mail/qmail/Makefile b/mail/qmail/Makefile index 6ef3844fa617..a204e823bde1 100644 --- a/mail/qmail/Makefile +++ b/mail/qmail/Makefile @@ -26,6 +26,12 @@ MAKE_JOBS_UNSAFE= yes PORTSCOUT= skipv:1.04 +USERS= alias +.for usersuffix in d l p q r s +USERS+= ${PORTNAME}${usersuffix} +.endfor +GROUPS= ${PORTNAME} qnofiles + .if defined(SLAVE_LDAP) || \ defined(SLAVE_MYSQL) BARRIER_MAILDIRQUOTA_PATCH= yes @@ -246,10 +252,8 @@ SLAVEPORT_LINE= ${PKGMESSAGE_SUFFIX} SLAVEPORT_LINE= spamcontrol .endif -SUB_FILES+= mailer.conf.sample bootfiles.sed enable-qmail -SUB_LIST+= ECHO_CMD=${ECHO_CMD} -# pkg-install could not be added to SUB_FILES because it's executed on do-configure: -PKGINSTALL?= ${WRKDIR}/pkg-install +SUB_FILES+= mailer.conf.sample bootfiles.sed enable-qmail pkg-install +SUB_LIST+= ECHO_CMD=${ECHO_CMD} RCDLINK=${RCDLINK} .if defined(PKGMESSAGE_SUFFIX) SUB_FILES+= pkg-message-${PKGMESSAGE_SUFFIX} @@ -512,9 +516,11 @@ PATCHFILES+= enhacelogging-ldap-${LDAP_PATCH_DATE}_4.patch:ldapenhacelog .endif .if defined(SLAVE_SPAMCONTROL) -MASTER_SITES+= http://www.superscript.com/ucspi-ssl/:ucspi_ssl \ +MASTER_SITES+= ${MASTER_SITE_LOCAL:S/$/:ucspi_ssl/} \ + http://www.superscript.com/ucspi-ssl/:ucspi_ssl \ http://dev.qmailrocks.org/downloads/qmailrocks_3.0-beta/:ucspi_ssl \ ${MASTER_SITE_GENTOO:S/$/:ucspi_ssl/} +MASTER_SITE_SUBDIR+= garga/ucspi-ssl/:ucspi_ssl DISTFILES+= ucspi-ssl-0.70.tar.gz:ucspi_ssl MASTER_SITES+= http://www.fehcom.de/qmail/spamcontrol/:ucspi_ssl_patch @@ -724,9 +730,6 @@ post-patch: .endif do-configure: - @${SED} -e 's,%%RCDLINK%%,${RCDLINK},g; s,%%LOCALBASE%%,${LOCALBASE},g' \ - ${FILESDIR}/pkg-install.in > ${WRKDIR}/pkg-install - @${SETENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL @${ECHO_CMD} "${CC} ${CFLAGS}" > ${WRKSRC}/conf-cc @${ECHO_CMD} ${PREFIX} > ${WRKSRC}/conf-qmail .if defined(WITH_BIG_CONCURRENCY_PATCH) \ diff --git a/mail/qmail/files/patch-Makefile b/mail/qmail/files/patch-Makefile new file mode 100644 index 000000000000..bfdf0117b7f5 --- /dev/null +++ b/mail/qmail/files/patch-Makefile @@ -0,0 +1,31 @@ +$FreeBSD$ + +This turns off the auto-finding of UIDs -- we shouldn't have the users +until pre-install! + +We use a new file, auto_uids.c.dist to record our UIDs + +--- Makefile.orig 2011-06-05 10:00:58.752481173 +0100 ++++ Makefile 2011-06-05 10:04:27.265135390 +0100 +@@ -110,19 +110,8 @@ + compile auto_split.c + ./compile auto_split.c + +-auto_uids.c: \ +-auto-uid auto-gid conf-users conf-groups +- ( ./auto-uid auto_uida `head -1 conf-users` \ +- &&./auto-uid auto_uidd `head -2 conf-users | tail -1` \ +- &&./auto-uid auto_uidl `head -3 conf-users | tail -1` \ +- &&./auto-uid auto_uido `head -4 conf-users | tail -1` \ +- &&./auto-uid auto_uidp `head -5 conf-users | tail -1` \ +- &&./auto-uid auto_uidq `head -6 conf-users | tail -1` \ +- &&./auto-uid auto_uidr `head -7 conf-users | tail -1` \ +- &&./auto-uid auto_uids `head -8 conf-users | tail -1` \ +- &&./auto-gid auto_gidq `head -1 conf-groups` \ +- &&./auto-gid auto_gidn `head -2 conf-groups | tail -1` \ +- ) > auto_uids.c.tmp && mv auto_uids.c.tmp auto_uids.c ++auto_uids.c: ++ mv auto_uids.c.dist auto_uids.c + + auto_uids.o: \ + compile auto_uids.c diff --git a/mail/qmail/files/patch-auto_uids-c-dist b/mail/qmail/files/patch-auto_uids-c-dist new file mode 100644 index 000000000000..c9729aa46d71 --- /dev/null +++ b/mail/qmail/files/patch-auto_uids-c-dist @@ -0,0 +1,16 @@ +--- /dev/null 1970-01-01 01:00:00.000000000 +0100 ++++ auto_uids.c.dist 2011-06-05 10:29:16.425936277 +0100 +@@ -0,0 +1,13 @@ ++/* These values are hard-coded here, which looks bad until you * ++ * realise that they're hard-coded in ${PORTSDIR}/?IDs anyway. */ ++/* $FreeBSD$ */ ++int auto_uida = 81; ++int auto_uidd = 82; ++int auto_uidl = 83; ++int auto_uido = 0; ++int auto_uidp = 84; ++int auto_uidq = 85; ++int auto_uidr = 86; ++int auto_uids = 87; ++int auto_gidq = 82; ++int auto_gidn = 81; diff --git a/mail/qmail/files/pkg-install.in b/mail/qmail/files/pkg-install.in index c6dd258e00d2..1e97b019ccde 100644 --- a/mail/qmail/files/pkg-install.in +++ b/mail/qmail/files/pkg-install.in @@ -6,66 +6,8 @@ export PATH=/bin:/sbin:/usr/bin:/usr/sbin PREFIX=${PKG_PREFIX:-%%PREFIX%%} -UID=`id -u` -addGroup() { - NGROUP=$1 - NGID=$2 - - if ! pw groupshow ${NGROUP} >/dev/null 2>&1; then - if ! pw groupadd ${NGROUP} -g ${NGID} >/dev/null 2>&1; then - echo "Failed to add group '${NGROUP}' as gid '${NGID}'" - exit 1 - fi - fi - - CHECKGID=`pw groupshow ${NGROUP} 2>/dev/null | cut -d: -f3` - if [ "${CHECKGID}" != "${NGID}" ]; then - echo "Group '$NGROUP' should have gid '$NGID'" - exit 1 - fi -} - -addUser() { - NUSER=$1 - NUID=$2 - NGROUP=$3 - NHOME=${4:-${PREFIX}} - - if ! pw usershow ${NUSER} >/dev/null 2>&1; then - if ! pw useradd ${NUSER} -g ${NGROUP} -d ${NHOME} -s /nonexistent -u ${NUID} >/dev/null 2>&1; then - echo "Failed to add user '${NUSER}' as uid '${NUID}'" - exit 1 - fi - fi - - CHECKUID=`pw usershow ${NUSER} 2>/dev/null | cut -d: -f3` - if [ "${CHECKUID}" != "${NUID}" ]; then - echo "User '$NUSER' should have uid '$NUID'" - exit 1 - fi -} - -if [ "$UID" != "0" ]; then - echo "It is necessary to add missing qmail users/groups at" - echo "this stage. Please either add them manually or retry" - echo "as root." - exit 1 -fi - -if [ "$2" = "PRE-INSTALL" ]; then - addGroup qmail 82 - addGroup qnofiles 81 - - addUser alias 81 qnofiles ${PREFIX}/alias - addUser qmaild 82 qnofiles - addUser qmaill 83 qnofiles - addUser qmailp 84 qnofiles - addUser qmailq 85 qmail - addUser qmailr 86 qmail - addUser qmails 87 qmail - -elif [ "$2" = "POST-INSTALL" ]; then +if [ "$2" = "POST-INSTALL" ]; then ${PREFIX}/configure/install x [ -e ${PREFIX}/control/me ] || (cd ${PREFIX}/configure && ./config) -- cgit v1.2.3