Index: head/www/gitea/Makefile =================================================================== --- head/www/gitea/Makefile (revision 453096) +++ head/www/gitea/Makefile (revision 453097) @@ -1,64 +1,74 @@ # Created by: Stefan Bethke # $FreeBSD$ PORTNAME= gitea PORTVERSION= 1.2.2 DISTVERSIONPREFIX= v +PORTREVISION= 1 CATEGORIES= www MAINTAINER= stb@lassitu.de COMMENT= Compact self-hosted Git service LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE RUN_DEPENDS= bash:shells/bash \ git:devel/git USES= go USE_GITHUB= yes GH_ACCOUNT= go-gitea GO_PKGNAME= code.gitea.io/${PORTNAME} GO_TARGET= -tags "${GO_TAGS}" USE_RC_SUBR= gitea SUB_FILES+= app.ini.sample SUB_LIST+= GITUSER=${USERS} USERS= git GROUPS= git OPTIONS_DEFINE= CERT PAM SQLITE CERT_DESC= Automatic creation of self-signed certificates PAM_DESC= Authentication using PAM -SQLITE= Add SQLite as database backend OPTIONS_DEFAULT= ${OPTIONS_DEFINE} CERT_VARS= GO_TAGS+=cert PAM_VARS= GO_TAGS+=pam SQLITE_VARS= GO_TAGS+=sqlite + +.include + +.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1100513 +DAEMONARGS= -S -l \$${gitea_facility} -s \$${gitea_priority} -t \$${name} +.else +DAEMONARGS= -f +.endif + +SUB_LIST+= DAEMONARGS="${DAEMONARGS}" post-patch: # Gitea releases don't supply the release version number; the # automatic method to obtain the version number in the Gitea build # system only works when sources are checked out from git. # See https://github.com/go-gitea/gitea/issues/1136#issuecomment-311622745 ${SED} -Ei .orig \ -e 's#^(var Version = )"[^"]+"#\1"${PORTVERSION}"#' \ ${GO_WRKSRC}/main.go do-install: ${INSTALL_PROGRAM} ${GO_WRKDIR_BIN}/${PORTNAME} ${STAGEDIR}${PREFIX}/sbin ${MKDIR} ${STAGEDIR}${ETCDIR}/conf ${INSTALL_DATA} ${WRKDIR}/app.ini.sample ${STAGEDIR}${ETCDIR}/conf/app.ini.sample ${INSTALL_DATA} ${GO_WRKSRC}/conf/app.ini ${STAGEDIR}${ETCDIR}/conf/app.ini.defaults ${MKDIR} ${STAGEDIR}${DATADIR} (cd ${GO_WRKSRC} && ${COPYTREE_SHARE} "options public templates" ${STAGEDIR}${DATADIR}) ${MKDIR} ${STAGEDIR}${DESTDIR}/var/db/${PORTNAME} ${MKDIR} ${STAGEDIR}${DESTDIR}/var/log/${PORTNAME} ${MKDIR} ${STAGEDIR}${DESTDIR}/var/run/${PORTNAME} .include Index: head/www/gitea/files/gitea.in =================================================================== --- head/www/gitea/files/gitea.in (revision 453096) +++ head/www/gitea/files/gitea.in (revision 453097) @@ -1,46 +1,46 @@ #!/bin/sh # # $FreeBSD$ # # PROVIDE: gitea # REQUIRE: NETWORKING SYSLOG # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf to enable gitea: # #gitea_enable="YES" . /etc/rc.subr name="gitea" rcvar="gitea_enable" load_rc_config $name : ${gitea_user:="%%GITUSER%%"} : ${gitea_enable:="NO"} : ${gitea_facility:="daemon"} : ${gitea_priority:="debug"} : ${gitea_shared:="%%PREFIX%%/share/${name}"} command="%%PREFIX%%/sbin/${name} web" procname="%%PREFIX%%/sbin/${name}" githome="$(eval echo ~${gitea_user})" pidfile="/var/run/${name}.pid" start_cmd="${name}_start" gitea_start() { - /usr/sbin/daemon -l ${gitea_facility} -s ${gitea_priority} \ - -u ${gitea_user} -p ${pidfile} -t "${command}" \ + /usr/sbin/daemon %%DAEMONARGS%% \ + -u ${gitea_user} -p ${pidfile} \ /usr/bin/env -i \ "GITEA_WORK_DIR=${gitea_shared}" \ "GITEA_CUSTOM=%%PREFIX%%/etc/${name}" \ "HOME=${githome}" \ "PATH=%%PREFIX%%/bin:${PATH}" \ "USER=%%GITUSER%%" \ $command } run_rc_command "$1"