aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/tarsnap-periodic/Makefile
blob: 6b17ae6172234832ea28e2b2e9d706e8d4e6b443 (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
# Created by: Kamila Souckova <kamila@ksp.sk>
# $FreeBSD$

PORTNAME=   tarsnap-periodic
PORTVERSION=    1.0.20160229
CATEGORIES= sysutils

MAINTAINER= kamila@ksp.sk
COMMENT=    Simple way of making tarsnap backups using the periodic system

RUN_DEPENDS=    tarsnap:${PORTSDIR}/sysutils/tarsnap

USE_GITHUB= yes
GH_ACCOUNT= anotherkamila
GH_TAGNAME= e593907

NO_ARCH=    yes
NO_BUILD=   yes

PERIODIC_DIRS=  etc/periodic/daily etc/periodic/weekly \
        etc/periodic/monthly etc/periodic

PERIODIC_FILES= etc/periodic/daily/000.tarsnap-backup \
        etc/periodic/weekly/000.tarsnap-backup \
        etc/periodic/monthly/000.tarsnap-backup

SCRIPT_FILE=    bin/tarsnap-backup

PLIST_FILES=    ${PERIODIC_FILES} ${SCRIPT_FILE}

post-patch:
    @${REINPLACE_CMD} -e "s|TARSNAP_CMD=.*|TARSNAP_CMD=${PREFIX}/bin/tarsnap|" \
        ${WRKSRC}/${SCRIPT_FILE}
.for _file in ${PERIODIC_FILES}
    @${REINPLACE_CMD} -e "s|tarsnap-backup|${PREFIX}/bin/tarsnap-backup|" \
        ${WRKSRC}/${_file}
.endfor

do-install:
    ${INSTALL_SCRIPT} ${WRKSRC}/bin/tarsnap-backup ${STAGEDIR}${PREFIX}/bin
.for _dir in ${PERIODIC_DIRS}
    @${MKDIR} ${STAGEDIR}${PREFIX}/${_dir}
.endfor

.for _file in ${PERIODIC_FILES}
    ${INSTALL_SCRIPT} ${WRKSRC}/${_file} ${STAGEDIR}${PREFIX}/${_file}
.endfor

.include <bsd.port.mk>