Bug 187703 - net-im/prosody: Convert to stage
Summary: net-im/prosody: Convert to stage
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: David Thiel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-18 18:30 UTC by Scot Hetzel
Modified: 2014-03-18 20:20 UTC (History)
0 users

See Also:


Attachments
prosody.diff (3.88 KB, patch)
2014-03-18 18:30 UTC, Scot Hetzel
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Scot Hetzel 2014-03-18 18:30:00 UTC
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

Fix: After applying the below patch, don't forget to remove files/pkg-install.in.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2014-03-18 18:30:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->lx

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Scot Hetzel 2014-03-18 18:34:50 UTC
Just noticed that the patch had removed pkg- from pkg-deinstall in
SUB_FILES.  The ports Makefile should have:

SUB_FILES= pkg-deinstall

Fix this after applying the patch.

Thanks,

-- 
DISCLAIMER:

No electrons were maimed while sending this message. Only slightly bruised.
Comment 3 dfilter service freebsd_committer freebsd_triage 2014-03-18 20:19:39 UTC
Author: lx
Date: Tue Mar 18 20:19:34 2014
New Revision: 348595
URL: http://svnweb.freebsd.org/changeset/ports/348595
QAT: https://qat.redports.org/buildarchive/r348595/

Log:
  Stageify and modernize.
  
  PR:		ports/187703
  Submitted by:	Scot Hetzel
  Reviewed by:	me

Deleted:
  head/net-im/prosody/files/pkg-install.in
Modified:
  head/net-im/prosody/Makefile
  head/net-im/prosody/files/patch-Makefile
  head/net-im/prosody/files/pkg-deinstall.in
  head/net-im/prosody/pkg-plist

Modified: head/net-im/prosody/Makefile
==============================================================================
--- head/net-im/prosody/Makefile	Tue Mar 18 20:14:23 2014	(r348594)
+++ head/net-im/prosody/Makefile	Tue Mar 18 20:19:34 2014	(r348595)
@@ -17,29 +17,28 @@ RUN_DEPENDS=	${LUA_MODLIBDIR}/socket/cor
 		${LUA_MODLIBDIR}/lxp.so:${PORTSDIR}/textproc/luaexpat \
 		${LUA_MODLIBDIR}/lfs.so:${PORTSDIR}/devel/luafilesystem \
 
-LIB_DEPENDS=	idn:${PORTSDIR}/dns/libidn
+LIB_DEPENDS=	libidn:${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
-
-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}
+SUB_FILES=	deinstall
+SUB_LIST=	USERS=${USERS} GROUPS=${GROUPS}
+PLIST_SUB=	PROSODY_USER=${USERS} PROSODY_GROUP=${GROUPS}
 
 .include <bsd.port.mk>

Modified: head/net-im/prosody/files/patch-Makefile
==============================================================================
--- head/net-im/prosody/files/patch-Makefile	Tue Mar 18 20:14:23 2014	(r348594)
+++ head/net-im/prosody/files/patch-Makefile	Tue Mar 18 20:19:34 2014	(r348595)
@@ -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
+ 

Modified: head/net-im/prosody/files/pkg-deinstall.in
==============================================================================
--- head/net-im/prosody/files/pkg-deinstall.in	Tue Mar 18 20:14:23 2014	(r348594)
+++ head/net-im/prosody/files/pkg-deinstall.in	Tue Mar 18 20:19:34 2014	(r348595)
@@ -10,17 +10,15 @@ POST-DEINSTALL)
 	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

Modified: head/net-im/prosody/pkg-plist
==============================================================================
--- head/net-im/prosody/pkg-plist	Tue Mar 18 20:14:23 2014	(r348594)
+++ head/net-im/prosody/pkg-plist	Tue Mar 18 20:19:34 2014	(r348595)
@@ -136,6 +136,7 @@ lib/prosody/util/sasl/digest-md5.lua
 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 @@ lib/prosody/util/sasl_cyrus.lua
 @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
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 4 David Thiel freebsd_committer freebsd_triage 2014-03-18 20:19:43 UTC
State Changed
From-To: open->closed

Committed, thanks!