summaryrefslogtreecommitdiff
path: root/pkgtools/tinderbox-dragonfly/Makefile
blob: fce0d6927781d6ebbbcd8936817f727a011b39bc (plain)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# $NetBSD: Makefile,v 1.9 2012/10/03 21:57:16 wiz Exp $
#

DISTNAME=	tinderbox-dragonfly-${TBOX_VERSION}
PKGREVISION=	4
CATEGORIES=	pkgtools
MASTER_SITES=	http://tinderbox.marcuscom.com/
DISTFILES=	tinderbox-${TBOX_VERSION}.tar.gz

MAINTAINER=	draco@marino.st
HOMEPAGE=	http://tinderbox.marcuscom.com/
COMMENT=	Tinderbox package building system (pkgsrc)
LICENSE=	modified-bsd

DEPENDS+=	p5-Compress-Bzip2>=2:../../archivers/p5-Compress-Bzip2
DEPENDS+=	csup>=20100101:../../net/csup
DEPENDS+=	scmgit>1.6:../../devel/scmgit

TBOX_VERSION=		3.4.1
ONLY_FOR_PLATFORM=	DragonFly-*-*

USE_TOOLS+=		perl perl:run
NO_CONFIGURE=		yes
NO_BUILD=		yes
RCD_SCRIPTS=		tinderd
WRKSRC=			${WRKDIR}/tinderbox-${TBOX_VERSION}
TRASH=			${WRKDIR}/trash
MAN_FILES_cmd=		${SED} -ne "s,^man/man1/,,p" PLIST
MAN_FILES=		${MAN_FILES_cmd:sh}

INSTALLATION_DIRS+=	tinderbox/scripts
INSTALLATION_DIRS+=	${PKGMANDIR}/man1

SUBST_CLASSES+=		paths
SUBST_FILES.paths+=	contrib/bulk/add_all_packages.sh
SUBST_FILES.paths+=	contrib/bulk/bulk_hook_1.sh
SUBST_FILES.paths+=	contrib/bulk/bulkbuild.sh
SUBST_SED.paths+=	-e 's,@TINROOT@,${PREFIX}/tinderbox,g'
SUBST_STAGE.paths=	post-patch

.include "options.mk"

post-extract:
	${MKDIR} ${TRASH}
.if empty(PKG_OPTIONS:Mwebui)
	mv ${WRKSRC}/webui ${TRASH}
.endif
	mv ${WRKSRC}/etc/rc.d ${TRASH}
	${MKDIR} ${WRKSRC}/contrib/bulk
	for dossier in add_all_packages bulk_hook_1 bulkbuild; do \
		${CP} ${FILESDIR}/$${dossier}.sh.in \
		${WRKSRC}/contrib/bulk/$${dossier}.sh; \
	done
	chmod 755 ${WRKSRC}/contrib/bulk/*

post-patch:
.if !empty(PKG_OPTIONS:Manybody)
	perl -i -pe 's/^if \[ `id -u` != 0 \]; then/if false; then/' \
		${WRKSRC}/tc
.endif
	cd ${WRKSRC} && ${FIND} -E . -regex '.*(orig|bak)' -exec ${RM} {} \;

do-install:
	for manual in ${MAN_FILES}; do \
		${INSTALL_MAN} ${WRKSRC}/man/man1/$${manual} ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1; \
	done
	mv ${WRKSRC}/man ${TRASH}
	cd ${WRKSRC}; for dossier in .version *; do \
		${TEST} ! -f "$$dossier" || \
		${CP} "$$dossier" ${DESTDIR}${PREFIX}/tinderbox/scripts; \
		${TEST} ! -d "$$dossier" || \
		${CP} -R "$$dossier" ${DESTDIR}${PREFIX}/tinderbox/scripts; \
	done

.include "../../mk/bsd.pkg.mk"