Date: Tue, 18 Mar 2014 13:21:23 -0500 (CDT) From: Scot Hetzel <swhetzel@gmail.com> To: FreeBSD-gnats-submit@freebsd.org Subject: ports/187703: net-im/prosody: Convert to stage Message-ID: <201403181821.s2IILN82004217@fbsd11> Resent-Message-ID: <201403181830.s2IIU09t028618@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 187703 >Category: ports >Synopsis: net-im/prosody: Convert to stage >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Mar 18 18:30:00 UTC 2014 >Closed-Date: >Last-Modified: >Originator: Scot Hetzel >Release: FreeBSD 11.0-CURRENT i386 >Organization: >Environment: System: FreeBSD fbsd11 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r258293M: Tue Nov 19 00:38:47 CST 2013 root@fbsd10:/usr/obj/usr/src/sys/GENERIC i386 >Description: The attached patch provides the following changes for net-im/prosody: - convert to using the stage directory - Change USES_GMAKE to USES= gmake - Use the shebangfix to replace the LUA_CMD in prosody and prosodyctl - Use USERS and GROUPS to create the prosody user and group - Change to pkg-plist -- add prosodyctl.1 man page -- change ${PREFIX}/var/lib/prosody user/group to prosody on install -- remove the empty ${PREFIX}/var/lib/prosody directory on uninstall - remove files/pkg-install.in (no longer needed) NOTE: can't add USES+= lua:51 due to differences between Uses/lua.mk and bsd.lua.mk >How-To-Repeat: >Fix: After applying the below patch, don't forget to remove files/pkg-install.in. --- prosody.diff begins here --- index: Makefile =================================================================== --- Makefile (revision 348215) +++ Makefile (working copy) @@ -19,27 +19,26 @@ LIB_DEPENDS= idn:${PORTSDIR}/dns/libidn +USERS= prosody +GROUPS= ${USERS} + USE_RC_SUBR= prosody -MAN1= prosodyctl.1 MANCOMPRESSED= no +USES= gmake shebangfix USE_LUA= 5.1 WANT_LUA_VER= 5.1 -USE_GMAKE= yes +SHEBANG_LANG= lua +SHEBANG_FILES= prosody prosodyctl +lua_OLD_CMD= ${SETENV} lua +lua_CMD= ${LUA_CMD} HAS_CONFIGURE= yes CONFIGURE_ARGS+= --ostype=freebsd --c-compiler="${CC}" --linker="${LD}" CONFIGURE_ENV+= LOCALBASE="${LOCALBASE}" PREFIX="${PREFIX}" LUA_SUFFIX="-${LUA_VER}" LUA_LIBDIR="${LUA_LIBDIR}" LUA_INCDIR="${LUA_INCDIR}" -SUB_FILES= pkg-install pkg-deinstall +SUB_FILES= deinstall +SUB_LIST= USERS=${USERS} GROUPS=${GROUPS} +PLIST_SUB= PROSODY_USER=${USERS} PROSODY_GROUP=${GROUPS} -NO_STAGE= yes -pre-install: - ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL - ${REINPLACE_CMD} -e 's|/usr/bin/env lua|${LUA_CMD}|' ${WRKSRC}/prosody.install ${WRKSRC}/prosodyctl.install - -post-install: - ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL - @${CAT} ${PKGMESSAGE} - .include <bsd.port.mk> Index: files/patch-Makefile =================================================================== --- files/patch-Makefile (revision 348215) +++ files/patch-Makefile (working copy) @@ -1,5 +1,5 @@ ---- Makefile.orig 2013-12-08 19:05:39.000000000 +0100 -+++ Makefile 2014-02-06 23:24:12.000000000 +0100 +--- Makefile.orig 2014-01-12 05:41:40.000000000 -0600 ++++ Makefile 2014-03-15 11:58:25.725744098 -0500 @@ -6,7 +6,7 @@ MODULES = $(DESTDIR)$(PREFIX)/lib/prosody/modules SOURCE = $(DESTDIR)$(PREFIX)/lib/prosody @@ -9,11 +9,12 @@ INSTALLEDSOURCE = $(PREFIX)/lib/prosody INSTALLEDCONFIG = $(SYSCONFDIR) -@@ -40,6 +40,7 @@ +@@ -40,7 +40,7 @@ umask 0022 && cp -r plugins/* $(MODULES) install -m644 certs/* $(CONFIG)/certs install -m644 man/prosodyctl.man $(MAN)/man1/prosodyctl.1 +- test -e $(CONFIG)/prosody.cfg.lua || install -m644 prosody.cfg.lua.install $(CONFIG)/prosody.cfg.lua + install -m644 prosody.cfg.lua.install $(CONFIG)/prosody.cfg.lua.sample - test -e $(CONFIG)/prosody.cfg.lua || install -m644 prosody.cfg.lua.install $(CONFIG)/prosody.cfg.lua test -e prosody.version && install -m644 prosody.version $(SOURCE)/prosody.version || true $(MAKE) install -C util-src + Index: files/pkg-deinstall.in =================================================================== --- files/pkg-deinstall.in (revision 348215) +++ files/pkg-deinstall.in (working copy) @@ -10,17 +10,15 @@ echo " Note:" echo " Prosody related user accounts and groups were not removed." echo "" - echo " To remove the 'prosody' user and the 'prosody' group which were" - echo " created by a default installation of this package, run:" + echo " To remove the user and group which were created by " + echo " the installation of this package, run:" echo "" - echo " pw userdel -n prosody" - echo " pw groupdel -n prosody" + echo " pw userdel -n %%USERS%%" + echo " pw groupdel -n %%GROUPS%%" echo "" - echo " and to remove all server data:" - echo " rm -rf /usr/local/var/lib/prosody" - echo "" + echo " and to remove all server data:" + echo " rm -rf /usr/local/var/lib/prosody" + echo "" ;; -*) - ;; esac exit 0 Index: pkg-plist =================================================================== --- pkg-plist (revision 348215) +++ pkg-plist (working copy) @@ -136,6 +136,7 @@ lib/prosody/util/sasl/plain.lua lib/prosody/util/sasl/scram.lua lib/prosody/util/sasl_cyrus.lua +man/man1/prosodyctl.1.gz @dirrmtry etc/prosody/certs @dirrmtry etc/prosody @dirrm lib/prosody/util/sasl @@ -149,3 +150,7 @@ @dirrm lib/prosody/modules @dirrm lib/prosody/core @dirrm lib/prosody +@exec chown -R %%PROSODY_USER%%:%%PROSODY_GROUP%% %D/var/lib/prosody +@dirrmtry var/lib/prosody +@dirrmtry var/lib +@dirrmtry var --- prosody.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403181821.s2IILN82004217>