Makefile 1.4 KB

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