blob: 912f6b0f6111a6bfffe1e7ed8192077e58060e7b [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"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00004LICENSE = "GPL-2.0-only"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05005LIC_FILES_CHKSUM = "file://${WORKDIR}/COPYRIGHT;md5=349c872e0066155e1818b786938876a4"
6
7SRC_URI = "file://skeleton \
8 file://skeleton_test.c \
9 file://COPYRIGHT \
10 "
11
Patrick Williams92b42cb2022-09-03 06:53:57 -050012S = "${WORKDIR}"
13
Patrick Williamsc124f4f2015-09-15 14:41:29 -050014do_compile () {
Patrick Williamsc0f7c042017-02-23 20:41:17 -060015 ${CC} ${CFLAGS} ${LDFLAGS} ${WORKDIR}/skeleton_test.c -o ${WORKDIR}/skeleton-test
Patrick Williamsc124f4f2015-09-15 14:41:29 -050016}
17
18do_install () {
19 install -d ${D}${sysconfdir}/init.d
20 cat ${WORKDIR}/skeleton | \
21 sed -e 's,/etc,${sysconfdir},g' \
22 -e 's,/usr/sbin,${sbindir},g' \
23 -e 's,/var,${localstatedir},g' \
24 -e 's,/usr/bin,${bindir},g' \
25 -e 's,/usr,${prefix},g' > ${D}${sysconfdir}/init.d/skeleton
26 chmod a+x ${D}${sysconfdir}/init.d/skeleton
27
28 install -d ${D}${sbindir}
29 install -m 0755 ${WORKDIR}/skeleton-test ${D}${sbindir}/
30}
31
Patrick Williams213cb262021-08-07 19:21:33 -050032RDEPENDS:${PN} = "initscripts"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050033
Patrick Williams213cb262021-08-07 19:21:33 -050034CONFFILES:${PN} += "${sysconfdir}/init.d/skeleton"