Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Sep 2019 17:53:24 +0000 (UTC)
From:      Alexander Leidinger <netchild@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r511830 - in head: . security/bastillion security/bastillion/files
Message-ID:  <201909111753.x8BHrOPm026138@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: netchild
Date: Wed Sep 11 17:53:23 2019
New Revision: 511830
URL: https://svnweb.freebsd.org/changeset/ports/511830

Log:
   - Add update tool.
   - Add update instructions (datastore needs to be updated).
   - Convert pkg-message to UCL format.
   - Rework plist generation target.

Modified:
  head/UPDATING
  head/security/bastillion/Makefile
  head/security/bastillion/files/pkg-message.in
  head/security/bastillion/pkg-plist

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Wed Sep 11 16:51:55 2019	(r511829)
+++ head/UPDATING	Wed Sep 11 17:53:23 2019	(r511830)
@@ -5,6 +5,14 @@ they are unavoidable.
 You should get into the habit of checking this file for changes each time
 you update your ports collection, before attempting any port upgrades.
 
+20190911:
+  AFFECTS: users of security/bastillion
+  AUTHOR: netchild@FreeBSD.org
+
+  The datastore of bastillion needs to be updated:
+    java -jar $PREFIX/jetty_bastillion/upgrade/bastillion-upgrade-3.08.00.jar \
+      $PREFIX/jetty_bastillion/bastillion/WEB-INF/classes/BastillionConfig.properties
+
 20190909:
   AFFECTS: users of lang/ruby25
   AUTHOR: mfechner@FreeBSD.org

Modified: head/security/bastillion/Makefile
==============================================================================
--- head/security/bastillion/Makefile	Wed Sep 11 16:51:55 2019	(r511829)
+++ head/security/bastillion/Makefile	Wed Sep 11 17:53:23 2019	(r511830)
@@ -3,7 +3,9 @@
 PORTNAME=		bastillion
 DISTVERSIONPREFIX=	jetty-v
 DISTVERSION=		3.08_00
-PORTREVISION=		1
+DISTFILES=		${DISTNAME}${EXTRACT_SUFX} \
+			${PORTNAME}-upgrade-${PORTVERSION}.jar
+PORTREVISION=		2
 CATEGORIES=		security www java
 MASTER_SITES=		https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/releases/download/v${PORTVERSION}/
 
@@ -65,20 +67,21 @@ do-install:
 	${MKDIR} ${STAGEDIR}/var/log/${PORTNAME}
 	${MKDIR} ${STAGEDIR}/var/run/${PORTNAME}
 	cd ${WRKSRC}; ${COPYTREE_BIN} jetty_bastillion ${STAGEDIR}${PREFIX} "! -name *\.orig"
+	${MKDIR} ${STAGEDIR}${PREFIX}/jetty_bastillion/upgrade
 	cd ${WRKSRC}; ${COPYTREE_SHARE} webapps ${STAGEDIR}${PREFIX}/${WWWDIR} "! -name *\.orig"
 	cd ${WRKSRC}; ${COPYTREE_SHARE} etc ${STAGEDIR}${PREFIX}/${WWWDIR} "! -name *\.orig"
 	${RLN} ${STAGEDIR}${PREFIX}/${WWWDIR}/etc ${STAGEDIR}${PREFIX}/jetty_bastillion/etc
 	${INSTALL_DATA} ${WRKSRC}/start.ini ${STAGEDIR}${PREFIX}/${WWWDIR}
 	${INSTALL_DATA} ${WRKSRC}/*.md ${STAGEDIR}${PREFIX}/${WWWDIR}
 	${INSTALL_DATA} ${WRKDIR}/${PORTNAME}.sample ${STAGEDIR}${ETCDIR}/
+	${INSTALL_DATA} ${DISTDIR}/bastillion-upgrade-3.08.00.jar ${STAGEDIR}${PREFIX}/jetty_bastillion/upgrade/
 
 gen-plist:
 	${ECHO} '@sample %%ETCDIR%%/%%APP_NAME%%.sample' >${PLIST}.new
 	${ECHO} '@sample(www,www,644) jetty_bastillion/bastillion/WEB-INF/classes/BastillionConfig.properties.sample' >> ${PLIST}.new
 	${ECHO} '@dir(www,www,755) /var/log/%%APP_NAME%%' >> ${PLIST}.new
 	${ECHO} '@dir(www,www,755) /var/run/%%APP_NAME%%' >> ${PLIST}.new
-	${FIND} ${WRKSRC}/jetty_bastillion -type f -a ! -name \*.orig | ${SED} -e "s:${WRKSRC}/::g" | ${SORT} >> ${PLIST}.new
-#	${REINPLACE_CMD} 's:jetty_bastillion/bastillion/WEB-INF/classes/BastillionConfig.properties$$:@(www,www,644) jetty_bastillion/bastillion/WEB-INF/classes/BastillionConfig.properties:g' ${PLIST}.new
+	${FIND} ${STAGEDIR}${PREFIX}/jetty_bastillion -type f -a ! -name \*.orig -a ! -name \*.sample | ${SED} -e "s:${STAGEDIR}${PREFIX}/::g" | ${SORT} >> ${PLIST}.new
 	${ECHO} '@dir(www,www,755) jetty_bastillion/bastillion/WEB-INF/classes' >> ${PLIST}.new
 	${ECHO} '@dir(www,www,755) %%WWWDIR%%' >> ${PLIST}.new
 	${ECHO} '@dir(www,www,755) %%WWWDIR%%/work' >> ${PLIST}.new
@@ -86,8 +89,8 @@ gen-plist:
 	${ECHO} '%%WWWDIR%%/3rdPartyLicenses.md' >> ${PLIST}.new
 	${ECHO} '%%WWWDIR%%/LICENSE.md' >> ${PLIST}.new
 	${ECHO} '%%WWWDIR%%/README.md' >> ${PLIST}.new
-	${FIND} ${WRKSRC}/webapps -type f -a ! -name \*.orig | ${SED} -e "s:${WRKSRC}/webapps:%%WWWDIR%%/webapps:g" | ${SORT} >> ${PLIST}.new
-	${FIND} ${WRKSRC}/etc -type f -a ! -name \*.orig | ${SED} -e "s:${WRKSRC}/etc:%%WWWDIR%%/etc:g" | ${SORT} >> ${PLIST}.new
+	${FIND} ${STAGEDIR}${PREFIX}/${WWWDIR}/webapps -type f -a ! -name \*.orig | ${SED} -e "s:${STAGEDIR}${PREFIX}/${WWWDIR}:%%WWWDIR%%:g" | ${SORT} >> ${PLIST}.new
+	${FIND} ${STAGEDIR}${PREFIX}/${WWWDIR}/etc -type f -a ! -name \*.orig | ${SED} -e "s:${STAGEDIR}${PREFIX}/${WWWDIR}:%%WWWDIR%%:g" | ${SORT} >> ${PLIST}.new
 	${ECHO} 'jetty_bastillion/etc' >> ${PLIST}.new
 
 .include <bsd.port.mk>

Modified: head/security/bastillion/files/pkg-message.in
==============================================================================
--- head/security/bastillion/files/pkg-message.in	Wed Sep 11 16:51:55 2019	(r511829)
+++ head/security/bastillion/files/pkg-message.in	Wed Sep 11 17:53:23 2019	(r511830)
@@ -1,3 +1,6 @@
+[
+{
+  message: <<EOT
 Bastille is now installed in %%PREFIX%%/%%WWWDIR%% and %%PREFIX%%/jetty_bastillion.
 
 Before the first start (but not if you update), you have to set a DB password in
@@ -11,4 +14,15 @@ You may want to activate it in /etc/rc.conf:
 
 Once Bastille is started, point your web browser to the login page at
     https://<hostname>:8443/.
-
+EOT
+}
+{
+  type: upgrade
+  maximum_version: "3.08.00"
+  message: <<EOT
+The datastore of bastillion needs to be upgraded (if you do not see users / can not login
+as someone else than admin, you forgot to upgrade it):
+    java -jar %%PREFIX%%/jetty_bastillion/upgrade/bastillion-upgrade-3.08.00.jar %%PREFIX%%/jetty_bastillion/bastillion/WEB-INF/classes/BastillionConfig.properties
+EOT
+}
+]

Modified: head/security/bastillion/pkg-plist
==============================================================================
--- head/security/bastillion/pkg-plist	Wed Sep 11 16:51:55 2019	(r511829)
+++ head/security/bastillion/pkg-plist	Wed Sep 11 17:53:23 2019	(r511830)
@@ -434,6 +434,7 @@ jetty_bastillion/modules/webapp.mod
 jetty_bastillion/modules/websocket.mod
 jetty_bastillion/notice.html
 jetty_bastillion/start.jar
+jetty_bastillion/upgrade/bastillion-upgrade-3.08.00.jar
 @dir(www,www,755) jetty_bastillion/bastillion/WEB-INF/classes
 @dir(www,www,755) %%WWWDIR%%
 @dir(www,www,755) %%WWWDIR%%/work



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