aboutsummaryrefslogtreecommitdiff
path: root/www/owncast/Makefile
blob: 1e3fffee93e56fa5d624248e4405a05cacb6b4b2 (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
PORTNAME=	owncast
DISTVERSIONPREFIX=	v
DISTVERSION=	0.1.2
PORTREVISION=	5
CATEGORIES=	www
DIST_SUBDIR=	${PORTNAME}

MAINTAINER=	de-freebsd@ctseuro.com
COMMENT=	Self-hosted streaming service written in Go
WWW=		https://owncast.online

LICENSE=	MIT
LICENSE_FILE=	${WRKSRC}/LICENSE

RUN_DEPENDS=	ffmpeg:multimedia/ffmpeg

USES=		cpe go:modules
USE_RC_SUBR=	owncast

CPE_VENDOR=	owncast_project

GO_MODULE=	github.com/owncast/owncast

_DAEMONARGS=	-S -l \$${owncast_facility} -s \$${owncast_priority} -T \$${name}
_OWNCAST_USER=	owncast
_OWNCAST_GROUP=	owncast

SUB_LIST+=	DAEMONARGS="${_DAEMONARGS}" \
		OWNCAST_USER=${_OWNCAST_USER}

USERS=		${_OWNCAST_USER}
GROUPS=		${_OWNCAST_GROUP}

PLIST_SUB=	OWNCAST_USER=${_OWNCAST_USER} \
		OWNCAST_GROUP=${_OWNCAST_GROUP}

post-patch:
	@${ECHO_CMD} ${DISTVERSION} >${WRKSRC}/VERSION

do-install:
	# Go binary is statically linked and cannot be stripped, so use
	# INSTALL_SCRIPT.
	${INSTALL_SCRIPT} ${WRKDIR}/bin/owncast ${STAGEDIR}${PREFIX}/sbin

	${MKDIR} -m 750 ${STAGEDIR}${WWWDIR}/
	cd ${WRKSRC} && ${COPYTREE_SHARE} "static" ${STAGEDIR}${WWWDIR}
	${INSTALL_DATA} ${WRKSRC}/LICENSE ${STAGEDIR}${WWWDIR}
	${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${WWWDIR}
	${INSTALL_DATA} ${WRKSRC}/VERSION ${STAGEDIR}${WWWDIR}
	${MKDIR} -m 750 ${STAGEDIR}${WWWDIR}/backup
	${MKDIR} -m 750 ${STAGEDIR}${WWWDIR}/data
	${MKDIR} -m 750 ${STAGEDIR}${WWWDIR}/hls
	${MKDIR} -m 750 ${STAGEDIR}${WWWDIR}/webroot/hls

.include <bsd.port.mk>