git: b890ffa426c9 - main - www/homer: general improvements

From: Dries Michiels <driesm_at_FreeBSD.org>
Date: Tue, 31 Oct 2023 12:39:27 UTC
The branch main has been updated by driesm:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b890ffa426c92aeae2026635a9fea06819112ab9

commit b890ffa426c92aeae2026635a9fea06819112ab9
Author:     Dries Michiels <driesm@FreeBSD.org>
AuthorDate: 2023-10-31 12:25:33 +0000
Commit:     Dries Michiels <driesm@FreeBSD.org>
CommitDate: 2023-10-31 12:39:14 +0000

    www/homer: general improvements
    
    - Config file now located in ETCDIR, adhere to hier
    - No need to own files by user, they don't need to be writeable
---
 www/homer/Makefile  | 10 +++++++---
 www/homer/pkg-plist |  9 +++------
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/www/homer/Makefile b/www/homer/Makefile
index cdfae06d8b5e..75644fb87a77 100644
--- a/www/homer/Makefile
+++ b/www/homer/Makefile
@@ -1,6 +1,7 @@
 PORTNAME=	homer
 DISTVERSIONPREFIX=	v
 DISTVERSION=	23.10.1
+PORTREVISION=	1
 CATEGORIES=	www
 MASTER_SITES=	https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/releases/download/${GH_TAGNAME}/
 DISTNAME=	homer
@@ -18,8 +19,6 @@ GH_ACCOUNT=	bastienwirtz
 NO_ARCH=	YES
 NO_BUILD=	YES
 
-PLIST_SUB=	HOMER_USERNAME=${WWWOWN}
-
 do-install:
 	${MKDIR} ${STAGEDIR}${WWWDIR}
 	${CP} -a ${WRKDIR}/*.js ${WRKDIR}/logo.png ${WRKDIR}/index.html ${STAGEDIR}${WWWDIR}
@@ -27,7 +26,12 @@ do-install:
 	cd ${WRKDIR}/assets && ${COPYTREE_SHARE} . ${STAGEDIR}${WWWDIR}/assets
 	${MKDIR} ${STAGEDIR}${WWWDIR}/resources
 	cd ${WRKDIR}/resources && ${COPYTREE_SHARE} . ${STAGEDIR}${WWWDIR}/resources
+	${MKDIR} ${STAGEDIR}${ETCDIR}
 	${INSTALL_DATA} ${WRKDIR}/assets/config.yml.dist \
-		${STAGEDIR}${WWWDIR}/assets/config.yml
+		${STAGEDIR}${ETCDIR}/config.yml
+
+post-install:
+	${RLN} ${STAGEDIR}${ETCDIR}/config.yml ${STAGEDIR}${WWWDIR}/assets/config.yml
+
 
 .include <bsd.port.mk>
diff --git a/www/homer/pkg-plist b/www/homer/pkg-plist
index 6477ccb8ff81..c0f5519e8d84 100644
--- a/www/homer/pkg-plist
+++ b/www/homer/pkg-plist
@@ -1,11 +1,8 @@
-@owner %%HOMER_USERNAME%%
-@dir %%WWWDIR%%/assets
-@dir %%WWWDIR%%/assets/icons
-@dir %%WWWDIR%%/assets/tools
-@dir %%WWWDIR%%/resources
+@dir %%ETCDIR%%
 %%WWWDIR%%/assets/additional-page.yml.dist
 %%WWWDIR%%/assets/config-demo.yml.dist
-@sample %%WWWDIR%%/assets/config.yml.dist %%WWWDIR%%/assets/config.yml
+%%WWWDIR%%/assets/config.yml
+@sample %%WWWDIR%%/assets/config.yml.dist %%ETCDIR%%/config.yml
 %%WWWDIR%%/assets/config.yml.dist.sample-sui
 %%WWWDIR%%/assets/custom.css.sample
 %%WWWDIR%%/assets/icons/README.md