xref: /OK3568_Linux_fs/yocto/poky/meta-skeleton/recipes-skeleton/service/service_0.1.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1SUMMARY = "The canonical example of init scripts"
2SECTION = "base"
3DESCRIPTION = "This recipe is a canonical example of init scripts"
4LICENSE = "GPL-2.0-only"
5LIC_FILES_CHKSUM = "file://${WORKDIR}/COPYRIGHT;md5=349c872e0066155e1818b786938876a4"
6
7SRC_URI = "file://skeleton \
8	   file://skeleton_test.c \
9	   file://COPYRIGHT \
10	   "
11
12do_compile () {
13	${CC} ${CFLAGS} ${LDFLAGS} ${WORKDIR}/skeleton_test.c -o ${WORKDIR}/skeleton-test
14}
15
16do_install () {
17	install -d ${D}${sysconfdir}/init.d
18	cat ${WORKDIR}/skeleton | \
19	  sed -e 's,/etc,${sysconfdir},g' \
20	      -e 's,/usr/sbin,${sbindir},g' \
21	      -e 's,/var,${localstatedir},g' \
22	      -e 's,/usr/bin,${bindir},g' \
23	      -e 's,/usr,${prefix},g' > ${D}${sysconfdir}/init.d/skeleton
24	chmod a+x ${D}${sysconfdir}/init.d/skeleton
25
26	install -d ${D}${sbindir}
27	install -m 0755 ${WORKDIR}/skeleton-test ${D}${sbindir}/
28}
29
30RDEPENDS:${PN} = "initscripts"
31
32CONFFILES:${PN} += "${sysconfdir}/init.d/skeleton"
33