Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Aug 2009 04:51:02 GMT
From:      "J. Kelly Hays" <kelly.hays@jkhfamily.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/137507: [MAINTAINER UPDATE] net-im/prosody fix plist
Message-ID:  <200908070451.n774p2MB042248@www.freebsd.org>
Resent-Message-ID: <200908070500.n77509Do019829@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         137507
>Category:       ports
>Synopsis:       [MAINTAINER UPDATE] net-im/prosody fix plist
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 07 05:00:09 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     J. Kelly Hays
>Release:        7.2
>Organization:
>Environment:
FreeBSD vorlon.jkhfamily.org 7.2-RELEASE-p3 FreeBSD 7.2-RELEASE-p3 #4: Wed Jul 29 23:24:07 CDT 2009     jhays@vorlon.jkhfamily.org:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
Fix plist and prevent overwriting user modified configuration files.

Noticed by:  pointyhat via erwin@
>How-To-Repeat:

>Fix:
see attached patch

Patch attached with submission follows:

diff -ruN prosody.orig/Makefile prosody/Makefile
--- prosody.orig/Makefile	2009-08-04 20:36:45.000000000 -0500
+++ prosody/Makefile	2009-08-06 23:43:29.000000000 -0500
@@ -7,6 +7,8 @@
 
 PORTNAME=	prosody
 PORTVERSION=	0.5.1
+PORTREVISION=	1
+
 CATEGORIES=	net-im
 MASTER_SITES=	http://prosody.im/downloads/source/
 
@@ -29,11 +31,10 @@
 CONFIGURE_ARGS+="--ostype=freebsd"
 CONFIGURE_ENV+=	LOCALBASE="${LOCALBASE}" LUA_SUFFIX="-${LUA_VER}" LUA_LIBDIR="${LUA_LIBDIR}" LUA_INCDIR="${LUA_INCDIR}"
 
-SUB_FILES=	pkg-install pkg-deinstall prosody.cfg.lua.install
+SUB_FILES=	pkg-install pkg-deinstall
 
 pre-install:
 	${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
-	${MV} ${WRKDIR}/prosody.cfg.lua.install ${WRKSRC}/prosody.cfg.lua.install
 	${REINPLACE_CMD} -e 's|/usr/bin/env lua|${LUA_CMD}|' ${WRKSRC}/prosody ${WRKSRC}/prosodyctl
 
 post-install:
diff -ruN prosody.orig/files/patch-Makefile prosody/files/patch-Makefile
--- prosody.orig/files/patch-Makefile	2009-07-28 13:29:37.000000000 -0500
+++ prosody/files/patch-Makefile	2009-08-06 23:14:52.000000000 -0500
@@ -1,5 +1,5 @@
---- Makefile.orig	2009-07-27 18:22:51.000000000 +0000
-+++ Makefile	2009-07-27 18:23:25.000000000 +0000
+--- Makefile.orig	2009-07-29 12:54:54.000000000 -0500
++++ Makefile	2009-08-06 21:25:36.000000000 -0500
 @@ -6,7 +6,7 @@
  MODULES = $(DESTDIR)$(PREFIX)/lib/prosody/modules
  SOURCE = $(DESTDIR)$(PREFIX)/lib/prosody
@@ -9,3 +9,17 @@
  
  INSTALLEDSOURCE = $(PREFIX)/lib/prosody
  INSTALLEDCONFIG = $(SYSCONFDIR)
+@@ -29,10 +29,11 @@
+ 	install -m644 util/* $(SOURCE)/util
+ 	install -m644 fallbacks/* $(SOURCE)/fallbacks
+ 	install -m644 plugins/* $(MODULES)
+-	install -m644 certs/* $(CONFIG)/certs
++	install -m644 certs/localhost.cert $(CONFIG)/certs/localhost.cert.sample
++	install -m644 certs/localhost.key $(CONFIG)/certs/localhost.key.sample
+ 	install -m644 plugins/* $(MODULES)
+ 	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 prosody.version && install prosody.version $(SOURCE)/prosody.version || true
+ 	$(MAKE) install -C util-src
+ 
diff -ruN prosody.orig/files/pkg-install.in prosody/files/pkg-install.in
--- prosody.orig/files/pkg-install.in	2009-07-28 13:29:37.000000000 -0500
+++ prosody/files/pkg-install.in	2009-08-06 22:33:29.000000000 -0500
@@ -40,7 +40,12 @@
 	;;
 
 POST-INSTALL)
-	chown "${USER}" $PREFIX/var/lib/prosody
+	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 "?"
diff -ruN prosody.orig/files/prosody.cfg.lua.install.in prosody/files/prosody.cfg.lua.install.in
--- prosody.orig/files/prosody.cfg.lua.install.in	2009-07-28 13:29:37.000000000 -0500
+++ prosody/files/prosody.cfg.lua.install.in	1969-12-31 18:00:00.000000000 -0600
@@ -1,95 +0,0 @@
--- Prosody Example Configuration File 
--- 
--- If it wasn't already obvious, -- starts a comment, and all 
--- text after it on a line is ignored by Prosody.
---
--- The config is split into sections, a global section, and one 
--- for each defined host that we serve. You can add as many host 
--- sections as you like.
---
--- Lists are written { "like", "this", "one" } 
--- Lists can also be of { 1, 2, 3 } numbers, etc. 
--- Either commas, or semi-colons; may be used
--- as seperators.
---
--- A table is a list of values, except each value has a name. An 
--- example would be:
---
--- logging = { type = "html", directory = "/var/logs", rotate = "daily" }
---
--- Whitespace (that is tabs, spaces, line breaks) is mostly insignificant, so 
--- can 
--- be placed anywhere
--- that 	you deem fitting.
---
--- Tip: You can check that the syntax of this file is correct when you have finished
--- by running: luac -p prosody.cfg.lua
--- If there are any errors, it will let you know what and where they are, otherwise it 
--- will keep quiet.
---
--- The only thing left to do is rename this file to remove the .dist ending, and fill in the 
--- blanks. Good luck, and happy Jabbering!
-
--- Global settings go in this section
-Host "*"
-	prosody_user = "prosody"
-        pidfile = "%%PREFIX%%/var/lib/prosody/prosody.pid"	
-        log = {
-            { levels = { min = "info" }, to = "syslog" };
-        } 
-	-- This is the list of modules Prosody will load on startup.
-	-- It looks for mod_modulename.lua in the plugins folder, so make sure that exists too.
-	modules_enabled = {
-			-- Generally required
-				"roster"; -- Allow users to have a roster. Recommended ;)
-				"saslauth"; -- Authentication for clients and servers. Recommended if you want to log in.
-				--"tls"; -- Add support for secure TLS on c2s/s2s connections
-				"dialback"; -- s2s dialback support
-			  	"disco"; -- Service discovery
-			
-			-- Not essential, but recommended
-				"private"; -- Private XML storage (for room bookmarks, etc.)
-				"vcard"; -- Allow users to set vCards
-			
-			-- Nice to have
-				"legacyauth"; -- Legacy authentication. Only used by some old clients and bots.
-				"version"; -- Replies to server version requests
-			  	"uptime"; -- Report how long server has been running
-			  	"time"; -- Let others know the time here on this server
-				"pep"; -- Enables users to publish their mood, activity, playing music and more
-			  	"ping"; -- Replies to XMPP pings with pongs
-
-			-- Other specific functionality
-				--"register"; -- Allow users to register on this server using a client
-				"posix"; -- POSIX functionality, sends server to background, enables syslog, etc.
-			  	--"console"; -- telnet to port 5582 (needs console_enabled = true)
-				--"bosh"; -- Enable BOSH clients, aka "Jabber over HTTP"
-				--"httpserver"; -- Serve static files from a directory over HTTP
-			  };
-	
-	-- These are the SSL/TLS-related settings. If you don't want
-	-- to use SSL/TLS, you may comment or remove this
---	ssl = { 
---		key = "certs/localhost.key";
---		certificate = "certs/localhost.cert";
---		}
-
--- This allows clients to connect to localhost. No harm in it.
-Host "localhost"
-
--- Section for example.com
--- (replace example.com with your domain name)
---Host "example.com"
---	-- Assign this host a certificate for TLS, otherwise it would use the one
---	-- set in the global section (if any).
---	-- Note that old-style SSL on port 5223 only supports one certificate, and will always
---	-- use the global one.
---	ssl = { 
---		key = "certs/example.com.key";
---		certificate = "certs/example.com.crt";
---		}
---
---	enabled = false -- This will disable the host, preserving the config, but denying connections
-
--- Set up a MUC (multi-user chat) room server on conference.example.com:
---Component "conference.example.com" "muc"
diff -ruN prosody.orig/pkg-plist prosody/pkg-plist
--- prosody.orig/pkg-plist	2009-08-04 20:36:45.000000000 -0500
+++ prosody/pkg-plist	2009-08-06 22:59:19.000000000 -0500
@@ -1,5 +1,16 @@
 bin/prosody
 bin/prosodyctl
+@unexec if cmp -s %D/etc/prosody/prosody.cfg.lua.sample %D/etc/prosody/prosody.cfg.lua; then rm -f %D/etc/prosody/prosody.cfg.lua; fi
+etc/prosody/prosody.cfg.lua.sample
+@exec if [ ! -f %D/etc/prosody/prosody.cfg.lua ]; then cp -p %D/etc/prosody/prosody.cfg.lua.sample %D/etc/prosody/prosody.cfg.lua; fi
+@unexec if cmp -s %D/etc/prosody/certs/localhost.cert.sample %D/etc/prosody/certs/localhost.cert; then rm -f %D/etc/prosody/certs/localhost.cert; fi
+etc/prosody/certs/localhost.cert.sample
+@exec if [ ! -f %D/etc/prosody/certs/localhost.cert ]; then cp -p %D/etc/prosody/certs/localhost.cert.sample %D/etc/prosody/certs/localhost.cert; fi
+@unexec if cmp -s %D/etc/prosody/certs/localhost.key.sample %D/etc/prosody/certs/localhost.key; then rm -f %D/etc/prosody/certs/localhost.key; fi
+etc/prosody/certs/localhost.key.sample
+@exec if [ ! -f %D/etc/prosody/certs/localhost.key ]; then cp -p %D/etc/prosody/certs/localhost.key.sample %D/etc/prosody/certs/localhost.key; fi
+@dirrmtry etc/prosody/certs
+@dirrmtry etc/prosody
 lib/prosody/core/actions.lua
 lib/prosody/core/componentmanager.lua
 lib/prosody/core/configmanager.lua


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908070451.n774p2MB042248>