CVS commit: pkgsrc/mail/php-dmarc-srg

"Takahiro Kambe" <[email protected]>
Newsgroups gmane.os.netbsd.devel.pkgsrc.cvs
Message-ID <[email protected]>
Module Name:	pkgsrc
Committed By:	taca
Date:		Wed Aug 12 08:04:35 UTC 2026

Modified Files:
	pkgsrc/mail/php-dmarc-srg: Makefile distinfo
Added Files:
	pkgsrc/mail/php-dmarc-srg: INSTALL
	pkgsrc/mail/php-dmarc-srg/patches: patch-config_vendor__config.php
	    patch-init.php

Log Message:
mail/php-dmarc-srg: improve configuration handling

Install configuration files under PKG_SYSCONFDIR.

Bump PKGREVISION.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/mail/php-dmarc-srg/INSTALL
cvs rdiff -u -r1.9 -r1.10 pkgsrc/mail/php-dmarc-srg/Makefile
cvs rdiff -u -r1.3 -r1.4 pkgsrc/mail/php-dmarc-srg/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/mail/php-dmarc-srg/patches/patch-config_vendor__config.php \
    pkgsrc/mail/php-dmarc-srg/patches/patch-init.php

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
(unnamed) (text/x-diff, 5.1 KB)
Modified files:

Index: pkgsrc/mail/php-dmarc-srg/Makefile
diff -u pkgsrc/mail/php-dmarc-srg/Makefile:1.9 pkgsrc/mail/php-dmarc-srg/Makefile:1.10
--- pkgsrc/mail/php-dmarc-srg/Makefile:1.9	Thu Jan  8 14:17:48 2026
+++ pkgsrc/mail/php-dmarc-srg/Makefile	Wed Aug 12 08:04:35 2026
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.9 2026/01/08 14:17:48 taca Exp $
+# $NetBSD: Makefile,v 1.10 2026/08/12 08:04:35 taca Exp $
 
 DISTNAME=	dmarc-srg-${GITHUB_RELEASE}
 PKGNAME=	${PHP_PKG_PREFIX}-${DISTNAME}
+PKGREVISION=	1
 CATEGORIES=	mail
 MASTER_SITES=	${MASTER_SITE_GITHUB:=liuch/}
 GITHUB_PROJECT=	dmarc-srg
@@ -30,22 +31,30 @@ WEBBASE=	dmarc-srg
 WEBDIR=		share/${PHP_PKG_PREFIX}/${WEBBASE}
 EGDIR=		share/examples/${PHP_PKG_PREFIX}/${WEBBASE}
 
-INSTALLATION_DIRS+=	${WEBDIR}/config ${EGDIR}
-OWN_DIRS_PERMS+=	${WEBDIR}/config ${REAL_ROOT_USER} ${APACHE_GROUP} 0750
-CONF_FILES+=		${EGDIR}/conf.php ${WEBDIR}/config/conf.php
+PKG_SYSCONFSUBDIR=	${WEBBASE}
+
+INSTALLATION_DIRS+=	${EGDIR}
+OWN_DIRS_PERMS+=	${PKG_SYSCONFDIR} ${REAL_ROOT_USER} ${APACHE_GROUP} 0750
+CONF_FILES+=		${EGDIR}/conf.php ${PKG_SYSCONFDIR}/conf.php
 CONF_FILES+=		${EGDIR}/vendor_config.php \
-			${WEBDIR}/config/vendor_config.php
+			${PKG_SYSCONFDIR}/vendor_config.php
 PLIST_SUBST+=		EGDIR=${EGDIR} WEBDIR=${WEBDIR}
 PRINT_PLIST_AWK+=	/^${EGDIR:S|/|\\/|g}/ \
 			{ gsub(/${EGDIR:S|/|\\/|g}/, "$${EGDIR}") }
 PRINT_PLIST_AWK+=	/^${WEBDIR:S|/|\\/|g}/ \
 			{ gsub(/${WEBDIR:S|/|\\/|g}/, "$${WEBDIR}") }
 
-pre-configure:
-	${MV} ${WRKSRC}/config/conf.sample.php ${WRKDIR}/conf.php
-	${MV} ${WRKSRC}/config/vendor_config.php ${WRKDIR}
+FILES_SUBST+=		WEBDIR=${WEBDIR}
+
+SUBST_CLASSES+=		files
+SUBST_STAGE.files=	do-configure
+SUBST_MESSAGE.files=	Fixing configuration files.
+SUBST_FILES.files=	config/vendor_config.php init.php
+SUBST_VARS.files+=	PKG_SYSCONFDIR
 
 do-install:
+	${MV} ${WRKSRC}/config/conf.sample.php ${WRKDIR}/conf.php
+	${MV} ${WRKSRC}/config/vendor_config.php ${WRKDIR}
 	cd ${WRKSRC} && ${FIND} . -type f \! -name '*.orig' -print | \
 		pax -rw ${DESTDIR}${PREFIX}/${WEBDIR}
 	${INSTALL_DATA} ${WRKDIR}/conf.php ${WRKDIR}/vendor_config.php \

Index: pkgsrc/mail/php-dmarc-srg/distinfo
diff -u pkgsrc/mail/php-dmarc-srg/distinfo:1.3 pkgsrc/mail/php-dmarc-srg/distinfo:1.4
--- pkgsrc/mail/php-dmarc-srg/distinfo:1.3	Mon Jun  9 16:30:32 2025
+++ pkgsrc/mail/php-dmarc-srg/distinfo	Wed Aug 12 08:04:35 2026
@@ -1,5 +1,7 @@
-$NetBSD: distinfo,v 1.3 2025/06/09 16:30:32 taca Exp $
+$NetBSD: distinfo,v 1.4 2026/08/12 08:04:35 taca Exp $
 
 BLAKE2s (dmarc-srg-2.3.tar.gz) = e7dd5ecd5926841d95df0d1c19b292f876187b8b21202f03b2173f954743a00b
 SHA512 (dmarc-srg-2.3.tar.gz) = fbadac432772207d53dc5874061aaaa28dd01046409c2d0b0c135789aabf67aef6d8af3e1fecaa6dd481fb8f611e7b11d4a7dc2044d3b0d3cecf80093a6afa23
 Size (dmarc-srg-2.3.tar.gz) = 189181 bytes
+SHA1 (patch-config_vendor__config.php) = 27bb8f9e46601b8f6c298823400e89d83407b36a
+SHA1 (patch-init.php) = 71fe64aa063114a53445b91591a8c70ea1a0b81d

Added files:

Index: pkgsrc/mail/php-dmarc-srg/INSTALL
diff -u /dev/null pkgsrc/mail/php-dmarc-srg/INSTALL:1.1
--- /dev/null	Wed Aug 12 08:04:35 2026
+++ pkgsrc/mail/php-dmarc-srg/INSTALL	Wed Aug 12 08:04:35 2026
@@ -0,0 +1,14 @@
+#!@SH@
+#
+# $NetBSD: INSTALL,v 1.1 2026/08/12 08:04:35 taca Exp $
+
+conf_old=@PREFIX@/@WEBDIR@/conf.php
+conf=@PKG_SYSCONFDIR@/conf.php
+
+case ${STAGE} in
+POST-INSTALL)
+	if test -f ${conf_old}; then
+		mv ${conf_old} ${conf}
+	fi
+	;;
+esac

Index: pkgsrc/mail/php-dmarc-srg/patches/patch-config_vendor__config.php
diff -u /dev/null pkgsrc/mail/php-dmarc-srg/patches/patch-config_vendor__config.php:1.1
--- /dev/null	Wed Aug 12 08:04:35 2026
+++ pkgsrc/mail/php-dmarc-srg/patches/patch-config_vendor__config.php	Wed Aug 12 08:04:35 2026
@@ -0,0 +1,15 @@
+$NetBSD: patch-config_vendor__config.php,v 1.1 2026/08/12 08:04:35 taca Exp $
+
+Adjust config file's path.
+
+--- config/vendor_config.php.orig	2025-03-17 23:58:10.000000000 +0000
++++ config/vendor_config.php
+@@ -16,7 +16,7 @@ return [
+     /**
+      * Path to the configuration file.
+      */
+-    'config_file' => ROOT_PATH . 'config' . DIRECTORY_SEPARATOR . 'conf.php',
++    'config_file' => '@PKG_SYSCONFDIR@' . DIRECTORY_SEPARATOR . 'conf.php',
+ 
+     /**
+      * Suffix to add to the DmarcSrg version
Index: pkgsrc/mail/php-dmarc-srg/patches/patch-init.php
diff -u /dev/null pkgsrc/mail/php-dmarc-srg/patches/patch-init.php:1.1
--- /dev/null	Wed Aug 12 08:04:35 2026
+++ pkgsrc/mail/php-dmarc-srg/patches/patch-init.php	Wed Aug 12 08:04:35 2026
@@ -0,0 +1,15 @@
+$NetBSD: patch-init.php,v 1.1 2026/08/12 08:04:35 taca Exp $
+
+Adjust config file's path.
+
+--- init.php.orig	2025-03-17 23:58:10.000000000 +0000
++++ init.php
+@@ -24,7 +24,7 @@ if (!defined('ROOT_PATH')) {
+     define('ROOT_PATH', __DIR__ . (__DIR__ === DIRECTORY_SEPARATOR ? '' : DIRECTORY_SEPARATOR));
+ }
+ 
+-$vc = require_once(ROOT_PATH . 'config' . DIRECTORY_SEPARATOR . 'vendor_config.php');
++$vc = require_once('@PKG_SYSCONFDIR@' . DIRECTORY_SEPARATOR . 'vendor_config.php');
+ if (!is_array($vc) || !isset($vc['autoload_file'], $vc['config_file'], $vc['version_suffix'])) {
+     echo 'Error: Incorrect vendor config file';
+     exit;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.