pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/mail/qmail



Module Name:    pkgsrc
Committed By:   schmonz
Date:           Mon Mar 20 16:23:20 UTC 2017

Modified Files:
        pkgsrc/mail/qmail: INSTALL Makefile distinfo
        pkgsrc/mail/qmail/patches: patch-Makefile
Added Files:
        pkgsrc/mail/qmail/patches: patch-hier.c
            patch-pkgsrc__user__destdir__fake__chown.c
            patch-pkgsrc__user__destdir__fake__uids.h

Log Message:
When I added basic DESTDIR support, I introduced a regression: the
source package stopped initializing the queue. (DESTDIR makes source
packages generate binary packages, which had never had that feature. See
<http://mail-index.netbsd.org/pkgsrc-changes/2011/06/07/msg056339.html>
for where the regression was introduced.)

Add a dependency on mail/queue-fix and, if no queue is present at
pkg_add time, initialize it.

Defer creating users and groups all the way to pkg_add time, and improve
DESTDIR support to full "user-destdir". Since mail/postfix lets
unprivileged users install it, we do too. (Can't run a server that way,
but so what.)

A typical (privileged) binary package should now:

1. Install on any other system of matching OS and architecture,
2. Not need matching numeric UIDs and GIDs to do so, and
3. Be usable in production.

You know, like any other binary package.

Bump PKGREVISION.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 pkgsrc/mail/qmail/INSTALL
cvs rdiff -u -r1.77 -r1.78 pkgsrc/mail/qmail/Makefile
cvs rdiff -u -r1.29 -r1.30 pkgsrc/mail/qmail/distinfo
cvs rdiff -u -r1.3 -r1.4 pkgsrc/mail/qmail/patches/patch-Makefile
cvs rdiff -u -r0 -r1.5 pkgsrc/mail/qmail/patches/patch-hier.c
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/mail/qmail/patches/patch-pkgsrc__user__destdir__fake__chown.c \
    pkgsrc/mail/qmail/patches/patch-pkgsrc__user__destdir__fake__uids.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mail/qmail/INSTALL
diff -u pkgsrc/mail/qmail/INSTALL:1.6 pkgsrc/mail/qmail/INSTALL:1.7
--- pkgsrc/mail/qmail/INSTALL:1.6       Fri May 30 21:35:04 2014
+++ pkgsrc/mail/qmail/INSTALL   Mon Mar 20 16:23:19 2017
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.6 2014/05/30 21:35:04 schmonz Exp $
+# $NetBSD: INSTALL,v 1.7 2017/03/20 16:23:19 schmonz Exp $
 
 DOCDIR=@DOCDIR@
 EGDIR=@EGDIR@
@@ -54,6 +54,9 @@ EOF
        ;;
 
 POST-INSTALL)
+       if ! [ -d ${QMAIL_QUEUE_DIR} ] || ! [ -d ${QMAIL_QUEUE_DIR}/info ]; then
+               ${PREFIX}/bin/queue-fix ${QMAIL_QUEUE_DIR}
+       fi
        if ! [ -z ${QMAIL_QUEUE_EXTRA} ]; then
                ${CAT} <<EOF
 ===========================================================================

Index: pkgsrc/mail/qmail/Makefile
diff -u pkgsrc/mail/qmail/Makefile:1.77 pkgsrc/mail/qmail/Makefile:1.78
--- pkgsrc/mail/qmail/Makefile:1.77     Fri Mar 10 03:13:29 2017
+++ pkgsrc/mail/qmail/Makefile  Mon Mar 20 16:23:19 2017
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.77 2017/03/10 03:13:29 schmonz Exp $
+# $NetBSD: Makefile,v 1.78 2017/03/20 16:23:19 schmonz Exp $
 #
 
 DISTNAME=              ${PKGNAME_NOREV}
 PKGNAME=               qmail-1.03
-PKGREVISION=           21
+PKGREVISION=           22
 CATEGORIES=            mail
 MASTER_SITES=          http://qmail.org/
 
@@ -14,6 +14,7 @@ LICENSE=              public-domain
 
 DEPENDS+=              checkpassword-[0-9]*:../../sysutils/checkpassword
 DEPENDS+=              daemontools-[0-9]*:../../sysutils/daemontools
+DEPENDS+=              queue-fix-[0-9]*:../../mail/queue-fix
 DEPENDS+=              ucspi-tcp-[0-9]*:../../net/ucspi-tcp
 
 CONFLICTS+=            courier-maildirmake-[0-9]*
@@ -23,11 +24,8 @@ CONFLICTS+=          mutt<=1.4.2.1nb1
 CONFLICTS+=            netqmail-[0-9]*
 CONFLICTS+=            pulsar<=0.1.1
 
-NOT_FOR_UNPRIVILEGED=  yes
-
 WRKSRC=                        ${WRKDIR}/${DISTNAME}
 
-PKG_DESTDIR_SUPPORT=   destdir
 USE_TOOLS+=            nroff
 
 DJB_CONFIG_CMDS=       ${ECHO} ${DESTDIR:Q}${QMAILDIR:Q} > conf-destdir
@@ -110,7 +108,6 @@ SUBST_SED.paths+=   -e 's,@GREP@,${GREP:Q}
 
 SUBST_FILES.djbware+=  cdb_seek.c dns.c
 
-USERGROUP_PHASE=       pre-install
 PKG_GROUPS=            qmail nofiles
 PKG_USERS+=            alias:nofiles
 PKG_USERS+=            qmaill:nofiles qmaild:nofiles qmailp:nofiles
@@ -120,16 +117,14 @@ PKG_HOME.${user}= ${QMAILDIR}
 .endfor
 PKG_HOME.alias=                ${QMAILDIR}/alias
 
-QMAIL_ROOT_ONLY_READABLES=     qmail-clean qmail-getpw qmail-local qmail-popup
-QMAIL_ROOT_ONLY_READABLES+=    qmail-pw2u qmail-remote qmail-rspawn qmail-send
-QMAIL_ROOT_ONLY_READABLES+=    splogger
-QMAIL_ROOT_ONLY_EVERYTHINGS=   qmail-lspawn qmail-newmrh qmail-newu qmail-start
-
-SPECIAL_PERMS+=                ${PREFIX}/bin/qmail-queue qmailq qmail 4555
-.for f in ${QMAIL_ROOT_ONLY_READABLES}
+SPECIAL_PERMS+=                ${PREFIX}/bin/qmail-queue qmailq qmail 04711
+.for f in qmail-inject qmail-pop3d qmail-qmqpc qmail-qmqpd qmail-qmtpd qmail-qread qmail-qstat qmail-showctl qmail-smtpd qmail-tcpok qmail-tcpto
+SPECIAL_PERMS+=                ${PREFIX}/bin/${f} root qmail 0755
+.endfor
+.for f in qmail-clean qmail-getpw qmail-local qmail-popup qmail-pw2u qmail-remote qmail-rspawn qmail-send splogger
 SPECIAL_PERMS+=                ${PREFIX}/bin/${f} root qmail 0711
 .endfor
-.for f in ${QMAIL_ROOT_ONLY_EVERYTHINGS}
+.for f in qmail-lspawn qmail-newmrh qmail-newu qmail-start
 SPECIAL_PERMS+=                ${PREFIX}/bin/${f} root qmail 0700
 .endfor
 
@@ -159,22 +154,6 @@ pre-install:
        ${LN} -s ${DESTDIR}${EGDIR}/users       ${DESTDIR}${QMAILDIR}/users
 
 post-install: post-install-viruscan
-       # allow packaging as non-root, fix at install time with SPECIAL_PERMS
-       ${CHMOD} 0755 ${DESTDIR}${PREFIX}/bin/qmail-queue
-.      for f in ${QMAIL_ROOT_ONLY_READABLES} ${QMAIL_ROOT_ONLY_EVERYTHINGS}
-         ${CHMOD} 0755 ${DESTDIR}${PREFIX}/bin/${f}
-.      endfor
-       # qmail's installer sets strange permissions, set them back
-.      for i in bin boot
-         ${CHGRP} ${BINGRP} ${DESTDIR}${QMAILDIR}/${i}
-.      endfor
-.      for i in doc
-         ${CHGRP} ${SHAREGRP} ${DESTDIR}${QMAILDIR}/${i}
-.      endfor
-.      for i in ${MANDIRS}
-         ${CHGRP} ${MANGRP} ${DESTDIR}${QMAILDIR}/${i}
-.      endfor
-
        ${INSTALL_DATA} ${WRKSRC}/README.pkgsrc ${DESTDIR}${DOCDIR}
 
        ${INSTALL_PROGRAM_DIR} ${DESTDIR}${SHAREDIR}/setup

Index: pkgsrc/mail/qmail/distinfo
diff -u pkgsrc/mail/qmail/distinfo:1.29 pkgsrc/mail/qmail/distinfo:1.30
--- pkgsrc/mail/qmail/distinfo:1.29     Fri Mar 10 03:13:29 2017
+++ pkgsrc/mail/qmail/distinfo  Mon Mar 20 16:23:19 2017
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.29 2017/03/10 03:13:29 schmonz Exp $
+$NetBSD: distinfo,v 1.30 2017/03/20 16:23:19 schmonz Exp $
 
 SHA1 (qmail-1.03.tar.gz) = 18fb960481291a0503e93a94df3f6094edb7f27a
 RMD160 (qmail-1.03.tar.gz) = b851f273f1d365d38efd949b1efcf35768ffa30f
@@ -40,8 +40,11 @@ SHA1 (qmail-smtpd-viruscan-logging.patch
 RMD160 (qmail-smtpd-viruscan-logging.patch) = 79631cb7b5b120f98397011c4fb94726c48b83e4
 SHA512 (qmail-smtpd-viruscan-logging.patch) = 6441dfb5dd8951a765d7172f44420d691976f4aa13c77ef16c459c6457cf32086a730278350bcb801ed4c986cbafa3c7a483c399ed073c02d53ad2ea18781efe
 Size (qmail-smtpd-viruscan-logging.patch) = 2157 bytes
-SHA1 (patch-Makefile) = bd2b4bc966767df6e4b700213201fe2d38ca82aa
+SHA1 (patch-Makefile) = 7ab7c2893393f42d8587a14a2d0c86c09e60061a
 SHA1 (patch-auto__uids.c) = f900b61e047eb8776e5ff2e0381f2a53d49fafad
 SHA1 (patch-auto__uids.h) = 5041dc91e51fc8413c0bf5e83c3d6b423f71cf86
+SHA1 (patch-hier.c) = 7578a0977f168e337748773d63e57504bf7bf075
+SHA1 (patch-pkgsrc__user__destdir__fake__chown.c) = 3897b81327ca5c59503199d08dd6ed5cdc6a531a
+SHA1 (patch-pkgsrc__user__destdir__fake__uids.h) = 139f6cf38c1b928265a16bd3335b8ce6d7563f96
 SHA1 (patch-spawn.c) = aad06c4ed3ad4bd0e500ab561d7f7307c19e3283
 SHA1 (patch-strerr_sys.c) = 15e6466c655058664cb660e5e12232bf45010814

Index: pkgsrc/mail/qmail/patches/patch-Makefile
diff -u pkgsrc/mail/qmail/patches/patch-Makefile:1.3 pkgsrc/mail/qmail/patches/patch-Makefile:1.4
--- pkgsrc/mail/qmail/patches/patch-Makefile:1.3        Fri Mar 10 03:13:29 2017
+++ pkgsrc/mail/qmail/patches/patch-Makefile    Mon Mar 20 16:23:20 2017
@@ -1,6 +1,6 @@
-$NetBSD: patch-Makefile,v 1.3 2017/03/10 03:13:29 schmonz Exp $
+$NetBSD: patch-Makefile,v 1.4 2017/03/20 16:23:20 schmonz Exp $
 
-DESTDIR support.
+DESTDIR support, and don't hardcode numeric IDs into binaries.
 
 --- Makefile.orig      1998-06-15 10:53:16.000000000 +0000
 +++ Makefile

Added files:

Index: pkgsrc/mail/qmail/patches/patch-hier.c
diff -u /dev/null pkgsrc/mail/qmail/patches/patch-hier.c:1.5
--- /dev/null   Mon Mar 20 16:23:20 2017
+++ pkgsrc/mail/qmail/patches/patch-hier.c      Mon Mar 20 16:23:20 2017
@@ -0,0 +1,15 @@
+$NetBSD: patch-hier.c,v 1.5 2017/03/20 16:23:20 schmonz Exp $
+
+Install files without needing real qmail users to exist yet.
+
+--- hier.c.orig        1998-06-15 10:53:16.000000000 +0000
++++ hier.c
+@@ -1,6 +1,7 @@
+ #include "auto_qmail.h"
+ #include "auto_split.h"
+-#include "auto_uids.h"
++#include "pkgsrc_user_destdir_fake_uids.h"
++#include "pkgsrc_user_destdir_fake_chown.c"
+ #include "fmt.h"
+ #include "fifo.h"
+ 

Index: pkgsrc/mail/qmail/patches/patch-pkgsrc__user__destdir__fake__chown.c
diff -u /dev/null pkgsrc/mail/qmail/patches/patch-pkgsrc__user__destdir__fake__chown.c:1.1
--- /dev/null   Mon Mar 20 16:23:20 2017
+++ pkgsrc/mail/qmail/patches/patch-pkgsrc__user__destdir__fake__chown.c        Mon Mar 20 16:23:20 2017
@@ -0,0 +1,15 @@
+$NetBSD: patch-pkgsrc__user__destdir__fake__chown.c,v 1.1 2017/03/20 16:23:20 schmonz Exp $
+
+Install files without needing real qmail users to exist yet.
+
+--- pkgsrc_user_destdir_fake_chown.c.orig      2017-03-20 13:51:05.000000000 +0000
++++ pkgsrc_user_destdir_fake_chown.c
+@@ -0,0 +1,8 @@
++int chown(path,owner,group)
++const char *path;
++unsigned int owner;
++unsigned int group;
++{
++  /* pkgsrc: can't chown in stage-install, will chown on install */
++  return 0;
++}
Index: pkgsrc/mail/qmail/patches/patch-pkgsrc__user__destdir__fake__uids.h
diff -u /dev/null pkgsrc/mail/qmail/patches/patch-pkgsrc__user__destdir__fake__uids.h:1.1
--- /dev/null   Mon Mar 20 16:23:20 2017
+++ pkgsrc/mail/qmail/patches/patch-pkgsrc__user__destdir__fake__uids.h Mon Mar 20 16:23:20 2017
@@ -0,0 +1,23 @@
+$NetBSD: patch-pkgsrc__user__destdir__fake__uids.h,v 1.1 2017/03/20 16:23:20 schmonz Exp $
+
+Install files without needing real qmail users to exist yet.
+
+--- pkgsrc_user_destdir_fake_uids.h.orig       2017-03-20 13:49:34.000000000 +0000
++++ pkgsrc_user_destdir_fake_uids.h
+@@ -0,0 +1,16 @@
++#ifndef AUTO_UIDS_H
++#define AUTO_UIDS_H
++
++#define auto_uido  0
++#define auto_uida  1
++#define auto_uidd  2
++#define auto_uidl  3
++#define auto_uidp  4
++#define auto_uidq  5
++#define auto_uidr  6
++#define auto_uids  7
++
++#define auto_gidq  8
++#define auto_gidn  9
++
++#endif



Home | Main Index | Thread Index | Old Index