blob: 15fea19720b65d5b28874703277b2d87eac5be36 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
PORTNAME= forgejo
DISTVERSIONPREFIX= v
DISTVERSION= 16.0.2
PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= https://codeberg.org/forgejo/forgejo/releases/download/${DISTVERSIONFULL}/
PKGNAMESUFFIX= ${PORTVERSION:C/([0-9]+).*/\1/}
DISTNAME= forgejo-src-${DISTVERSION}
MAINTAINER= des@FreeBSD.org
COMMENT= Compact self-hosted Git forge
WWW= https://forgejo.org/
LICENSE= GPLv3+
LICENSE_FILE= ${WRKSRC}/LICENSE
RUN_DEPENDS= git:devel/git
USES= cpe gmake go:1.26+,no_targets
USE_RC_SUBR= forgejo
PIE_UNSAFE= yes
CONFLICTS_INSTALL= forgejo[0-9]*
EXTRACT_AFTER_ARGS= --strip-components 1
DBDIR= /var/db/forgejo
LOGDIR= /var/log/forgejo
SUB_FILES= app.ini.sample pkg-message
SUB_LIST= GITUSER=${USERS} DBDIR=${DBDIR} LOGDIR=${LOGDIR}
PLIST_SUB= DBDIR=${DBDIR} LOGDIR=${LOGDIR}
NO_WRKSUBDIR= yes
USERS= git
GROUPS= git
# If the BINDATA option is off, we will install assets into DATADIR
# and this line ensures that they are included in the packing list.
# Otherwise, assets are compiled into the binary, DATADIR remains
# empty, and this line has no effect.
PORTDATA= *
OPTIONS_DEFINE= BINDATA GIT_LFS PAM SQLITE
OPTIONS_DEFAULT= BINDATA GIT_LFS PAM SQLITE
OPTIONS_SUB= yes
BINDATA_DESC= Build a single monolithic binary, with all assets included
GIT_LFS_DESC= Support for Git Large File Storage (LFS)
PAM_DESC= Enable support for PAM
BINDATA_VARS= GO_TAGS+=bindata
GIT_LFS_RUN_DEPENDS= git-lfs:devel/git-lfs
PAM_VARS= GO_TAGS+=pam
SQLITE_VARS= GO_TAGS+="sqlite sqlite_unlock_notify"
SSP_UNSAFE= true
LDFLAGS= "'-X "forgejo.org/modules/setting.CustomPath=${PREFIX}/etc/forgejo"'" \
"'-X "forgejo.org/modules/setting.StaticRootPath=${DATADIR}"'" \
"'-X "forgejo.org/modules/setting.AppWorkPath=${DBDIR}"'"
MAKE_ARGS= GOFLAGS="-buildvcs=false" \
GOPATH=${WRKDIR} \
TAGS="${GO_TAGS}"
MAKE_JOBS_UNSAFE= yes
# The default build target builds both the frontend and the backend.
# However, release tarballs include a prebuilt frontend, so save a
# little time by explicitly building only the backend.
ALL_TARGET= backend
# Go binaries are statically linked
STRIP= #
# The provided Makefile does not include an install target.
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/gitea \
${STAGEDIR}${PREFIX}/sbin/forgejo
@${MKDIR} ${STAGEDIR}${ETCDIR}/conf
${INSTALL_DATA} ${WRKDIR}/app.ini.sample \
${STAGEDIR}${ETCDIR}/conf/app.ini.sample
${INSTALL_DATA} ${WRKSRC}/custom/conf/app.example.ini \
${STAGEDIR}${ETCDIR}/conf/app.ini.defaults
${MKDIR} ${STAGEDIR}${DBDIR}/data
${MKDIR} ${STAGEDIR}${DBDIR}/forgejo-repositories
${MKDIR} ${STAGEDIR}${LOGDIR}
# If the BINDATA option is off, install assets into DATADIR.
do-install-BINDATA-off:
${MKDIR} ${STAGEDIR}${DATADIR}
cd ${WRKSRC} && \
${COPYTREE_SHARE} "options public templates" ${STAGEDIR}${DATADIR}
.include <bsd.port.mk>
|