pkgsrc-WIP-changes archive

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

gitea: Add a rc.subr script



Module Name:	pkgsrc-wip
Committed By:	nia <nia%NetBSD.org@localhost>
Pushed By:	nee
Date:		Wed Feb 13 17:17:00 2019 +0000
Changeset:	4400f7ec06a2608fa24036d3992b11b9b6e434cf

Modified Files:
	gitea/Makefile
Added Files:
	gitea/files/gitea.sh

Log Message:
gitea: Add a rc.subr script

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

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

diffstat:
 gitea/Makefile       |  2 ++
 gitea/files/gitea.sh | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+)

diffs:
diff --git a/gitea/Makefile b/gitea/Makefile
index 2c37e5928e..bc698d9529 100644
--- a/gitea/Makefile
+++ b/gitea/Makefile
@@ -68,6 +68,8 @@ FILES_SUBST+=	GITEA_GROUP=${GITEA_GROUP}
 FILES_SUBST+=	GITEA_USER_HOME=${VARBASE}/db/gitea
 FILES_SUBST+=	GITEA_SHARE_DIR=${PREFIX}/share/gitea
 
+RCD_SCRIPTS+=	gitea
+
 pre-patch:
 	${CP} ${FILESDIR}/app.ini.sample ${WRKDIR}/
 
diff --git a/gitea/files/gitea.sh b/gitea/files/gitea.sh
new file mode 100644
index 0000000000..86a8a14b6a
--- /dev/null
+++ b/gitea/files/gitea.sh
@@ -0,0 +1,33 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD$
+#
+# PROVIDE: gitea
+# REQUIRE: DAEMON
+
+. /etc/rc.subr
+
+name="gitea"
+rcvar=${name}
+required_files="@PKG_SYSCONFDIR@/app.ini"
+pidfile="/dev/null"
+command="@PREFIX@/sbin/gitea"
+command_args="--config @PKG_SYSCONFDIR@/app.ini web &"
+
+gitea_env="GITEA_WORK_DIR=@GITEA_SHARE_DIR@"
+gitea_env="${gitea_env} GITEA_CUSTOM=@PKG_SYSCONFDIR@"
+gitea_env="${gitea_env} HOME=@GITEA_USER_HOME@"
+gitea_env="${gitea_env} USER=@GITEA_USER@"
+
+gitea_user="@GITEA_USER@"
+gitea_group="@GITEA_GROUP@"
+
+# gitea's pidfile creation seems to not work...
+check_pidfile()
+{
+	pid=$(pgrep -U "${gitea_user}" /sbin/gitea$)
+	echo -n "${pid}"
+}
+
+load_rc_config $name
+run_rc_command "$1"


Home | Main Index | Thread Index | Old Index