Makefile 1.6 KB

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