Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / sysutils / sysbuild / Makefile
blob5550af578246782bdcf67719fd6c1ec0be46cea6
1 # $NetBSD: Makefile,v 1.23 2012/10/23 19:51:25 asau Exp $
3 DISTNAME= sysbuild-2.5
4 CATEGORIES= sysutils
5 MASTER_SITES= # empty
6 DISTFILES= # empty
8 MAINTAINER= jmmv@NetBSD.org
9 COMMENT= Automates builds of NetBSD and manages source trees
10 LICENSE= modified-bsd
12 PKG_INSTALLATION_TYPES= overwrite pkgviews
14 WRKSRC= ${WRKDIR}
15 NO_CONFIGURE= YES
17 BUILD_SUBST= -e 's,@SYSBUILD_BINDIR@,${PREFIX}/bin,g'
18 BUILD_SUBST+= -e 's,@SYSBUILD_EGDIR@,${EGDIR},g'
19 BUILD_SUBST+= -e 's,@SYSBUILD_ETCDIR@,${PKG_SYSCONFDIR},g'
20 BUILD_SUBST+= -e 's,@SYSBUILD_SHAREDIR@,${PREFIX}/share/sysbuild,g'
22 PKG_SYSCONFSUBDIR= sysbuild
23 EGDIR= ${PREFIX}/share/examples/sysbuild
24 CONF_FILES+= ${EGDIR}/default.conf ${PKG_SYSCONFDIR}/default.conf
26 PKG_OPTIONS_VAR= PKG_OPTIONS.sysbuild
27 PKG_SUPPORTED_OPTIONS= tests
28 PKG_SUGGESTED_OPTIONS= tests
30 .include "../../mk/bsd.options.mk"
32 .if $(PKG_OPTIONS:Mtests)
33 TEST_PROGS= sysbuild_test sysbuild4cron_test
35 PLIST_SUBST+= TESTS=
36 . include "../../devel/atf-libs/buildlink3.mk"
38 BUILD_SUBST+= -e 's,@ATF_SH@,${BUILDLINK_PREFIX.atf-libs}/bin/atf-sh,g'
40 do-build: build-tests
41 build-tests:
42 cp ${FILESDIR}/Kyuafile ${WRKSRC}
43 .for file in ${TEST_PROGS}
44 sed ${BUILD_SUBST} <${FILESDIR}/${file}.sh >${WRKSRC}/${file}
45 chmod +x ${WRKSRC}/${file}
46 .endfor
48 INSTALLATION_DIRS+= tests/sysbuild
50 do-install: install-tests
51 install-tests:
52 ${INSTALL_DATA} ${WRKSRC}/Kyuafile ${DESTDIR}${PREFIX}/tests/sysbuild
53 .for file in ${TEST_PROGS}
54 ${INSTALL_SCRIPT} ${WRKSRC}/${file} ${DESTDIR}${PREFIX}/tests/sysbuild/
55 .endfor
57 do-test:
58 cd ${WRKSRC} && PATH="${WRKSRC}:${PATH}" \
59 SYSBUILD_SHAREDIR="${WRKSRC}" kyua test
60 .else
61 PLIST_SUBST+= TESTS=@comment
62 .endif
64 do-build:
65 .for file in sysbuild sysbuild4cron
66 sed ${BUILD_SUBST} ${FILESDIR}/${file}.sh \
67 | ${BUILDLINK_PREFIX.shtk}/bin/shtk build \
68 -s ${SH} -m ${file}_main -o ${WRKSRC}/${file} -
69 .endfor
70 .for file in sysbuild.1 sysbuild4cron.1 sysbuild.conf.5 default.conf
71 sed ${BUILD_SUBST} <${FILESDIR}/${file} >${WRKSRC}/${file}
72 .endfor
73 cp ${FILESDIR}/env.sh ${WRKSRC}
74 chmod +x ${WRKSRC}/env.sh
76 INSTALLATION_DIRS+= bin ${PKGMANDIR}/man1 ${PKGMANDIR}/man5 \
77 share/examples/sysbuild share/sysbuild
79 do-install:
80 ${INSTALL_SCRIPT} ${WRKSRC}/sysbuild ${DESTDIR}${PREFIX}/bin/
81 ${INSTALL_SCRIPT} ${WRKSRC}/sysbuild4cron ${DESTDIR}${PREFIX}/bin/
82 ${INSTALL_MAN} ${WRKSRC}/sysbuild.1 \
83 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/
84 ${INSTALL_MAN} ${WRKSRC}/sysbuild4cron.1 \
85 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/
86 ${INSTALL_MAN} ${WRKSRC}/sysbuild.conf.5 \
87 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man5/
88 .for file in default.conf
89 ${INSTALL_DATA} ${WRKSRC}/${file} ${DESTDIR}${EGDIR}
90 .endfor
91 ${INSTALL_SCRIPT} ${WRKSRC}/env.sh ${DESTDIR}${PREFIX}/share/sysbuild
93 BUILDLINK_API_DEPENDS.shtk+= shtk>=1.1
94 .include "../../devel/shtk/buildlink3.mk"
95 .include "../../mk/bsd.pkg.mk"