diff options
author | lx <lx@FreeBSD.org> | 2014-03-19 04:19:34 +0800 |
---|---|---|
committer | lx <lx@FreeBSD.org> | 2014-03-19 04:19:34 +0800 |
commit | 190b2250e20a9d501a775f9a8ed82958cf997d4c (patch) | |
tree | 96801037ac074f8c699ee30274f534a0e38d5876 /net-im | |
parent | c8653031e2af33e66c20a977680e153f8d455d80 (diff) | |
download | freebsd-ports-gnome-190b2250e20a9d501a775f9a8ed82958cf997d4c.tar.gz freebsd-ports-gnome-190b2250e20a9d501a775f9a8ed82958cf997d4c.tar.zst freebsd-ports-gnome-190b2250e20a9d501a775f9a8ed82958cf997d4c.zip |
Stageify and modernize.
PR: ports/187703
Submitted by: Scot Hetzel
Reviewed by: me
Diffstat (limited to 'net-im')
-rw-r--r-- | net-im/prosody/Makefile | 25 | ||||
-rw-r--r-- | net-im/prosody/files/patch-Makefile | 9 | ||||
-rw-r--r-- | net-im/prosody/files/pkg-deinstall.in | 16 | ||||
-rw-r--r-- | net-im/prosody/files/pkg-install.in | 54 | ||||
-rw-r--r-- | net-im/prosody/pkg-plist | 5 |
5 files changed, 29 insertions, 80 deletions
diff --git a/net-im/prosody/Makefile b/net-im/prosody/Makefile index c1ee577338fd..6d7f0ab963ba 100644 --- a/net-im/prosody/Makefile +++ b/net-im/prosody/Makefile @@ -17,29 +17,28 @@ RUN_DEPENDS= ${LUA_MODLIBDIR}/socket/core.so:${PORTSDIR}/net/luasocket \ ${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> diff --git a/net-im/prosody/files/patch-Makefile b/net-im/prosody/files/patch-Makefile index 4b0d025b220a..b3af09d02f57 100644 --- a/net-im/prosody/files/patch-Makefile +++ b/net-im/prosody/files/patch-Makefile @@ -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 + diff --git a/net-im/prosody/files/pkg-deinstall.in b/net-im/prosody/files/pkg-deinstall.in index 5cafa9c90b58..ac4bcbaf9a96 100644 --- a/net-im/prosody/files/pkg-deinstall.in +++ b/net-im/prosody/files/pkg-deinstall.in @@ -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 diff --git a/net-im/prosody/files/pkg-install.in b/net-im/prosody/files/pkg-install.in deleted file mode 100644 index 0580a656d538..000000000000 --- a/net-im/prosody/files/pkg-install.in +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# - -PW=/usr/sbin/pw -UID=242 -GID=$UID -USER="prosody" -GROUP="prosody" -PREFIX="%%PREFIX%%" - -case $2 in - -PRE-INSTALL) - - 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 daemon -h - \ - -d "/nonexistent" -s /usr/sbin/nologin -c "Prosody XMPP Server" - then - echo "Added user \"${USER}\"." - else - echo "Adding user \"${USER}\" failed..." - exit 1 - fi - fi - ;; - -POST-INSTALL) - chown "${USER}:${GROUP}" $PREFIX/var/lib/prosody - for file in `find $PREFIX/etc/prosody -type f`; do - if [ ! -s "${file%.sample}" ]; then - cp -p $file ${file%.sample} - fi - done - ;; -*) - echo "?" -;; -esac -exit 0 diff --git a/net-im/prosody/pkg-plist b/net-im/prosody/pkg-plist index f60cedd72d74..04d6b154d91f 100644 --- a/net-im/prosody/pkg-plist +++ b/net-im/prosody/pkg-plist @@ -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 |