pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

adguardhome revision 1



Module Name:	pkgsrc-wip
Committed By:	bkrawczyk <bbartlomiej%gmail.com@localhost>
Pushed By:	bkrawczyk
Date:		Mon Feb 15 23:43:00 2021 +0100
Changeset:	f5ea2edd1c5b1a1e369f3b74ce15240ddff4cdda

Modified Files:
	adguardhome/DESCR
	adguardhome/Makefile
	adguardhome/PLIST
	adguardhome/distinfo
Added Files:
	adguardhome/MESSAGE
	adguardhome/TODO
	adguardhome/files/adguardhome.sh

Log Message:
adguardhome revision 1

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=f5ea2edd1c5b1a1e369f3b74ce15240ddff4cdda

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 adguardhome/DESCR                |  6 ++++++
 adguardhome/MESSAGE              |  9 +++++++++
 adguardhome/Makefile             | 26 ++++++++++++++++----------
 adguardhome/PLIST                |  7 ++++---
 adguardhome/TODO                 |  5 +++++
 adguardhome/distinfo             |  8 ++++----
 adguardhome/files/adguardhome.sh | 16 ++++++++++++++++
 7 files changed, 60 insertions(+), 17 deletions(-)

diffs:
diff --git a/adguardhome/DESCR b/adguardhome/DESCR
index e69de29bb2..879625707e 100644
--- a/adguardhome/DESCR
+++ b/adguardhome/DESCR
@@ -0,0 +1,6 @@
+AdGuard Home is a network-wide software for blocking ads & tracking. After you
+set it up, it'll cover ALL your home devices, and you don't need any
+client-side software for that.
+
+It operates as a DNS server that re-routes tracking domains to a "black hole",
+thus preventing your devices from connecting to those servers.
diff --git a/adguardhome/MESSAGE b/adguardhome/MESSAGE
new file mode 100644
index 0000000000..b0f68532d8
--- /dev/null
+++ b/adguardhome/MESSAGE
@@ -0,0 +1,9 @@
+===========================================================================
+$NetBSD$
+When started for the first time using rc script ${PKGNAME} will listen on
+all interfaces and all IP addresses on port TCP/3000.
+Accessing any local IP address with a web browser over http://YOUR_IP:3000
+will allow you to configure it.
+
+After first run configuration will be saved in ${PKG_SYSCONFDIR}.
+===========================================================================
diff --git a/adguardhome/Makefile b/adguardhome/Makefile
index 31ec27f1e6..cc2f0bf54a 100644
--- a/adguardhome/Makefile
+++ b/adguardhome/Makefile
@@ -5,23 +5,23 @@
 GITHUB_PROJECT=	AdGuardHome
 GITHUB_TAG=	v0.104.3
 DISTNAME=	v0.104.3
-PKGNAME=	${GITHUB_PROJECT}-${DISTNAME:S,^v,,}
+PKGNAME=	adguardhome-${DISTNAME:S,^v,,}
 CATEGORIES=	net
 MASTER_SITES=	${MASTER_SITE_GITHUB:=AdguardTeam/}
 EXTRACT_SUFX=	.zip
 DIST_SUBDIR=	${GITHUB_PROJECT}
+PKGREVISION=	1
 
-FRONTEND=           ${PKGNAME_NOREV}-frontend.tar.gz
-SITES.AdGuardHome-0.104.3-frontend.tar.gz=	https://cloud.krawczyk.it/     
-DISTFILES=          ${DEFAULT_DISTFILES} ${FRONTEND}
+FRONTEND=	${PKGNAME_NOREV}-frontend.tar.gz
+SITES.adguardhome-0.104.3-frontend.tar.gz=	https://cloud.krawczyk.it/
+DISTFILES=	${DEFAULT_DISTFILES} ${FRONTEND}
 
 MAINTAINER=	bbartlomiej%gmail.com@localhost
 HOMEPAGE=	https://github.com/AdguardTeam/AdGuardHome/
 COMMENT=	Free and open source, network-wide ads & trackers blocking DNS server
 LICENSE=	gnu-gpl-v3
 
-WRKSRC=		${WRKDIR}/${PKGNAME_NOREV}
-PKG_SYSCONFSUBDIR=	adguardhome
+WRKSRC=		${WRKDIR}/AdGuardHome-${DISTNAME:S,^v,,}
 
 USE_TOOLS+=	tar
 #USE_LANGUAGES=	# none
@@ -36,16 +36,22 @@ USE_TOOLS+=	tar
 #BUILD_DEPENDS+=	npm>=6.14:../../lang/npm
 #BUILD_DEPENDS+=	nodejs>=10.16:../../lang/nodejs
 
+INSTALLATION_DIRS+=	sbin libdata/adguardhome
+PKG_SYSCONFSUBDIR=	adguardhome
+RCD_SCRIPTS+=		adguardhome
 
 do-build:
 	${RUN} cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GO} generate ./...
 	${RUN} cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GO} build -ldflags="-s -w -X main.version=${DISTNAME:S,^v,,} -X main.channel=release -X main.goarm=${GOARM}"
 
+#pre-install:
+#	${RUN} ${RM} ${WRKDIR}/.destdir/usr/pkg/bin/packr
+
+do-install:
+	${INSTALL_PROGRAM} ${WRKSRC}/AdGuardHome ${DESTDIR}${PREFIX}/sbin/adguardhome
+
 .PHONY: generate-frontend
 generate-frontend:
-	# You need to have npm >=6.14:../../lang/npm and
-	# nodejs>=10.16:../../lang/nodejs to build this part. Next it has to be
-	# uploaded to distfile location on pkgsrc distfile server.
 	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} npm --prefix client ci
 	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} npm --prefix client run build-prod
 	cd ${WRKDIR} && ${TAR} -zcf ${WRKDIR}/${PKGNAME_NOREV}-frontend.tar.gz ${PKGNAME_NOREV}/build
@@ -53,7 +59,7 @@ generate-frontend:
 
 .include "../../mk/bsd.prefs.mk"
 
-PREPEND_PATH+= ${WRKDIR}/.gopath/bin
+PREPEND_PATH+=	${WRKDIR}/.gopath/bin
 
 .include "../../lang/go/go-module.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/adguardhome/PLIST b/adguardhome/PLIST
index 92ba51a2d7..6053a66810 100644
--- a/adguardhome/PLIST
+++ b/adguardhome/PLIST
@@ -1,4 +1,5 @@
 @comment $NetBSD$
-@comment TODO: to fill this file with the file listing:
-@comment TODO: 1. run "/usr/bin/make package"
-@comment TODO: 2. run "/usr/bin/make print-PLIST"
+sbin/adguardhome
+share/examples/rc.d/adguardhome
+@pkgdir libdata/adguardhome
+@pkgdir etc/adguardhome
diff --git a/adguardhome/TODO b/adguardhome/TODO
new file mode 100644
index 0000000000..b95f17a640
--- /dev/null
+++ b/adguardhome/TODO
@@ -0,0 +1,5 @@
+- improve rc.d script
+- add information or DEINSTALL script to handle $PREFIX/libdata/adguardhome and
+  $PREFIX/etc/adguardhome directories
+- discuss in community if using only do-* targets is a good approach
+- create separate go-packr package and add as build dependency
diff --git a/adguardhome/distinfo b/adguardhome/distinfo
index 51c94c40c0..2d4d0b06c1 100644
--- a/adguardhome/distinfo
+++ b/adguardhome/distinfo
@@ -1,9 +1,9 @@
 $NetBSD$
 
-SHA1 (AdGuardHome/AdGuardHome-0.104.3-frontend.tar.gz) = c4c93793a84f5469a168f5908a79e4de618896c9
-RMD160 (AdGuardHome/AdGuardHome-0.104.3-frontend.tar.gz) = 37a7a35fbd0d7ce89ae06b248d5b5d1d3b1c9f03
-SHA512 (AdGuardHome/AdGuardHome-0.104.3-frontend.tar.gz) = 088e97fd2c1f06a79891061661046f7613253c997f4ec590077b73225e4535fa60a788c4f6b55ad6aa29a670fc459d4d1cd79ea3e08eb8b9e627fb9d9a4f8e4c
-Size (AdGuardHome/AdGuardHome-0.104.3-frontend.tar.gz) = 2298109 bytes
+SHA1 (AdGuardHome/adguardhome-0.104.3-frontend.tar.gz) = c4c93793a84f5469a168f5908a79e4de618896c9
+RMD160 (AdGuardHome/adguardhome-0.104.3-frontend.tar.gz) = 37a7a35fbd0d7ce89ae06b248d5b5d1d3b1c9f03
+SHA512 (AdGuardHome/adguardhome-0.104.3-frontend.tar.gz) = 088e97fd2c1f06a79891061661046f7613253c997f4ec590077b73225e4535fa60a788c4f6b55ad6aa29a670fc459d4d1cd79ea3e08eb8b9e627fb9d9a4f8e4c
+Size (AdGuardHome/adguardhome-0.104.3-frontend.tar.gz) = 2298109 bytes
 SHA1 (AdGuardHome/cloud.google.com_go_@v_v0.26.0.mod) = 8293f3ba79a69f4176a8f80fba7311b4f03e179e
 RMD160 (AdGuardHome/cloud.google.com_go_@v_v0.26.0.mod) = 072627a02c6b01bbb485da13d664567e3064d7ab
 SHA512 (AdGuardHome/cloud.google.com_go_@v_v0.26.0.mod) = 5132f3438533427c0ab0fbb7a12112a7830ea9122662ed46019ff89c71d9cf80c02edc32dd5c892da572031b5a2cce100f2602fa6a19bea6be7c02781f701273
diff --git a/adguardhome/files/adguardhome.sh b/adguardhome/files/adguardhome.sh
new file mode 100644
index 0000000000..a2e70006a5
--- /dev/null
+++ b/adguardhome/files/adguardhome.sh
@@ -0,0 +1,16 @@
+#!@RCD_SCRIPTS_SHELL@
+
+# PROVIDE: lldpd
+# REQUIRE: DAEMON
+# BEFORE:  LOGIN
+
+ . /etc/rc.subr
+
+ name="adguardhome"
+ rcvar="adguardhome"
+ command="@PREFIX@/sbin/${name}"
+ command_args="--no-check-update -c @PKG_SYSCONFDIR@/AdGuardHome.yaml -w @PREFIX@/libdata/adguardhome --pidfile @VARBASE@/run/${name}.pid -l syslog &"
+ pidfile="/var/run/${name}.pid"
+
+ load_rc_config $name
+ run_rc_command "$1"


Home | Main Index | Thread Index | Old Index