aboutsummaryrefslogtreecommitdiff
path: root/www/hs-postgrest/Makefile
blob: 3fadba275aaec4980452e6d5c0d0963c86e48668 (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
PORTNAME=	postgrest
DISTVERSION=	10.1.0
DISTVERSIONPREFIX=	v
CATEGORIES=	www databases haskell

MAINTAINER=	dmitry.wagin@ya.ru
COMMENT=	PostgREST create a REST API to an existing Postgres database
WWW=		https://postgrest.org

LICENSE=	MIT
LICENSE_FILE=	${WRKSRC}/LICENSE

ONLY_FOR_ARCHS=	amd64 i386

BUILD_DEPENDS=	pg_config:databases/postgresql${PGSQL_DEFAULT}-client

USES=		cabal pgsql

USE_GITHUB=	yes
GH_ACCOUNT=	PostgREST

USE_RC_SUBR=	postgrest

SKIP_CABAL_PLIST=	yes

POSTGREST_USER?=	postgrest
POSTGREST_GROUP?=	postgrest

SUB_FILES=	default.conf
SUB_LIST=	ETCDIR=${ETCDIR} \
		POSTGREST_GROUP=${POSTGREST_GROUP} \
		POSTGREST_USER=${POSTGREST_USER}

USERS=		${POSTGREST_USER}
GROUPS=		${POSTGREST_GROUP}

PLIST_FILES=	"@sample ${ETCDIR}/default.conf.sample" \
		sbin/postgrest

PLIST_SUB=	ETCDIR=${ETCDIR} \
		POSTGREST_GROUP=${POSTGREST_GROUP} \
		POSTGREST_USER=${POSTGREST_USER}

# This file includes the USE_CABAL. To regenerate it it's required to run:
# 1) make cabal-extract
# 2) make cabal-configure
# 3) make make-use-cabal && paste the USE_CABAL section to Makefile.modules
.include "Makefile.modules"

do-install:
	@${MKDIR} ${STAGEDIR}${ETCDIR}
	${INSTALL_DATA} ${WRKDIR}/default.conf ${STAGEDIR}${ETCDIR}/default.conf.sample
	${INSTALL_PROGRAM} \
		$$(find ${WRKSRC}/dist-newstyle -name ${PORTNAME} -type f -perm +111) \
		${STAGEDIR}${PREFIX}/sbin/${PORTNAME}

.include <bsd.port.mk>