diff --git a/www/gitlab-pages/Makefile b/www/gitlab-pages/Makefile index 87f6d96ff89e..c3538c0371bf 100644 --- a/www/gitlab-pages/Makefile +++ b/www/gitlab-pages/Makefile @@ -1,45 +1,46 @@ PORTNAME= gitlab-pages PORTVERSION= 17.0.1 DISTVERSIONPREFIX= v +PORTREVISION= 1 CATEGORIES= www MASTER_SITES+= https://gitlab.com/gitlab-org/gitlab-pages/-/raw/v${DISTVERSION}/ DISTFILES+= go.mod MAINTAINER= mfechner@FreeBSD.org COMMENT= Official GitLab Pages daemon WWW= https://gitlab.com/gitlab-org/gitlab-pages LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE USES= go:modules,1.22 USE_GITLAB= yes GL_ACCOUNT= gitlab-org USE_RC_SUBR= gitlab_pages GO_MODULE= gitlab.com/gitlab-org/gitlab-pages GO_BUILDFLAGS= -ldflags="-X 'main.VERSION=${PORTVERSION}' -X 'main.REVISION=${GL_TAGNAME}'" USERS= gitlab-pages GROUPS= gitlab-pages post-patch: ${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|" ${WRKSRC}/gitlab-pages.conf.sample do-install: @${MKDIR} ${STAGEDIR}${DATADIR} ${MKDIR} ${STAGEDIR}${DATADIR}/bin (cd ${WRKDIR}/bin/ && ${COPYTREE_BIN} . ${STAGEDIR}${DATADIR}/bin) .for x in gitlab-pages.conf.sample ${INSTALL_DATA} ${WRKSRC}/${x} ${STAGEDIR}${DATADIR}/ .endfor post-install: ${FIND} -s ${STAGEDIR}${DATADIR} -not -type d | ${SORT} | \ ${SED} -e 's#^${STAGEDIR}${PREFIX}/##' | \ ${SED} -E -e '/sample$$/ s#^#@sample #; \ s#${DATADIR_REL}/bin#@(,,555) ${DATADIR_REL}/bin#; ' >> ${TMPPLIST} cat ${TMPPLIST} .include diff --git a/www/gitlab-pages/files/gitlab_pages.in b/www/gitlab-pages/files/gitlab_pages.in index f49fd4b4e6f6..628b13ab029c 100644 --- a/www/gitlab-pages/files/gitlab_pages.in +++ b/www/gitlab-pages/files/gitlab_pages.in @@ -1,63 +1,64 @@ #!/bin/sh # PROVIDE: gitlab_pages # REQUIRE: DAEMON NETWORKING # KEYWORD: shutdown # # Add the following line to /etc/rc.conf to enable gitlab_pages: # # gitlab_pages_enable (bool): Set to "NO" by default. # Set it to "YES" to enable gitlab-pages # gitlab_pages_dir (str): Set to "/var/tmp/gitlab_pages" by default. # Set it to directory to run gitlab-pages in # gitlab_pages_user (str): Set to "gitlab-pages" by default. # Set it to user to run gitlab_pages under # gitlab_pages_group (str): Set to "gitlab-pages" by default. # Set it to group to run gitlab-pages under # gitlab_pages_logfile (str): Set to "/var/log/gitlab_pages.log" by default. # Set it to file to send gitlab-pages logs to # . /etc/rc.subr name="gitlab_pages" rcvar="gitlab_pages_enable" load_rc_config $name : ${gitlab_pages_enable:="NO"} : ${gitlab_pages_dir:="/var/tmp/gitlab_pages"} : ${gitlab_pages_user:="gitlab-pages"} : ${gitlab_pages_group:="gitlab-pages"} : ${gitlab_pages_logfile:="/var/log/gitlab_pages.log"} : ${gitlab_pages_args:="-config=%%PREFIX%%/share/gitlab-pages/gitlab-pages.conf"} +: ${gitlab_pages_svcj_options:="net_basic"} export HOME=${gitlab_pages_dir} export PATH=${PATH}:%%PREFIX%%/bin pidfile="/var/run/${name}.pid" gitlab_pages_chdir="${gitlab_pages_dir}" procname=%%PREFIX%%/share/gitlab-pages/bin/gitlab-pages start_precmd="gitlab_pages_startprecmd" start_cmd="gitlab_pages_startcmd" gitlab_pages_startprecmd() { if [ ! -e "${pidfile}" ]; then install -g ${gitlab_pages_group} -o ${gitlab_pages_user} -- /dev/null "${pidfile}"; fi if [ ! -d "${gitlab_pages_dir}" ]; then install -d -o "${gitlab_pages_user}" -g "${gitlab_pages_group}" "${gitlab_pages_dir}" fi } gitlab_pages_startcmd() { cd ${gitlab_pages_chdir} ; \ daemon -u ${gitlab_pages_user} -p ${pidfile} ${procname} ${gitlab_pages_args} run < /dev/null >> ${gitlab_pages_logfile} 2>> ${gitlab_pages_logfile} } run_rc_command $1