Makefile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=ffho-banner
  3. PKG_VERSION:=1
  4. PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
  5. include $(TOPDIR)/../package/gluon.mk
  6. define Package/ffho-banner
  7. SECTION:=ffho
  8. CATEGORY:=FFHO
  9. TITLE:=Banner file replacement
  10. DEPENDS:=+gluon-core +busybox
  11. MAINTAINER:=Freifunk Hochstift <kontakt@hochstift.freifunk.net>
  12. endef
  13. define Package/ffho-banner/description
  14. Banner file replacement
  15. endef
  16. define Build/Prepare
  17. mkdir -p $(PKG_BUILD_DIR)
  18. endef
  19. define Build/Configure
  20. endef
  21. define Build/Compile
  22. endef
  23. define Package/ffho-banner/preinst
  24. #!/bin/sh
  25. cd "$${IPKG_INSTROOT}/etc/"
  26. if [ -h "./banner" ] ; then
  27. /bin/rm "./banner"
  28. elif [ -f "./banner" ] ; then
  29. /bin/mv "./banner" "./banner.openwrt"
  30. fi
  31. /bin/ln -s "./banner.openwrt" "./banner"
  32. exit 0
  33. endef
  34. define Package/ffho-banner/postinst
  35. #!/bin/sh
  36. cd "$${IPKG_INSTROOT}/etc/"
  37. [ -h "./banner" ] && /bin/rm -f "./banner"
  38. /bin/ln -s "./banner.ffho" "./banner"
  39. exit $$?
  40. endef
  41. define Package/ffho-banner/prerm
  42. #!/bin/sh
  43. cd "$${IPKG_INSTROOT}/etc/"
  44. if [ -h "./banner" ] ; then
  45. [[ "$$(readlink -n ./banner)" == "./banner.ffho" ]] && \
  46. /bin/rm -f "./banner" && \
  47. [ -f "./banner.openwrt" ] && \
  48. /bin/ln -s "./banner.openwrt" "./banner"
  49. fi
  50. exit 0
  51. endef
  52. define Package/ffho-banner/install
  53. $(INSTALL_DIR) $(1)/etc/
  54. $(INSTALL_DATA) ./files/etc/banner.ffho $(1)/etc/
  55. endef
  56. $(eval $(call BuildPackage,ffho-banner))