blob: 2c048aa05093925c18e51c4576f71aa1eafd5810 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "The canonical example of init scripts"
2SECTION = "base"
Andrew Geissler95ac1b82021-03-31 14:34:31 -05003DESCRIPTION = "This recipe is a canonical example of init scripts"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05004LICENSE = "GPLv2"
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 () {
Patrick Williamsc0f7c042017-02-23 20:41:17 -060013 ${CC} ${CFLAGS} ${LDFLAGS} ${WORKDIR}/skeleton_test.c -o ${WORKDIR}/skeleton-test
Patrick Williamsc124f4f2015-09-15 14:41:29 -050014}
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
Patrick Williams213cb262021-08-07 19:21:33 -050030RDEPENDS:${PN} = "initscripts"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050031
Patrick Williams213cb262021-08-07 19:21:33 -050032CONFFILES:${PN} += "${sysconfdir}/init.d/skeleton"