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" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 4 | LICENSE = "GPLv2" |
| 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 | |
| 12 | do_compile () { |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 13 | ${CC} ${CFLAGS} ${LDFLAGS} ${WORKDIR}/skeleton_test.c -o ${WORKDIR}/skeleton-test |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 14 | } |
| 15 | |
| 16 | do_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 | |
| 30 | RDEPENDS_${PN} = "initscripts" |
| 31 | |
| 32 | CONFFILES_${PN} += "${sysconfdir}/init.d/skeleton" |