Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "The canonical example of init scripts" |
| 2 | SECTION = "base" |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 3 | DESCRIPTION = "This recipe is a canonical example of init scripts" |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 4 | LICENSE = "GPL-2.0-only" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 5 | LIC_FILES_CHKSUM = "file://${WORKDIR}/COPYRIGHT;md5=349c872e0066155e1818b786938876a4" |
| 6 | |
| 7 | SRC_URI = "file://skeleton \ |
| 8 | file://skeleton_test.c \ |
| 9 | file://COPYRIGHT \ |
| 10 | " |
| 11 | |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 12 | S = "${WORKDIR}" |
| 13 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 14 | do_compile () { |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 15 | ${CC} ${CFLAGS} ${LDFLAGS} ${WORKDIR}/skeleton_test.c -o ${WORKDIR}/skeleton-test |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 16 | } |
| 17 | |
| 18 | do_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 Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 32 | RDEPENDS:${PN} = "initscripts" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 33 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 34 | CONFFILES:${PN} += "${sysconfdir}/init.d/skeleton" |