Makefile 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. URL:=https://git.c3pb.de/freifunk-pb/ffho-packages
  14. endef
  15. define Package/ffho-banner/description
  16. Banner file replacement
  17. endef
  18. define Build/Prepare
  19. mkdir -p $(PKG_BUILD_DIR)
  20. endef
  21. define Build/Configure
  22. endef
  23. define Build/Compile
  24. endef
  25. define Package/ffho-banner/preinst
  26. #!/bin/sh
  27. cd "$${IPKG_INSTROOT}/etc/"
  28. if [ -h "./banner" ] ; then
  29. /bin/rm "./banner"
  30. elif [ -f "./banner" ] ; then
  31. /bin/mv "./banner" "./banner.openwrt"
  32. fi
  33. /bin/ln -s "./banner.openwrt" "./banner"
  34. exit 0
  35. endef
  36. define Package/ffho-banner/postinst
  37. #!/bin/sh
  38. cd "$${IPKG_INSTROOT}/etc/"
  39. [ -h "./banner" ] && /bin/rm -f "./banner"
  40. /bin/ln -s "./banner.ffho" "./banner"
  41. exit $$?
  42. endef
  43. define Package/ffho-banner/prerm
  44. #!/bin/sh
  45. cd "$${IPKG_INSTROOT}/etc/"
  46. if [ -h "./banner" ] ; then
  47. [[ "$$(readlink -n ./banner)" == "./banner.ffho" ]] && \
  48. /bin/rm -f "./banner" && \
  49. [ -f "./banner.openwrt" ] && \
  50. /bin/ln -s "./banner.openwrt" "./banner"
  51. fi
  52. exit 0
  53. endef
  54. define Package/ffho-banner/install
  55. $(INSTALL_DIR) $(1)/etc/
  56. $(INSTALL_DATA) ./files/etc/banner.ffho $(1)/etc/
  57. endef
  58. $(eval $(call BuildPackage,ffho-banner))