View | Details | Raw Unified | Return to bug 224113 | Differences between
and this patch

Collapse All | Expand All

(-)devel/gogs/Makefile (-9 / +12 lines)
Lines 3-8 Link Here
3
PORTNAME=	gogs
3
PORTNAME=	gogs
4
DISTVERSIONPREFIX=	v
4
DISTVERSIONPREFIX=	v
5
DISTVERSION=	0.11.34
5
DISTVERSION=	0.11.34
6
PORTREVISION=	1
6
CATEGORIES=	devel www
7
CATEGORIES=	devel www
7
8
8
MAINTAINER=	dg@syrec.org
9
MAINTAINER=	dg@syrec.org
Lines 20-27 Link Here
20
21
21
OPTIONS_DEFINE=	DOCS
22
OPTIONS_DEFINE=	DOCS
22
23
23
USERS=		gogs
24
USERS=		git
24
GROUPS=		gogs
25
GROUPS=		git
25
26
26
GOGS_DBDIR?=	/var/db/gogs
27
GOGS_DBDIR?=	/var/db/gogs
27
GOGS_LOGDIR?=	/var/log/gogs
28
GOGS_LOGDIR?=	/var/log/gogs
Lines 31-38 Link Here
31
		gogs-service \
32
		gogs-service \
32
		gogs-rm-data \
33
		gogs-rm-data \
33
		pkg-message
34
		pkg-message
34
SUB_LIST=	PREFIX=${PREFIX} \
35
SUB_LIST=	PORTNAME=${PORTNAME} \
35
		PORTNAME=${PORTNAME} \
36
		PORTNAME_FANCY=${PORTNAME_FANCY} \
36
		PORTNAME_FANCY=${PORTNAME_FANCY} \
37
		GOGS_USER=${USERS} \
37
		GOGS_USER=${USERS} \
38
		GOGS_DBDIR=${GOGS_DBDIR} \
38
		GOGS_DBDIR=${GOGS_DBDIR} \
Lines 46-53 Link Here
46
46
47
post-patch:
47
post-patch:
48
	@${REINPLACE_CMD} -i '' \
48
	@${REINPLACE_CMD} -i '' \
49
		-e '/^# \!\!\!/d' \
50
		-e 's|^RUN_USER = git$$|RUN_USER = ${USERS}|' \
51
		-e 's|^RUN_MODE = dev$$|RUN_MODE = prod|' \
49
		-e 's|^ROOT =$$|ROOT = ${GOGS_DBDIR}/repositories|' \
52
		-e 's|^ROOT =$$|ROOT = ${GOGS_DBDIR}/repositories|' \
50
		-e 's|^RUN_USER = git$$|RUN_USER = ${USERS}|' \
51
		-e 's|^DB_TYPE = mysql$$|DB_TYPE = sqlite3|' \
53
		-e 's|^DB_TYPE = mysql$$|DB_TYPE = sqlite3|' \
52
		${WRKSRC}/conf/app.ini
54
		${WRKSRC}/conf/app.ini
53
55
Lines 62-71 Link Here
62
	${INSTALL_SCRIPT} ${WRKDIR}/gogs-rm-data ${STAGEDIR}${PREFIX}/bin/
64
	${INSTALL_SCRIPT} ${WRKDIR}/gogs-rm-data ${STAGEDIR}${PREFIX}/bin/
63
	${INSTALL_SCRIPT} ${WRKDIR}/gogs-service ${STAGEDIR}${PREFIX}/etc/rc.d/gogs
65
	${INSTALL_SCRIPT} ${WRKDIR}/gogs-service ${STAGEDIR}${PREFIX}/etc/rc.d/gogs
64
	@(cd ${WRKSRC} && ${COPYTREE_SHARE} "conf public templates" ${STAGEDIR}${PREFIX}/libexec/${PORTNAME})
66
	@(cd ${WRKSRC} && ${COPYTREE_SHARE} "conf public templates" ${STAGEDIR}${PREFIX}/libexec/${PORTNAME})
65
	@${MKDIR} ${STAGEDIR}${PREFIX}/libexec/${PORTNAME}/custom/conf
67
	@${MKDIR} ${STAGEDIR}${ETCDIR}/conf
66
	${INSTALL_DATA} ${WRKSRC}/conf/app.ini ${STAGEDIR}${PREFIX}/libexec/${PORTNAME}/custom/conf/
68
	@${MKDIR} ${STAGEDIR}${ETCDIR}/https
67
	@${MKDIR} ${STAGEDIR}${PREFIX}/libexec/${PORTNAME}/custom/https
69
	@${INSTALL_DATA} ${WRKSRC}/conf/app.ini ${STAGEDIR}${ETCDIR}/conf/app.ini.sample
68
	@${MKDIR} ${STAGEDIR}${GOGS_DBDIR}/data ${STAGEDIR}${GOGS_DBDIR}/repositories ${STAGEDIR}${GOGS_DBDIR}/home
70
	@${RLN} ${STAGEDIR}${ETCDIR} ${STAGEDIR}${PREFIX}/libexec/${PORTNAME}/custom
71
	@${MKDIR} ${STAGEDIR}${GOGS_DBDIR}/data ${STAGEDIR}${GOGS_DBDIR}/repositories
69
	@${LN} -sf ${GOGS_DBDIR}/data ${STAGEDIR}/${PREFIX}/libexec/${PORTNAME}/data
72
	@${LN} -sf ${GOGS_DBDIR}/data ${STAGEDIR}/${PREFIX}/libexec/${PORTNAME}/data
70
	@${MKDIR} ${STAGEDIR}${GOGS_LOGDIR}
73
	@${MKDIR} ${STAGEDIR}${GOGS_LOGDIR}
71
	@${LN} -sf ${GOGS_LOGDIR} ${STAGEDIR}/${PREFIX}/libexec/${PORTNAME}/log
74
	@${LN} -sf ${GOGS_LOGDIR} ${STAGEDIR}/${PREFIX}/libexec/${PORTNAME}/log
(-)devel/gogs/files/gogs-rm-data.in (-2 / +1 lines)
Lines 17-21 Link Here
17
  esac
17
  esac
18
done
18
done
19
19
20
rm -rf %%GOGS_DBDIR%%/*/* %%GOGS_DBDIR%%/*/.ssh \
20
rm -rf %%GOGS_DBDIR%%/*/* %%GOGS_LOGDIR%%/* /var/log/gogs.log
21
    %%GOGS_LOGDIR%%/* /var/log/gogs.log
(-)devel/gogs/files/gogs-service.in (-2 / +3 lines)
Lines 24-29 Link Here
24
load_rc_config ${name}
24
load_rc_config ${name}
25
25
26
: ${%%PORTNAME%%_enable="NO"}
26
: ${%%PORTNAME%%_enable="NO"}
27
: ${%%PORTNAME%%_config="%%ETCDIR%%/conf/app.ini"}
27
28
28
is_process_running() {
29
is_process_running() {
29
  local pidfile=$1
30
  local pidfile=$1
Lines 43-53 Link Here
43
    return 1
44
    return 1
44
  fi
45
  fi
45
  export USER=%%GOGS_USER%%
46
  export USER=%%GOGS_USER%%
46
  export HOME=$(getent passwd %%GOGS_USER%% | cut -d: -f6)
47
  export HOME=$(echo ~%%GOGS_USER%%)
47
  touch $logfile
48
  touch $logfile
48
  chmod 640 $logfile
49
  chmod 640 $logfile
49
  cd %%PREFIX%%/libexec/%%PORTNAME%%
50
  cd %%PREFIX%%/libexec/%%PORTNAME%%
50
  /usr/sbin/daemon -P $pidfile -u %%GOGS_USER%% %%PREFIX%%/libexec/%%PORTNAME%%/%%PORTNAME%% web >>$logfile 2>&1
51
  /usr/sbin/daemon -P $pidfile -u %%GOGS_USER%% %%PREFIX%%/libexec/%%PORTNAME%%/%%PORTNAME%% web --config ${%%PORTNAME%%_config} >>$logfile 2>&1
51
  if is_process_running $pidfile; then
52
  if is_process_running $pidfile; then
52
    echo "started %%PORTNAME%% (pid=$(cat $pidfile))"
53
    echo "started %%PORTNAME%% (pid=$(cat $pidfile))"
53
  else
54
  else
(-)devel/gogs/files/gogs.in (-2 / +2 lines)
Lines 2-6 Link Here
2
2
3
cd %%PREFIX%%/libexec/%%PORTNAME%% &&
3
cd %%PREFIX%%/libexec/%%PORTNAME%% &&
4
USER=%%GOGS_USER%% \
4
USER=%%GOGS_USER%% \
5
HOME=$(getent passwd %%GOGS_USER%% | cut -d: -f6) \
5
HOME=$(echo ~%%GOGS_USER%%) \
6
su -m %%GOGS_USER%% -c './%%PORTNAME%% web'
6
su -m %%GOGS_USER%% -c './%%PORTNAME%% web --config %%ETCDIR%%/conf/app.ini'
(-)devel/gogs/files/pkg-message.in (-1 / +1 lines)
Lines 13-19 Link Here
13
Connect to %%PORTNAME%% on the default port 3000:
13
Connect to %%PORTNAME%% on the default port 3000:
14
http://localhost:3000
14
http://localhost:3000
15
15
16
Configuration file is %%PREFIX%%/libexec/%%PORTNAME%%/custom/conf/app.ini.
16
Configuration file is %%ETCDIR%%/conf/app.ini.
17
You can only edit it when %%PORTNAME%% isn't running.
17
You can only edit it when %%PORTNAME%% isn't running.
18
18
19
%%PORTNAME_FANCY%% needs an SSH daemon, so make sure sure you execute:
19
%%PORTNAME_FANCY%% needs an SSH daemon, so make sure sure you execute:
(-)devel/gogs/pkg-plist (-4 / +4 lines)
Lines 1-6 Link Here
1
bin/gogs
1
bin/gogs
2
bin/gogs-rm-data
2
bin/gogs-rm-data
3
@(%%GOGS_USER%%,%%GOGS_GROUP%%,640) libexec/gogs/custom/conf/app.ini
3
@dir(%%GOGS_USER%%,%%GOGS_GROUP%%,750) %%ETCDIR%%/conf
4
@dir(%%GOGS_USER%%,%%GOGS_GROUP%%,750) %%ETCDIR%%/https
5
@sample(%%GOGS_USER%%,%%GOGS_GROUP%%,640) %%ETCDIR%%/conf/app.ini.sample
4
etc/rc.d/gogs
6
etc/rc.d/gogs
5
libexec/gogs/conf/app.ini
7
libexec/gogs/conf/app.ini
6
libexec/gogs/conf/gitignore/Actionscript
8
libexec/gogs/conf/gitignore/Actionscript
Lines 232-237 Link Here
232
libexec/gogs/conf/locale/TRANSLATORS
234
libexec/gogs/conf/locale/TRANSLATORS
233
libexec/gogs/conf/README.md
235
libexec/gogs/conf/README.md
234
libexec/gogs/conf/readme/Default
236
libexec/gogs/conf/readme/Default
237
libexec/gogs/custom
235
libexec/gogs/data
238
libexec/gogs/data
236
libexec/gogs/gogs
239
libexec/gogs/gogs
237
libexec/gogs/log
240
libexec/gogs/log
Lines 1719-1728 Link Here
1719
libexec/gogs/templates/user/settings/sshkeys.tmpl
1722
libexec/gogs/templates/user/settings/sshkeys.tmpl
1720
libexec/gogs/templates/user/settings/two_factor_enable.tmpl
1723
libexec/gogs/templates/user/settings/two_factor_enable.tmpl
1721
libexec/gogs/templates/user/settings/two_factor_recovery_codes.tmpl
1724
libexec/gogs/templates/user/settings/two_factor_recovery_codes.tmpl
1722
@dir(%%GOGS_USER%%,%%GOGS_GROUP%%,750) libexec/gogs/custom/conf
1723
@dir(%%GOGS_USER%%,%%GOGS_GROUP%%,750) libexec/gogs/custom/https
1724
@dir(%%GOGS_USER%%,%%GOGS_GROUP%%,750) %%GOGS_DBDIR%%/data
1725
@dir(%%GOGS_USER%%,%%GOGS_GROUP%%,750) %%GOGS_DBDIR%%/data
1725
@dir(%%GOGS_USER%%,%%GOGS_GROUP%%,750) %%GOGS_DBDIR%%/home
1726
@dir(%%GOGS_USER%%,%%GOGS_GROUP%%,750) %%GOGS_DBDIR%%/repositories
1726
@dir(%%GOGS_USER%%,%%GOGS_GROUP%%,750) %%GOGS_DBDIR%%/repositories
1727
@dir(%%GOGS_USER%%,%%GOGS_GROUP%%,750) %%GOGS_DBDIR%%
1727
@dir(%%GOGS_USER%%,%%GOGS_GROUP%%,750) %%GOGS_DBDIR%%
1728
@dir(%%GOGS_USER%%,%%GOGS_GROUP%%,750) %%GOGS_LOGDIR%%
1728
@dir(%%GOGS_USER%%,%%GOGS_GROUP%%,750) %%GOGS_LOGDIR%%
(-)UPDATING (+14 lines)
Lines 5-10 Link Here
5
You should get into the habit of checking this file for changes each time
5
You should get into the habit of checking this file for changes each time
6
you update your ports collection, before attempting any port upgrades.
6
you update your ports collection, before attempting any port upgrades.
7
7
8
20171205:
9
  AFFECTS: users of devel/gogs
10
  AUTHOR: dg@syrec.org
11
12
  Gogs user has been changed to "git" and configuration files are now
13
  located in /usr/local/etc/gogs. Users should update ownership of the
14
  existing Gogs directories with
15
16
  # chown -R git:git /var/db/gogs
17
  # chown -R git:git /var/log/gogs
18
19
  and either move or merge the contents of /var/db/gogs/home/.ssh with
20
  /usr/local/git/.ssh.  After migration, /var/db/gogs/home can be removed.
21
  
8
20171203:
22
20171203:
9
  AFFECTS: users of sysutils/dsbmd
23
  AFFECTS: users of sysutils/dsbmd
10
  AUTHOR: mk@freeshell.de
24
  AUTHOR: mk@freeshell.de

Return to bug 224113