service_0.1.bb 940 B

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