pkgsrc/mail/gld/Makefile
jlam 4390d56940 Make it easier to build and install packages "unprivileged", where
the owner of all installed files is a non-root user.  This change
affects most packages that require special users or groups by making
them use the specified unprivileged user and group instead.

(1) Add two new variables PKG_GROUPS_VARS and PKG_USERS_VARS to
    unprivileged.mk.  These two variables are lists of other bmake
    variables that define package-specific users and groups.  Packages
    that have user-settable variables for users and groups, e.g. apache
    and APACHE_{USER,GROUP}, courier-mta and COURIER_{USER,GROUP},
    etc., should list these variables in PKG_USERS_VARS and PKG_GROUPS_VARS
    so that unprivileged.mk can know to set them to ${UNPRIVILEGED_USER}
    and ${UNPRIVILEGED_GROUP}.

(2) Modify packages to use PKG_GROUPS_VARS and PKG_USERS_VARS.
2007-07-04 20:54:31 +00:00

42 lines
1.1 KiB
Makefile

# $NetBSD: Makefile,v 1.23 2007/07/04 20:54:43 jlam Exp $
#
DISTNAME= gld-1.7
CATEGORIES= mail
MASTER_SITES= http://www.gasmi.net/down/
EXTRACT_SUFX= .tgz
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://www.gasmi.net/
COMMENT= Standalone greylisting server for Postfix
GNU_CONFIGURE= yes
LDFLAGS.SunOS+= -lsocket -lnsl -lresolv
EGDIR= ${PREFIX}/share/examples/${PKGBASE}
CONF_FILES_PERMS= ${EGDIR}/gld.conf ${PKG_SYSCONFDIR}/gld.conf \
${BINOWN} ${GLD_GROUP} 0640
RCD_SCRIPTS= gld
GLD_USER?= gld
GLD_GROUP?= gld
PKG_GROUPS= ${GLD_GROUP}
PKG_USERS= ${GLD_USER}:${GLD_GROUP}
PKG_GECOS.${GLD_USER}= Greylisting Daemon user
PKG_GROUPS_VARS+= GLD_GROUP
PKG_USERS_VARS+= GLD_USER
SUBST_CLASSES+= gld users
SUBST_STAGE.gld= post-patch
SUBST_FILES.gld= gld.h
SUBST_SED.gld= -e "s,/etc,${PKG_SYSCONFDIR},"
SUBST_MESSAGE.gld= Fixing harcoded paths.
SUBST_STAGE.users= post-patch
SUBST_FILES.users= gld.conf
SUBST_SED.users+= -e "s|^USER=nobody|USER=${GLD_USER}|"
SUBST_SED.users+= -e "s|^GROUP=nobody|GROUP=${GLD_GROUP}|"
SUBST_MESSAGE.users= Adjusting user/group in configuration file.
.include "options.mk"
.include "../../mk/bsd.pkg.mk"