Fri Aug 18 22:20:49 2023 UTC ()
Rework the www/viewvc package some:

Put the preferences under PKG_SYSCONFDIR
Pre-set pkgsrc-dependend viewvc.conf entries
Lose the MESSAGE, it was pointless
Install the docs


(hauke)
diff -r1.1 -r0 pkgsrc/www/viewvc/MESSAGE
diff -r1.43 -r1.44 pkgsrc/www/viewvc/Makefile
diff -r1.6 -r1.7 pkgsrc/www/viewvc/PLIST
diff -r1.22 -r1.23 pkgsrc/www/viewvc/distinfo
diff -r1.5 -r0 pkgsrc/www/viewvc/patches/patch-aa
diff -r1.5 -r0 pkgsrc/www/viewvc/patches/patch-ab
diff -r0 -r1.1 pkgsrc/www/viewvc/patches/patch-conf_viewvc.conf.dist
diff -r0 -r1.1 pkgsrc/www/viewvc/patches/patch-lib_viewvc.py
diff -r0 -r1.1 pkgsrc/www/viewvc/patches/patch-viewvc-install
Sat Aug 19 07:20:49 2023
Mon Jun 26 19:41:19 2023
pkgsrc/www/viewvc/MESSAGE,v

anoncvs not yet been updated
Sat Aug 19 07:20:49 2023
Mon Jun 26 19:41:19 2023
pkgsrc/www/viewvc/patches/patch-aa,v

anoncvs not yet been updated
Sat Aug 19 07:20:49 2023
Mon Jun 26 19:41:19 2023
pkgsrc/www/viewvc/patches/patch-ab,v

anoncvs not yet been updated

File Deleted: pkgsrc/www/viewvc/MESSAGE

cvs diff -r1.43 -r1.44 pkgsrc/www/viewvc/Makefile (expand / switch to unified diff)

--- pkgsrc/www/viewvc/Makefile 2023/08/17 21:26:49 1.43
+++ pkgsrc/www/viewvc/Makefile 2023/08/18 22:20:49 1.44
@@ -1,68 +1,85 @@ @@ -1,68 +1,85 @@
1# $NetBSD: Makefile,v 1.43 2023/08/17 21:26:49 hauke Exp $ 1# $NetBSD: Makefile,v 1.44 2023/08/18 22:20:49 hauke Exp $
2 2
3DISTNAME= viewvc-1.2.3 3DISTNAME= viewvc-1.2.3
4PKGREVISION= 1 4PKGREVISION= 2
5CATEGORIES= devel www 5CATEGORIES= devel www
6MASTER_SITES= ${MASTER_SITE_GITHUB:=viewvc/} 6MASTER_SITES= ${MASTER_SITE_GITHUB:=viewvc/}
7 7
8MAINTAINER= pkgsrc-users@NetBSD.org 8MAINTAINER= pkgsrc-users@NetBSD.org
9HOMEPAGE= http://www.viewvc.org/ 9HOMEPAGE= https://www.viewvc.org/
10COMMENT= Viewing the content of CVS/SVN repositories with a Webbrowser 10COMMENT= Viewing the content of CVS/SVN repositories with a Webbrowser
11LICENSE= 2-clause-bsd 11LICENSE= 2-clause-bsd
12 12
13REPLACE_PYTHON= viewvc-install bin/* bin/cgi/*.cgi lib/*.py 13REPLACE_PYTHON= viewvc-install bin/* bin/cgi/*.cgi lib/*.py
14# https://github.com/viewvc/viewvc/issues/138 14# https://github.com/viewvc/viewvc/issues/138
15PYTHON_VERSIONS_ACCEPTED= 27 # not yet ported as of 1.1.27 15PYTHON_VERSIONS_ACCEPTED= 27 # not yet ported as of 1.2.3
16 16
17.if !exists(/usr/bin/rlog) 17.if exists(/usr/bin/rlog)
18DEPENDS+= rcs-[0-9]*:../../devel/rcs 18RCSPATH= /usr/bin
19RCS_PKG= YES 
20.else 19.else
21RCS_PKG= NO 20DEPENDS+= rcs-[0-9]*:../../devel/rcs
 21RCSPATH= ${PREFIX}/bin
22.endif 22.endif
23 23
24NO_BUILD= YES 24NO_BUILD= YES
 25
 26DOCDIR= share/doc/viewvc
 27EGDIR= share/examples/viewvc
25VIEWVCDIR= share/viewvc 28VIEWVCDIR= share/viewvc
26PLIST_SUBST+= VIEWVCDIR=${VIEWVCDIR:Q} 
27 29
28CONF_FILES= ${PREFIX}/share/examples/viewvc/viewvc.conf \ 30CFGFILES= cvsgraph.conf mimetypes.conf viewvc.conf
29 ${PREFIX}/${VIEWVCDIR:Q}/viewvc.conf 31DOCFILES= CHANGES INSTALL \
30CONF_FILES+= ${PREFIX}/share/examples/viewvc/cvsgraph.conf \ 32 docs/template-authoring-guide.html \
31 ${PREFIX}/${VIEWVCDIR:Q}/cvsgraph.conf 33 docs/upgrading-howto.html \
 34 docs/url-reference.html
 35
 36PKG_SYSCONFSUBDIR= viewvc
 37
 38.for cfg in ${CFGFILES}
 39CONF_FILES+= ${EGDIR}/${cfg} ${PKG_SYSCONFDIR}/${cfg}
 40.endfor
 41
 42PLIST_SUBST+= VIEWVCDIR=${VIEWVCDIR:Q}
 43
 44PRINT_PLIST_AWK+= { gsub(/^${VIEWVCDIR:S|/|\\/|g}/, "$${VIEWVCDIR}"); }
32 45
33.include "options.mk" 46.include "options.mk"
34 47
 48SUBST_CLASSES+= paths
 49SUBST_STAGE.paths= pre-configure
 50SUBST_MESSAGE.paths= Fixing pkgsrc paths.
 51SUBST_FILES.paths+= lib/viewvc.py
 52SUBST_FILES.paths+= viewvc-install
 53SUBST_VARS.paths= PREFIX PKG_SYSCONFDIR
 54
 55DIFF= ${TOOLS_PATH.diff}
 56
35SUBST_CLASSES+= conf 57SUBST_CLASSES+= conf
36SUBST_STAGE.conf= pre-configure 58SUBST_STAGE.conf= pre-configure
37SUBST_MESSAGE.conf= Fixing configuration files. 59SUBST_MESSAGE.conf= Fixing configuration files.
38SUBST_FILES.conf= conf/viewvc.conf.dist 60SUBST_FILES.conf= conf/viewvc.conf.dist
39SUBST_VARS.conf= PREFIX PKG_SYSCONFDIR 61SUBST_VARS.conf= PREFIX PKG_SYSCONFBASE PKG_SYSCONFDIR
40SUBST_VARS.conf+= VIEWVCDIR PHP_OPT CVSGRAPH_OPT 62SUBST_VARS.conf+= VIEWVCDIR DIFF RCSPATH CVSGRAPH_OPT
41.if defined(RCS_PKG) && ${RCS_PKG} == "YES" 
42SUBST_SED.conf+= -e "s|@RCS_PREFIX@|${PREFIX}|g" 
43.else 
44SUBST_SED.conf+= -e "s|@RCS_PREFIX@|/usr|g" 
45.endif 
46 63
47CHECK_PORTABILITY_SKIP= tools/make-release 64CHECK_PORTABILITY_SKIP= tools/make-release
48 65
49INSTALLATION_DIRS= share/examples/viewvc 66INSTALLATION_DIRS= ${DOCDIR} ${EGDIR}
50 67
51do-install: 68do-install:
52 (cd ${WRKSRC} && \ 69 (cd ${WRKSRC} && ${PYTHONBIN} viewvc-install \
53 ${PYTHONBIN} \ 70 --prefix=${PREFIX}/${VIEWVCDIR} --destdir=${DESTDIR})
54 viewvc-install --prefix=${PREFIX}/${VIEWVCDIR} --destdir=${DESTDIR}) 71.for cfg in ${CFGFILES}
55 72 ${INSTALL_DATA} ${WRKSRC}/conf/${cfg}.dist \
56 ${INSTALL_DATA} ${WRKSRC}/conf/viewvc.conf.dist \ 73 ${DESTDIR}${PREFIX}/${EGDIR}/${cfg}
57 ${DESTDIR}${PREFIX}/share/examples/viewvc/viewvc.conf 74.endfor
58 ${INSTALL_DATA} ${WRKSRC}/conf/cvsgraph.conf.dist \ 75.for doc in ${DOCFILES}
59 ${DESTDIR}${PREFIX}/share/examples/viewvc/cvsgraph.conf 76 ${INSTALL_DATA} ${WRKSRC}/${doc} \
 77 ${DESTDIR}${PREFIX}/${DOCDIR}/${doc:T}
 78.endfor
60 79
61post-install: 80post-install:
62 ${CHMOD} ${SHAREMODE} \ 81 ( cd ${DESTDIR}/${PREFIX}/${VIEWVCDIR}/bin/mod_python ; \
63 ${DESTDIR}/${PREFIX}/share/viewvc/bin/mod_python/.htaccess 82 ${CHMOD} ${SHAREMODE} .htaccess *.py)
64 ${CHMOD} ${SHAREMODE} \ 
65 ${DESTDIR}/${PREFIX}/share/viewvc/bin/mod_python/*.py 
66 83
67.include "../../lang/python/application.mk" 84.include "../../lang/python/application.mk"
68.include "../../mk/bsd.pkg.mk" 85.include "../../mk/bsd.pkg.mk"

cvs diff -r1.6 -r1.7 pkgsrc/www/viewvc/PLIST (expand / switch to unified diff)

--- pkgsrc/www/viewvc/PLIST 2020/03/17 22:14:15 1.6
+++ pkgsrc/www/viewvc/PLIST 2023/08/18 22:20:49 1.7
@@ -1,15 +1,21 @@ @@ -1,15 +1,21 @@
1@comment $NetBSD: PLIST,v 1.6 2020/03/17 22:14:15 wiz Exp $ 1@comment $NetBSD: PLIST,v 1.7 2023/08/18 22:20:49 hauke Exp $
 2share/doc/viewvc/CHANGES
 3share/doc/viewvc/INSTALL
 4share/doc/viewvc/template-authoring-guide.html
 5share/doc/viewvc/upgrading-howto.html
 6share/doc/viewvc/url-reference.html
2share/examples/viewvc/cvsgraph.conf 7share/examples/viewvc/cvsgraph.conf
 8share/examples/viewvc/mimetypes.conf
3share/examples/viewvc/viewvc.conf 9share/examples/viewvc/viewvc.conf
4${VIEWVCDIR}/bin/cgi/viewvc.cgi 10${VIEWVCDIR}/bin/cgi/viewvc.cgi
5${VIEWVCDIR}/bin/cvsdbadmin 11${VIEWVCDIR}/bin/cvsdbadmin
6${VIEWVCDIR}/bin/loginfo-handler 12${VIEWVCDIR}/bin/loginfo-handler
7${VIEWVCDIR}/bin/make-database 13${VIEWVCDIR}/bin/make-database
8${VIEWVCDIR}/bin/mod_python/.htaccess 14${VIEWVCDIR}/bin/mod_python/.htaccess
9${VIEWVCDIR}/bin/mod_python/handler.py 15${VIEWVCDIR}/bin/mod_python/handler.py
10${VIEWVCDIR}/bin/mod_python/viewvc.py 16${VIEWVCDIR}/bin/mod_python/viewvc.py
11${VIEWVCDIR}/bin/standalone.py 17${VIEWVCDIR}/bin/standalone.py
12${VIEWVCDIR}/bin/svndbadmin 18${VIEWVCDIR}/bin/svndbadmin
13${VIEWVCDIR}/bin/wsgi/viewvc.fcgi 19${VIEWVCDIR}/bin/wsgi/viewvc.fcgi
14${VIEWVCDIR}/bin/wsgi/viewvc.wsgi 20${VIEWVCDIR}/bin/wsgi/viewvc.wsgi
15${VIEWVCDIR}/lib/accept.py 21${VIEWVCDIR}/lib/accept.py

cvs diff -r1.22 -r1.23 pkgsrc/www/viewvc/distinfo (expand / switch to unified diff)

--- pkgsrc/www/viewvc/distinfo 2023/08/17 21:26:49 1.22
+++ pkgsrc/www/viewvc/distinfo 2023/08/18 22:20:49 1.23
@@ -1,7 +1,8 @@ @@ -1,7 +1,8 @@
1$NetBSD: distinfo,v 1.22 2023/08/17 21:26:49 hauke Exp $ 1$NetBSD: distinfo,v 1.23 2023/08/18 22:20:49 hauke Exp $
2 2
3BLAKE2s (viewvc-1.2.3.tar.gz) = 4efe844e1fedca51c40245d61c96e951b30db0fb9081e54230459a508be19144 3BLAKE2s (viewvc-1.2.3.tar.gz) = 4efe844e1fedca51c40245d61c96e951b30db0fb9081e54230459a508be19144
4SHA512 (viewvc-1.2.3.tar.gz) = dd5fd1d01629e7e6894e3bd244579a3581883ffb18f66e4ca44b911a5bc41810fcdd1176bfdbf0b88c943780b61c1af2a35c4dd8d757b9e10ff00d560eee0a0f 4SHA512 (viewvc-1.2.3.tar.gz) = dd5fd1d01629e7e6894e3bd244579a3581883ffb18f66e4ca44b911a5bc41810fcdd1176bfdbf0b88c943780b61c1af2a35c4dd8d757b9e10ff00d560eee0a0f
5Size (viewvc-1.2.3.tar.gz) = 361272 bytes 5Size (viewvc-1.2.3.tar.gz) = 361272 bytes
6SHA1 (patch-aa) = ff0a6e52ea66c838ba3ab7b1d055c27bf561a376 6SHA1 (patch-conf_viewvc.conf.dist) = 44d16cc79e02bac4639a61235b6685ab8c56c26d
7SHA1 (patch-ab) = 5be3c5eb60e58341510a96c5a2cab230beec956e 7SHA1 (patch-lib_viewvc.py) = d6ba030b22b4284d36edec3f482394b97f30c19a
 8SHA1 (patch-viewvc-install) = e05fa7219d8a55b0359336b2f08cef20c4bf6cfa

File Deleted: pkgsrc/www/viewvc/patches/patch-aa

File Deleted: pkgsrc/www/viewvc/patches/patch-ab

File Added: pkgsrc/www/viewvc/patches/patch-conf_viewvc.conf.dist
$NetBSD: patch-conf_viewvc.conf.dist,v 1.1 2023/08/18 22:20:49 hauke Exp $

Make paths adaptable for pkgsrc installation.

--- conf/viewvc.conf.dist.orig	2023-01-04 14:48:34.000000000 +0000
+++ conf/viewvc.conf.dist
@@ -218,7 +218,8 @@
 ##                    /etc/mime.types,
 ##                    /usr/local/apache2/conf/mime.types
 ##
-#mime_types_files = mimetypes.conf
+#mime_types_files = @PKG_SYSCONFDIR@/mimetypes.conf,
+#                   @PKG_SYSCONFBASE@/httpd/mime.types
 
 ## address: The address of the local repository maintainer.  (This
 ## option is provided only as a convenience for ViewVC installations
@@ -312,7 +313,7 @@
 ## Example:
 ## rcs_dir = /usr/bin/
 ##
-#rcs_dir =
+rcs_dir = @RCSPATH@/
 
 ## cvsnt: Location of cvsnt program.  ViewVC can use CVSNT (www.cvsnt.org)
 ## instead of the RCS utilities to retrieve information from CVS
@@ -334,7 +335,7 @@
 ## Example:
 ## diff = /usr/bin/diff
 ##
-#diff = 
+diff = @DIFF@
 
 ## cvsgraph: Location of the CvsGraph program, a graphical CVS version
 ## graph generator (see options.use_cvsgraph).
@@ -342,7 +343,7 @@
 ## Example:
 ## cvsgraph = /usr/local/bin/cvsgraph
 ##
-#cvsgraph =
+cvsgraph = @PREFIX@/bin/cvsgraph
 
 
 ##---------------------------------------------------------------------------
@@ -662,7 +663,7 @@
 ## template_dir = templates/default
 ## template_dir = /opt/custom-viewvc-templates/templates
 #
-#template_dir = templates/default
+template_dir = @PREFIX@/@VIEWVCDIR@/templates/default
 
 ## docroot: Web path to a directory that contains ViewVC static files
 ## (stylesheets, images, etc.)  If set, static files will get
@@ -753,13 +754,13 @@
 
 ## use_cvsgraph: Use CvsGraph to offer visual graphs of CVS revision history.
 ##
-#use_cvsgraph = 0
+use_cvsgraph = @CVSGRAPH_OPT@
 
 ## cvsgraph_conf: Location of the customized cvsgraph configuration file.
 ## May be specified as an absolute path or as a path relative to this
 ## configuration file.
 ##
-#cvsgraph_conf = cvsgraph.conf
+cvsgraph_conf = @PKG_SYSCONFDIR@/cvsgraph.conf
 
 ## allowed_cvsgraph_useropts: A list of settings used for cvsgraph's
 ## user-modifiable behavior which can be changed in the graph display.

File Added: pkgsrc/www/viewvc/patches/patch-lib_viewvc.py
$NetBSD: patch-lib_viewvc.py,v 1.1 2023/08/18 22:20:49 hauke Exp $

Look for config file under PKG_SYSCONFDIR

--- lib/viewvc.py.orig	2023-01-04 14:48:34.000000000 +0000
+++ lib/viewvc.py
@@ -5158,6 +5158,7 @@ def load_config(pathname=None, server=No
   # default.
   pathname = (env_pathname
               or pathname
+              or "@PKG_SYSCONFDIR@/viewvc.conf"
               or os.path.join(os.path.dirname(os.path.dirname(__file__)),
                               "viewvc.conf"))
 

File Added: pkgsrc/www/viewvc/patches/patch-viewvc-install
$NetBSD: patch-viewvc-install,v 1.1 2023/08/18 22:20:49 hauke Exp $

Let pkgsrc machinery take care of config files 

--- viewvc-install.orig	2023-01-04 14:48:34.000000000 +0000
+++ viewvc-install
@@ -56,12 +56,6 @@ FILE_INFO_LIST = [
     ("bin/cvsdbadmin",            "bin/cvsdbadmin",            0755, 1, 0, 0),
     ("bin/svndbadmin",            "bin/svndbadmin",            0755, 1, 0, 0),
     ("bin/make-database",         "bin/make-database",         0755, 1, 0, 0),
-    ("conf/viewvc.conf.dist",     "viewvc.conf.dist",          0644, 0, 0, 0),
-    ("conf/viewvc.conf.dist",     "viewvc.conf",               0644, 0, 1, 0),
-    ("conf/cvsgraph.conf.dist",   "cvsgraph.conf.dist",        0644, 0, 0, 0),
-    ("conf/cvsgraph.conf.dist",   "cvsgraph.conf",             0644, 0, 1, 0),
-    ("conf/mimetypes.conf.dist",  "mimetypes.conf.dist",       0644, 0, 0, 0),
-    ("conf/mimetypes.conf.dist",  "mimetypes.conf",            0644, 0, 1, 0),
     ]
 if sys.platform == "win32":
   FILE_INFO_LIST.extend([
@@ -128,7 +122,7 @@ def replace_paths(contents):
         shbang = '#!' + sys.executable
         contents = re.sub('^#![^\n]*', _escape(shbang), contents)
     contents = replace_var(contents, 'LIBRARY_DIR', 'lib')
-    contents = replace_var(contents, 'CONF_PATHNAME', 'viewvc.conf')
+    contents = replace_var(contents, 'CONF_PATHNAME', '@PKG_SYSCONFDIR@/viewvc.conf')
     return contents