git: b521c14b6d8a - main - www/adguardhome: update 0.107.51 → 0.107.53
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 14 Oct 2024 17:32:11 UTC
The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=b521c14b6d8a099a172e55e869de65a99680cd47 commit b521c14b6d8a099a172e55e869de65a99680cd47 Author: Denis Shaposhnikov <dsh@bamus.cz> AuthorDate: 2024-10-14 15:02:33 +0000 Commit: Yuri Victorovich <yuri@FreeBSD.org> CommitDate: 2024-10-14 17:32:08 +0000 www/adguardhome: update 0.107.51 → 0.107.53 PR: 281875 --- www/adguardhome/Makefile | 47 +++++++++------------------- www/adguardhome/distinfo | 16 +++++----- www/adguardhome/files/adguardhome.in | 59 ++++++++++++++++++------------------ www/adguardhome/files/newsyslog.conf | 5 +++ www/adguardhome/files/patch-go.mod | 10 ++++++ www/adguardhome/pkg-plist | 3 ++ 6 files changed, 70 insertions(+), 70 deletions(-) diff --git a/www/adguardhome/Makefile b/www/adguardhome/Makefile index 8cdc2f055541..95d394f1b173 100644 --- a/www/adguardhome/Makefile +++ b/www/adguardhome/Makefile @@ -1,8 +1,9 @@ PORTNAME= adguardhome DISTVERSIONPREFIX= v -DISTVERSION= 0.107.51 -PORTREVISION= 4 +DISTVERSION= 0.107.53 CATEGORIES= www +MASTER_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/releases/download/${DISTVERSIONFULL}/ +DISTFILES= ${GH_PROJECT}_frontend${EXTRACT_SUFX} MAINTAINER= yuri@FreeBSD.org COMMENT= Network-wide ads & trackers blocking DNS server @@ -13,47 +14,29 @@ LICENSE_FILE= ${WRKSRC}/LICENSE.txt RUN_DEPENDS= ca_root_nss>=0:security/ca_root_nss -USES= cpe go:1.22,modules +USES= cpe go:1.23,modules -GO_MODULE= github.com/AdguardTeam/AdGuardHome -GO_BUILDFLAGS= -ldflags="-s -w -X github.com/AdguardTeam/AdGuardHome/internal/version.version=${DISTVERSION}" # workaround for https://github.com/AdguardTeam/AdGuardHome/issues/4774 - -# to rebuild the deps archives: -# 1. set DEV_UPDATE_MODE=yes -# 2. make makesum build -# 3. upload the *-html-{build,client}* archives -# 4. set DEV_UPDATE_MODE=no -# 5. make clean makesum +GH_ACCOUNT= AdguardTeam +GH_PROJECT= AdGuardHome -DEV_UPDATE_MODE= no +GO_MODULE= github.com/AdguardTeam/AdGuardHome +GO_BUILDFLAGS= -ldflags="-s -w -X github.com/${GH_ACCOUNT}/${GH_PROJECT}/internal/version.version=${DISTVERSION}" # workaround for https://github.com/AdguardTeam/AdGuardHome/issues/4774 USER= root # it has to run as root because it listens on the privileged DNS port GROUP= wheel SUB_LIST= USER=${USER} GROUP=${GROUP} USE_RC_SUBR= ${PORTNAME} +PLIST_SUB= PORTNAME=${PORTNAME} CPE_VENDOR= adguard -.if (${DEV_UPDATE_MODE} == "yes") -BUILD_DEPENDS= npm:www/npm \ - yarn:www/yarn -MAKE_ENV+= NODE_OPTIONS=--openssl-legacy-provider # workaround suggested in https://github.com/AdguardTeam/AdGuardHome/issues/6585 - -do-build: - @cd ${WRKSRC} && \ - ${SETENV} ${MAKE_ENV} ${MAKE_CMD} js-deps js-build && \ - ${TAR} czf ${DISTDIR}/${DIST_SUBDIR}/${PORTNAME}-html-build-${DISTVERSION}${EXTRACT_SUFX} build && \ - ${TAR} czf ${DISTDIR}/${DIST_SUBDIR}/${PORTNAME}-html-client-${DISTVERSION}${EXTRACT_SUFX} client && \ - ${ECHO} "Please upload files ${DISTDIR}/${DIST_SUBDIR}/${PORTNAME}-html-build-${DISTVERSION}${EXTRACT_SUFX} and ${DISTDIR}/${DIST_SUBDIR}/${PORTNAME}-html-client-${DISTVERSION}${EXTRACT_SUFX}" -.else -MASTER_SITES= LOCAL/yuri/:deps -DISTFILES= ${PORTNAME}-html-build-${DISTVERSION}${EXTRACT_SUFX}:deps \ - ${PORTNAME}-html-client-${DISTVERSION}${EXTRACT_SUFX}:deps - pre-build: - @${CP} -r ${WRKDIR}/build ${WRKDIR}/client ${WRKSRC}/ -.endif + @${CP} -r ${WRKDIR}/build ${WRKSRC}/ -PLIST_FILES= bin/${PORTNAME} +post-install: + ${MKDIR} ${STAGEDIR}${EXAMPLESDIR} \ + ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d + ${INSTALL_DATA} ${FILESDIR}/newsyslog.conf \ + ${STAGEDIR}${EXAMPLESDIR}/newsyslog.conf .include <bsd.port.mk> diff --git a/www/adguardhome/distinfo b/www/adguardhome/distinfo index 83d0dfa44d43..48a2b454f73c 100644 --- a/www/adguardhome/distinfo +++ b/www/adguardhome/distinfo @@ -1,9 +1,7 @@ -TIMESTAMP = 1717774829 -SHA256 (go/www_adguardhome/adguardhome-v0.107.51/adguardhome-html-build-0.107.51.tar.gz) = 9e1c7f95401fc2555aa0cdf4475b3d06cf35ea86ce106fcc9bcd31b617e7ea0f -SIZE (go/www_adguardhome/adguardhome-v0.107.51/adguardhome-html-build-0.107.51.tar.gz) = 2817042 -SHA256 (go/www_adguardhome/adguardhome-v0.107.51/adguardhome-html-client-0.107.51.tar.gz) = f2ab3c324162e485795baae7293713b0b1c86141610148f392eb1999687f9e34 -SIZE (go/www_adguardhome/adguardhome-v0.107.51/adguardhome-html-client-0.107.51.tar.gz) = 36857142 -SHA256 (go/www_adguardhome/adguardhome-v0.107.51/v0.107.51.mod) = 674f69b0bd06161f1a8689b32eb5709cf1cfe3e5eb15afd601f00d9a1694f22c -SIZE (go/www_adguardhome/adguardhome-v0.107.51/v0.107.51.mod) = 2597 -SHA256 (go/www_adguardhome/adguardhome-v0.107.51/v0.107.51.zip) = cbd015bd2b5683d5cef9c17f6fc0ed055e96c3a07bd2aa98caaeb76a7c0e665c -SIZE (go/www_adguardhome/adguardhome-v0.107.51/v0.107.51.zip) = 2688166 +TIMESTAMP = 1728926887 +SHA256 (go/www_adguardhome/adguardhome-v0.107.53/AdGuardHome_frontend.tar.gz) = 69047225e2a5474e55fa56d12b71ba4e58e36b5af299f27099d216e1e7ab7f43 +SIZE (go/www_adguardhome/adguardhome-v0.107.53/AdGuardHome_frontend.tar.gz) = 2455367 +SHA256 (go/www_adguardhome/adguardhome-v0.107.53/v0.107.53.mod) = d1bc920c2193b1fcbfebcd8794b905295dbd610a21fe3de039546e079966b594 +SIZE (go/www_adguardhome/adguardhome-v0.107.53/v0.107.53.mod) = 2786 +SHA256 (go/www_adguardhome/adguardhome-v0.107.53/v0.107.53.zip) = 0e308e24be562dd2691a0549c12d360785afc72516d555f0931409b60dc4fe7c +SIZE (go/www_adguardhome/adguardhome-v0.107.53/v0.107.53.zip) = 2712383 diff --git a/www/adguardhome/files/adguardhome.in b/www/adguardhome/files/adguardhome.in index 347814f8a0d3..16035b8c1ff4 100644 --- a/www/adguardhome/files/adguardhome.in +++ b/www/adguardhome/files/adguardhome.in @@ -9,62 +9,63 @@ . /etc/rc.subr -name=adguardhome -rcvar=adguardhome_enable +name="adguardhome" +rcvar="${name}_enable" -load_rc_config $name +load_rc_config "$name" -: ${adguardhome_enable:=NO} -: ${adguardhome_config:=%%PREFIX%%/etc/AdGuardHome.yaml} -: ${adguardhome_user:=%%USER%%} -: ${adguardhome_group:=%%GROUP%%} -: ${adguardhome_work_dir:=/var/db/adguardhome} -: ${adguardhome_work_dir_data:=/var/db/adguardhome/data} -: ${adguardhome_svcj_options:="net_basic"} +: "${adguardhome_enable:=NO}" +: "${adguardhome_config:=%%PREFIX%%/etc/AdGuardHome.yaml}" +: "${adguardhome_user:=%%USER%%}" +: "${adguardhome_group:=%%GROUP%%}" +: "${adguardhome_work_dir:=/var/db/adguardhome}" +: "${adguardhome_svcj_options:=net_basic}" +: "${adguardhome_extra:=}" # old values -: ${adguardhome_config_old:=%%PREFIX%%/bin/AdGuardHome.yaml} -: ${adguardhome_work_dir_data_old:=%%PREFIX%%/bin/data} +: "${adguardhome_config_old:=%%PREFIX%%/bin/AdGuardHome.yaml}" +: "${adguardhome_work_dir_old:=%%PREFIX%%/bin}" logfile="/var/log/${name}.log" pidfile="/var/run/${name}.pid" -procname=%%PREFIX%%/bin/adguardhome command="/usr/sbin/daemon" -command_args="-u ${adguardhome_user} -o ${logfile} -t ${name} -p ${pidfile} %%PREFIX%%/bin/adguardhome -c ${adguardhome_config} -w ${adguardhome_work_dir}" +command_args="-H -o $logfile -t $name -P $pidfile %%PREFIX%%/bin/adguardhome -c $adguardhome_config -w $adguardhome_work_dir $adguardhome_extra" start_precmd="${name}_prestart" +extra_commands="reload" adguardhome_prestart() { # check if the old config exists - if [ -f ${adguardhome_config_old} ] || [ -d ${adguardhome_work_dir_data_old} ]; then - if ! [ -f ${adguardhome_config} ] && ! [ -d ${adguardhome_work_dir_data} ]; then # old config exists, new config doesn't exist + if [ -f "$adguardhome_config_old" ] || [ -d "${adguardhome_work_dir_old}/data" ]; then + if ! [ -f "$adguardhome_config" ] && ! [ -d "${adguardhome_work_dir}/data" ]; then + # old config exists, new config doesn't exist # move old config to new locations - if [ -f ${adguardhome_config_old} ]; then - echo "moving old config ${adguardhome_config_old} to the new location ${adguardhome_config}" - mv ${adguardhome_config_old} ${adguardhome_config} + if [ -f "$adguardhome_config_old" ]; then + echo "moving old config $adguardhome_config_old to the new location $adguardhome_config" + mv "$adguardhome_config_old" "$adguardhome_config" fi - if [ -d ${adguardhome_work_dir_data_old} ]; then - install -d -m 0750 -o ${adguardhome_user} -g ${adguardhome_group} \ - ${adguardhome_work_dir} - echo "moving old config ${adguardhome_work_dir_data_old} to the new location ${adguardhome_work_dir_data}" - mv ${adguardhome_work_dir_data_old} ${adguardhome_work_dir_data} + if [ -d "${adguardhome_work_dir_old}/data" ]; then + install -d -m 0750 -o "$adguardhome_user" \ + -g "$adguardhome_group" "$adguardhome_work_dir" + echo "moving old config ${adguardhome_work_dir_old}/data to the new location ${adguardhome_work_dir}/data" + mv "${adguardhome_work_dir_old}/data" "${adguardhome_work_dir}/data" fi else # both old and new config exist echo "(!!!) WARNING ==================================================================" echo "(!!!) WARNING Both old and new configs exist" echo "(!!!) WARNING Please choose which configs do you need and remove the old configs" - echo "(!!!) WARNING OLD config locations: ${adguardhome_config_old} ${adguardhome_work_dir_data_old}" - echo "(!!!) WARNING NEW config locations: ${adguardhome_config} ${adguardhome_work_dir_data}" + echo "(!!!) WARNING OLD config locations: $adguardhome_config_old ${adguardhome_work_dir_old}/data" + echo "(!!!) WARNING NEW config locations: $adguardhome_config ${adguardhome_work_dir}/data" echo "(!!!) WARNING ==================================================================" fi fi # install dir - if [ ! -d ${adguardhome_work_dir} ]; then - install -d -m 0750 -o ${adguardhome_user} -g ${adguardhome_group} \ - ${adguardhome_work_dir} + if [ ! -d "$adguardhome_work_dir" ]; then + install -d -m 0750 -o "$adguardhome_user" -g "$adguardhome_group" \ + "$adguardhome_work_dir" fi } diff --git a/www/adguardhome/files/newsyslog.conf b/www/adguardhome/files/newsyslog.conf new file mode 100644 index 000000000000..492184b74a5f --- /dev/null +++ b/www/adguardhome/files/newsyslog.conf @@ -0,0 +1,5 @@ +# Newsyslog configuration file for zrepl. +# See newsyslog.conf(5) for details. +# +# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] +/var/log/adguardhome.log 644 5 1000 @0101T JC /var/run/adguardhome.pid diff --git a/www/adguardhome/files/patch-go.mod b/www/adguardhome/files/patch-go.mod new file mode 100644 index 000000000000..a0181dc3e1a2 --- /dev/null +++ b/www/adguardhome/files/patch-go.mod @@ -0,0 +1,10 @@ +--- go.mod.orig 1979-11-29 23:00:00 UTC ++++ go.mod +@@ -1,6 +1,6 @@ module github.com/AdguardTeam/AdGuardHome + module github.com/AdguardTeam/AdGuardHome + +-go 1.23.2 ++go 1.23 + + require ( + github.com/AdguardTeam/dnsproxy v0.73.2 diff --git a/www/adguardhome/pkg-plist b/www/adguardhome/pkg-plist new file mode 100644 index 000000000000..2b6b53d5cc7f --- /dev/null +++ b/www/adguardhome/pkg-plist @@ -0,0 +1,3 @@ +bin/%%PORTNAME%% +@sample %%EXAMPLESDIR%%/newsyslog.conf etc/newsyslog.conf.d/adguardhome.conf +@dir etc/newsyslog.conf.d