aboutsummaryrefslogtreecommitdiff
path: root/databases/pgbarman/Makefile
blob: d4db9ee88881febcb6bb48b80241442b467bd3d2 (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
# Created by: Matthew Seaman
# $FreeBSD$

PORTNAME=	barman
DISTVERSION=	2.3
CATEGORIES=	databases
MASTER_SITES=	SF/${PKGNAMEPREFIX}${PORTNAME}/${DISTVERSION}
PKGNAMEPREFIX=	pg
DISTFILES=	${DISTNAME}${EXTRACT_SUFX} tutorial.pdf
EXTRACT_ONLY=	${DISTNAME}${EXTRACT_SUFX}

MAINTAINER=	matthew@FreeBSD.org
COMMENT=	Backup and recovery manager for PostgreSQL

LICENSE=	GPLv3

RUN_DEPENDS=	rsync:net/rsync						\
		${PYTHON_PKGNAMEPREFIX}psycopg2>0:databases/py-psycopg2	\
		${PYTHON_PKGNAMEPREFIX}dateutil>=2.1:devel/py-dateutil	\
		${PYTHON_PKGNAMEPREFIX}argh>=0.21.2:devel/py-argh \
		${PYTHON_PKGNAMEPREFIX}argcomplete>0:devel/py-argcomplete

NO_ARCH=	yes

USERS=		barman
GROUPS=		barman

USES=		pgsql python
WANT_PGSQL=	client
USE_PYTHON=	autoplist distutils

PORTDOCS=	tutorial.pdf

.include <bsd.port.pre.mk>

.if ${PGSQL_VER:M9\.[12345]}
PGUSER=		pgsql
.else
PGUSER=		postgres
.endif

post-extract:
	${CP} ${DISTDIR}/${PORTDOCS} ${WRKDIR}/

post-patch:
	${SED} -i -e "s@%%PREFIX%%@${PREFIX}@" ${WRKSRC}/barman/config.py
	${SED} -i -e "s@%%PREFIX%%@${PREFIX}@" ${WRKSRC}/doc/barman.conf
	${SED} -i -e "s@%%PGUSER%%@${PGUSER}@" ${WRKSRC}/doc/barman.5

post-install:
	${MKDIR} ${STAGEDIR}${DOCSDIR}
	${INSTALL_MAN} ${WRKDIR}/${PORTDOCS} ${STAGEDIR}${DOCSDIR}
	${MKDIR} ${STAGEDIR}${ETCDIR}
	${INSTALL_DATA} ${WRKSRC}/doc/barman.conf ${STAGEDIR}${ETCDIR}/barman.conf.sample

.include <bsd.port.post.mk>