1 # $NetBSD: Makefile,v 1.23 2012/10/23 19:51:25 asau Exp $
8 MAINTAINER
= jmmv@NetBSD.org
9 COMMENT
= Automates builds of NetBSD and manages source trees
12 PKG_INSTALLATION_TYPES
= overwrite pkgviews
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
36 .
include "../../devel/atf-libs/buildlink3.mk"
38 BUILD_SUBST
+= -e
's,@ATF_SH@,${BUILDLINK_PREFIX.atf-libs}/bin/atf-sh,g'
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}
48 INSTALLATION_DIRS
+= tests
/sysbuild
50 do-install
: 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
/
58 cd
${WRKSRC} && PATH
="${WRKSRC}:${PATH}" \
59 SYSBUILD_SHAREDIR
="${WRKSRC}" kyua
test
61 PLIST_SUBST
+= TESTS
=@comment
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} -
70 .for file in sysbuild
.1 sysbuild4cron
.1 sysbuild.conf
.5 default.conf
71 sed
${BUILD_SUBST} <${FILESDIR}/${file} >${WRKSRC}/${file}
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
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}
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"