pkgsrc-Changes archive

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

CVS commit: pkgsrc/www/anubis



Module Name:    pkgsrc
Committed By:   ryoon
Date:           Thu May 22 15:14:15 UTC 2025

Modified Files:
        pkgsrc/www/anubis: Makefile
Added Files:
        pkgsrc/www/anubis/files: anubis.sh

Log Message:
www/anubis: Add rc script and use PKGVERSION_NOREV instead of devel in URI

* Bump PKGREVISION.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 pkgsrc/www/anubis/Makefile
cvs rdiff -u -r0 -r1.1 pkgsrc/www/anubis/files/anubis.sh

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

Modified files:

Index: pkgsrc/www/anubis/Makefile
diff -u pkgsrc/www/anubis/Makefile:1.3 pkgsrc/www/anubis/Makefile:1.4
--- pkgsrc/www/anubis/Makefile:1.3      Tue May 20 15:16:41 2025
+++ pkgsrc/www/anubis/Makefile  Thu May 22 15:14:14 2025
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.3 2025/05/20 15:16:41 ryoon Exp $
+# $NetBSD: Makefile,v 1.4 2025/05/22 15:14:14 ryoon Exp $
 
 DISTNAME=      anubis-1.18.0
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    www
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=TecharoHQ/}
 GITHUB_TAG=    v${PKGVERSION_NOREV}
@@ -18,7 +18,8 @@ SITES.${ASSETS}=      ${MASTER_SITE_LOCAL}
 EXTRACT_ONLY=  ${DEFAULT_DISTFILES} ${ASSETS}
 
 USE_LANGUAGES=         c # Go
-GO_BUILD_PATTERN=      ./cmd/anubis
+GO_BUILD_PATTERN+=     -ldflags="-X github.com/TecharoHQ/anubis.Version=v${PKGVERSION_NOREV}"
+GO_BUILD_PATTERN+=     ./cmd/anubis
 
 EGDIR=                 share/examples/anubis
 INSTALLATION_DIRS=     ${EGDIR}
@@ -26,6 +27,17 @@ PKG_SYSCONFSUBDIR=   anubis
 CONF_FILES+=           ${EGDIR}/botPolicies.json ${PKG_SYSCONFDIR}/botPolicies.json
 CONF_FILES+=           ${EGDIR}/default.env ${PKG_SYSCONFDIR}/default.env
 
+APACHE_USER?=          www
+APACHE_GROUP?=         www
+PKG_USERS_VARS+=       APACHE_USER
+PKG_GROUPS_VARS+=      APACHE_GROUP
+PKG_GROUPS=            ${APACHE_GROUP}
+PKG_USERS=             ${APACHE_USER}:${APACHE_GROUP}
+
+FILES_SUBST+=          APACHE_USER=${APACHE_USER}
+FILES_SUBST+=          APACHE_GROUP=${APACHE_GROUP}
+
+RCD_SCRIPTS+=          anubis
 
 post-install:
        ${INSTALL_DATA} ${WRKSRC}/data/botPolicies.json ${DESTDIR}${PREFIX}/share/examples/anubis

Added files:

Index: pkgsrc/www/anubis/files/anubis.sh
diff -u /dev/null pkgsrc/www/anubis/files/anubis.sh:1.1
--- /dev/null   Thu May 22 15:14:15 2025
+++ pkgsrc/www/anubis/files/anubis.sh   Thu May 22 15:14:15 2025
@@ -0,0 +1,45 @@
+#!/bin/sh
+#
+# $NetBSD: anubis.sh,v 1.1 2025/05/22 15:14:15 ryoon Exp $
+#
+# PROVIDE: anubis
+# REQUIRE: DAEMON
+#
+# anubis=YES
+
+$_rc_subr_loaded . @SYSCONFBASE@/rc.subr
+
+name="anubis"
+rcvar=${name}
+command="@PREFIX@/bin/${name}"
+pidfile="@VARBASE@/run/${name}/${name}.pid"
+anubis_user="@APACHE_USER@"
+anubis_group="@APACHE_GROUP@"
+start_precmd="anubis_precmd"
+start_cmd="anubis_start"
+start_postcmd="anubis_poststart"
+
+anubis_precmd()
+{
+       if [ ! -d @VARBASE@/run/${name} ]; then
+               @MKDIR@ @VARBASE@/run/${name}
+               @CHOWN@ ${anubis_user}:${anubis_group} @VARBASE@/run/${name}
+       fi
+}
+
+anubis_start()
+{
+       @SU@ -m ${anubis_user} -c "${command} -serve-robots-txt" >> @VARBASE@/log/anubis.log 2>&1 &
+}
+
+anubis_poststart() {
+       echo $! > ${pidfile}
+}
+
+anubis_stop()
+{
+       kill -HUP $(check_pidfile $pidfile $name)
+}
+
+load_rc_config $name
+run_rc_command "$1"



Home | Main Index | Thread Index | Old Index