From 60522ee2532b3e34569fa3bf027ad3aead4d6ed9 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 8 Mar 2018 19:49:41 +0100 Subject: [PATCH] treewide: move package Makefile boilerplate to gluon.mk --- package/gluon-alfred/Makefile | 11 +-- package/gluon-authorized-keys/Makefile | 15 +--- package/gluon-autoupdater/Makefile | 19 +---- package/gluon-client-bridge/Makefile | 15 +--- .../gluon-config-mode-autoupdater/Makefile | 14 +--- .../gluon-config-mode-contact-info/Makefile | 19 +---- package/gluon-config-mode-core/Makefile | 14 +--- .../gluon-config-mode-domain-select/Makefile | 15 +--- .../gluon-config-mode-geo-location/Makefile | 19 +---- package/gluon-config-mode-hostname/Makefile | 14 +--- package/gluon-config-mode-mesh-vpn/Makefile | 14 +--- package/gluon-config-mode-theme/Makefile | 13 +--- package/gluon-core/Makefile | 18 ++--- .../gluon-ebtables-filter-multicast/Makefile | 11 +-- .../gluon-ebtables-filter-ra-dhcp/Makefile | 11 +-- package/gluon-ebtables-limit-arp/Makefile | 9 ++- package/gluon-ebtables-source-filter/Makefile | 14 +--- package/gluon-ebtables/Makefile | 14 +--- package/gluon-l3roamd/Makefile | 11 +-- package/gluon-lock-password/Makefile | 11 +-- package/gluon-mesh-batman-adv/Makefile | 34 ++------- package/gluon-mesh-vpn-core/Makefile | 16 +---- package/gluon-mesh-vpn-fastd/Makefile | 21 +----- package/gluon-mesh-vpn-tunneldigger/Makefile | 16 +---- package/gluon-neighbour-info/Makefile | 12 ++-- package/gluon-node-info/Makefile | 22 +----- package/gluon-radv-filterd/Makefile | 14 +--- package/gluon-radvd/Makefile | 11 +-- package/gluon-respondd/Makefile | 14 +--- package/gluon-setup-mode/Makefile | 16 +---- package/gluon-site/Makefile | 4 +- package/gluon-status-page/Makefile | 19 ++--- package/gluon-wan-dnsmasq/Makefile | 11 +-- package/gluon-web-admin/Makefile | 20 +----- package/gluon-web-autoupdater/Makefile | 14 +--- package/gluon-web-logging/Makefile | 14 +--- package/gluon-web-mesh-vpn-fastd/Makefile | 20 +----- package/gluon-web-model/Makefile | 14 +--- package/gluon-web-network/Makefile | 14 +--- package/gluon-web-node-role/Makefile | 19 +---- package/gluon-web-private-wifi/Makefile | 14 +--- package/gluon-web-wifi-config/Makefile | 14 +--- package/gluon-web/Makefile | 23 ++---- package/gluon.mk | 70 +++++++++++++++++-- package/libgluonutil/Makefile | 2 +- 45 files changed, 140 insertions(+), 589 deletions(-) diff --git a/package/gluon-alfred/Makefile b/package/gluon-alfred/Makefile index ba3b9eb1..23a8f242 100644 --- a/package/gluon-alfred/Makefile +++ b/package/gluon-alfred/Makefile @@ -13,13 +13,4 @@ define Package/gluon-alfred TITLE:=Configure alfred endef -define Build/Compile - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - -define Package/gluon-alfred/install - $(CP) ./files/* $(1)/ - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ -endef - -$(eval $(call BuildPackage,gluon-alfred)) +$(eval $(call BuildPackageGluon,gluon-alfred)) diff --git a/package/gluon-authorized-keys/Makefile b/package/gluon-authorized-keys/Makefile index 6a538f40..d6fcb0e4 100644 --- a/package/gluon-authorized-keys/Makefile +++ b/package/gluon-authorized-keys/Makefile @@ -12,17 +12,4 @@ define Package/gluon-authorized-keys DEPENDS:=+gluon-core endef -define Build/Compile - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - -define Package/gluon-authorized-keys/install - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ -endef - -define Package/gluon-authorized-keys/postinst -#!/bin/sh -$(call GluonCheckSite,check_site.lua) -endef - -$(eval $(call BuildPackage,gluon-authorized-keys)) +$(eval $(call BuildPackageGluon,gluon-authorized-keys)) diff --git a/package/gluon-autoupdater/Makefile b/package/gluon-autoupdater/Makefile index 6d8b9f07..b0314afe 100644 --- a/package/gluon-autoupdater/Makefile +++ b/package/gluon-autoupdater/Makefile @@ -4,7 +4,6 @@ PKG_NAME:=gluon-autoupdater PKG_VERSION:=4 PKG_CONFIG_DEPENDS := CONFIG_GLUON_BRANCH -PKG_BUILD_DEPENDS := respondd include ../gluon.mk @@ -22,17 +21,8 @@ config GLUON_BRANCH default "" endef -define Build/Compile - $(call Build/Compile/Default) - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - define Package/gluon-autoupdater/install - $(CP) ./files/* $(1)/ - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ - - $(INSTALL_DIR) $(1)/lib/gluon/respondd - $(CP) $(PKG_BUILD_DIR)/respondd.so $(1)/lib/gluon/respondd/autoupdater.so + $(Gluon/Build/Install) ifneq ($(CONFIG_GLUON_BRANCH),"") $(INSTALL_DIR) $(1)/lib/gluon/autoupdater @@ -40,9 +30,4 @@ ifneq ($(CONFIG_GLUON_BRANCH),"") endif endef -define Package/gluon-autoupdater/postinst -#!/bin/sh -$(call GluonCheckSite,check_site.lua) -endef - -$(eval $(call BuildPackage,gluon-autoupdater)) +$(eval $(call BuildPackageGluon,gluon-autoupdater)) diff --git a/package/gluon-client-bridge/Makefile b/package/gluon-client-bridge/Makefile index af2a69c8..ccf1bcd8 100644 --- a/package/gluon-client-bridge/Makefile +++ b/package/gluon-client-bridge/Makefile @@ -12,17 +12,4 @@ define Package/gluon-client-bridge DEPENDS:=+gluon-core +kmod-veth endef -define Build/Compile - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - -define Package/gluon-client-bridge/install - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ -endef - -define Package/gluon-client-bridge/postinst -#!/bin/sh -$(call GluonCheckSite,check_site.lua) -endef - -$(eval $(call BuildPackage,gluon-client-bridge)) +$(eval $(call BuildPackageGluon,gluon-client-bridge)) diff --git a/package/gluon-config-mode-autoupdater/Makefile b/package/gluon-config-mode-autoupdater/Makefile index 07c85b37..d6a97f27 100644 --- a/package/gluon-config-mode-autoupdater/Makefile +++ b/package/gluon-config-mode-autoupdater/Makefile @@ -5,8 +5,6 @@ PKG_VERSION:=1 include ../gluon.mk -PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG) - define Package/gluon-config-mode-autoupdater SECTION:=gluon CATEGORY:=Gluon @@ -14,14 +12,4 @@ define Package/gluon-config-mode-autoupdater DEPENDS:=+gluon-config-mode-core +gluon-autoupdater endef -define Build/Compile - $(call GluonBuildI18N,gluon-config-mode-autoupdater,i18n) - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - -define Package/gluon-config-mode-autoupdater/install - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ - $(call GluonInstallI18N,gluon-config-mode-autoupdater,$(1)) -endef - -$(eval $(call BuildPackage,gluon-config-mode-autoupdater)) +$(eval $(call BuildPackageGluon,gluon-config-mode-autoupdater)) diff --git a/package/gluon-config-mode-contact-info/Makefile b/package/gluon-config-mode-contact-info/Makefile index 96cf6131..5b84b1a5 100644 --- a/package/gluon-config-mode-contact-info/Makefile +++ b/package/gluon-config-mode-contact-info/Makefile @@ -5,8 +5,6 @@ PKG_VERSION:=1 include ../gluon.mk -PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG) - define Package/gluon-config-mode-contact-info SECTION:=gluon CATEGORY:=Gluon @@ -19,19 +17,4 @@ define Package/gluon-config-mode-contact-info/description Can be made obligatory in site.conf endef -define Build/Compile - $(call GluonBuildI18N,gluon-config-mode-contact-info,i18n) - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - -define Package/gluon-config-mode-contact-info/install - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ - $(call GluonInstallI18N,gluon-config-mode-contact-info,$(1)) -endef - -define Package/gluon-config-mode-contact-info/postinst -#!/bin/sh -$(call GluonCheckSite,check_site.lua) -endef - -$(eval $(call BuildPackage,gluon-config-mode-contact-info)) +$(eval $(call BuildPackageGluon,gluon-config-mode-contact-info)) diff --git a/package/gluon-config-mode-core/Makefile b/package/gluon-config-mode-core/Makefile index 6c0aeb5f..21976dc6 100644 --- a/package/gluon-config-mode-core/Makefile +++ b/package/gluon-config-mode-core/Makefile @@ -8,8 +8,6 @@ PKG_VERSION:=2 include ../gluon.mk -PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG) - define Package/gluon-config-mode-core SECTION:=gluon CATEGORY:=Gluon @@ -17,21 +15,13 @@ define Package/gluon-config-mode-core DEPENDS:=+gluon-setup-mode +gluon-web-model +gluon-config-mode-theme +uhttpd endef -define Build/Compile - $(call GluonBuildI18N,gluon-config-mode-core,i18n) - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - define Package/gluon-config-mode-core/install - $(CP) ./files/* $(1)/ - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ + $(Gluon/Build/Install) $(INSTALL_DIR) $(1)/lib/gluon/config-mode/view/ $(1)/lib/gluon/config-mode/www/static/ $(LN) /lib/gluon/web/i18n $(1)/lib/gluon/config-mode/ $(LN) /lib/gluon/web/view/{error,model} $(1)/lib/gluon/config-mode/view/ $(LN) /lib/gluon/web/www/static/gluon-web-model.js $(1)/lib/gluon/config-mode/www/static/ - - $(call GluonInstallI18N,gluon-config-mode-core,$(1)) endef -$(eval $(call BuildPackage,gluon-config-mode-core)) +$(eval $(call BuildPackageGluon,gluon-config-mode-core)) diff --git a/package/gluon-config-mode-domain-select/Makefile b/package/gluon-config-mode-domain-select/Makefile index 907de1a8..410ac964 100644 --- a/package/gluon-config-mode-domain-select/Makefile +++ b/package/gluon-config-mode-domain-select/Makefile @@ -12,17 +12,4 @@ define Package/gluon-config-mode-domain-select DEPENDS:=+gluon-config-mode-core @GLUON_MULTIDOMAIN endef -define Build/Compile - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - -define Package/gluon-config-mode-domain-select/install - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ -endef - -define Package/gluon-config-domain-select/postinst -#!/bin/sh -$(call GluonCheckSite,check_site.lua) -endef - -$(eval $(call BuildPackage,gluon-config-mode-domain-select)) +$(eval $(call BuildPackageGluon,gluon-config-mode-domain-select)) diff --git a/package/gluon-config-mode-geo-location/Makefile b/package/gluon-config-mode-geo-location/Makefile index a63d2341..e1482de9 100644 --- a/package/gluon-config-mode-geo-location/Makefile +++ b/package/gluon-config-mode-geo-location/Makefile @@ -5,8 +5,6 @@ PKG_VERSION:=1 include ../gluon.mk -PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG) - define Package/gluon-config-mode-geo-location SECTION:=gluon CATEGORY:=Gluon @@ -14,19 +12,4 @@ define Package/gluon-config-mode-geo-location DEPENDS:=+gluon-config-mode-core +gluon-node-info endef -define Build/Compile - $(call GluonBuildI18N,gluon-config-mode-geo-location,i18n) - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - -define Package/gluon-config-mode-geo-location/install - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ - $(call GluonInstallI18N,gluon-config-mode-geo-location,$(1)) -endef - -define Package/gluon-config-mode-geo-location/postinst -#!/bin/sh -$(call GluonCheckSite,check_site.lua) -endef - -$(eval $(call BuildPackage,gluon-config-mode-geo-location)) +$(eval $(call BuildPackageGluon,gluon-config-mode-geo-location)) diff --git a/package/gluon-config-mode-hostname/Makefile b/package/gluon-config-mode-hostname/Makefile index 2b435340..f4dfd7e8 100644 --- a/package/gluon-config-mode-hostname/Makefile +++ b/package/gluon-config-mode-hostname/Makefile @@ -5,8 +5,6 @@ PKG_VERSION:=1 include ../gluon.mk -PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG) - define Package/gluon-config-mode-hostname SECTION:=gluon CATEGORY:=Gluon @@ -14,14 +12,4 @@ define Package/gluon-config-mode-hostname DEPENDS:=+gluon-config-mode-core endef -define Build/Compile - $(call GluonBuildI18N,gluon-config-mode-hostname,i18n) - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - -define Package/gluon-config-mode-hostname/install - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ - $(call GluonInstallI18N,gluon-config-mode-hostname,$(1)) -endef - -$(eval $(call BuildPackage,gluon-config-mode-hostname)) +$(eval $(call BuildPackageGluon,gluon-config-mode-hostname)) diff --git a/package/gluon-config-mode-mesh-vpn/Makefile b/package/gluon-config-mode-mesh-vpn/Makefile index 2cd04594..549dbdbd 100644 --- a/package/gluon-config-mode-mesh-vpn/Makefile +++ b/package/gluon-config-mode-mesh-vpn/Makefile @@ -5,8 +5,6 @@ PKG_VERSION:=2 include ../gluon.mk -PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG) - define Package/gluon-config-mode-mesh-vpn SECTION:=gluon CATEGORY:=Gluon @@ -14,14 +12,4 @@ define Package/gluon-config-mode-mesh-vpn DEPENDS:=+gluon-config-mode-core +gluon-mesh-vpn-core endef -define Build/Compile - $(call GluonBuildI18N,gluon-config-mode-mesh-vpn,i18n) - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - -define Package/gluon-config-mode-mesh-vpn/install - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ - $(call GluonInstallI18N,gluon-config-mode-mesh-vpn,$(1)) -endef - -$(eval $(call BuildPackage,gluon-config-mode-mesh-vpn)) +$(eval $(call BuildPackageGluon,gluon-config-mode-mesh-vpn)) diff --git a/package/gluon-config-mode-theme/Makefile b/package/gluon-config-mode-theme/Makefile index d8bf6b58..34e2a0d4 100644 --- a/package/gluon-config-mode-theme/Makefile +++ b/package/gluon-config-mode-theme/Makefile @@ -8,8 +8,6 @@ PKG_VERSION:=1 include ../gluon.mk -PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG) - define Package/gluon-config-mode-theme SECTION:=gluon CATEGORY:=Gluon @@ -17,13 +15,4 @@ define Package/gluon-config-mode-theme DEPENDS:=+gluon-core +gluon-web endef -define Build/Compile - $(call GluonBuildI18N,gluon-config-mode-theme,i18n) -endef - -define Package/gluon-config-mode-theme/install - $(CP) ./files/* $(1)/ - $(call GluonInstallI18N,gluon-config-mode-theme,$(1)) -endef - -$(eval $(call BuildPackage,gluon-config-mode-theme)) +$(eval $(call BuildPackageGluon,gluon-config-mode-theme)) diff --git a/package/gluon-core/Makefile b/package/gluon-core/Makefile index 00d0b6f7..1b83c424 100644 --- a/package/gluon-core/Makefile +++ b/package/gluon-core/Makefile @@ -7,6 +7,8 @@ PKG_VERSION:=$(if $(DUMP),x,$(GLUON_VERSION)) PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) +GLUON_PKG_MAKE:=1 + include ../gluon.mk include $(INCLUDE_DIR)/cmake.mk @@ -23,23 +25,11 @@ define Package/gluon-core/description Gluon community wifi mesh firmware framework: core endef -define Build/Compile - $(call Build/Compile/Default,all) - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - define Package/gluon-core/install - $(CP) ./files/* $(1)/ - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ - $(CP) $(PKG_INSTALL_DIR)/* $(1)/ + $(Gluon/Build/Install) $(INSTALL_DIR) $(1)/lib/gluon echo '$(GLUON_VERSION)' > $(1)/lib/gluon/gluon-version endef -define Package/gluon-core/postinst -#!/bin/sh -$(call GluonCheckSite,check_site.lua) -endef - -$(eval $(call BuildPackage,gluon-core)) +$(eval $(call BuildPackageGluon,gluon-core)) diff --git a/package/gluon-ebtables-filter-multicast/Makefile b/package/gluon-ebtables-filter-multicast/Makefile index 6771d16b..1b500fd5 100644 --- a/package/gluon-ebtables-filter-multicast/Makefile +++ b/package/gluon-ebtables-filter-multicast/Makefile @@ -4,7 +4,7 @@ PKG_NAME:=gluon-ebtables-filter-multicast PKG_VERSION:=1 PKG_RELEASE:=1 -include $(INCLUDE_DIR)/package.mk +include ../gluon.mk define Package/gluon-ebtables-filter-multicast SECTION:=gluon @@ -21,11 +21,4 @@ define Package/gluon-ebtables-filter-multicast/description Allowed protocols are: DHCP, DHCPv6, ARP, ICMP, ICMPv6, BitTorrent local peer discovery, BABEL and OSPF endef -define Build/Compile -endef - -define Package/gluon-ebtables-filter-multicast/install - $(CP) ./files/* $(1)/ -endef - -$(eval $(call BuildPackage,gluon-ebtables-filter-multicast)) +$(eval $(call BuildPackageGluon,gluon-ebtables-filter-multicast)) diff --git a/package/gluon-ebtables-filter-ra-dhcp/Makefile b/package/gluon-ebtables-filter-ra-dhcp/Makefile index fd990327..30f5238a 100644 --- a/package/gluon-ebtables-filter-ra-dhcp/Makefile +++ b/package/gluon-ebtables-filter-ra-dhcp/Makefile @@ -4,7 +4,7 @@ PKG_NAME:=gluon-ebtables-filter-ra-dhcp PKG_VERSION:=1 PKG_RELEASE:=1 -include $(INCLUDE_DIR)/package.mk +include ../gluon.mk define Package/gluon-ebtables-filter-ra-dhcp SECTION:=gluon @@ -20,11 +20,4 @@ define Package/gluon-ebtables-filter-ra-dhcp/description client network, and not vice-versa. endef -define Build/Compile -endef - -define Package/gluon-ebtables-filter-ra-dhcp/install - $(CP) ./files/* $(1)/ -endef - -$(eval $(call BuildPackage,gluon-ebtables-filter-ra-dhcp)) +$(eval $(call BuildPackageGluon,gluon-ebtables-filter-ra-dhcp)) diff --git a/package/gluon-ebtables-limit-arp/Makefile b/package/gluon-ebtables-limit-arp/Makefile index d649025a..399cca2b 100644 --- a/package/gluon-ebtables-limit-arp/Makefile +++ b/package/gluon-ebtables-limit-arp/Makefile @@ -4,6 +4,8 @@ PKG_NAME:=gluon-ebtables-limit-arp PKG_VERSION:=1 PKG_RELEASE:=1 +GLUON_PKG_MAKE:=1 + include ../gluon.mk define Package/gluon-ebtables-limit-arp @@ -37,9 +39,10 @@ define Package/gluon-ebtables-limit-arp/description endef define Package/gluon-ebtables-limit-arp/install - mkdir -p $(1)/usr/sbin/ + $(Gluon/Build/Install) + + $(INSTALL_DIR) $(1)/usr/sbin/ $(CP) $(PKG_BUILD_DIR)/gluon-arp-limiter $(1)/usr/sbin/gluon-arp-limiter - $(CP) ./files/* $(1)/ endef -$(eval $(call BuildPackage,gluon-ebtables-limit-arp)) +$(eval $(call BuildPackageGluon,gluon-ebtables-limit-arp)) diff --git a/package/gluon-ebtables-source-filter/Makefile b/package/gluon-ebtables-source-filter/Makefile index 8016dc7c..d19b047b 100644 --- a/package/gluon-ebtables-source-filter/Makefile +++ b/package/gluon-ebtables-source-filter/Makefile @@ -18,16 +18,4 @@ define Package/gluon-ebtables-source-filter/description traffic entering the network via the nodes. endef -define Build/Compile -endef - -define Package/gluon-ebtables-source-filter/install - $(CP) ./files/* $(1)/ -endef - -define Package/gluon-ebtables-source-filter/postinst -#!/bin/sh -$(call GluonCheckSite,check_site.lua) -endef - -$(eval $(call BuildPackage,gluon-ebtables-source-filter)) +$(eval $(call BuildPackageGluon,gluon-ebtables-source-filter)) diff --git a/package/gluon-ebtables/Makefile b/package/gluon-ebtables/Makefile index b97e10d3..f5ee0e38 100644 --- a/package/gluon-ebtables/Makefile +++ b/package/gluon-ebtables/Makefile @@ -17,16 +17,4 @@ define Package/gluon-ebtables/description Gluon community wifi mesh firmware framework: ebtables support endef -define Build/Compile -endef - -define Package/gluon-ebtables/install - $(CP) ./files/* $(1)/ -endef - -define Package/gluon-ebtables/postinst -#!/bin/sh -$(call GluonCheckSite,check_site.lua) -endef - -$(eval $(call BuildPackage,gluon-ebtables)) +$(eval $(call BuildPackageGluon,gluon-ebtables)) diff --git a/package/gluon-l3roamd/Makefile b/package/gluon-l3roamd/Makefile index 4b4c438a..04883387 100644 --- a/package/gluon-l3roamd/Makefile +++ b/package/gluon-l3roamd/Makefile @@ -12,13 +12,4 @@ define Package/gluon-l3roamd DEPENDS:=+gluon-core +l3roamd endef -define Build/Compile - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - -define Package/gluon-l3roamd/install - $(CP) ./files/* $(1)/ - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ -endef - -$(eval $(call BuildPackage,gluon-l3roamd)) +$(eval $(call BuildPackageGluon,gluon-l3roamd)) diff --git a/package/gluon-lock-password/Makefile b/package/gluon-lock-password/Makefile index 3de51fac..f6282006 100644 --- a/package/gluon-lock-password/Makefile +++ b/package/gluon-lock-password/Makefile @@ -4,7 +4,7 @@ PKG_NAME:=gluon-lock-password PKG_VERSION:=1 PKG_RELEASE:=1 -include $(INCLUDE_DIR)/package.mk +include ../gluon.mk define Package/gluon-lock-password SECTION:=gluon @@ -17,11 +17,4 @@ define Package/gluon-lock-password/description This packages locks the root account by default. endef -define Build/Compile -endef - -define Package/gluon-lock-password/install - $(CP) ./files/* $(1)/ -endef - -$(eval $(call BuildPackage,gluon-lock-password)) +$(eval $(call BuildPackageGluon,gluon-lock-password)) diff --git a/package/gluon-mesh-batman-adv/Makefile b/package/gluon-mesh-batman-adv/Makefile index b647ba75..22355798 100644 --- a/package/gluon-mesh-batman-adv/Makefile +++ b/package/gluon-mesh-batman-adv/Makefile @@ -3,8 +3,6 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gluon-mesh-batman-adv PKG_VERSION:=1 -PKG_BUILD_DEPENDS := respondd - include ../gluon.mk define Package/gluon-mesh-batman-adv/common @@ -27,37 +25,19 @@ $(Package/gluon-mesh-batman-adv/common) DEPENDS+=+kmod-batman-adv +batctl endef -define Build/Compile - $(call Build/Compile/Default) - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - -define Package/gluon-mesh-batman-adv/common/install - $(CP) ./files/* $(1)/ - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ - $(INSTALL_DIR) $(1)/lib/gluon/respondd - $(CP) $(PKG_BUILD_DIR)/respondd.so $(1)/lib/gluon/respondd/mesh-batman-adv.so +define Package/gluon-mesh-batman-adv-14/install + $(Gluon/Build/Install) $(INSTALL_DIR) $(1)/lib/gluon/mesh-batman-adv -endef - -define Package/gluon-mesh-batman-adv-14/install -$(Package/gluon-mesh-batman-adv/common/install) echo 14 > $(1)/lib/gluon/mesh-batman-adv/compat endef define Package/gluon-mesh-batman-adv-15/install -$(Package/gluon-mesh-batman-adv/common/install) + $(Gluon/Build/Install) + + $(INSTALL_DIR) $(1)/lib/gluon/mesh-batman-adv echo 15 > $(1)/lib/gluon/mesh-batman-adv/compat endef -define Package/gluon-mesh-batman-adv/common/postinst -#!/bin/sh -$(call GluonCheckSite,check_site.lua) -endef -Package/gluon-mesh-batman-adv-14/postinst := $(Package/gluon-mesh-batman-adv/common/postinst) -Package/gluon-mesh-batman-adv-15/postinst := $(Package/gluon-mesh-batman-adv/common/postinst) - - -$(eval $(call BuildPackage,gluon-mesh-batman-adv-14)) -$(eval $(call BuildPackage,gluon-mesh-batman-adv-15)) +$(eval $(call BuildPackageGluon,gluon-mesh-batman-adv-14)) +$(eval $(call BuildPackageGluon,gluon-mesh-batman-adv-15)) diff --git a/package/gluon-mesh-vpn-core/Makefile b/package/gluon-mesh-vpn-core/Makefile index 46b30096..263ec217 100644 --- a/package/gluon-mesh-vpn-core/Makefile +++ b/package/gluon-mesh-vpn-core/Makefile @@ -13,18 +13,4 @@ define Package/gluon-mesh-vpn-core USERID:=:gluon-mesh-vpn=800 endef -define Build/Compile - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - -define Package/gluon-mesh-vpn-core/install - $(CP) ./files/* $(1)/ - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ -endef - -define Package/gluon-mesh-vpn-core/postinst -#!/bin/sh -$(call GluonCheckSite,check_site.lua) -endef - -$(eval $(call BuildPackage,gluon-mesh-vpn-core)) +$(eval $(call BuildPackageGluon,gluon-mesh-vpn-core)) diff --git a/package/gluon-mesh-vpn-fastd/Makefile b/package/gluon-mesh-vpn-fastd/Makefile index 7e607199..50b35e5a 100644 --- a/package/gluon-mesh-vpn-fastd/Makefile +++ b/package/gluon-mesh-vpn-fastd/Makefile @@ -3,8 +3,6 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gluon-mesh-vpn-fastd PKG_VERSION:=3 -PKG_BUILD_DEPENDS := respondd - include ../gluon.mk define Package/gluon-mesh-vpn-fastd @@ -14,21 +12,4 @@ define Package/gluon-mesh-vpn-fastd DEPENDS:=+gluon-core +libgluonutil +gluon-mesh-vpn-core +fastd endef -define Build/Compile - $(call Build/Compile/Default) - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - -define Package/gluon-mesh-vpn-fastd/install - $(CP) ./files/* $(1)/ - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ - $(INSTALL_DIR) $(1)/lib/gluon/respondd - $(CP) $(PKG_BUILD_DIR)/respondd.so $(1)/lib/gluon/respondd/mesh-vpn-fastd.so -endef - -define Package/gluon-mesh-vpn-fastd/postinst -#!/bin/sh -$(call GluonCheckSite,check_site.lua) -endef - -$(eval $(call BuildPackage,gluon-mesh-vpn-fastd)) +$(eval $(call BuildPackageGluon,gluon-mesh-vpn-fastd)) diff --git a/package/gluon-mesh-vpn-tunneldigger/Makefile b/package/gluon-mesh-vpn-tunneldigger/Makefile index 64e6b5d9..8b8099b1 100644 --- a/package/gluon-mesh-vpn-tunneldigger/Makefile +++ b/package/gluon-mesh-vpn-tunneldigger/Makefile @@ -12,18 +12,4 @@ define Package/gluon-mesh-vpn-tunneldigger DEPENDS:=+gluon-core +gluon-mesh-vpn-core +tunneldigger endef -define Build/Compile - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - -define Package/gluon-mesh-vpn-tunneldigger/install - $(CP) ./files/* $(1)/ - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ -endef - -define Package/gluon-mesh-vpn-tunneldigger/postinst -#!/bin/sh -$(call GluonCheckSite,check_site.lua) -endef - -$(eval $(call BuildPackage,gluon-mesh-vpn-tunneldigger)) +$(eval $(call BuildPackageGluon,gluon-mesh-vpn-tunneldigger)) diff --git a/package/gluon-neighbour-info/Makefile b/package/gluon-neighbour-info/Makefile index d56f5188..11d9465f 100644 --- a/package/gluon-neighbour-info/Makefile +++ b/package/gluon-neighbour-info/Makefile @@ -4,6 +4,8 @@ PKG_NAME:=gluon-neighbour-info PKG_VERSION:=1 PKG_RELEASE:=1 +GLUON_PKG_MAKE:=1 + include ../gluon.mk define Package/gluon-neighbour-info @@ -17,15 +19,11 @@ define Package/gluon-neighbour-info/description Gluon community wifi mesh firmware framework: neighbour-info endef -define Build/Compile - $(Build/Compile/Default) - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - define Package/gluon-neighbour-info/install - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ + $(Gluon/Build/Install) + $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/gluon-neighbour-info $(1)/usr/bin/ endef -$(eval $(call BuildPackage,gluon-neighbour-info)) +$(eval $(call BuildPackageGluon,gluon-neighbour-info)) diff --git a/package/gluon-node-info/Makefile b/package/gluon-node-info/Makefile index c0b9487e..037c2e66 100644 --- a/package/gluon-node-info/Makefile +++ b/package/gluon-node-info/Makefile @@ -4,11 +4,8 @@ PKG_NAME:=gluon-node-info PKG_VERSION:=1 PKG_RELEASE:=1 -PKG_BUILD_DEPENDS := respondd - include ../gluon.mk - define Package/gluon-node-info SECTION:=gluon CATEGORY:=Gluon @@ -16,21 +13,4 @@ define Package/gluon-node-info DEPENDS:=+gluon-core +libgluonutil endef -define Build/Compile - $(call Build/Compile/Default) - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - -define Package/gluon-node-info/install - $(CP) ./files/* $(1)/ - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ - $(INSTALL_DIR) $(1)/lib/gluon/respondd - $(CP) $(PKG_BUILD_DIR)/respondd.so $(1)/lib/gluon/respondd/node-info.so -endef - -define Package/gluon-node-info/postinst -#!/bin/sh -$(call GluonCheckSite,check_site.lua) -endef - -$(eval $(call BuildPackage,gluon-node-info)) +$(eval $(call BuildPackageGluon,gluon-node-info)) diff --git a/package/gluon-radv-filterd/Makefile b/package/gluon-radv-filterd/Makefile index 2e9ae559..23485130 100644 --- a/package/gluon-radv-filterd/Makefile +++ b/package/gluon-radv-filterd/Makefile @@ -4,8 +4,6 @@ PKG_NAME:=gluon-radv-filterd PKG_VERSION:=1 PKG_RELEASE:=1 -PKG_BUILD_DEPENDS := respondd - include ../gluon.mk define Package/gluon-radv-filterd @@ -20,18 +18,10 @@ MAKE_VARS += \ LIBNL_GENL_NAME="libnl-tiny" define Package/gluon-radv-filterd/install - $(CP) ./files/* $(1)/ + $(Gluon/Build/Install) $(INSTALL_DIR) $(1)/usr/sbin/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/gluon-radv-filterd $(1)/usr/sbin/ - - $(INSTALL_DIR) $(1)/lib/gluon/respondd - $(CP) $(PKG_BUILD_DIR)/respondd.so $(1)/lib/gluon/respondd/radv-filterd.so endef -define Package/gluon-radv-filterd/postinst -#!/bin/sh -$(call GluonCheckSite,check_site.lua) -endef - -$(eval $(call BuildPackage,gluon-radv-filterd)) +$(eval $(call BuildPackageGluon,gluon-radv-filterd)) diff --git a/package/gluon-radvd/Makefile b/package/gluon-radvd/Makefile index c039c500..7bcdaafd 100644 --- a/package/gluon-radvd/Makefile +++ b/package/gluon-radvd/Makefile @@ -16,13 +16,4 @@ define Package/gluon-radvd/description Gluon community wifi mesh firmware framework: Advertise an IPv6 prefix from the node endef -define Build/Compile - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - -define Package/gluon-radvd/install - $(CP) ./files/* $(1)/ - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ -endef - -$(eval $(call BuildPackage,gluon-radvd)) +$(eval $(call BuildPackageGluon,gluon-radvd)) diff --git a/package/gluon-respondd/Makefile b/package/gluon-respondd/Makefile index e372064c..9dc3f0f3 100644 --- a/package/gluon-respondd/Makefile +++ b/package/gluon-respondd/Makefile @@ -12,16 +12,4 @@ define Package/gluon-respondd DEPENDS:=+gluon-core +libplatforminfo +libgluonutil +libuci +ubus +respondd endef -define Build/Compile - $(call Build/Compile/Default) - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - -define Package/gluon-respondd/install - $(CP) ./files/* $(1)/ - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ - $(INSTALL_DIR) $(1)/lib/gluon/respondd - $(CP) $(PKG_BUILD_DIR)/respondd.so $(1)/lib/gluon/respondd/respondd.so -endef - -$(eval $(call BuildPackage,gluon-respondd)) +$(eval $(call BuildPackageGluon,gluon-respondd)) diff --git a/package/gluon-setup-mode/Makefile b/package/gluon-setup-mode/Makefile index 57d94a6c..6e11f420 100644 --- a/package/gluon-setup-mode/Makefile +++ b/package/gluon-setup-mode/Makefile @@ -19,18 +19,4 @@ define Package/gluon-setup-mode/description Offline mode to perform basic setup in a secure manner. endef -define Build/Compile - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - -define Package/gluon-setup-mode/install - $(CP) ./files/* $(1)/ - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ -endef - -define Package/gluon-setup-mode/postinst -#!/bin/sh -$(call GluonCheckSite,check_site.lua) -endef - -$(eval $(call BuildPackage,gluon-setup-mode)) +$(eval $(call BuildPackageGluon,gluon-setup-mode)) diff --git a/package/gluon-site/Makefile b/package/gluon-site/Makefile index ca88e5f5..5b7a6968 100644 --- a/package/gluon-site/Makefile +++ b/package/gluon-site/Makefile @@ -58,7 +58,7 @@ define Build/Compile ) endif - $(call GluonBuildI18N,gluon-site,$(GLUON_SITEDIR)/i18n) + $(call GluonBuildI18N,$(GLUON_SITEDIR)/i18n) endef define Package/gluon-site/install @@ -72,7 +72,7 @@ define Package/gluon-site/install echo '$(GLUON_SITE_VERSION)' > $(1)/lib/gluon/site-version echo '$(call qstrip,$(CONFIG_GLUON_RELEASE))' > $(1)/lib/gluon/release - $(call GluonInstallI18N,gluon-site,$(1)) + $(GluonInstallI18N) endef $(eval $(call BuildPackage,gluon-site)) diff --git a/package/gluon-status-page/Makefile b/package/gluon-status-page/Makefile index 68079ee0..acf4cef8 100644 --- a/package/gluon-status-page/Makefile +++ b/package/gluon-status-page/Makefile @@ -3,9 +3,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gluon-status-page PKG_VERSION:=3 -include ../gluon.mk +GLUON_PKG_MAKE:=1 -PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG) +include ../gluon.mk define Package/gluon-status-page SECTION:=gluon @@ -14,24 +14,15 @@ define Package/gluon-status-page DEPENDS:=+gluon-web +gluon-neighbour-info +gluon-respondd +uhttpd +sse-multiplex +libiwinfo +libjson-c +libnl-tiny +libubus-lua +libbatadv endef -define Build/Compile - $(call Build/Compile/Default) - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) - $(call GluonBuildI18N,gluon-status-page,i18n) -endef - define Package/gluon-status-page/install + $(Gluon/Build/Install) + $(INSTALL_DIR) $(1)/lib/gluon/status-page/providers $(INSTALL_BIN) $(PKG_BUILD_DIR)/{neighbours-batadv,stations} $(1)/lib/gluon/status-page/providers/ - $(CP) ./files/* $(1)/ - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ - $(INSTALL_DIR) $(1)/lib/gluon/status-page/view/ $(LN) /lib/gluon/web/i18n $(1)/lib/gluon/status-page/ $(LN) /lib/gluon/web/view/error $(1)/lib/gluon/status-page/view/ - - $(call GluonInstallI18N,gluon-status-page,$(1)) endef -$(eval $(call BuildPackage,gluon-status-page)) +$(eval $(call BuildPackageGluon,gluon-status-page)) diff --git a/package/gluon-wan-dnsmasq/Makefile b/package/gluon-wan-dnsmasq/Makefile index f1cf3c03..75be1b53 100644 --- a/package/gluon-wan-dnsmasq/Makefile +++ b/package/gluon-wan-dnsmasq/Makefile @@ -16,13 +16,4 @@ define Package/gluon-wan-dnsmasq/description Gluon community wifi mesh firmware framework: Support for a secondary DNS server using the WAN interface endef -define Build/Compile - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - -define Package/gluon-wan-dnsmasq/install - $(CP) ./files/* $(1)/ - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ -endef - -$(eval $(call BuildPackage,gluon-wan-dnsmasq)) +$(eval $(call BuildPackageGluon,gluon-wan-dnsmasq)) diff --git a/package/gluon-web-admin/Makefile b/package/gluon-web-admin/Makefile index eb82c8d7..881db831 100644 --- a/package/gluon-web-admin/Makefile +++ b/package/gluon-web-admin/Makefile @@ -9,8 +9,6 @@ PKG_RELEASE:=1 include ../gluon.mk -PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG) - define Package/gluon-web-admin SECTION:=gluon CATEGORY:=Gluon @@ -18,20 +16,4 @@ define Package/gluon-web-admin DEPENDS:=+gluon-config-mode-core +pretty-hostname endef -define Build/Compile - $(call GluonBuildI18N,gluon-web-admin,i18n) - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - -define Package/gluon-web-admin/install - $(CP) ./files/* $(1)/ - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ - $(call GluonInstallI18N,gluon-web-admin,$(1)) -endef - -define Package/gluon-web-admin/postinst -#!/bin/sh -$(call GluonCheckSite,check_site.lua) -endef - -$(eval $(call BuildPackage,gluon-web-admin)) +$(eval $(call BuildPackageGluon,gluon-web-admin)) diff --git a/package/gluon-web-autoupdater/Makefile b/package/gluon-web-autoupdater/Makefile index 4bc856bd..daa7508f 100644 --- a/package/gluon-web-autoupdater/Makefile +++ b/package/gluon-web-autoupdater/Makefile @@ -9,8 +9,6 @@ PKG_RELEASE:=1 include ../gluon.mk -PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG) - define Package/gluon-web-autoupdater SECTION:=gluon CATEGORY:=Gluon @@ -18,14 +16,4 @@ define Package/gluon-web-autoupdater DEPENDS:=+gluon-web-admin +gluon-autoupdater endef -define Build/Compile - $(call GluonBuildI18N,gluon-web-autoupdater,i18n) - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - -define Package/gluon-web-autoupdater/install - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ - $(call GluonInstallI18N,gluon-web-autoupdater,$(1)) -endef - -$(eval $(call BuildPackage,gluon-web-autoupdater)) +$(eval $(call BuildPackageGluon,gluon-web-autoupdater)) diff --git a/package/gluon-web-logging/Makefile b/package/gluon-web-logging/Makefile index a810b52d..4cd1076c 100644 --- a/package/gluon-web-logging/Makefile +++ b/package/gluon-web-logging/Makefile @@ -6,8 +6,6 @@ PKG_RELEASE:=1 include ../gluon.mk -PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG) - define Package/gluon-web-logging SECTION:=gluon CATEGORY:=Gluon @@ -15,14 +13,4 @@ define Package/gluon-web-logging TITLE:=UI for remote syslog configuration endef -define Build/Compile - $(call GluonBuildI18N,gluon-web-logging,i18n) - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - -define Package/gluon-web-logging/install - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ - $(call GluonInstallI18N,gluon-web-logging,$(1)) -endef - -$(eval $(call BuildPackage,gluon-web-logging)) +$(eval $(call BuildPackageGluon,gluon-web-logging)) diff --git a/package/gluon-web-mesh-vpn-fastd/Makefile b/package/gluon-web-mesh-vpn-fastd/Makefile index 3df01b42..da13d43d 100644 --- a/package/gluon-web-mesh-vpn-fastd/Makefile +++ b/package/gluon-web-mesh-vpn-fastd/Makefile @@ -6,8 +6,6 @@ PKG_RELEASE:=1 include ../gluon.mk -PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG) - define Package/gluon-web-mesh-vpn-fastd SECTION:=gluon CATEGORY:=Gluon @@ -15,20 +13,4 @@ define Package/gluon-web-mesh-vpn-fastd DEPENDS:=+gluon-web-admin +gluon-mesh-vpn-fastd endef -define Build/Compile - $(call GluonBuildI18N,gluon-web-mesh-vpn-fastd,i18n) - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - -define Package/gluon-web-mesh-vpn-fastd/install - $(CP) ./files/* $(1)/ - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ - $(call GluonInstallI18N,gluon-web-mesh-vpn-fastd,$(1)) -endef - -define Package/gluon-web-mesh-vpn-fastd/postinst -#!/bin/sh -$(call GluonCheckSite,check_site.lua) -endef - -$(eval $(call BuildPackage,gluon-web-mesh-vpn-fastd)) +$(eval $(call BuildPackageGluon,gluon-web-mesh-vpn-fastd)) diff --git a/package/gluon-web-model/Makefile b/package/gluon-web-model/Makefile index 846fdfb7..e2badbd4 100644 --- a/package/gluon-web-model/Makefile +++ b/package/gluon-web-model/Makefile @@ -12,16 +12,4 @@ define Package/gluon-web-model DEPENDS:=+gluon-web endef -define Build/Compile - $(call GluonBuildI18N,gluon-web-model,i18n) - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - -define Package/gluon-web-model/install - $(CP) ./files/* $(1)/ - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ - $(call GluonInstallI18N,gluon-web-model,$(1)) - -endef - -$(eval $(call BuildPackage,gluon-web-model)) +$(eval $(call BuildPackageGluon,gluon-web-model)) diff --git a/package/gluon-web-network/Makefile b/package/gluon-web-network/Makefile index 096a8d68..a7c14254 100644 --- a/package/gluon-web-network/Makefile +++ b/package/gluon-web-network/Makefile @@ -9,8 +9,6 @@ PKG_RELEASE:=1 include ../gluon.mk -PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG) - define Package/gluon-web-network SECTION:=gluon CATEGORY:=Gluon @@ -18,14 +16,4 @@ define Package/gluon-web-network DEPENDS:=+gluon-web-admin +gluon-client-bridge endef -define Build/Compile - $(call GluonBuildI18N,gluon-web-network,i18n) - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - -define Package/gluon-web-network/install - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ - $(call GluonInstallI18N,gluon-web-network,$(1)) -endef - -$(eval $(call BuildPackage,gluon-web-network)) +$(eval $(call BuildPackageGluon,gluon-web-network)) diff --git a/package/gluon-web-node-role/Makefile b/package/gluon-web-node-role/Makefile index 40a1b233..099b9c41 100644 --- a/package/gluon-web-node-role/Makefile +++ b/package/gluon-web-node-role/Makefile @@ -5,8 +5,6 @@ PKG_VERSION:=1 include ../gluon.mk -PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG) - define Package/gluon-web-node-role SECTION:=gluon CATEGORY:=Gluon @@ -14,19 +12,4 @@ define Package/gluon-web-node-role TITLE:=UI for specifying node role endef -define Build/Compile - $(call GluonBuildI18N,gluon-web-node-role,i18n) - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - -define Package/gluon-web-node-role/install - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ - $(call GluonInstallI18N,gluon-web-node-role,$(1)) -endef - -define Package/gluon-web-node-role/postinst -#!/bin/sh -$(call GluonCheckSite,check_site.lua) -endef - -$(eval $(call BuildPackage,gluon-web-node-role)) +$(eval $(call BuildPackageGluon,gluon-web-node-role)) diff --git a/package/gluon-web-private-wifi/Makefile b/package/gluon-web-private-wifi/Makefile index b8171aea..313c0ce4 100644 --- a/package/gluon-web-private-wifi/Makefile +++ b/package/gluon-web-private-wifi/Makefile @@ -6,8 +6,6 @@ PKG_RELEASE:=1 include ../gluon.mk -PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG) - define Package/gluon-web-private-wifi SECTION:=gluon CATEGORY:=Gluon @@ -15,14 +13,4 @@ define Package/gluon-web-private-wifi TITLE:=UI for activating a private WLAN endef -define Build/Compile - $(call GluonBuildI18N,gluon-web-private-wifi,i18n) - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - -define Package/gluon-web-private-wifi/install - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ - $(call GluonInstallI18N,gluon-web-private-wifi,$(1)) -endef - -$(eval $(call BuildPackage,gluon-web-private-wifi)) +$(eval $(call BuildPackageGluon,gluon-web-private-wifi)) diff --git a/package/gluon-web-wifi-config/Makefile b/package/gluon-web-wifi-config/Makefile index 3f889e98..398bf42e 100644 --- a/package/gluon-web-wifi-config/Makefile +++ b/package/gluon-web-wifi-config/Makefile @@ -6,8 +6,6 @@ PKG_RELEASE:=1 include ../gluon.mk -PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG) - define Package/gluon-web-wifi-config SECTION:=gluon CATEGORY:=Gluon @@ -15,14 +13,4 @@ define Package/gluon-web-wifi-config TITLE:=UI for Wifi Settings endef -define Build/Compile - $(call GluonBuildI18N,gluon-web-wifi-config,i18n) - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - -define Package/gluon-web-wifi-config/install - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ - $(call GluonInstallI18N,gluon-web-wifi-config,$(1)) -endef - -$(eval $(call BuildPackage,gluon-web-wifi-config)) +$(eval $(call BuildPackageGluon,gluon-web-wifi-config)) diff --git a/package/gluon-web/Makefile b/package/gluon-web/Makefile index 113d033d..8606ad6d 100644 --- a/package/gluon-web/Makefile +++ b/package/gluon-web/Makefile @@ -3,12 +3,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gluon-web PKG_VERSION:=1 -include ../gluon.mk - -PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG) - +GLUON_PKG_MAKE:=1 PKG_INSTALL:=1 +include ../gluon.mk + define Package/gluon-web SECTION:=gluon CATEGORY:=Gluon @@ -28,18 +27,4 @@ define Package/gluon-web/config $(foreach lang,$(GLUON_SUPPORTED_LANGS),$(call lang-config,$(lang))) endef -define Build/Compile - $(call Build/Compile/Default) - $(call GluonBuildI18N,gluon-web,i18n) - $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/) -endef - -define Package/gluon-web/install - $(CP) ./files/* $(1)/ - $(CP) $(PKG_INSTALL_DIR)/* $(1)/ - $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/ - $(call GluonInstallI18N,gluon-web,$(1)) - -endef - -$(eval $(call BuildPackage,gluon-web)) +$(eval $(call BuildPackageGluon,gluon-web)) diff --git a/package/gluon.mk b/package/gluon.mk index ccf6afe3..cd2783f8 100644 --- a/package/gluon.mk +++ b/package/gluon.mk @@ -4,6 +4,11 @@ PKG_FILE_DEPENDS += $(GLUON_MK) # Dependencies for LuaSrcDiet PKG_BUILD_DEPENDS += luci-base/host +ifneq ($(wildcard ./src/respondd.c),) + PKG_BUILD_DEPENDS += respondd + GLUON_PKG_MAKE ?= 1 +endif + include $(INCLUDE_DIR)/package.mk @@ -26,22 +31,26 @@ GLUON_LANG_fr := French GLUON_I18N_CONFIG := $(foreach lang,$(GLUON_SUPPORTED_LANGS),CONFIG_GLUON_WEB_LANG_$(lang)) GLUON_ENABLED_LANGS := en $(foreach lang,$(GLUON_SUPPORTED_LANGS),$(if $(CONFIG_GLUON_WEB_LANG_$(lang)),$(lang))) +ifneq ($(wildcard ./i18n/.),) + PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG) +endif + define GluonBuildI18N mkdir -p $$(PKG_BUILD_DIR)/i18n for lang in $$(GLUON_ENABLED_LANGS); do \ - if [ -e $(2)/$$$$lang.po ]; then \ - rm -f $$(PKG_BUILD_DIR)/i18n/$(1).$$$$lang.lmo; \ - po2lmo $(2)/$$$$lang.po $$(PKG_BUILD_DIR)/i18n/$(1).$$$$lang.lmo; \ + if [ -e $(1)/$$$$lang.po ]; then \ + rm -f $$(PKG_BUILD_DIR)/i18n/$$$$lang.lmo; \ + po2lmo $(1)/$$$$lang.po $$(PKG_BUILD_DIR)/i18n/$$$$lang.lmo; \ fi; \ done endef define GluonInstallI18N - $$(INSTALL_DIR) $(2)/lib/gluon/web/i18n + $$(INSTALL_DIR) $(1)/lib/gluon/web/i18n for lang in $$(GLUON_ENABLED_LANGS); do \ - if [ -e $$(PKG_BUILD_DIR)/i18n/$(1).$$$$lang.lmo ]; then \ - $$(INSTALL_DATA) $$(PKG_BUILD_DIR)/i18n/$(1).$$$$lang.lmo $(2)/lib/gluon/web/i18n/$(1).$$$$lang.lmo; \ + if [ -e $$(PKG_BUILD_DIR)/i18n/$$$$lang.lmo ]; then \ + $$(INSTALL_DATA) $$(PKG_BUILD_DIR)/i18n/$$$$lang.lmo $(1)/lib/gluon/web/i18n/$(PKG_NAME).$$$$lang.lmo; \ fi; \ done endef @@ -56,3 +65,52 @@ define GluonSrcDiet fi; \ done endef + + +GLUON_PKG_MAKE ?= 0 + +define Gluon/Build/Compile + $(if $(findstring $(GLUON_PKG_MAKE),1), + $(Build/Compile/Default) + ) + $(if $(wildcard ./luasrc/.), + $(call GluonSrcDiet,luasrc,$(PKG_BUILD_DIR)/luadest/) + ) + $(if $(wildcard ./i18n/.), + $(call GluonBuildI18N,i18n) + ) +endef + +define Gluon/Build/Install + $(if $(findstring $(PKG_INSTALL),1), + $(CP) $(PKG_INSTALL_DIR)/. $(1)/ + ) + $(if $(wildcard ./files/.), + $(CP) ./files/. $(1)/ + ) + $(if $(wildcard ./luasrc/.), + $(CP) $(PKG_BUILD_DIR)/luadest/. $(1)/ + ) + $(if $(wildcard ./src/respondd.c), + $(INSTALL_DIR) $(1)/lib/gluon/respondd + $(CP) $(PKG_BUILD_DIR)/respondd.so $(1)/lib/gluon/respondd/$(PKG_NAME).so + ) + $(if $(wildcard ./i18n/.), + $(GluonInstallI18N) + ) +endef + +Build/Compile=$(call Gluon/Build/Compile) + +define BuildPackageGluon + Package/$(1)/install ?= $$(Gluon/Build/Install) + + ifneq ($(wildcard check_site.lua),) + define Package/$(1)/postinst +#!/bin/sh +$$(call GluonCheckSite,check_site.lua) + endef + endif + + $$(eval $$(call BuildPackage,$(1))) +endef diff --git a/package/libgluonutil/Makefile b/package/libgluonutil/Makefile index 7fd7a865..e9cc45cb 100644 --- a/package/libgluonutil/Makefile +++ b/package/libgluonutil/Makefile @@ -6,7 +6,7 @@ CMAKE_INSTALL:=1 PKG_LICENSE:=BSD-2-Clause -include ../gluon.mk +include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk define Package/libgluonutil