service_0.1.bb 881 B

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