Fixup fromcvs/togit conversion
[pkgsrcv2.git] / pkgtools / tinderbox-dragonfly / Makefile
1 # $NetBSD: Makefile,v 1.7 2012/08/05 10:02:13 obache Exp $
2 #
3
4 DISTNAME=       tinderbox-dragonfly-${TBOX_VERSION}
5 PKGREVISION=    3
6 CATEGORIES=     pkgtools
7 MASTER_SITES=   http://tinderbox.marcuscom.com/
8 DISTFILES=      tinderbox-${TBOX_VERSION}.tar.gz
9
10 MAINTAINER=     draco@marino.st
11 HOMEPAGE=       http://tinderbox.marcuscom.com/
12 COMMENT=        Tinderbox package building system (pkgsrc)
13 LICENSE=        modified-bsd
14
15 DEPENDS+=       p5-Compress-Bzip2>=2:../../archivers/p5-Compress-Bzip2
16 DEPENDS+=       csup>=20100101:../../net/csup
17 DEPENDS+=       scmgit>1.6:../../devel/scmgit
18
19 TBOX_VERSION=           3.4.1
20 ONLY_FOR_PLATFORM=      DragonFly-*-*
21
22 USE_TOOLS+=             perl perl:run
23 NO_CONFIGURE=           yes
24 NO_BUILD=               yes
25 RCD_SCRIPTS=            tinderd
26 WRKSRC=                 ${WRKDIR}/tinderbox-${TBOX_VERSION}
27 TRASH=                  ${WRKDIR}/trash
28 MAN_FILES_cmd=          ${SED} -ne "s,^man/man1/,,p" PLIST
29 MAN_FILES=              ${MAN_FILES_cmd:sh}
30
31 INSTALLATION_DIRS+=     tinderbox/scripts
32 INSTALLATION_DIRS+=     ${PKGMANDIR}/man1
33
34 SUBST_CLASSES+=         paths
35 SUBST_FILES.paths+=     contrib/bulk/add_all_packages.sh
36 SUBST_FILES.paths+=     contrib/bulk/bulk_hook_1.sh
37 SUBST_FILES.paths+=     contrib/bulk/bulkbuild.sh
38 SUBST_SED.paths+=       -e 's,@TINROOT@,${PREFIX}/tinderbox,g'
39 SUBST_STAGE.paths=      post-patch
40
41 .include "options.mk"
42
43 post-extract:
44         ${MKDIR} ${TRASH}
45 .if empty(PKG_OPTIONS:Mwebui)
46         mv ${WRKSRC}/webui ${TRASH}
47 .endif
48         mv ${WRKSRC}/etc/rc.d ${TRASH}
49         ${MKDIR} ${WRKSRC}/contrib/bulk
50         for dossier in add_all_packages bulk_hook_1 bulkbuild; do \
51                 ${CP} ${FILESDIR}/$${dossier}.sh.in \
52                 ${WRKSRC}/contrib/bulk/$${dossier}.sh; \
53         done
54         chmod 755 ${WRKSRC}/contrib/bulk/*
55
56 post-patch:
57 .if !empty(PKG_OPTIONS:Manybody)
58         perl -i -pe 's/^if \[ `id -u` != 0 \]; then/if false; then/' \
59                 ${WRKSRC}/tc
60 .endif
61         cd ${WRKSRC} && ${FIND} -E . -regex '.*(orig|bak)' -exec ${RM} {} \;
62
63 do-install:
64         for manual in ${MAN_FILES}; do \
65                 ${INSTALL_MAN} ${WRKSRC}/man/man1/$${manual} ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1; \
66         done
67         mv ${WRKSRC}/man ${TRASH}
68         cd ${WRKSRC}; for dossier in .version *; do \
69                 ${TEST} ! -f "$$dossier" || \
70                 ${CP} "$$dossier" ${DESTDIR}${PREFIX}/tinderbox/scripts; \
71                 ${TEST} ! -d "$$dossier" || \
72                 ${CP} -R "$$dossier" ${DESTDIR}${PREFIX}/tinderbox/scripts; \
73         done
74
75 .include "../../mk/bsd.pkg.mk"