pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mail/qmail When I added basic DESTDIR support, I intro...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f4e462a5da78
branches:  trunk
changeset: 360026:f4e462a5da78
user:      schmonz <schmonz%pkgsrc.org@localhost>
date:      Mon Mar 20 16:23:19 2017 +0000

description:
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.

diffstat:

 mail/qmail/INSTALL                                            |   5 +-
 mail/qmail/Makefile                                           |  39 ++--------
 mail/qmail/distinfo                                           |   7 +-
 mail/qmail/patches/patch-Makefile                             |   4 +-
 mail/qmail/patches/patch-hier.c                               |  15 ++++
 mail/qmail/patches/patch-pkgsrc__user__destdir__fake__chown.c |  15 ++++
 mail/qmail/patches/patch-pkgsrc__user__destdir__fake__uids.h  |  23 ++++++
 7 files changed, 73 insertions(+), 35 deletions(-)

diffs (207 lines):

diff -r 5e561aa4154c -r f4e462a5da78 mail/qmail/INSTALL
--- a/mail/qmail/INSTALL        Mon Mar 20 16:22:48 2017 +0000
+++ b/mail/qmail/INSTALL        Mon Mar 20 16:23:19 2017 +0000
@@ -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 @@
        ;;
 
 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
 ===========================================================================
diff -r 5e561aa4154c -r f4e462a5da78 mail/qmail/Makefile
--- a/mail/qmail/Makefile       Mon Mar 20 16:22:48 2017 +0000
+++ b/mail/qmail/Makefile       Mon Mar 20 16:23:19 2017 +0000
@@ -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 @@
 
 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+=            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_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 @@
 .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 @@
        ${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
diff -r 5e561aa4154c -r f4e462a5da78 mail/qmail/distinfo
--- a/mail/qmail/distinfo       Mon Mar 20 16:22:48 2017 +0000
+++ b/mail/qmail/distinfo       Mon Mar 20 16:23:19 2017 +0000
@@ -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 @@
 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
diff -r 5e561aa4154c -r f4e462a5da78 mail/qmail/patches/patch-Makefile
--- a/mail/qmail/patches/patch-Makefile Mon Mar 20 16:22:48 2017 +0000
+++ b/mail/qmail/patches/patch-Makefile Mon Mar 20 16:23:19 2017 +0000
@@ -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
diff -r 5e561aa4154c -r f4e462a5da78 mail/qmail/patches/patch-hier.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/qmail/patches/patch-hier.c   Mon Mar 20 16:23:19 2017 +0000
@@ -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"
+ 
diff -r 5e561aa4154c -r f4e462a5da78 mail/qmail/patches/patch-pkgsrc__user__destdir__fake__chown.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/qmail/patches/patch-pkgsrc__user__destdir__fake__chown.c     Mon Mar 20 16:23:19 2017 +0000
@@ -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;
++}
diff -r 5e561aa4154c -r f4e462a5da78 mail/qmail/patches/patch-pkgsrc__user__destdir__fake__uids.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/qmail/patches/patch-pkgsrc__user__destdir__fake__uids.h      Mon Mar 20 16:23:19 2017 +0000
@@ -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