diff options
author | Florent Thoumie <flz@FreeBSD.org> | 2009-09-06 21:18:50 +0000 |
---|---|---|
committer | Florent Thoumie <flz@FreeBSD.org> | 2009-09-06 21:18:50 +0000 |
commit | 80ce349ead781fafb5528d69310848254d4afbf8 (patch) | |
tree | 9e4543908f3bf06a3af78267b4523928d41925b9 | |
parent | 082f117cfc49edb878d4e17e43719ab6e461af0b (diff) |
Notes
-rw-r--r-- | Mk/bsd.port.mk | 90 | ||||
-rw-r--r-- | audio/pulseaudio/Makefile | 8 | ||||
-rw-r--r-- | audio/pulseaudio/pkg-install | 63 | ||||
-rw-r--r-- | devel/dbus/Makefile | 5 | ||||
-rw-r--r-- | devel/dbus/pkg-install | 27 | ||||
-rw-r--r-- | sysutils/hal/Makefile | 5 | ||||
-rw-r--r-- | sysutils/hal/files/pkg-install.in | 27 | ||||
-rw-r--r-- | sysutils/policykit/Makefile | 5 | ||||
-rw-r--r-- | sysutils/policykit/pkg-install | 27 | ||||
-rw-r--r-- | x11/gdm/Makefile | 5 | ||||
-rw-r--r-- | x11/gdm/pkg-install | 30 |
11 files changed, 108 insertions, 184 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk index ddb207946dd2..d74c57f4a8b0 100644 --- a/Mk/bsd.port.mk +++ b/Mk/bsd.port.mk @@ -593,6 +593,10 @@ FreeBSD_MAINTAINER= portmgr@FreeBSD.org # Default: ${MASTERDIR}/files # PKGDIR - A directory containing any package creation files. # Default: ${MASTERDIR} +# UID_FILES - A list of files containing information about registered UIDs. +# Note that files have decreasing priority. +# GID_FILES - A list of files containing information about registered GIDs. +# Note that files have decreasing priority. # # Variables that serve as convenient "aliases" for your *-install targets. # Use these like: "${INSTALL_PROGRAM} ${WRKSRC}/prog ${PREFIX}/bin". @@ -1027,6 +1031,11 @@ FreeBSD_MAINTAINER= portmgr@FreeBSD.org # Default: ${PREFIX}/www/${PORTNAME} # WWWDIR_REL - The WWWDIR relative to ${PREFIX} # +# USERS - List of users to create at install time. Each login must have a +# corresponding entry in ${UID_FILES}. +# GROUPS - List of groups to create at install time. Each group must have a +# corresponding entry in ${GID_FILES}. +# # DESKTOPDIR - Name of the directory to install ${DESKTOP_ENTRIES} in. # Default: ${PREFIX}/share/applications # DESKTOP_ENTRIES @@ -1256,6 +1265,11 @@ USE_SUBMAKE= yes # where 'make config' records user configuration options PORT_DBDIR?= /var/db/ports +UID_FILES?= ${PORTSDIR}/UIDs +GID_FILES?= ${PORTSDIR}/GIDs +UID_OFFSET?= 0 +GID_OFFSET?= 0 + LDCONFIG_DIR= libdata/ldconfig LDCONFIG32_DIR= libdata/ldconfig32 @@ -4003,6 +4017,78 @@ install-ldconfig-file: .endif .endif +.if !target(create-users-groups) +create-users-groups: +.if defined(GROUPS) || defined(USERS) +.if defined(GROUPS) +.for _file in ${GID_FILES} +.if !exists(${_file}) + @${ECHO_CMD} "** ${_file} doesn't exist. Exiting."; exit 1 +.endif +.endfor + @${ECHO_MSG} "===> Creating users and/or groups." +.for _group in ${GROUPS} +# _bgpd:*:130: + @if ! ${GREP} -h ^${_group}: ${GID_FILES} >/dev/null 2>&1; then \ + ${ECHO_CMD} "** Cannot find any information about group \`${_group}' in ${GID_FILES}."; \ + exit 1; \ + fi + @IFS=":"; ${GREP} -h ^${_group}: ${GID_FILES} | head -n 1 | while read group foo gid members; do \ + gid=$$(($$gid+${GID_OFFSET}));\ + if ! ${PW} groupshow $$group >/dev/null 2>&1; then \ + ${ECHO_MSG} "Creating group \`$$group' with gid \`$$gid'."; \ + ${PW} groupadd $$group -g $$gid; \ + else \ + ${ECHO_MSG} "Using existing group \`$$group'."; \ + fi; \ + ${ECHO_CMD} "@exec if ! ${PW} groupshow $$group >/dev/null 2>&1; then ${PW} groupadd $$group -g $$gid; fi" >> ${TMPPLIST}; \ + done +.endfor +.endif +.if defined(USERS) +.for _file in ${UID_FILES} +.if !exists(${_file}) + @${ECHO_CMD} "** ${_file} doesn't exist. Exiting."; exit 1 +.endif +.endfor +.for _user in ${USERS} +# _bgpd:*:130:130:BGP Daemon:/var/empty:/sbin/nologin + @if ! ${GREP} -h ^${_user}: ${UID_FILES} >/dev/null 2>&1; then \ + ${ECHO_CMD} "** Cannot find any information about user \`${_user}' in ${UID_FILES}."; \ + exit 1; \ + fi + @IFS=":"; ${GREP} -h ^${_user}: ${UID_FILES} | head -n 1 | while read login passwd uid gid class change expire gecos homedir shell; do \ + uid=$$(($$uid+${UID_OFFSET}));\ + gid=$$(($$gid+${GID_OFFSET}));\ + if ! ${PW} usershow $$login >/dev/null 2>&1; then \ + ${ECHO_MSG} "Creating user \`$$login' with uid \`$$uid'."; \ + ${PW} useradd $$login -u $$uid -g $$gid -c "$$gecos" -d $$homedir -s $$shell; \ + else \ + ${ECHO_MSG} "Using existing user \`$$login'."; \ + fi; \ + ${ECHO_CMD} "@exec if ! ${PW} usershow $$login >/dev/null 2>&1; then ${PW} useradd $$login -u $$uid -g $$gid -c \"$$gecos\" -d $$homedir -s $$shell; fi" >> ${TMPPLIST}; \ + done +.endfor +.if defined(GROUPS) +.for _group in ${GROUPS} +# _bgpd:*:130: + @IFS=":"; ${GREP} -h ^${_group}: ${GID_FILES} | head -n 1 | while read group foo gid members; do \ + gid=$$(($$gid+${GID_OFFSET}));\ + IFS=","; for _login in $$members; do \ + list=`${PW} usershow $${_login} -P | ${SED} -ne 's/.*Groups: //p'`; \ + ${ECHO_MSG} "Setting \`$${_login}' groups to \`$$list$${list:+,}${_group}'."; \ + ${PW} usermod $${_login} -G $$list$${list:+,}${_group}; \ + ${ECHO_CMD} "@exec list=\`${PW} usershow $${_login} -P | ${SED} -ne 's/.*Groups: //p'\`; ${PW} usermod $${_login} -G \$${list},${_group}" >> ${TMPPLIST}; \ + done; \ + done +.endfor +.endif +.endif +.else + @${DO_NADA} +.endif +.endif + .if !defined(DISABLE_SECURITY_CHECK) .if !target(security-check) .if !defined(OLD_SECURITY_CHECK) @@ -4187,8 +4273,8 @@ _INSTALL_SEQ= install-message check-conflicts \ pre-install-script generate-plist check-already-installed _INSTALL_SUSEQ= check-umask install-mtree pre-su-install \ pre-su-install-script do-install install-desktop-entries \ - post-install post-install-script add-plist-info \ - add-plist-docs add-plist-examples add-plist-data \ + create-users-groups post-install post-install-script \ + add-plist-info add-plist-docs add-plist-examples add-plist-data \ add-plist-post install-rc-script compress-man \ install-ldconfig-file fake-pkg security-check _PACKAGE_DEP= install diff --git a/audio/pulseaudio/Makefile b/audio/pulseaudio/Makefile index aa0fa5bb9911..3889fa8fcb46 100644 --- a/audio/pulseaudio/Makefile +++ b/audio/pulseaudio/Makefile @@ -8,7 +8,7 @@ PORTNAME= pulseaudio PORTVERSION= 0.9.15 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= audio MASTER_SITES= http://0pointer.de/lennart/projects/${PORTNAME}/ @@ -41,6 +41,9 @@ CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \ CONFIGURE_ARGS= --localstatedir=/var \ --disable-lirc # untested +USERS= pulse +GROUPS= pulse pulse-access pulse-rt + OPTIONS= JACK "JACK audio support" Off \ AVAHI "Enable Avahi mDNS support" On \ HAL "Enable HAL support" On \ @@ -114,9 +117,6 @@ post-install: ${INSTALL_DATA} ${WRKSRC}/src/${ii} \ ${PREFIX}/etc/pulse/${ii}-dist .endfor -.if !defined(PACKAGE_BUILDING) - @${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL -.endif @${CAT} ${PKGMESSAGE} .include <bsd.port.post.mk> diff --git a/audio/pulseaudio/pkg-install b/audio/pulseaudio/pkg-install deleted file mode 100644 index 118fd3ef2bba..000000000000 --- a/audio/pulseaudio/pkg-install +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/sh - -case $2 in -POST-INSTALL) - RGROUP=pulse-rt - SUSER=pulse - SGROUP=${SUSER} - AGROUP=pulse-access - SUID=563 - RGID=557 - SGID=${SUID} - AGID=564 - PW=/usr/sbin/pw - - if ${PW} group show "${RGROUP}" 2>/dev/null; then - echo "You already have a group \"${RGROUP}\", so I will use it." - else - if ${PW} groupadd ${RGROUP} -g ${RGID}; then - echo "Added group \"${RGROUP}\"." - else - echo "Adding group \"${RGROUP}\" failed..." - exit 1 - fi - fi - - if ${PW} group show "${SGROUP}" 2>/dev/null; then - echo "You already have a group \"${SGROUP}\", so I will use it." - else - if ${PW} groupadd ${SGROUP} -g ${SGID}; then - echo "Added group \"${SGROUP}\"." - else - echo "Adding group \"${SGROUP}\" failed..." - exit 1 - fi - fi - - if ${PW} group show "${AGROUP}" 2>/dev/null; then - echo "You already have a group \"${AGROUP}\", so I will use it." - else - if ${PW} groupadd ${AGROUP} -g ${AGID}; then - echo "Added group \"${AGROUP}\"." - else - echo "Adding group \"${AGROUP}\" failed..." - exit 1 - fi - fi - - if ${PW} user show "${SUSER}" 2>/dev/null; then - echo "You already have a user \"${SUSER}\", so I will use it." - else - if ${PW} useradd ${SUSER} -u ${SUID} -g ${SGROUP} -h - \ - -d "/nonexistent" -s /sbin/nologin -c "PulseAudio System User" - then - echo "Added user \"${SUSER}\"." - else - echo "Adding user \"${SUSER}\" failed..." - exit 1 - fi - fi - echo "" - exit 0 - ;; -esac diff --git a/devel/dbus/Makefile b/devel/dbus/Makefile index 6b9dffbe4eb5..39c8a33cf3f1 100644 --- a/devel/dbus/Makefile +++ b/devel/dbus/Makefile @@ -7,7 +7,7 @@ PORTNAME= dbus PORTVERSION?= 1.2.4.6 -PORTREVISION?= 0 +PORTREVISION?= 1 CATEGORIES= devel gnome MASTER_SITES= http://dbus.freedesktop.org/releases/dbus/ DISTNAME= dbus-${PORTVERSION}permissive @@ -36,6 +36,9 @@ CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \ USE_RC_SUBR= dbus USE_GNOME_SUBR= yes +USERS= messagebus +GROUPS= messagebus + PLIST_SUB= VERSION="1.0" MAN1= dbus-cleanup-sockets.1 dbus-daemon.1 dbus-launch.1 \ diff --git a/devel/dbus/pkg-install b/devel/dbus/pkg-install index 4ed46afa771a..5ad0a1f8429c 100644 --- a/devel/dbus/pkg-install +++ b/devel/dbus/pkg-install @@ -4,33 +4,6 @@ case $2 in POST-INSTALL) USER=messagebus GROUP=${USER} - UID=556 - GID=${UID} - PW=/usr/sbin/pw - - if ${PW} group show "${GROUP}" 2>/dev/null; then - echo "You already have a group \"${GROUP}\", so I will use it." - else - if ${PW} groupadd ${GROUP} -g ${GID}; then - echo "Added group \"${GROUP}\"." - else - echo "Adding group \"${GROUP}\" failed..." - exit 1 - fi - fi - - if ${PW} user show "${USER}" 2>/dev/null; then - echo "You already have a user \"${USER}\", so I will use it." - else - if ${PW} useradd ${USER} -u ${UID} -g ${GROUP} -h - \ - -d "/nonexistent" -s /sbin/nologin -c "D-BUS Daemon User" - then - echo "Added user \"${USER}\"." - else - echo "Adding user \"${USER}\" failed..." - exit 1 - fi - fi /usr/bin/install -d -o ${USER} -g ${GROUP} /var/run/dbus /usr/bin/install -d -o ${USER} -g ${GROUP} /var/db/dbus diff --git a/sysutils/hal/Makefile b/sysutils/hal/Makefile index a0ed228cd194..c83611bfa3b3 100644 --- a/sysutils/hal/Makefile +++ b/sysutils/hal/Makefile @@ -8,7 +8,7 @@ PORTNAME= hal DISTVERSION= 0.5.11 -PORTREVISION= 25 +PORTREVISION= 26 CATEGORIES= sysutils MASTER_SITES= http://hal.freedesktop.org/releases/ @@ -50,6 +50,9 @@ CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include -DHAVE_CK_0_3" \ #HALVERSION= 0.5.10 #SNAPVERSION= 20080218 +USERS= haldaemon +GROUPS= haldaemon + USE_RC_SUBR= hald USE_GNOME_SUBR= yes DOCSDIR= ${PREFIX}/share/doc/${PORTNAME}-${DISTVERSION} diff --git a/sysutils/hal/files/pkg-install.in b/sysutils/hal/files/pkg-install.in index 59505fc30505..253eef1f0e62 100644 --- a/sysutils/hal/files/pkg-install.in +++ b/sysutils/hal/files/pkg-install.in @@ -4,33 +4,6 @@ case $2 in POST-INSTALL) USER=haldaemon GROUP=${USER} - UID=560 - GID=${UID} - PW=/usr/sbin/pw - - if ${PW} group show "${GROUP}" 2>/dev/null; then - echo "You already have a group \"${GROUP}\", so I will use it." - else - if ${PW} groupadd ${GROUP} -g ${GID}; then - echo "Added group \"${GROUP}\"." - else - echo "Adding group \"${GROUP}\" failed..." - exit 1 - fi - fi - - if ${PW} user show "${USER}" 2>/dev/null; then - echo "You already have a user \"${USER}\", so I will use it." - else - if ${PW} useradd ${USER} -u ${UID} -g ${GROUP} -h - \ - -d "/nonexistent" -s /sbin/nologin -c "HAL Daemon User" - then - echo "Added user \"${USER}\"." - else - echo "Adding user \"${USER}\" failed..." - exit 1 - fi - fi /usr/bin/install -d -o ${USER} -g ${GROUP} /var/run/hald /usr/bin/install -d -o ${USER} -g ${GROUP} /var/cache/hald diff --git a/sysutils/policykit/Makefile b/sysutils/policykit/Makefile index c784bead4d8d..a43749208604 100644 --- a/sysutils/policykit/Makefile +++ b/sysutils/policykit/Makefile @@ -8,7 +8,7 @@ PORTNAME= policykit PORTVERSION= 0.9 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= sysutils gnome MASTER_SITES= http://hal.freedesktop.org/releases/ DISTNAME= PolicyKit-${PORTVERSION} @@ -19,6 +19,9 @@ COMMENT= Framework for controlling access to system-wide components LIB_DEPENDS= dbus-glib-1.2:${PORTSDIR}/devel/dbus-glib \ expat.6:${PORTSDIR}/textproc/expat2 +USERS= polkit +GROUPS= polkit + USE_GNOME= gnomehack glib20 intlhack USE_GMAKE= yes GNU_CONFIGURE= yes diff --git a/sysutils/policykit/pkg-install b/sysutils/policykit/pkg-install index 132e98e9f5a5..3fbb00c5f1fb 100644 --- a/sysutils/policykit/pkg-install +++ b/sysutils/policykit/pkg-install @@ -4,33 +4,6 @@ case $2 in POST-INSTALL) USER=polkit GROUP=${USER} - UID=562 - GID=${UID} - PW=/usr/sbin/pw - - if ${PW} group show "${GROUP}" 2>/dev/null; then - echo "You already have a group \"${GROUP}\", so I will use it." - else - if ${PW} groupadd ${GROUP} -g ${GID}; then - echo "Added group \"${GROUP}\"." - else - echo "Adding group \"${GROUP}\" failed..." - exit 1 - fi - fi - - if ${PW} user show "${USER}" 2>/dev/null; then - echo "You already have a user \"${USER}\", so I will use it." - else - if ${PW} useradd ${USER} -u ${UID} -g ${GROUP} -h - \ - -d "/nonexistent" -s /sbin/nologin -c "PolicyKit Daemon User" - then - echo "Added user \"${USER}\"." - else - echo "Adding user \"${USER}\" failed..." - exit 1 - fi - fi /usr/bin/install -d -o root -m 0770 -g ${GROUP} /var/run/PolicyKit /usr/bin/install -d -o root -m 0770 -g ${GROUP} /var/lib/PolicyKit diff --git a/x11/gdm/Makefile b/x11/gdm/Makefile index 4d9d5e2e3165..9a6e1a7baf58 100644 --- a/x11/gdm/Makefile +++ b/x11/gdm/Makefile @@ -8,7 +8,7 @@ PORTNAME= gdm PORTVERSION= 2.26.1 -PORTREVISION= 6 +PORTREVISION= 7 CATEGORIES= x11 gnome MASTER_SITES= GNOME DIST_SUBDIR= gnome2 @@ -24,6 +24,9 @@ RUN_DEPENDS= zenity:${PORTSDIR}/x11/zenity \ ${LOCALBASE}/libexec/gnome-settings-daemon:${PORTSDIR}/sysutils/gnome-settings-daemon \ gnome-session:${PORTSDIR}/x11/gnome-session +USERS= gdm +GROUPS= gdm + USE_BZIP2= yes USE_GETTEXT= yes USE_LDCONFIG= yes diff --git a/x11/gdm/pkg-install b/x11/gdm/pkg-install index 788a1a610c81..4adf27abbb43 100644 --- a/x11/gdm/pkg-install +++ b/x11/gdm/pkg-install @@ -4,40 +4,10 @@ case $2 in POST-INSTALL) USER=gdm GROUP=${USER} - UID=92 - GID=${UID} - PW=/usr/sbin/pw CHMOD=/bin/chmod CHOWN=/usr/sbin/chown MKDIR=/bin/mkdir - if ${PW} group show "${GROUP}" 2>/dev/null; then - echo "You already have a group \"${GROUP}\", so I will use it." - else - if ${PW} groupadd ${GROUP} -g ${GID}; then - echo "Added group \"${GROUP}\"." - else - echo "Adding group \"${GROUP}\" failed..." - exit 1 - fi - fi - - if ${PW} user show "${USER}" 2>/dev/null; then - echo "You already have a user \"${USER}\", so I will use it." - uhome=`${PW} user show ${USER} | awk -F: '{print $9}'` - if [ x"${uhome}" = x"/nonexistent" -o x"${uhome}" = x"/var/gdm" ]; then - ${PW} usermod ${USER} -d "${PKG_PREFIX}/etc/gdm/home" - fi - else - if ${PW} useradd ${USER} -u ${UID} -g ${GROUP} -h - \ - -d "${PKG_PREFIX}/etc/gdm/home" -s /sbin/nologin -c "GNOME Display Manager" - then - echo "Added user \"${USER}\"." - else - echo "Adding user \"${USER}\" failed..." - exit 1 - fi - fi ${MKDIR} -p /var/gdm ${MKDIR} -p /var/log/gdm ${CHMOD} 0755 /var/log/gdm |