2014-07-27 17:31:45 +00:00
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=gluon-config-mode-geo-location
|
|
|
|
PKG_VERSION:=1
|
|
|
|
|
2016-10-08 22:18:45 +00:00
|
|
|
include ../gluon.mk
|
2014-07-27 17:31:45 +00:00
|
|
|
|
|
|
|
define Package/gluon-config-mode-geo-location
|
2018-07-22 07:09:23 +00:00
|
|
|
TITLE:=Set geographic location of a node and share it.
|
2018-07-18 04:38:25 +00:00
|
|
|
CONFLICTS:=+gluon-config-mode-geo-location-with-map
|
2017-07-08 14:34:40 +00:00
|
|
|
DEPENDS:=+gluon-config-mode-core +gluon-node-info
|
2014-07-27 17:31:45 +00:00
|
|
|
endef
|
|
|
|
|
2018-07-18 04:38:25 +00:00
|
|
|
define Package/gluon-config-mode-geo-location-with-map
|
2018-07-22 07:09:23 +00:00
|
|
|
TITLE:=Set geographic location of a node and share it, additionally show a map if internet is available.
|
2018-07-18 04:38:25 +00:00
|
|
|
CONFLICTS:=+gluon-config-mode-geo-location
|
|
|
|
DEPENDS:=+gluon-config-mode-core +gluon-node-info +gluon-web-osm
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/Configure
|
|
|
|
$(CP) ./src/* $(PKG_BUILD_DIR)/
|
|
|
|
|
|
|
|
$(INSTALL_DIR) $(PKG_BUILD_DIR)/gluon-config-mode-geo-location{,-with-map}/{luasrc/lib/gluon/config-mode/wizard/,i18n/}
|
|
|
|
endef
|
|
|
|
|
2018-07-23 13:53:24 +00:00
|
|
|
define GluonBuildI18N
|
|
|
|
mkdir -p $(1)
|
|
|
|
for lang in $$(GLUON_ENABLED_LANGS); do \
|
|
|
|
if [ -e $(1)/$$$$lang.po ]; then \
|
|
|
|
rm -f $(1)/$$$$lang.lmo; \
|
|
|
|
po2lmo $(1)/$$$$lang.po $(1)/$$$$lang.lmo; \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
endef
|
|
|
|
|
|
|
|
define GluonInstallI18N
|
|
|
|
$(INSTALL_DIR) $(1)/lib/gluon/web/i18n
|
|
|
|
for lang in $$(GLUON_ENABLED_LANGS); do \
|
|
|
|
if [ -e $(2)/i18n/$$$$lang.lmo ]; then \
|
|
|
|
$(INSTALL_DATA) $(2)/i18n/$$$$lang.lmo $(1)/lib/gluon/web/i18n/$(PKG_NAME).$$$$lang.lmo; \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
2018-07-18 04:38:25 +00:00
|
|
|
define Build/Compile
|
|
|
|
$(CC) -E -x c -P $(PKG_BUILD_DIR)/0400-geo-location.lua.in -o $(PKG_BUILD_DIR)/gluon-config-mode-geo-location/luasrc/lib/gluon/config-mode/wizard/0400-geo-location.lua
|
|
|
|
$(CC) -E -x c -P $(PKG_BUILD_DIR)/gluon-config-mode-geo-location.pot.in -o $(PKG_BUILD_DIR)/gluon-config-mode-geo-location/i18n/gluon-config-mode-geo-location.pot
|
|
|
|
$(CC) -E -x c -P $(PKG_BUILD_DIR)/check_site.lua.in -o $(PKG_BUILD_DIR)/gluon-config-mode-geo-location/check_site.lua
|
|
|
|
$(CC) -E -x c -P $(PKG_BUILD_DIR)/de.po.in -o $(PKG_BUILD_DIR)/gluon-config-mode-geo-location/i18n/de.po
|
|
|
|
$(CC) -E -x c -P $(PKG_BUILD_DIR)/fr.po.in -o $(PKG_BUILD_DIR)/gluon-config-mode-geo-location/i18n/fr.po
|
|
|
|
$(call GluonSrcDiet,$(PKG_BUILD_DIR)/gluon-config-mode-geo-location/luasrc,$(PKG_BUILD_DIR)/gluon-config-mode-geo-location/luadest/)
|
2018-07-23 13:53:24 +00:00
|
|
|
$(call GluonBuildI18N,$(PKG_BUILD_DIR)/gluon-config-mode-geo-location/i18n)
|
2018-07-18 04:38:25 +00:00
|
|
|
|
|
|
|
$(CC) -DWITHMAP -E -x c -P $(PKG_BUILD_DIR)/0400-geo-location.lua.in -o $(PKG_BUILD_DIR)/gluon-config-mode-geo-location-with-map/luasrc/lib/gluon/config-mode/wizard/0400-geo-location.lua
|
|
|
|
$(CC) -DWITHMAP -E -x c -P $(PKG_BUILD_DIR)/gluon-config-mode-geo-location.pot.in -o $(PKG_BUILD_DIR)/gluon-config-mode-geo-location-with-map/i18n/gluon-config-mode-geo-location-with-map.pot
|
|
|
|
$(CC) -DWITHMAP -E -x c -P $(PKG_BUILD_DIR)/check_site.lua.in -o $(PKG_BUILD_DIR)/gluon-config-mode-geo-location-with-map/check_site.lua
|
|
|
|
$(CC) -DWITHMAP -E -x c -P $(PKG_BUILD_DIR)/de.po.in -o $(PKG_BUILD_DIR)/gluon-config-mode-geo-location-with-map/i18n/de.po
|
|
|
|
$(CC) -DWITHMAP -E -x c -P $(PKG_BUILD_DIR)/fr.po.in -o $(PKG_BUILD_DIR)/gluon-config-mode-geo-location-with-map/i18n/fr.po
|
|
|
|
$(call GluonSrcDiet,$(PKG_BUILD_DIR)/gluon-config-mode-geo-location-with-map/luasrc,$(PKG_BUILD_DIR)/gluon-config-mode-geo-location-with-map/luadest/)
|
2018-07-23 13:53:24 +00:00
|
|
|
$(call GluonBuildI18N,$(PKG_BUILD_DIR)/gluon-config-mode-geo-location-with-map/i18n)
|
2018-07-18 04:38:25 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/gluon-config-mode-geo-location/install
|
|
|
|
$(CP) $(PKG_BUILD_DIR)/gluon-config-mode-geo-location/luadest/* $(1)/
|
2018-07-23 13:53:24 +00:00
|
|
|
$(call GluonInstallI18N,$(1),$(PKG_BUILD_DIR)/gluon-config-mode-geo-location)
|
2018-07-18 04:38:25 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/gluon-config-mode-geo-location-with-map/install
|
|
|
|
$(CP) $(PKG_BUILD_DIR)/gluon-config-mode-geo-location-with-map/luadest/* $(1)/
|
|
|
|
$(INSTALL_DIR) $(1)/lib/gluon/config-mode/www/static/
|
|
|
|
$(LN) /lib/gluon/web/www/static/osm.js $(1)/lib/gluon/config-mode/www/static/osm.js
|
2018-07-23 13:53:24 +00:00
|
|
|
$(call GluonInstallI18N,$(1),$(PKG_BUILD_DIR)/gluon-config-mode-geo-location-with-map)
|
2018-07-18 04:38:25 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/gluon-config-mode-geo-location/postinst
|
|
|
|
#!/bin/sh
|
|
|
|
$(call GluonCheckSite,$(PKG_BUILD_DIR)/gluon-config-mode-geo-location/check_site.lua)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/gluon-config-mode-geo-location-with-map/postinst
|
|
|
|
#!/bin/sh
|
|
|
|
$(call GluonCheckSite,$(PKG_BUILD_DIR)/gluon-config-mode-geo-location-with-map/check_site.lua)
|
|
|
|
endef
|
|
|
|
|
2018-03-08 18:49:41 +00:00
|
|
|
$(eval $(call BuildPackageGluon,gluon-config-mode-geo-location))
|
2018-07-18 04:38:25 +00:00
|
|
|
$(eval $(call BuildPackageGluon,gluon-config-mode-geo-location-with-map))
|