From 56821fd000044caac1c833b0af660604c22588e0 Mon Sep 17 00:00:00 2001 From: mm Date: Sat, 22 Nov 2014 11:40:08 +0000 Subject: Remove pkg-install and pkg-deinstall Use .sample config files instead of .dist Improve pkg-plist --- net-im/jabberd/Makefile | 20 ++++++--- net-im/jabberd/files/patch-etc__Makefile.in | 51 ++++++++++++---------- .../files/patch-etc__templates__Makefile.in | 15 ++++++- net-im/jabberd/files/pkg-deinstall.in | 13 ------ net-im/jabberd/files/pkg-install.in | 24 ---------- net-im/jabberd/pkg-plist | 31 +++++++------ 6 files changed, 71 insertions(+), 83 deletions(-) delete mode 100644 net-im/jabberd/files/pkg-deinstall.in delete mode 100644 net-im/jabberd/files/pkg-install.in diff --git a/net-im/jabberd/Makefile b/net-im/jabberd/Makefile index b6b8c433e714..6bbe741dbc9c 100644 --- a/net-im/jabberd/Makefile +++ b/net-im/jabberd/Makefile @@ -2,8 +2,8 @@ # $FreeBSD$ PORTNAME= jabberd -DISTVERSION= 2.3.1 -PORTREVISION= 6 +PORTVERSION= 2.3.1 +PORTREVISION= 7 CATEGORIES= net-im MASTER_SITES= https://github.com/jabberd2/jabberd2/releases/download/${PORTNAME}-${DISTVERSION}/ \ LOCAL/matthew/${PORTNAME} @@ -47,14 +47,15 @@ GROUPS= ${JABBER_GROUP} JABBER_ETCDIR= "${PREFIX}/etc/jabberd" JABBER_RUNDIR= "/var/jabberd" -SUB_LIST+= JABBER_USER=${JABBER_USER} \ +PLIST_SUB+= JABBER_USER=${JABBER_USER} \ JABBER_GROUP=${JABBER_GROUP} \ JABBER_ETCDIR="${JABBER_ETCDIR}" \ + JABBER_RUNDIR="${JABBER_RUNDIR}" + +SUB_LIST+= JABBER_USER=${JABBER_USER} \ JABBER_RUNDIR="${JABBER_RUNDIR}" \ PERL="${PERL}" -SUB_FILES+= pkg-install pkg-deinstall - PORTDOCS= * DOCFILES= AUTHORS ChangeLog NEWS README README.config \ @@ -141,6 +142,10 @@ SUB_LIST+= REQUIRE="LOGIN" REQUIRES_DESC= Add backend requires to startup script post-patch: +.for FILE in c2s.xml jabberd.cfg router-filter.xml router-users.xml \ + router.xml s2s.xml sm.xml templates/roster.xml + @${MV} ${WRKSRC}/etc/${FILE}.dist.in ${WRKSRC}/etc/${FILE}.sample.in +.endfor @${REINPLACE_CMD} -e 's|%%PERL%%|${PERL}|g' \ ${WRKSRC}/tools/jabberd.in .if ${PORT_OPTIONS:MCYRUS} @@ -149,6 +154,11 @@ post-patch: .endif post-install: +.for DIR in db logs pid + @${MKDIR} ${STAGEDIR}${JABBER_RUNDIR}/${DIR} +.endfor + @${CHOWN} -R ${JABBER_USER}:${JABBER_GROUP} ${STAGEDIR}${JABBER_RUNDIR} + @${CHMOD} -R go= ${STAGEDIR}${JABBER_RUNDIR} .if ${PORT_OPTIONS:MDOCS} @${MKDIR} ${STAGEDIR}${DOCSDIR} .for FILE in ${DOCFILES} diff --git a/net-im/jabberd/files/patch-etc__Makefile.in b/net-im/jabberd/files/patch-etc__Makefile.in index 11181f6eb6b3..e9d24499efd1 100644 --- a/net-im/jabberd/files/patch-etc__Makefile.in +++ b/net-im/jabberd/files/patch-etc__Makefile.in @@ -1,29 +1,34 @@ ---- ./etc/Makefile.in.orig 2013-11-28 11:16:25.000000000 +0000 -+++ ./etc/Makefile.in 2013-12-15 10:29:42.301779845 +0000 -@@ -336,7 +336,7 @@ +--- etc/Makefile.in.orig 2013-11-28 12:16:25.000000000 +0100 ++++ etc/Makefile.in 2014-11-22 12:36:09.272204737 +0100 +@@ -334,11 +334,11 @@ + top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ - sysconf_DATA = c2s.xml.dist router.xml.dist s2s.xml.dist sm.xml.dist jabberd.cfg.dist router-users.xml.dist router-filter.xml.dist +-sysconf_DATA = c2s.xml.dist router.xml.dist s2s.xml.dist sm.xml.dist jabberd.cfg.dist router-users.xml.dist router-filter.xml.dist ++sysconf_DATA = c2s.xml.sample router.xml.sample s2s.xml.sample sm.xml.sample jabberd.cfg.sample router-users.xml.sample router-filter.xml.sample initdir = $(prefix)/etc/init --init_DATA = jabberd-c2s.conf jabberd-router.conf jabberd-s2s.conf jabberd-sm.conf -+init_DATA = + init_DATA = jabberd-c2s.conf jabberd-router.conf jabberd-s2s.conf jabberd-sm.conf configs = $(sysconf_DATA) $(init_DATA) - EXTRA_DIST = $(sysconf_DATA:%.dist=%.dist.in) $(init_DATA:%.conf=%.conf.in) +-EXTRA_DIST = $(sysconf_DATA:%.dist=%.dist.in) $(init_DATA:%.conf=%.conf.in) ++EXTRA_DIST = $(sysconf_DATA:%.sample=%.sample.in) $(init_DATA:%.conf=%.conf.in) SUBDIRS = templates -@@ -721,14 +721,9 @@ - mv $@.tmp $@ + jabberd_bin = router sm s2s c2s + edit = sed \ +@@ -599,7 +599,7 @@ + uninstall: uninstall-recursive - install-data-hook: -- @list='$(configs)'; for p in $$list; do \ -- dest=`echo $$p | sed -e s/.dist//`; \ -- if test -f $(DESTDIR)$(sysconfdir)/$$dest; then \ -- echo "$@ will not overwrite existing $(DESTDIR)$(sysconfdir)/$$dest"; \ -- else \ -- echo " $(INSTALL_DATA) $$p $(DESTDIR)$(sysconfdir)/$$dest"; \ -- $(INSTALL_DATA) $$p $(DESTDIR)$(sysconfdir)/$$dest; \ -- fi; \ -+ @list='$(configs)'; for dest in $$list; do \ -+ echo " $(INSTALL_DATA) $$dest $(DESTDIR)$(sysconfdir)/$$dest"; \ -+ $(INSTALL_DATA) $$dest $(DESTDIR)$(sysconfdir)/$$dest; \ - done + install-am: all-am +- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am ++ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am - clean-local: + installcheck: installcheck-recursive + install-strip: +@@ -709,7 +709,7 @@ + uninstall-am uninstall-initDATA uninstall-sysconfDATA + + +-$(configs): $(sysconf_DATA:%.dist=@srcdir@/%.dist.in) $(init_DATA:%.conf=@srcdir@/%.conf.in) ++$(configs): $(sysconf_DATA:%.sample=@srcdir@/%.sample.in) $(init_DATA:%.conf=@srcdir@/%.conf.in) + @echo "generating $@ from $@.in"; \ + edit='$(edit)'; \ + list='$(jabberd_bin)'; for p in $$list; do \ diff --git a/net-im/jabberd/files/patch-etc__templates__Makefile.in b/net-im/jabberd/files/patch-etc__templates__Makefile.in index 861b3940eed5..fc147c095a82 100644 --- a/net-im/jabberd/files/patch-etc__templates__Makefile.in +++ b/net-im/jabberd/files/patch-etc__templates__Makefile.in @@ -1,5 +1,16 @@ ---- ./etc/templates/Makefile.in.orig 2013-11-28 11:16:25.000000000 +0000 -+++ ./etc/templates/Makefile.in 2013-12-15 10:29:42.305779574 +0000 +--- etc/templates/Makefile.in.orig 2014-02-24 10:13:54.000000000 +0100 ++++ etc/templates/Makefile.in 2014-11-22 12:01:11.535347369 +0100 +@@ -275,8 +275,8 @@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + templatesdir = $(sysconfdir)/templates +-templates_DATA = roster.xml.dist +-EXTRA_DIST = roster.xml.dist.in ++templates_DATA = roster.xml.sample ++EXTRA_DIST = roster.xml.sample.in + edit = sed \ + -e 's,@sysconfdir\@,$(sysconfdir),g' \ + -e 's,@localstatedir\@,$(localstatedir),g' \ @@ -506,14 +506,9 @@ mv $@.tmp $@ diff --git a/net-im/jabberd/files/pkg-deinstall.in b/net-im/jabberd/files/pkg-deinstall.in deleted file mode 100644 index d2915f81dda9..000000000000 --- a/net-im/jabberd/files/pkg-deinstall.in +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -if [ "$2" != "POST-DEINSTALL" ]; then - exit 0 -fi - -RUNDIR="%%JABBER_RUNDIR%%" - -echo "===> You should manually delete the following directories:" -echo "${RUNDIR}" - -exit 0 diff --git a/net-im/jabberd/files/pkg-install.in b/net-im/jabberd/files/pkg-install.in deleted file mode 100644 index ead0e703a634..000000000000 --- a/net-im/jabberd/files/pkg-install.in +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# $FreeBSD$ - -if [ "$2" != "POST-INSTALL" ]; then - exit 0 -fi - -USER=%%JABBER_USER%% -GROUP=%%JABBER_GROUP%% -ETCDIR=%%JABBER_ETCDIR%% -RUNDIR=%%JABBER_RUNDIR%% - -if [ ! -d ${RUNDIR} ]; then - echo "===> Creating \"${RUNDIR}\"." - mkdir -p ${RUNDIR}/pid ${RUNDIR}/db ${RUNDIR}/logs -fi - -echo "===> Changing owner and modes for \"${ETCDIR}\"." -chown -R ${USER}:${GROUP} ${ETCDIR} -chmod -R go= ${ETCDIR} - -echo "===> Changing owner and modes for \"${RUNDIR}\"." -chown -R ${USER}:${GROUP} ${RUNDIR} -chmod -R go= ${RUNDIR} diff --git a/net-im/jabberd/pkg-plist b/net-im/jabberd/pkg-plist index d1328a45237c..f28a8606ebfe 100644 --- a/net-im/jabberd/pkg-plist +++ b/net-im/jabberd/pkg-plist @@ -4,22 +4,14 @@ bin/jabberd bin/router bin/s2s bin/sm -@unexec if cmp -s %D/etc/jabberd/c2s.xml %D/etc/jabberd/c2s.xml.dist; then rm -f %D/etc/jabberd/c2s.xml; fi -etc/jabberd/c2s.xml.dist -@unexec if cmp -s %D/etc/jabberd/jabberd.cfg %D/etc/jabberd/jabberd.cfg.dist; then rm -f %D/etc/jabberd/jabberd.cfg; fi -etc/jabberd/jabberd.cfg.dist -@unexec if cmp -s %D/etc/jabberd/router-filter.xml %D/etc/jabberd/router-filter.xml.dist; then rm -f %D/etc/jabberd/router-filter.xml; fi -etc/jabberd/router-filter.xml.dist -@unexec if cmp -s %D/etc/jabberd/router-users.xml %D/etc/jabberd/router-users.xml.dist; then rm -f %D/etc/jabberd/router-users.xml; fi -etc/jabberd/router-users.xml.dist -@unexec if cmp -s %D/etc/jabberd/router.xml %D/etc/jabberd/router.xml.dist; then rm -f %D/etc/jabberd/router.xml; fi -etc/jabberd/router.xml.dist -@unexec if cmp -s %D/etc/jabberd/s2s.xml %D/etc/jabberd/s2s.xml.dist; then rm -f %D/etc/jabberd/s2s.xml; fi -etc/jabberd/s2s.xml.dist -@unexec if cmp -s %D/etc/jabberd/sm.xml %D/etc/jabberd/sm.xml.dist; then rm -f %D/etc/jabberd/sm.xml; fi -etc/jabberd/sm.xml.dist -@unexec if cmp -s %D/etc/jabberd/templates/roster.xml %D/etc/jabberd/templates/roster.xml.dist; then rm -f %D/etc/jabberd/templates/roster.xml; fi -etc/jabberd/templates/roster.xml.dist +@sample etc/jabberd/c2s.xml.sample +@sample etc/jabberd/jabberd.cfg.sample +@sample etc/jabberd/router-filter.xml.sample +@sample etc/jabberd/router-users.xml.sample +@sample etc/jabberd/router.xml.sample +@sample etc/jabberd/s2s.xml.sample +@sample etc/jabberd/sm.xml.sample +@sample etc/jabberd/templates/roster.xml.sample %%ANON%%lib/jabberd/authreg_anon.so %%BDB%%lib/jabberd/authreg_db.so %%LDAP%%lib/jabberd/authreg_ldap.so @@ -118,3 +110,10 @@ man/man8/sm.8.gz @dirrm lib/jabberd @dirrmtry etc/jabberd/templates @dirrmtry etc/jabberd +@cwd / +@exec chown -R %%JABBER_USER%%:%%JABBER_GROUP%% %%JABBER_RUNDIR%% +@exec chmod -R go= %%JABBER_RUNDIR%% +@dirrmtry %%JABBER_RUNDIR%%/pid +@dirrmtry %%JABBER_RUNDIR%%/logs +@dirrmtry %%JABBER_RUNDIR%%/db +@dirrmtry %%JABBER_RUNDIR%% -- cgit