From 7e9f56646460d10b750aedc8d07e681432626742 Mon Sep 17 00:00:00 2001 From: a-gave Date: Sun, 17 Nov 2024 11:44:51 +0100 Subject: [PATCH 1/7] chore: add include libremesh.mk in more packages modify various packages to use libremesh.mk. drop the package lua-argparse since it is available in openwrt feeds. adapt packages to apk version schema. --- libremesh.mk | 29 ++++------- packages/altermundi-grafana/Makefile | 17 +------ packages/auto-usb-wwan/Makefile | 17 +------ packages/bandwidth-test/Makefile | 24 +-------- .../{bandwidth-test.lua => bandwidth-test} | 0 packages/batman-adv-auto-gw-mode/Makefile | 18 +------ packages/bmx7-auto-gw-bw-mode/Makefile | 18 ++----- packages/bmx7-auto-gw-mode/Makefile | 20 +------- packages/bmx7-mdns/Makefile | 34 ++----------- .../lib/lua/luci/model/cbi}/bmx7-mdns.lua | 0 packages/check-date-http/Makefile | 18 +------ packages/check-internet/Makefile | 18 +------ packages/deferable-reboot/Makefile | 27 +--------- packages/first-boot-wizard/Makefile | 16 +----- packages/hotplug-initd-services/Makefile | 18 +------ packages/lime-ap-watchping/Makefile | 18 +------ packages/lime-app/Makefile | 25 +++------ packages/lime-debug/Makefile | 8 ++- packages/lime-docs/Makefile | 4 +- packages/lime-hwd-ground-routing/Makefile | 25 +-------- packages/lime-hwd-openwrt-wan/Makefile | 25 +-------- packages/lime-hwd-usbradio/Makefile | 28 +--------- .../etc/hotplug.d/usb/60-lime-hwd-usbradio} | 0 .../usr/lib/lua/lime/hwd}/usbradio.lua | 0 packages/lime-proto-anygw/Makefile | 25 +-------- packages/lime-proto-bgp/Makefile | 25 +-------- packages/lime-proto-olsr/Makefile | 23 +-------- .../usr/lib/lua/lime/proto}/olsr.lua | 0 packages/lime-proto-olsr2/Makefile | 23 +-------- .../usr/lib/lua/lime/proto}/olsr2.lua | 0 packages/lime-proto-olsr6/Makefile | 23 +-------- .../usr/lib/lua/lime/proto}/olsr6.lua | 0 packages/lime-report/Makefile | 21 +------- .../files/{ => bin}/lime-report.sh | 0 packages/lime-system/Makefile | 4 +- packages/lua-argparse/Makefile | 51 ------------------- packages/lua-argparse/Readme.md | 15 ------ packages/luci-lib-jquery-flot/Makefile | 13 +---- .../resources/jquery}/jquery.flot.min.js | 0 packages/luci-mod-status/Makefile | 17 +------ packages/miniserver-client/Makefile | 17 +------ packages/pirania/Makefile | 17 +------ .../Makefile | 17 +------ .../Makefile | 17 +------ .../Makefile | 17 +------ .../Makefile | 17 +------ packages/prometheus-node-push-influx/Makefile | 17 +------ packages/random-numgen/Makefile | 21 ++------ .../files/{ => usr/bin}/random-numgen | 0 packages/safe-reboot/Makefile | 17 +------ packages/safe-upgrade/Makefile | 21 +------- packages/shared-state-async/Makefile | 6 +-- packages/shared-state-babeld_hosts/Makefile | 18 +------ packages/shared-state-bat_hosts/Makefile | 18 +------ packages/shared-state-dnsmasq_hosts/Makefile | 18 +------ packages/shared-state-dnsmasq_leases/Makefile | 18 +------ .../shared-state-dnsmasq_servers/Makefile | 18 +------ .../shared-state-nodes_and_links/Makefile | 18 +------ packages/shared-state-persist/Makefile | 18 +------ packages/shared-state-pirania/Makefile | 18 +------ .../shared-state-wifi_links_info/Makefile | 18 +------ packages/shared-state/Makefile | 18 +------ packages/soporteremoto/Makefile | 17 +------ packages/sprunge/Makefile | 19 +------ .../sprunge/{src/ix.sh => files/usr/bin/ix} | 0 .../{src/sprunge.sh => files/usr/bin/sprunge} | 0 packages/ubus-lime-batman-adv/Makefile | 17 +------ packages/ubus-lime-groundrouting/Makefile | 17 +------ packages/ubus-lime-location/Makefile | 17 +------ packages/ubus-lime-metrics/Makefile | 17 +------ packages/ubus-lime-openairview/Makefile | 17 +------ packages/ubus-lime-utils/Makefile | 17 +------ packages/ubus-tmate/Makefile | 17 +------ packages/watchping/Makefile | 17 +------ packages/wifi-unstuck-wa/Makefile | 27 +--------- 75 files changed, 91 insertions(+), 1119 deletions(-) rename packages/bandwidth-test/files/bin/{bandwidth-test.lua => bandwidth-test} (100%) mode change 100644 => 100755 rename packages/bmx7-mdns/files/{luci => usr/lib/lua/luci/model/cbi}/bmx7-mdns.lua (100%) rename packages/lime-hwd-usbradio/{src/hotplug-hook.sh => files/etc/hotplug.d/usb/60-lime-hwd-usbradio} (100%) mode change 100644 => 100755 rename packages/lime-hwd-usbradio/{src => files/usr/lib/lua/lime/hwd}/usbradio.lua (100%) mode change 100644 => 100755 rename packages/lime-proto-olsr/{src => files/usr/lib/lua/lime/proto}/olsr.lua (100%) rename packages/lime-proto-olsr2/{src => files/usr/lib/lua/lime/proto}/olsr2.lua (100%) rename packages/lime-proto-olsr6/{src => files/usr/lib/lua/lime/proto}/olsr6.lua (100%) rename packages/lime-report/files/{ => bin}/lime-report.sh (100%) mode change 100644 => 100755 delete mode 100644 packages/lua-argparse/Makefile delete mode 100644 packages/lua-argparse/Readme.md rename packages/luci-lib-jquery-flot/files/{ => www/luci-static/resources/jquery}/jquery.flot.min.js (100%) rename packages/random-numgen/files/{ => usr/bin}/random-numgen (100%) rename packages/sprunge/{src/ix.sh => files/usr/bin/ix} (100%) rename packages/sprunge/{src/sprunge.sh => files/usr/bin/sprunge} (100%) diff --git a/libremesh.mk b/libremesh.mk index abb02afc4..53a0448ce 100644 --- a/libremesh.mk +++ b/libremesh.mk @@ -2,26 +2,13 @@ include $(TOPDIR)/rules.mk PKG_NAME?=$(notdir ${CURDIR}) -# from https://github.com/openwrt/luci/blob/master/luci.mk -PKG_VERSION?=$(if $(DUMP),x,$(strip $(shell \ - if svn info >/dev/null 2>/dev/null; then \ - revision="svn-r$$(LC_ALL=C svn info | sed -ne 's/^Revision: //p')"; \ - elif git log -1 >/dev/null 2>/dev/null; then \ - revision="svn-r$$(LC_ALL=C git log -1 | sed -ne 's/.*git-svn-id: .*@\([0-9]\+\) .*/\1/p')"; \ - if [ "$$revision" = "svn-r" ]; then \ - set -- $$(git log -1 --format="%ct %h" --abbrev=7); \ - secs="$$(($$1 % 86400))"; \ - yday="$$(date --utc --date="@$$1" "+%y.%j")"; \ - revision="$$(printf 'git-%s.%05d-%s' "$$yday" "$$secs" "$$2")"; \ - fi; \ - else \ - revision="unknown"; \ - fi; \ - echo "$$revision" \ -))) -PKG_RELEASE?=1 - -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) +GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . | sed 's|-|.|g') +GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) + +PKG_SRC_VERSION:=$(GIT_COMMIT_DATE)~$(GIT_COMMIT_TSTAMP) +PKG_VERSION:=$(if $(PKG_VERSION),$(PKG_VERSION),$(PKG_SRC_VERSION)) + +PKG_BUILD_DIR:=$(if $(PKG_BUILD_DIR),$(PKG_BUILD_DIR),$(BUILD_DIR)/$(PKG_NAME)) include $(INCLUDE_DIR)/package.mk @@ -31,6 +18,8 @@ define Build/Compile $(CP) ./files ./build $(FIND) ./build -name '*.sh' -exec sed -i '/^\s*#\[Doc\]/d' {} + $(FIND) ./build -name '*.lua' -exec sed -i '/^\s*--!.*/d' {} + + $(FIND) ./build -type f -executable -exec sed -i '/^\s*#\[Doc\]/d' {} + + $(FIND) ./build -type f -executable -exec sed -i '/^\s*--!.*/d' {} + endef define Package/$(PKG_NAME)/install diff --git a/packages/altermundi-grafana/Makefile b/packages/altermundi-grafana/Makefile index 1b2641168..91b36d680 100644 --- a/packages/altermundi-grafana/Makefile +++ b/packages/altermundi-grafana/Makefile @@ -4,14 +4,7 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -PKG_NAME:=altermundi-grafana -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) SECTION:=utils @@ -36,12 +29,4 @@ define Package/$(PKG_NAME)/description that gathers data on the node and pushes to https://grafana.altermundi.net endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/auto-usb-wwan/Makefile b/packages/auto-usb-wwan/Makefile index 1e178efd9..078601e49 100644 --- a/packages/auto-usb-wwan/Makefile +++ b/packages/auto-usb-wwan/Makefile @@ -4,14 +4,7 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -PKG_NAME:=auto-usb-wwan -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) SECTION:=utils @@ -28,12 +21,4 @@ define Package/$(PKG_NAME)/description By default, it will try connect to SSID "internet" with password "internet" endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/bandwidth-test/Makefile b/packages/bandwidth-test/Makefile index d748ce2b4..016e4bc51 100644 --- a/packages/bandwidth-test/Makefile +++ b/packages/bandwidth-test/Makefile @@ -4,15 +4,7 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=bandwidth-test -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) SECTION:=utils @@ -24,23 +16,9 @@ define Package/$(PKG_NAME) PKGARCH:=all endef -define Package/$(PKG_NAME)/config -endef - - define Package/$(PKG_NAME)/description Measure the maximum available bandwidth towards the internet, in the download direction. Downloading a list of files via HTTP connections. endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/bin/ - $(INSTALL_DIR) $(1)/etc/config/ - $(INSTALL_BIN) ./files/bin/bandwidth-test.lua $(1)/bin/bandwidth-test - $(INSTALL_CONF) ./files/etc/config/bandwidth-test $(1)/etc/config/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/bandwidth-test/files/bin/bandwidth-test.lua b/packages/bandwidth-test/files/bin/bandwidth-test old mode 100644 new mode 100755 similarity index 100% rename from packages/bandwidth-test/files/bin/bandwidth-test.lua rename to packages/bandwidth-test/files/bin/bandwidth-test diff --git a/packages/batman-adv-auto-gw-mode/Makefile b/packages/batman-adv-auto-gw-mode/Makefile index fe50ff5eb..be5ac643e 100644 --- a/packages/batman-adv-auto-gw-mode/Makefile +++ b/packages/batman-adv-auto-gw-mode/Makefile @@ -4,15 +4,7 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=batman-adv-auto-gw-mode -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) CATEGORY:=LibreMesh @@ -38,12 +30,4 @@ port of any (one or more) nodes, it will be autodetected and the rest of the nodes will route through it (or them) endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/bmx7-auto-gw-bw-mode/Makefile b/packages/bmx7-auto-gw-bw-mode/Makefile index b8dd677d1..16bfd3a00 100644 --- a/packages/bmx7-auto-gw-bw-mode/Makefile +++ b/packages/bmx7-auto-gw-bw-mode/Makefile @@ -4,12 +4,11 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk +include ../../libremesh.mk -PKG_NAME:=bmx7-auto-gw-bw-mode -PKG_VERSION=0.1 - -include $(INCLUDE_DIR)/package.mk +PKG_REALVERSION:=0.1 +PKG_VERSION:=0.0.1 +PKG_RELEASE:=1 define Package/$(PKG_NAME) CATEGORY:=LibreMesh @@ -26,17 +25,8 @@ define Package/$(PKG_NAME)/config select CONFIG_BUSYBOX_CONFIG_CRONTAB endef - define Package/$(PKG_NAME)/description Watchping hooks to set bmx7 Internet bandwidth announcement endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/bmx7-auto-gw-mode/Makefile b/packages/bmx7-auto-gw-mode/Makefile index 756ea34a4..eb6ae86fb 100644 --- a/packages/bmx7-auto-gw-mode/Makefile +++ b/packages/bmx7-auto-gw-mode/Makefile @@ -4,22 +4,14 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=bmx7-auto-gw-mode -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) CATEGORY:=LibreMesh TITLE:=bmx7 auto Internet gateway module MAINTAINER:=Pau Escrich URL:=http://libremesh.org - DEPENDS:= bmx7 +watchping +ip + DEPENDS:=+bmx7 +watchping +ip PKGARCH:=all endef @@ -27,12 +19,4 @@ define Package/$(PKG_NAME)/description Watchping hooks to set bmx7 Internet automatic announcements endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/bmx7-mdns/Makefile b/packages/bmx7-mdns/Makefile index d6bd9c623..4e827eb23 100644 --- a/packages/bmx7-mdns/Makefile +++ b/packages/bmx7-mdns/Makefile @@ -21,16 +21,12 @@ # Pau Escrich # -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/kernel.mk +include ../../libremesh.mk -PKG_NAME:=bmx7-mdns -PKG_VERSION:=0.1 +PKG_REALVERSION:=0.1 +PKG_VERSION:=0.0.1 PKG_RELEASE:=1 PKG_LICENSE:=GPL-2.0+ -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) - -include $(INCLUDE_DIR)/package.mk define Package/$(PKG_NAME) SECTION:=net @@ -52,26 +48,4 @@ define Package/$(PKG_NAME)/description Distributed DNS system using bmx7 sms plugin endef -define Build/Prepare - mkdir -p $(PKG_BUILD_DIR) -endef - -define Build/Configure -endef - -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(INSTALL_DIR) $(1)/etc - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_DIR) $(1)/etc/config - $(CP) ./files/etc/init.d/bmx7-mdns $(1)/etc/init.d/bmx7-mdns - chmod 755 $(1)/etc/init.d/bmx7-mdns - $(CP) ./files/etc/config/bmx7-mdns $(1)/etc/config/bmx7-mdns - $(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi/ - $(CP) ./files/luci/bmx7-mdns.lua $(1)/usr/lib/lua/luci/model/cbi/bmx7-mdns.lua -endef - -$(eval $(call BuildPackage,bmx7-mdns)) +$(eval $(call BuildPackage,$(PKG_NAME))) \ No newline at end of file diff --git a/packages/bmx7-mdns/files/luci/bmx7-mdns.lua b/packages/bmx7-mdns/files/usr/lib/lua/luci/model/cbi/bmx7-mdns.lua similarity index 100% rename from packages/bmx7-mdns/files/luci/bmx7-mdns.lua rename to packages/bmx7-mdns/files/usr/lib/lua/luci/model/cbi/bmx7-mdns.lua diff --git a/packages/check-date-http/Makefile b/packages/check-date-http/Makefile index cab37f7e5..83e66401a 100644 --- a/packages/check-date-http/Makefile +++ b/packages/check-date-http/Makefile @@ -4,15 +4,7 @@ # This is free software, licensed under the GNU Affero General Public License v3. # -include $(TOPDIR)/rules.mk - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=check-date-http -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) TITLE:=Keep local date under NTP too far away skew @@ -30,12 +22,4 @@ define Package/$(PKG_NAME)/description reset trought date command depending on configuration. endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/check-internet/Makefile b/packages/check-internet/Makefile index cf25eb911..3dfb76344 100644 --- a/packages/check-internet/Makefile +++ b/packages/check-internet/Makefile @@ -4,15 +4,7 @@ # This is free software, licensed under the GNU Affero General Public License v3. # -include $(TOPDIR)/rules.mk - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=check-internet -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) TITLE:=Check internet connection @@ -27,12 +19,4 @@ define Package/$(PKG_NAME)/description Simple script to verify that there is internet access. endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/deferable-reboot/Makefile b/packages/deferable-reboot/Makefile index 94097d07b..968fc0f2c 100644 --- a/packages/deferable-reboot/Makefile +++ b/packages/deferable-reboot/Makefile @@ -4,15 +4,7 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=deferable-reboot -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) SECTION:=utils @@ -34,21 +26,4 @@ define Package/$(PKG_NAME)/description awk '{print $1 + 120}' /proc/uptime > /tmp/deferable-reboot.defer endef -define Build/Configure -endef - -define Build/Compile - @rm -rf ./build || true - @mkdir ./build - $(CP) ./files ./build - $(FIND) ./build -name '*.sh' -exec sed -i '/^\s*#\[Doc\]/d' {} + - $(FIND) ./build -name '*.lua' -exec sed -i '/^\s*--!.*/d' {} + -endef - - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/first-boot-wizard/Makefile b/packages/first-boot-wizard/Makefile index 1e2dc9b36..862730179 100755 --- a/packages/first-boot-wizard/Makefile +++ b/packages/first-boot-wizard/Makefile @@ -1,11 +1,4 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=first-boot-wizard -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) TITLE:=$(PKG_NAME) @@ -22,11 +15,4 @@ define Package/$(PKG_NAME)/description Scans surrounding LibreMesh networks and joins them. endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/hotplug-initd-services/Makefile b/packages/hotplug-initd-services/Makefile index be1fb06ab..647e378f1 100644 --- a/packages/hotplug-initd-services/Makefile +++ b/packages/hotplug-initd-services/Makefile @@ -4,15 +4,7 @@ # This is free software, licensed under the GNU Affero General Public License v3. # -include $(TOPDIR)/rules.mk - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=hotplug-initd-services -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) TITLE:=Hotplug events of init.d services @@ -29,12 +21,4 @@ define Package/$(PKG_NAME)/description stopped. Put your hooks into /etc/hotplug.d/initd/. endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/lime-ap-watchping/Makefile b/packages/lime-ap-watchping/Makefile index cf24675bb..5f665dee6 100644 --- a/packages/lime-ap-watchping/Makefile +++ b/packages/lime-ap-watchping/Makefile @@ -4,15 +4,7 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=lime-ap-watchping -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) CATEGORY:=LibreMesh @@ -29,12 +21,4 @@ define Package/$(PKG_NAME)/description So the WiFi roaming is broken and the clients are not using the AP anymore until fixed. endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/lime-app/Makefile b/packages/lime-app/Makefile index 7ac250246..0158450f5 100644 --- a/packages/lime-app/Makefile +++ b/packages/lime-app/Makefile @@ -3,17 +3,17 @@ # # This is free software, licensed under the GNU General Public License v3. -include $(TOPDIR)/rules.mk +include ../../libremesh.mk -PKG_NAME:=lime-app -PKG_VERSION:=v0.2.26 +PKG_REALVERSION:=v0.2.26 +PKG_VERSION:=0.2.26 PKG_RELEASE:=2 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE:=$(PKG_NAME)-$(PKG_REALVERSION).tar.gz PKG_HASH:=afb74137af470f1a07d75870d569776e0eef05cce30682f58fed601e4a457d62 -PKG_SOURCE_URL:=https://github.com/libremesh/lime-app/releases/download/$(PKG_VERSION) - -include $(INCLUDE_DIR)/package.mk +PKG_SOURCE_URL:=https://github.com/libremesh/lime-app/releases/download/$(PKG_REALVERSION) +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_REALVERSION) +HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)/$(PKG_REALVERSION) define Package/$(PKG_NAME) CATEGORY:=LibreMesh @@ -30,17 +30,6 @@ define Package/$(PKG_NAME)/description Light webApp for LibreMesh over uhttpd endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ - $(INSTALL_DIR) $(1)/www/app/ - $(CP) $(BUILD_DIR)/build/* $(1)/www/app/ - $(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d || true -endef - define Package/$(PKG_NAME)/postinst #!/bin/sh [ -n "$${IPKG_INSTROOT}" ] || ( /etc/init.d/rpcd restart && /etc/init.d/uhttpd restart ) || true diff --git a/packages/lime-debug/Makefile b/packages/lime-debug/Makefile index acd29967a..2e4862c38 100644 --- a/packages/lime-debug/Makefile +++ b/packages/lime-debug/Makefile @@ -6,13 +6,11 @@ include $(TOPDIR)/rules.mk -LIME_BUILDDATE:=$(shell date +%Y%m%d_%H%M) - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) +GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . | sed 's|-|.|g') GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) -PKG_NAME:=lime-debug -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) +PKG_NAME=lime-debug +PKG_VERSION=$(GIT_COMMIT_DATE)~$(GIT_COMMIT_TSTAMP) include $(INCLUDE_DIR)/package.mk diff --git a/packages/lime-docs/Makefile b/packages/lime-docs/Makefile index 282ea197d..8405b274a 100644 --- a/packages/lime-docs/Makefile +++ b/packages/lime-docs/Makefile @@ -6,11 +6,11 @@ include $(TOPDIR)/rules.mk -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) +GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . | sed 's|-|.|g' ) GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) PKG_NAME:=lime-docs -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) +PKG_VERSION=$(GIT_COMMIT_DATE)~$(GIT_COMMIT_TSTAMP) PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_URL:=https://github.com/libremesh/libremesh.github.io/ diff --git a/packages/lime-hwd-ground-routing/Makefile b/packages/lime-hwd-ground-routing/Makefile index 18d2d2ef2..de1cf3ed5 100644 --- a/packages/lime-hwd-ground-routing/Makefile +++ b/packages/lime-hwd-ground-routing/Makefile @@ -4,17 +4,7 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -LIME_BUILDDATE:=$(shell date +%Y%m%d_%H%M) - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=lime-hwd-ground-routing -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) TITLE:=Manage 802.1q VLANs for ground routing @@ -34,17 +24,4 @@ define Package/$(PKG_NAME)/description switch port for each connected device in WDS mode. endef -define Build/Compile - @rm -rf ./build || true - @mkdir ./build - $(CP) ./files ./build - $(FIND) ./build -name '*.sh' -exec sed -i '/^\s*#\[Doc\]/d' {} + - $(FIND) ./build -name '*.lua' -exec sed -i '/^\s*--!.*/d' {} + -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./build/files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/lime-hwd-openwrt-wan/Makefile b/packages/lime-hwd-openwrt-wan/Makefile index a6e1896c1..ce7cb4475 100644 --- a/packages/lime-hwd-openwrt-wan/Makefile +++ b/packages/lime-hwd-openwrt-wan/Makefile @@ -4,17 +4,7 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -LIME_BUILDDATE:=$(shell date +%Y%m%d_%H%M) - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=lime-hwd-openwrt-wan -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) TITLE:=Respect openwrt wan interface as default @@ -24,17 +14,4 @@ define Package/$(PKG_NAME) PKGARCH:=all endef -define Build/Compile - @rm -rf ./build || true - @mkdir ./build - $(CP) ./files ./build - $(FIND) ./build -name '*.sh' -exec sed -i '/^\s*#\[Doc\]/d' {} + - $(FIND) ./build -name '*.lua' -exec sed -i '/^\s*--!.*/d' {} + -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./build/files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/lime-hwd-usbradio/Makefile b/packages/lime-hwd-usbradio/Makefile index 6c5282f69..e77d148bd 100644 --- a/packages/lime-hwd-usbradio/Makefile +++ b/packages/lime-hwd-usbradio/Makefile @@ -4,17 +4,7 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -LIME_BUILDDATE:=$(shell date +%Y%m%d_%H%M) - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=lime-hwd-usbradio -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) TITLE:=LiMe hardware detection usb radio support @@ -24,21 +14,5 @@ define Package/$(PKG_NAME) PKGARCH:=all endef -define Build/Compile - @rm -rf ./build || true - @cp -r ./src ./build - @sed -i '/^\s*--!.*/d' build/*.lua - @sed -i '/^\s*#\[Doc\]/d' build/*.sh -endef - -define Package/$(PKG_NAME)/install - @mkdir -p $(1)/usr/lib/lua/lime/hwd || true - @mkdir -p $(1)/etc/hotplug.d/usb || true - $(CP) ./build/usbradio.lua $(1)/usr/lib/lua/lime/hwd/usbradio.lua - $(CP) ./build/hotplug-hook.sh $(1)/etc/hotplug.d/usb/60-lime-hwd-usbradio - @chmod +x $(1)/usr/lib/lua/lime/hwd/usbradio.lua - @chmod +x $(1)/etc/hotplug.d/usb/60-lime-hwd-usbradio -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/lime-hwd-usbradio/src/hotplug-hook.sh b/packages/lime-hwd-usbradio/files/etc/hotplug.d/usb/60-lime-hwd-usbradio old mode 100644 new mode 100755 similarity index 100% rename from packages/lime-hwd-usbradio/src/hotplug-hook.sh rename to packages/lime-hwd-usbradio/files/etc/hotplug.d/usb/60-lime-hwd-usbradio diff --git a/packages/lime-hwd-usbradio/src/usbradio.lua b/packages/lime-hwd-usbradio/files/usr/lib/lua/lime/hwd/usbradio.lua old mode 100644 new mode 100755 similarity index 100% rename from packages/lime-hwd-usbradio/src/usbradio.lua rename to packages/lime-hwd-usbradio/files/usr/lib/lua/lime/hwd/usbradio.lua diff --git a/packages/lime-proto-anygw/Makefile b/packages/lime-proto-anygw/Makefile index 10f8a3a1c..3d588ad9b 100644 --- a/packages/lime-proto-anygw/Makefile +++ b/packages/lime-proto-anygw/Makefile @@ -4,17 +4,7 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -LIME_BUILDDATE:=$(shell date +%Y%m%d_%H%M) - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=lime-proto-anygw -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) TITLE:=LiMe anygw proto support @@ -28,18 +18,5 @@ define Package/$(PKG_NAME) PKGARCH:=all endef -define Build/Compile - @rm -rf ./build || true - @mkdir ./build - $(CP) ./files ./build - $(FIND) ./build -name '*.sh' -exec sed -i '/^\s*#\[Doc\]/d' {} + - $(FIND) ./build -name '*.lua' -exec sed -i '/^\s*--!.*/d' {} + -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./build/files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/lime-proto-bgp/Makefile b/packages/lime-proto-bgp/Makefile index 7ac1dee36..0db30fb92 100644 --- a/packages/lime-proto-bgp/Makefile +++ b/packages/lime-proto-bgp/Makefile @@ -4,17 +4,7 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -LIME_BUILDDATE:=$(shell date +%Y%m%d_%H%M) - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=lime-proto-bgp -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) TITLE:=LiMe BGP proto support @@ -25,18 +15,5 @@ define Package/$(PKG_NAME) PKGARCH:=all endef -define Build/Compile - @rm -rf ./build || true - @mkdir ./build - $(CP) ./files ./build - $(FIND) ./build -name '*.sh' -exec sed -i '/^\s*#\[Doc\]/d' {} + - $(FIND) ./build -name '*.lua' -exec sed -i '/^\s*--!.*/d' {} + -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./build/files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/lime-proto-olsr/Makefile b/packages/lime-proto-olsr/Makefile index c6babb94f..b396293a9 100644 --- a/packages/lime-proto-olsr/Makefile +++ b/packages/lime-proto-olsr/Makefile @@ -4,17 +4,7 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -LIME_BUILDDATE:=$(shell date +%Y%m%d_%H%M) - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=lime-proto-olsr -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) TITLE:=LiMe OLSR proto support (IPv4) @@ -26,15 +16,4 @@ define Package/$(PKG_NAME) PKGARCH:=all endef -define Build/Compile - @rm -rf ./build || true - @cp -r ./src ./build - @sed -i '/^--!.*/d' build/*.lua -endef - -define Package/$(PKG_NAME)/install - @mkdir -p $(1)/usr/lib/lua/lime/proto || true - $(CP) ./build/olsr.lua $(1)/usr/lib/lua/lime/proto/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/lime-proto-olsr/src/olsr.lua b/packages/lime-proto-olsr/files/usr/lib/lua/lime/proto/olsr.lua similarity index 100% rename from packages/lime-proto-olsr/src/olsr.lua rename to packages/lime-proto-olsr/files/usr/lib/lua/lime/proto/olsr.lua diff --git a/packages/lime-proto-olsr2/Makefile b/packages/lime-proto-olsr2/Makefile index b55a70230..561a719af 100644 --- a/packages/lime-proto-olsr2/Makefile +++ b/packages/lime-proto-olsr2/Makefile @@ -4,17 +4,7 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -LIME_BUILDDATE:=$(shell date +%Y%m%d_%H%M) - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=lime-proto-olsr2 -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) TITLE:=LiMe OLSR2 proto support (IPv4/v6) @@ -26,15 +16,4 @@ define Package/$(PKG_NAME) PKGARCH:=all endef -define Build/Compile - @rm -rf ./build || true - @cp -r ./src ./build - @sed -i '/^--!.*/d' build/*.lua -endef - -define Package/$(PKG_NAME)/install - @mkdir -p $(1)/usr/lib/lua/lime/proto || true - $(CP) ./build/olsr2.lua $(1)/usr/lib/lua/lime/proto/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/lime-proto-olsr2/src/olsr2.lua b/packages/lime-proto-olsr2/files/usr/lib/lua/lime/proto/olsr2.lua similarity index 100% rename from packages/lime-proto-olsr2/src/olsr2.lua rename to packages/lime-proto-olsr2/files/usr/lib/lua/lime/proto/olsr2.lua diff --git a/packages/lime-proto-olsr6/Makefile b/packages/lime-proto-olsr6/Makefile index c5b6b83f3..ff9087040 100644 --- a/packages/lime-proto-olsr6/Makefile +++ b/packages/lime-proto-olsr6/Makefile @@ -4,17 +4,7 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -LIME_BUILDDATE:=$(shell date +%Y%m%d_%H%M) - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=lime-proto-olsr6 -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) TITLE:=LiMe OLSR proto support (IPv6) @@ -26,15 +16,4 @@ define Package/$(PKG_NAME) PKGARCH:=all endef -define Build/Compile - @rm -rf ./build || true - @cp -r ./src ./build - @sed -i '/^--!.*/d' build/*.lua -endef - -define Package/$(PKG_NAME)/install - @mkdir -p $(1)/usr/lib/lua/lime/proto || true - $(CP) ./build/olsr6.lua $(1)/usr/lib/lua/lime/proto/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/lime-proto-olsr6/src/olsr6.lua b/packages/lime-proto-olsr6/files/usr/lib/lua/lime/proto/olsr6.lua similarity index 100% rename from packages/lime-proto-olsr6/src/olsr6.lua rename to packages/lime-proto-olsr6/files/usr/lib/lua/lime/proto/olsr6.lua diff --git a/packages/lime-report/Makefile b/packages/lime-report/Makefile index d68954120..25c91283a 100644 --- a/packages/lime-report/Makefile +++ b/packages/lime-report/Makefile @@ -2,15 +2,7 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=lime-report -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) TITLE:=LibreMesh status report utility @@ -25,15 +17,4 @@ define Package/$(PKG_NAME)/description of a LibreMesh node, useful for debugging and issues reporting. endef -define Package/$(PKG_NAME)/config -endef - -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/bin/ - $(INSTALL_BIN) ./files/lime-report.sh $(1)/bin/lime-report -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/lime-report/files/lime-report.sh b/packages/lime-report/files/bin/lime-report.sh old mode 100644 new mode 100755 similarity index 100% rename from packages/lime-report/files/lime-report.sh rename to packages/lime-report/files/bin/lime-report.sh diff --git a/packages/lime-system/Makefile b/packages/lime-system/Makefile index d327c9c54..63e0ab5a5 100644 --- a/packages/lime-system/Makefile +++ b/packages/lime-system/Makefile @@ -6,11 +6,11 @@ include $(TOPDIR)/rules.mk -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) +GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . | sed 's|-|.|g' ) GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) PKG_NAME:=lime-system -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) +PKG_VERSION=$(GIT_COMMIT_DATE)~$(GIT_COMMIT_TSTAMP) LIME_ID:=LiMe LIME_RELEASE:=$(shell git branch | sed -n '/\* /s///p') diff --git a/packages/lua-argparse/Makefile b/packages/lua-argparse/Makefile deleted file mode 100644 index 9a48caf1e..000000000 --- a/packages/lua-argparse/Makefile +++ /dev/null @@ -1,51 +0,0 @@ -# -# Copyright (C) 2019 Santiago Piccinini -# -# This is free software, licensed under the GNU General Public License v2. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=lua-argparse -PKG_VERSION:=0.6.0 -PKG_RELEASE:=2 -PKG_MAINTAINER:=Santiago Piccinini -PKG_LICENSE:=MIT - -PKG_SOURCE:=argparse-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/mpeterv/argparse/archive/$(PKG_VERSION)/ -PKG_HASH:=0eddda29d591536bc7310b99ce7acc3e5e00557f18d6e63ab10d56683e8952f1 -PKG_BUILD_DIR:=$(BUILD_DIR)/argparse-$(PKG_VERSION) - -include $(INCLUDE_DIR)/package.mk - -define Package/lua-argparse - SUBMENU:=Lua - SECTION:=lang - CATEGORY:=Languages - TITLE:=Lua argparse - URL:=https://github.com/mpeterv/argparse - DEPENDS:=+lua - PKGARCH:=all - MAINTAINER:=Peter Melnichenko -endef - -define Package/lua-argparse/description - Argparse is a feature-rich command line parser for Lua inspired by argparse for Python. - Argparse supports positional arguments, options, flags, optional arguments, - subcommands and more. Argparse automatically generates usage, help and error messages. -endef - - -define Build/Configure -endef - -define Build/Compile -endef - -define Package/lua-argparse/install - $(INSTALL_DIR) $(1)/usr/lib/lua - $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/argparse.lua $(1)/usr/lib/lua -endef - -$(eval $(call BuildPackage,lua-argparse)) diff --git a/packages/lua-argparse/Readme.md b/packages/lua-argparse/Readme.md deleted file mode 100644 index 4bbc13362..000000000 --- a/packages/lua-argparse/Readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# lua-argparse - -Argparse is a feature-rich command line parser for Lua inspired by argparse for Python. - -Argparse supports positional arguments, options, flags, optional arguments, subcommands and more. Argparse automatically generates usage, help and error messages. - -This package is installed argparse in openwrt and is mainly used in [safe-upgrade](https://github.com/libremesh/lime-packages/blob/master/packages/safe-upgrade/files/usr/sbin/safe-upgrade). It is really useful and you can see the complete documentation in [its own repository](https://github.com/mpeterv/argparse/). - -## Contents - -* [Example](https://github.com/mpeterv/argparse/#example) -* [Installation](https://github.com/mpeterv/argparse/#installation) -* [Tutorial](https://github.com/mpeterv/argparse/#tutorial) -* [Testing](https://github.com/mpeterv/argparse/#testing) -* [License](https://github.com/mpeterv/argparse/#license) \ No newline at end of file diff --git a/packages/luci-lib-jquery-flot/Makefile b/packages/luci-lib-jquery-flot/Makefile index bcad5f993..a86ad3a14 100644 --- a/packages/luci-lib-jquery-flot/Makefile +++ b/packages/luci-lib-jquery-flot/Makefile @@ -4,13 +4,10 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -PKG_NAME:=luci-lib-jquery-flot-0-8 PKG_VERSION:=0.8.1 PKG_RELEASE:=1 -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) SECTION:=luci @@ -22,12 +19,4 @@ define Package/$(PKG_NAME) PKGARCH:=all endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/www/luci-static/resources/jquery/ - $(CP) ./files/* $(1)/www/luci-static/resources/jquery/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/luci-lib-jquery-flot/files/jquery.flot.min.js b/packages/luci-lib-jquery-flot/files/www/luci-static/resources/jquery/jquery.flot.min.js similarity index 100% rename from packages/luci-lib-jquery-flot/files/jquery.flot.min.js rename to packages/luci-lib-jquery-flot/files/www/luci-static/resources/jquery/jquery.flot.min.js diff --git a/packages/luci-mod-status/Makefile b/packages/luci-mod-status/Makefile index a5683eeee..fc3997011 100644 --- a/packages/luci-mod-status/Makefile +++ b/packages/luci-mod-status/Makefile @@ -4,14 +4,7 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -PKG_NAME:=luci-mod-status -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) SECTION:=admin @@ -32,12 +25,4 @@ Minimal and simple web app to view some status info: * ethernet switch ports status endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/miniserver-client/Makefile b/packages/miniserver-client/Makefile index 500ab7ebf..646121954 100644 --- a/packages/miniserver-client/Makefile +++ b/packages/miniserver-client/Makefile @@ -4,14 +4,7 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -PKG_NAME:=miniserver-client -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) SECTION:=utils @@ -37,12 +30,4 @@ define Package/$(PKG_NAME)/description reachable on the local network. endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/pirania/Makefile b/packages/pirania/Makefile index b359f01ec..50fe40a4e 100644 --- a/packages/pirania/Makefile +++ b/packages/pirania/Makefile @@ -1,11 +1,4 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=pirania -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) SUBMENU:=Captive Portals @@ -23,12 +16,4 @@ define Package/$(PKG_NAME)/description Captive Portal for routers that want to share their Internet connection via vouchers. endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/prometheus-node-exporter-lua-location-latlon/Makefile b/packages/prometheus-node-exporter-lua-location-latlon/Makefile index a04444d95..713d38dc8 100644 --- a/packages/prometheus-node-exporter-lua-location-latlon/Makefile +++ b/packages/prometheus-node-exporter-lua-location-latlon/Makefile @@ -4,14 +4,7 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -PKG_NAME:=prometheus-node-exporter-lua-location-latlon -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) SECTION:=utils @@ -22,12 +15,4 @@ define Package/$(PKG_NAME) DEPENDS:= +lua +libuci-lua +iw +libubus-lua endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/prometheus-node-exporter-lua-wifi-params/Makefile b/packages/prometheus-node-exporter-lua-wifi-params/Makefile index 314296409..ded2cb91d 100644 --- a/packages/prometheus-node-exporter-lua-wifi-params/Makefile +++ b/packages/prometheus-node-exporter-lua-wifi-params/Makefile @@ -4,14 +4,7 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -PKG_NAME:=prometheus-node-exporter-lua-wifi-params -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) SECTION:=utils @@ -22,12 +15,4 @@ define Package/$(PKG_NAME) DEPENDS:= +lua +libuci-lua +iw endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/prometheus-node-exporter-lua-wifi-stations-extra/Makefile b/packages/prometheus-node-exporter-lua-wifi-stations-extra/Makefile index 8c2c4847d..1bacad6a5 100644 --- a/packages/prometheus-node-exporter-lua-wifi-stations-extra/Makefile +++ b/packages/prometheus-node-exporter-lua-wifi-stations-extra/Makefile @@ -4,14 +4,7 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -PKG_NAME:=prometheus-node-exporter-lua-wifi-stations-extra -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) SECTION:=utils @@ -22,12 +15,4 @@ define Package/$(PKG_NAME) DEPENDS:= +lua +libuci-lua +iw +libubus-lua endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/prometheus-node-exporter-lua-wifi-survey/Makefile b/packages/prometheus-node-exporter-lua-wifi-survey/Makefile index 98e401f2b..4639f2aee 100644 --- a/packages/prometheus-node-exporter-lua-wifi-survey/Makefile +++ b/packages/prometheus-node-exporter-lua-wifi-survey/Makefile @@ -4,14 +4,7 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -PKG_NAME:=prometheus-node-exporter-lua-wifi-survey -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) SECTION:=utils @@ -22,12 +15,4 @@ define Package/$(PKG_NAME) DEPENDS:= +lua +iw +libubus-lua endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/prometheus-node-push-influx/Makefile b/packages/prometheus-node-push-influx/Makefile index 8e929de8b..1b1ec7d1e 100644 --- a/packages/prometheus-node-push-influx/Makefile +++ b/packages/prometheus-node-push-influx/Makefile @@ -4,14 +4,7 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -PKG_NAME:=prometheus-node-push-influx -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) SECTION:=utils @@ -29,12 +22,4 @@ define Package/$(PKG_NAME)/description to a remote VictoriaMetrics server. endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/random-numgen/Makefile b/packages/random-numgen/Makefile index 942b3cf29..a815afed5 100644 --- a/packages/random-numgen/Makefile +++ b/packages/random-numgen/Makefile @@ -2,17 +2,15 @@ # See /LICENSES for more information. # -include $(TOPDIR)/rules.mk +include ../../libremesh.mk -PKG_NAME:=random-numgen -PKG_VERSION:=0.1 +PKG_REALVERSION:=0.1 +PKG_VERSION:=0.0.1 PKG_RELEASE:=1 PKG_MAINTAINER:=Ilario Gelmetti PKG_LICENSE:=GPL-3.0-or-later -include $(INCLUDE_DIR)/package.mk - define Package/random-numgen SECTION:=utils CATEGORY:=Utilities @@ -26,15 +24,4 @@ define Package/random-numgen/description 65535 using /dev/urandom as a random data source. endef -define Build/Compile -endef - -define Build/Configure -endef - -define Package/random-numgen/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) ./files/random-numgen $(1)/usr/bin/ -endef - -$(eval $(call BuildPackage,random-numgen)) +$(eval $(call BuildPackage,$(PKG_NAME))) \ No newline at end of file diff --git a/packages/random-numgen/files/random-numgen b/packages/random-numgen/files/usr/bin/random-numgen similarity index 100% rename from packages/random-numgen/files/random-numgen rename to packages/random-numgen/files/usr/bin/random-numgen diff --git a/packages/safe-reboot/Makefile b/packages/safe-reboot/Makefile index 084ee313a..b2d42c976 100644 --- a/packages/safe-reboot/Makefile +++ b/packages/safe-reboot/Makefile @@ -4,14 +4,7 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -PKG_NAME:=safe-reboot -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) SECTION:=utils @@ -32,12 +25,4 @@ define Package/$(PKG_NAME)/description for the revert timeout. endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) ./files/usr/sbin/safe-reboot $(1)/usr/sbin/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/safe-upgrade/Makefile b/packages/safe-upgrade/Makefile index 79ccb9cd6..e066785e7 100644 --- a/packages/safe-upgrade/Makefile +++ b/packages/safe-upgrade/Makefile @@ -4,15 +4,7 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=safe-upgrade -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) SECTION:=utils @@ -28,15 +20,4 @@ define Package/$(PKG_NAME)/description confirmation step. See $(PKG_NAME)/Readme.md for more details. endef -define Build/Configure -endef - -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) ./files/usr/sbin/safe-upgrade $(1)/usr/sbin/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/shared-state-async/Makefile b/packages/shared-state-async/Makefile index a2686614f..5fa61900a 100644 --- a/packages/shared-state-async/Makefile +++ b/packages/shared-state-async/Makefile @@ -17,15 +17,15 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see # -# SPDX-License-Identifier: AGPL-3.0-only +# SPDX-License-Identifier: AGPL-3.0-only include $(TOPDIR)/rules.mk -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) +GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . | sed 's|-|.|g' ) GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) PKG_NAME:=shared-state-async -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) +PKG_VERSION=$(GIT_COMMIT_DATE)~$(GIT_COMMIT_TSTAMP) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/libremesh/shared-state-async.git diff --git a/packages/shared-state-babeld_hosts/Makefile b/packages/shared-state-babeld_hosts/Makefile index 070450e84..05a238f39 100644 --- a/packages/shared-state-babeld_hosts/Makefile +++ b/packages/shared-state-babeld_hosts/Makefile @@ -4,15 +4,7 @@ # This is free software, licensed under the GNU Affero General Public License v3. # -include $(TOPDIR)/rules.mk - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=shared-state-babeld_hosts -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) TITLE:=babeld-hosts module for shared-state @@ -29,12 +21,4 @@ define Package/$(PKG_NAME)/description bab2host and host2bab commands. endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/shared-state-bat_hosts/Makefile b/packages/shared-state-bat_hosts/Makefile index 6a8508bd8..97d32e601 100644 --- a/packages/shared-state-bat_hosts/Makefile +++ b/packages/shared-state-bat_hosts/Makefile @@ -4,15 +4,7 @@ # This is free software, licensed under the GNU Affero General Public License v3. # -include $(TOPDIR)/rules.mk - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=shared-state-bat_hosts -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) TITLE:=bat-hosts module for shared-state @@ -28,12 +20,4 @@ define Package/$(PKG_NAME)/description Syncronize bat-hosts beween nodes, provides also mac2bat and bat2mac. endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/shared-state-dnsmasq_hosts/Makefile b/packages/shared-state-dnsmasq_hosts/Makefile index e4881f908..f226d8a2c 100644 --- a/packages/shared-state-dnsmasq_hosts/Makefile +++ b/packages/shared-state-dnsmasq_hosts/Makefile @@ -4,15 +4,7 @@ # This is free software, licensed under the GNU Affero General Public License v3. # -include $(TOPDIR)/rules.mk - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=shared-state-dnsmasq_hosts -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) TITLE:=dnsmasq hosts module for shared-state @@ -28,12 +20,4 @@ define Package/$(PKG_NAME)/description Syncronize dnsmasq hosts beween nodes. endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/shared-state-dnsmasq_leases/Makefile b/packages/shared-state-dnsmasq_leases/Makefile index 422fa3a51..df89000b5 100644 --- a/packages/shared-state-dnsmasq_leases/Makefile +++ b/packages/shared-state-dnsmasq_leases/Makefile @@ -4,15 +4,7 @@ # This is free software, licensed under the GNU Affero General Public License v3. # -include $(TOPDIR)/rules.mk - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=shared-state-dnsmasq_leases -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) TITLE:=dnsmasq leases module for shared-state @@ -29,12 +21,4 @@ define Package/$(PKG_NAME)/description Syncronize dnsmasq leases beween nodes. endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/shared-state-dnsmasq_servers/Makefile b/packages/shared-state-dnsmasq_servers/Makefile index 70d21a2dd..4f1c1d87f 100644 --- a/packages/shared-state-dnsmasq_servers/Makefile +++ b/packages/shared-state-dnsmasq_servers/Makefile @@ -4,15 +4,7 @@ # This is free software, licensed under the GNU Affero General Public License v3. # -include $(TOPDIR)/rules.mk - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=shared-state-dnsmasq_servers -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) TITLE:=Mesh DNS module for shared-state @@ -29,12 +21,4 @@ define Package/$(PKG_NAME)/description by other nodes in the mesh can be resolved transparently. endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/shared-state-nodes_and_links/Makefile b/packages/shared-state-nodes_and_links/Makefile index c17ad8477..9d23f2eed 100644 --- a/packages/shared-state-nodes_and_links/Makefile +++ b/packages/shared-state-nodes_and_links/Makefile @@ -4,15 +4,7 @@ # This is free software, licensed under the GNU Affero General Public License v3. # -include $(TOPDIR)/rules.mk - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=shared-state-nodes_and_links -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) TITLE:=nodes_and_links module for shared-state @@ -28,12 +20,4 @@ define Package/$(PKG_NAME)/description Syncronize nodes_and_links beween nodes. endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/shared-state-persist/Makefile b/packages/shared-state-persist/Makefile index 28cc316f7..5d4ff6c8e 100644 --- a/packages/shared-state-persist/Makefile +++ b/packages/shared-state-persist/Makefile @@ -4,15 +4,7 @@ # This is free software, licensed under the GNU Affero General Public License v3. # -include $(TOPDIR)/rules.mk - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=shared-state-persist -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) TITLE:=Persists shared-state in usb devices @@ -28,12 +20,4 @@ define Package/$(PKG_NAME)/description Detects block-mount storage devices and configures shared-state so that status persists on those devices. endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/shared-state-pirania/Makefile b/packages/shared-state-pirania/Makefile index c79d1a2db..46d552f3a 100644 --- a/packages/shared-state-pirania/Makefile +++ b/packages/shared-state-pirania/Makefile @@ -4,15 +4,7 @@ # This is free software, licensed under the GNU Affero General Public License v3. # -include $(TOPDIR)/rules.mk - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=shared-state-pirania -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) TITLE:=Pirania vaucher module for shared-state @@ -27,12 +19,4 @@ define Package/$(PKG_NAME)/description Syncronize valid pirania vauchers beween nodes endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/shared-state-wifi_links_info/Makefile b/packages/shared-state-wifi_links_info/Makefile index ed2a59d19..367cf1c56 100644 --- a/packages/shared-state-wifi_links_info/Makefile +++ b/packages/shared-state-wifi_links_info/Makefile @@ -4,15 +4,7 @@ # This is free software, licensed under the GNU Affero General Public License v3. # -include $(TOPDIR)/rules.mk - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=shared-state-wifi_links_info -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) TITLE:=WiFI links information module for shared-state @@ -27,12 +19,4 @@ define Package/$(PKG_NAME)/description Syncronize links information beween nodes. endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/shared-state/Makefile b/packages/shared-state/Makefile index b377ddbc0..beb8a6a5e 100644 --- a/packages/shared-state/Makefile +++ b/packages/shared-state/Makefile @@ -4,15 +4,7 @@ # This is free software, licensed under the GNU Affero General Public License v3. # -include $(TOPDIR)/rules.mk - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=shared-state -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) TITLE:=Very minimal state sharing betwen nodes @@ -28,12 +20,4 @@ define Package/$(PKG_NAME)/description LiMe style minimal unsecured CRDT to share light state between nodes endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/soporteremoto/Makefile b/packages/soporteremoto/Makefile index e21d48620..2b88858f0 100644 --- a/packages/soporteremoto/Makefile +++ b/packages/soporteremoto/Makefile @@ -4,14 +4,7 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -PKG_NAME:=soporteremoto -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) SECTION:=utils @@ -28,12 +21,4 @@ define Package/$(PKG_NAME)/description that will be granted root access endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/sprunge/Makefile b/packages/sprunge/Makefile index 7229f9404..296b67b40 100644 --- a/packages/sprunge/Makefile +++ b/packages/sprunge/Makefile @@ -4,15 +4,7 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=sprunge -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) TITLE:=sprunge.us and ix.io pastebin @@ -27,13 +19,4 @@ define Package/$(PKG_NAME)/description sprunge.us and ix.io command line pastebin endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - @mkdir -p $(1)/usr/bin/ || true - $(INSTALL_BIN) ./src/sprunge.sh $(1)/usr/bin/sprunge - $(INSTALL_BIN) ./src/ix.sh $(1)/usr/bin/ix -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/sprunge/src/ix.sh b/packages/sprunge/files/usr/bin/ix similarity index 100% rename from packages/sprunge/src/ix.sh rename to packages/sprunge/files/usr/bin/ix diff --git a/packages/sprunge/src/sprunge.sh b/packages/sprunge/files/usr/bin/sprunge similarity index 100% rename from packages/sprunge/src/sprunge.sh rename to packages/sprunge/files/usr/bin/sprunge diff --git a/packages/ubus-lime-batman-adv/Makefile b/packages/ubus-lime-batman-adv/Makefile index c9da43e9b..fb4c28158 100644 --- a/packages/ubus-lime-batman-adv/Makefile +++ b/packages/ubus-lime-batman-adv/Makefile @@ -1,11 +1,4 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=ubus-lime-batman-adv -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) SECTION:=ubus @@ -17,12 +10,4 @@ define Package/$(PKG_NAME) PKGARCH:=all endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/ubus-lime-groundrouting/Makefile b/packages/ubus-lime-groundrouting/Makefile index fbb66a138..129188bfe 100644 --- a/packages/ubus-lime-groundrouting/Makefile +++ b/packages/ubus-lime-groundrouting/Makefile @@ -1,11 +1,4 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=ubus-lime-grondrouting -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) SECTION:=ubus @@ -17,12 +10,4 @@ define Package/$(PKG_NAME) PKGARCH:=all endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/ubus-lime-location/Makefile b/packages/ubus-lime-location/Makefile index 5cebad3d1..bf8309bc8 100644 --- a/packages/ubus-lime-location/Makefile +++ b/packages/ubus-lime-location/Makefile @@ -1,11 +1,4 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=ubus-lime-location -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) SECTION:=ubus @@ -17,12 +10,4 @@ define Package/$(PKG_NAME) PKGARCH:=all endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/ubus-lime-metrics/Makefile b/packages/ubus-lime-metrics/Makefile index 441036e2f..15a12c32f 100644 --- a/packages/ubus-lime-metrics/Makefile +++ b/packages/ubus-lime-metrics/Makefile @@ -1,12 +1,5 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=ubus-lime-metrics -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) SECTION:=ubus @@ -18,12 +11,4 @@ define Package/$(PKG_NAME) PKGARCH:=all endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/ubus-lime-openairview/Makefile b/packages/ubus-lime-openairview/Makefile index e67d093b1..312d3814e 100644 --- a/packages/ubus-lime-openairview/Makefile +++ b/packages/ubus-lime-openairview/Makefile @@ -1,12 +1,5 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=ubus-lime-openairview -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) SECTION:=ubus @@ -18,12 +11,4 @@ define Package/$(PKG_NAME) PKGARCH:=all endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/ubus-lime-utils/Makefile b/packages/ubus-lime-utils/Makefile index 02cfa4bf7..6a3f0d7cb 100644 --- a/packages/ubus-lime-utils/Makefile +++ b/packages/ubus-lime-utils/Makefile @@ -1,11 +1,4 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=ubus-lime-utils -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) SECTION:=ubus @@ -19,12 +12,4 @@ define Package/$(PKG_NAME) PKGARCH:=all endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/ubus-tmate/Makefile b/packages/ubus-tmate/Makefile index 4a5005523..18a89a90e 100644 --- a/packages/ubus-tmate/Makefile +++ b/packages/ubus-tmate/Makefile @@ -1,11 +1,4 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=ubus-tmate -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) SECTION:=net @@ -21,12 +14,4 @@ define Package/$(PKG_NAME)/description It allows to create remote sessions over tmate through ubus. endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/watchping/Makefile b/packages/watchping/Makefile index b2d1a12ea..e6d5cb27b 100644 --- a/packages/watchping/Makefile +++ b/packages/watchping/Makefile @@ -4,14 +4,7 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -PKG_NAME:=watchping -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) SECTION:=utils @@ -27,12 +20,4 @@ define Package/$(PKG_NAME)/description Configuration is done in /etc/config/system. endef -define Build/Compile -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/packages/wifi-unstuck-wa/Makefile b/packages/wifi-unstuck-wa/Makefile index b5a57b767..ad30fb432 100644 --- a/packages/wifi-unstuck-wa/Makefile +++ b/packages/wifi-unstuck-wa/Makefile @@ -4,15 +4,7 @@ # This is free software, licensed under the GNU General Public License v3. # -include $(TOPDIR)/rules.mk - -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_NAME:=wifi-unstuck-wa -PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) - -include $(INCLUDE_DIR)/package.mk +include ../../libremesh.mk define Package/$(PKG_NAME) SECTION:=utils @@ -28,21 +20,4 @@ define Package/$(PKG_NAME)/description radio driver bugs. endef -define Build/Configure -endef - -define Build/Compile - @rm -rf ./build || true - @mkdir ./build - $(CP) ./files ./build - $(FIND) ./build -name '*.sh' -exec sed -i '/^\s*#\[Doc\]/d' {} + - $(FIND) ./build -name '*.lua' -exec sed -i '/^\s*--!.*/d' {} + -endef - - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/ - $(CP) ./files/* $(1)/ -endef - $(eval $(call BuildPackage,$(PKG_NAME))) From 51f9ee6a8c16c6639eb157ef921645b6fac2e027 Mon Sep 17 00:00:00 2001 From: a-gave Date: Sun, 17 Nov 2024 19:56:14 +0100 Subject: [PATCH 2/7] ci: add multi branch build; add initial support for apk lime-system: add apk option in 92_add-lime-repos ci: update feeds scheme to build C++ packages for 3 lastest openwrt branches the new scheme make these packages available at https://github.com/libremesh/lime-feed referenced by apk in /etc/apk/repositories as @libremesh_arch_packages https://feed.libremesh.org/arch_packages/master/openwrt_main/x86_64/packages.adb ci: disable sign packages in main openwrt branch not yet supported, there is an active pull Support sign apk feed https://github.com/openwrt/gh-action-sdk/pull/46 to install packages use "apk add --allow-untrusted lime-docs" --- .github/workflows/build.yml | 32 +++- .github/workflows/multi-arch-build.yml | 143 ++++++++++++------ README.md | 36 +++-- .../files/etc/uci-defaults/92_add-lime-repos | 49 ++++-- 4 files changed, 188 insertions(+), 72 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 56899355b..4995060ee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,25 +9,41 @@ on: - v* - '!v2020*' paths: - - ".github/workflows/*" + - ".github/workflows/build.yml" - "libremesh.mk" - "packages/**" + workflow_dispatch: jobs: +# Build all packages for x86_64 +# Use openwrt branches 'main' and 'openwrt-24.10' to produce two feeds: +# one for 'apk' and one for the older 'opkg'. +# NOTE: this doesn't sign packages for apk build: - name: Build ${{ github.ref }} + name: Build ${{ matrix.version }} ${{ github.ref }} runs-on: ubuntu-latest - + strategy: + fail-fast: false + max-parallel: 1 + matrix: + include: + - { version: main, output_path: 'apk/'} + - { version: openwrt-24.10, output_path: ''} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Build packages uses: openwrt/gh-action-sdk@v7 env: - ARCH: "x86_64-openwrt-23.05" + ARCH: "x86_64-${{ matrix.version }}" FEEDNAME: "libremesh" IGNORE_ERRORS: "n m y" - KEY_BUILD: "${{ secrets.KEY_BUILD }}" + KEY_BUILD: "${{ matrix.version != 'main' && secrets.KEY_BUILD || '' }}" + INDEX: 1 + NO_DEFAULT_FEEDS: 1 + NO_REFRESH_CHECK: 1 + NO_SHFMT_CHECK: 1 + # V: sc - name: Set package destination run: | @@ -36,12 +52,12 @@ jobs: echo "DEST_DIR=$TAG" >> $GITHUB_ENV - name: Upload packages to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@v4 with: deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} external_repository: libremesh/lime-feed publish_dir: bin/packages/x86_64/libremesh/ - destination_dir: ${{ env.DEST_DIR }} + destination_dir: ${{ matrix.output_path }}${{ env.DEST_DIR }} # - name: Upload packages to S3 # uses: jakejarvis/s3-sync-action@master diff --git a/.github/workflows/multi-arch-build.yml b/.github/workflows/multi-arch-build.yml index 241027325..38f9a6f90 100644 --- a/.github/workflows/multi-arch-build.yml +++ b/.github/workflows/multi-arch-build.yml @@ -9,79 +9,136 @@ on: - v* - '!v2020*' paths: + - ".github/workflows/multi-arch-build.yml" - 'packages/shared-state-async/**' # Allows you to run this workflow manually from the Actions tab workflow_dispatch: +# Build packages using the openwrt sdk +# for each architecture supported +# in openwrt branchs 'main', 'stable', 'old-stable' +# +# NOTE: +# This list of branches will be updated manually +# - at next openwrt release, ideally adding '25.xx' and removing '23.05' +# - whether it will be identified an incompatibility of the current libremesh code with an openwrt branch +env: + BUILD_BRANCHES: "main 24.10 23.05" + +# workaround: 'make package/shared-state-async/check' fails with 'Package HASH check failed' + PACKAGES: "shared-state-bat_hosts" + jobs: + generate_matrix: + name: 'Generate matrix' + runs-on: ubuntu-latest + outputs: + matrix_builds: ${{ steps.define_matrix.outputs.matrix_builds }} + steps: + - name: Define matrix of branchs and archs + id: define_matrix + run: | + JSON='[' + FIRST_BUILD=1 + echo "${{ env.BUILD_BRANCHES }}" + for version in ${{ env.BUILD_BRANCHES }}; do + + VERSION=$([ "$version" == "main" ] \ + && echo "main" || echo "openwrt-$version") + echo $VERSION + + VERSION_PATH=$([ "$version" == "main" ] \ + && echo "snapshots/packages" || echo "releases/packages-$version") + echo $VERSION_PATH + + OUTPUT_PATH=$([ "$version" == "main" ] \ + && echo "openwrt_main" || echo "openwrt_$version") + echo $OUTPUT_PATH + + wget -r -nH --no-parent --level 1 --accept html -P. \ + --directory-prefix=. https://downloads.openwrt.org/$VERSION_PATH/ + + for arch in $(ls ./$VERSION_PATH/ | grep -v html); do + [[ $FIRST_BUILD -ne 1 ]] && JSON="$JSON"',' + FIRST_BUILD=0 + + JSON="$JSON"'{"version": "'"$VERSION"'" ,"arch": "'"$arch"'", "output_path": "'"$OUTPUT_PATH"'" }' + echo $JSON + done + done + + matrix_include='{"include": '"$JSON"']}' + echo "matrix_builds=${matrix_include}" >> "$GITHUB_OUTPUT" + build: - name: build ${{ matrix.arch }} ${{ github.ref }} + name: build ${{ matrix.arch }}-${{ matrix.version }} runs-on: ubuntu-latest + needs: generate_matrix strategy: fail-fast: false - max-parallel: 1 - matrix: - arch: - - aarch64_cortex-a53 - - aarch64_cortex-a72 - - aarch64_generic - - arm_arm1176jzf-s_vfp - - arm_arm926ej-s - - arm_cortex-a15_neon-vfpv4 - - arm_cortex-a5_vfpv4 - - arm_cortex-a7 - - arm_cortex-a7_neon-vfpv4 - - arm_cortex-a7_vfpv4 - - arm_cortex-a8_vfpv3 - - arm_cortex-a9 - - arm_cortex-a9_neon - - arm_cortex-a9_vfpv3-d16 - - arm_fa526 - - arm_mpcore - - arm_xscale - - i386_pentium-mmx - - i386_pentium4 - - mips64_octeonplus - - mips_24kc - - mips_4kec - - mips_mips32 - - mipsel_24kc - - mipsel_24kc_24kf - - mipsel_74kc - - mipsel_mips32 - - powerpc_464fp - - powerpc_8548 - - riscv64_riscv64 - - x86_64 - + max-parallel: 10 + matrix: ${{ fromJson(needs.generate_matrix.outputs.matrix_builds) }} + # matrix: + # include: + # - { version: main, arch: x86_64, output_path: 'openwrt_main'} + # - { version: main, arch: arc_archs, output_path: 'openwrt_main'} steps: - uses: actions/checkout@v4 - - name: Build packages ${{ matrix.arch }} + - name: Build packages ${{ matrix.arch }}-${{ matrix.version }} uses: openwrt/gh-action-sdk@v7 env: - ARCH: "${{ matrix.arch }}" + ARCH: "${{ matrix.arch }}-${{ matrix.version }}" FEEDNAME: "libremesh" IGNORE_ERRORS: "n m y" - KEY_BUILD: "${{ secrets.KEY_BUILD }}" - PACKAGES: "shared-state-bat_hosts" + KEY_BUILD: "${{ matrix.version != 'main' && secrets.KEY_BUILD || '' }}" + PACKAGES: "${{ env.PACKAGES }}" INDEX: 1 NO_DEFAULT_FEEDS: 1 NO_REFRESH_CHECK: 1 NO_SHFMT_CHECK: 1 + - name: upload artifact + if: ${{ always() }} + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.arch }}-${{ matrix.version }} + path: bin/packages/${{ matrix.arch }}/libremesh/ + + publish: + name: publish ${{ github.ref }} + runs-on: ubuntu-latest + if: ${{ always() }} + needs: [generate_matrix, build] + strategy: + fail-fast: false + max-parallel: 1 + matrix: ${{ fromJson(needs.generate_matrix.outputs.matrix_builds) }} + # matrix: + # include: + # - { version: main, arch: x86_64, output_path: 'openwrt_main'} + # - { version: main, arch: arc_archs, output_path: 'openwrt_main'} + steps: + - uses: actions/checkout@v4 + + - uses: actions/download-artifact@v4 + with: + name: "${{ matrix.arch }}-${{ matrix.version }}" + path: artifacts + - name: Set package destination run: | + ls ./artifacts export TAG=$(echo "${{ github.ref }}" | cut -d '/' -f 3- | perl -pe 's/v([0-9])/$1/') echo "$TAG" echo "DEST_DIR=$TAG" >> $GITHUB_ENV - name: Upload packages to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@v4 with: deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} external_repository: libremesh/lime-feed - publish_dir: bin/packages/${{ matrix.arch }}/libremesh/ - destination_dir: arch_packages/${{ env.DEST_DIR }}/${{ matrix.arch }} + publish_dir: ./artifacts/ + destination_dir: arch_packages/${{ env.DEST_DIR }}/${{ matrix.output_path }}/${{ matrix.arch }}/ diff --git a/README.md b/README.md index 29ea7d419..b76cb4410 100644 --- a/README.md +++ b/README.md @@ -56,22 +56,41 @@ Start an ImageBuilder of your choice, for example ath79-generic if your device i ```shell mkdir ./images/ -docker run -it -v $(pwd)/images:/images/ ghcr.io/openwrt/imagebuilder:ath79-generic-v23.05.3 +docker run -it -v $(pwd)/images:/images/ ghcr.io/openwrt/imagebuilder:ath79-generic-v23.05.5 ``` If your device is not part of ath79-generic profiles, you can replace it with another <target>-<subtarget> combination. For knowing which target and subtarget is best suited for your router, check out the page about it in the [OpenWrt's Table of Hardware][OpenWrt-ToH]. Within the container, add the `lime-packages` feeds: +**opkg on openwrt 24.10.x and previous** + ```shell echo "src/gz libremesh https://feed.libremesh.org/master" >> repositories.conf echo "src/gz libremesh_profiles https://feed.libremesh.org/profiles" >> repositories.conf -echo "src/gz libremesh_arch_packages https://feed.libremesh.org/arch_packages/master/mips_24kc" >> repositories.conf echo "untrusted comment: signed by libremesh.org key a71b3c8285abd28b" > keys/a71b3c8285abd28b echo "RWSnGzyChavSiyQ+vLk3x7F0NqcLa4kKyXCdriThMhO78ldHgxGljM/8" >> keys/a71b3c8285abd28b ``` +To use the new `shared-state-async` add this repo: +- replace `openwrt_23.05` with the openwrt branch +- replace `mips_24kc` with the architecture of your device based on target/subtarget + +```shell +echo "src/gz libremesh_arch_packages https://feed.libremesh.org/arch_packages/master/openwrt_23.05/mips_24kc" >> repositories.conf +``` -If your device is not part of ath79-generic replace `mips_24kc` with the architecture of the selected <target>/<subtarget>. +**apk on openwrt main branch** +``` +echo "@libremesh https://feed.libremesh.org/apk/master/packages.adb" >> repositories +echo "@libremesh_profiles https://feed.libremesh.org/apk/profiles/packages.adb" >> repositories +``` +To use the new `shared-state-async` add this repo: +- replace `openwrt_main` with the openwrt branch +- replace `mips_24kc` with the architecture of your device based on target/subtarget + +```shell +echo "@libremesh_arch_packages https://feed.libremesh.org/arch_packages/master/openwrt_main/mips_24kc/packages.adb" >> repositories +``` Ideally add your own `lime-community` files within the container in the folder `./files/etc/config/`. To find possible options consult the @@ -94,14 +113,9 @@ Your images should be available outside of the container in the `./images/` fold Go to . Find your device. Click on the folder symbol right after "Links: ". Alternatively, find your device in [OpenWrt's Table of Hardware][OpenWrt-ToH], find the image download link, remove the filename from the right side of the link and put the result in your browsers address bar. Scroll down and download openwrt-imagebuilder-*. Unpack the file and open a terminal inside the directory. Add the `lime-packages` feed: -```shell -echo "src/gz libremesh https://feed.libremesh.org/master" >> repositories.conf -echo "src/gz libremesh_profiles https://feed.libremesh.org/profiles" >> repositories.conf -echo "src/gz libremesh_arch_packages https://feed.libremesh.org/arch_packages/master/mips_24kc" >> repositories.conf -echo "untrusted comment: signed by libremesh.org key a71b3c8285abd28b" > keys/a71b3c8285abd28b -echo "RWSnGzyChavSiyQ+vLk3x7F0NqcLa4kKyXCdriThMhO78ldHgxGljM/8" >> keys/a71b3c8285abd28b -``` -If your device is not part of ath79-generic replace `mips_24kc` with the architecture of the selected <target>/<subtarget>. +Follow the same steps at With Docker +- **opkg on openwrt 24.10.x and previous** +- **apk on openwrt main branch** Create an image with ```shell diff --git a/packages/lime-system/files/etc/uci-defaults/92_add-lime-repos b/packages/lime-system/files/etc/uci-defaults/92_add-lime-repos index 59a05fc28..1065e8c86 100755 --- a/packages/lime-system/files/etc/uci-defaults/92_add-lime-repos +++ b/packages/lime-system/files/etc/uci-defaults/92_add-lime-repos @@ -5,21 +5,43 @@ exit 0 } -feeds_file="/etc/opkg/limefeeds.conf" +repo=$([ -f /etc/opkg/distfeed.conf ] && echo "opkg" \ + || ([ -f /etc/apk/repositories.d/distfeeds.list ] && echo "apk" ) ) || { + echo "Package manager not found - skipping" + exit 0 + } -[ -f "$feeds_file" ] && { - echo "LibreMesh opkg feeds already defined - skipping" - exit 0 +feeds_file=$([ $repo == 'opkg' ] && echo "/etc/opkg/limefeeds.conf" \ + || ([ $repo == 'apk' ] && echo "/etc/apk/repositories.d/limefeeds.list") ) + +dist_feeds_file=$([ $repo == 'opkg' ] && echo "/etc/opkg/distfeeds.conf" \ + || ([ $repo == 'apk' ] && echo "/etc/apk/repositories.d/distfeeds.list") ) + +$( ([ $repo == 'opkg' ] && [ -f "$feeds_file" ]) \ + || ([ $repo == 'apk' ] && $(grep -q '@libremesh' $feeds_file)) ) && +{ + echo "LibreMesh $repo feeds already defined - skipping" + exit 0; +} + +arch="$(grep OPENWRT_ARCH /etc/os-release | sed 's/OPENWRT_ARCH=\"\(.*\)\"/\1/')" + +openwrt_branch_ref="$(grep -m 1 "openwrt.org/" $dist_feeds_file | sed 's|.*openwrt.org/\(.*\)|\1|' )" +openwrt_branch=$(echo $openwrt_branch_ref | grep -q 'snapshots' && echo 'openwrt_main' ) +$(echo $openwrt_branch_ref | grep -q 'releases') && { + branch_n="$(echo $openwrt_branch_ref | sed 's/releases\///')" + openwrt_branch="openwrt_${branch_n:0:5}" } -arch_packages="$(grep OPENWRT_ARCH /etc/os-release | sed 's/OPENWRT_ARCH=\"\(.*\)\"/\1/')" +main_feed_path=$([ $repo == 'opkg' ] && echo "" \ + || ([ $repo == 'apk' ] && echo "apk/") ) [ "$LIME_CODENAME" == "development" ] && { - packages_url="http://feed.libremesh.org/master"; - arch_packages_url="http://feed.libremesh.org/arch_packages/master/$arch_packages"; + packages_url="http://feed.libremesh.org/${main_feed_path}master"; + arch_packages_url="http://feed.libremesh.org/arch_packages/master/$openwrt_branch/$arch/"; } || { - packages_url="http://feed.libremesh.org/$LIME_RELEASE" - arch_packages_url="http://feed.libremesh.org/arch_packages/$LIME_RELEASE/$arch_packages"; + packages_url="http://feed.libremesh.org/${main_feed_path}$LIME_RELEASE" + arch_packages_url="http://feed.libremesh.org/arch_packages/$LIME_RELEASE/$openwrt_branch/$arch/"; } profiles_url="http://feed.libremesh.org/profiles" @@ -27,9 +49,16 @@ profiles_url="http://feed.libremesh.org/profiles" key_name="a71b3c8285abd28b" key_content="RWSnGzyChavSiyQ+vLk3x7F0NqcLa4kKyXCdriThMhO78ldHgxGljM/8" -echo "Configuring official LibreMesh opkg feeds" +echo "Configuring official LibreMesh $repo feeds" +[ $repo == 'opkg' ] && { echo "src/gz libremesh $packages_url" > "$feeds_file" echo "src/gz libremesh_arch_packages $arch_packages_url" >> "$feeds_file" echo "src/gz profiles $profiles_url" >> "$feeds_file" echo "untrusted comment: signed by libremesh.org key $key_name" > "/etc/opkg/keys/$key_name" echo "$key_content" >> "/etc/opkg/keys/$key_name" +} +[ $repo == 'apk' ] && { +echo "@libremesh $packages_url/packages.adb" >> "$feeds_file" +echo "@libremesh_arch_packages $arch_packages_url/packages.adb" >> "$feeds_file" +echo "@profiles $profiles_url/packages.adb" >> "$feeds_file" +} \ No newline at end of file From f883a08d662a25bf318199d3702c7a79d5f1654f Mon Sep 17 00:00:00 2001 From: a-gave Date: Tue, 19 Nov 2024 07:38:35 +0100 Subject: [PATCH 3/7] fix: libremesh.mk restore original version schema adapted to satisfy also apk --- libremesh.mk | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/libremesh.mk b/libremesh.mk index 53a0448ce..52023c81b 100644 --- a/libremesh.mk +++ b/libremesh.mk @@ -2,13 +2,21 @@ include $(TOPDIR)/rules.mk PKG_NAME?=$(notdir ${CURDIR}) -GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . | sed 's|-|.|g') -GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) - -PKG_SRC_VERSION:=$(GIT_COMMIT_DATE)~$(GIT_COMMIT_TSTAMP) -PKG_VERSION:=$(if $(PKG_VERSION),$(PKG_VERSION),$(PKG_SRC_VERSION)) - -PKG_BUILD_DIR:=$(if $(PKG_BUILD_DIR),$(PKG_BUILD_DIR),$(BUILD_DIR)/$(PKG_NAME)) +# from https://github.com/openwrt/luci/blob/master/luci.mk +# default package version follow this scheme: +# [year].[day_of_year].[seconds_of_day]~[commit_short_hash] eg. 24.322.80622~a403707 +PKG_VERSION?=$(if $(DUMP),x,$(strip $(shell \ + if git log -1 >/dev/null 2>/dev/null; then \ + set -- $$(git log -1 --format="%ct %h" --abbrev=7); \ + secs="$$(($$1 % 86400))"; \ + yday="$$(date --utc --date="@$$1" "+%y.%j")"; \ + printf '%s.%05d~%s' "$$yday" "$$secs" "$$2"; \ + else \ + echo "0"; \ + fi; \ +))) + +PKG_BUILD_DIR?=$(BUILD_DIR)/$(PKG_NAME) include $(INCLUDE_DIR)/package.mk From cf6c5e6eef190097705c91206bdf8ed1fe0737a8 Mon Sep 17 00:00:00 2001 From: a-gave Date: Tue, 19 Nov 2024 07:40:29 +0100 Subject: [PATCH 4/7] fix: 92_add-lime-repos remove unsupported apk @tags and refactor; update README.md --- README.md | 6 +- .../files/etc/uci-defaults/92_add-lime-repos | 61 +++++++++++-------- 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index b76cb4410..fd1e7d8da 100644 --- a/README.md +++ b/README.md @@ -81,15 +81,15 @@ echo "src/gz libremesh_arch_packages https://feed.libremesh.org/arch_packages/ma **apk on openwrt main branch** ``` -echo "@libremesh https://feed.libremesh.org/apk/master/packages.adb" >> repositories -echo "@libremesh_profiles https://feed.libremesh.org/apk/profiles/packages.adb" >> repositories +echo "https://feed.libremesh.org/apk/master/packages.adb" >> repositories +echo "https://feed.libremesh.org/apk/profiles/packages.adb" >> repositories ``` To use the new `shared-state-async` add this repo: - replace `openwrt_main` with the openwrt branch - replace `mips_24kc` with the architecture of your device based on target/subtarget ```shell -echo "@libremesh_arch_packages https://feed.libremesh.org/arch_packages/master/openwrt_main/mips_24kc/packages.adb" >> repositories +echo "https://feed.libremesh.org/arch_packages/master/openwrt_main/mips_24kc/packages.adb" >> repositories ``` Ideally add your own `lime-community` files within the container in the folder diff --git a/packages/lime-system/files/etc/uci-defaults/92_add-lime-repos b/packages/lime-system/files/etc/uci-defaults/92_add-lime-repos index 1065e8c86..1c8245f28 100755 --- a/packages/lime-system/files/etc/uci-defaults/92_add-lime-repos +++ b/packages/lime-system/files/etc/uci-defaults/92_add-lime-repos @@ -5,21 +5,26 @@ exit 0 } -repo=$([ -f /etc/opkg/distfeed.conf ] && echo "opkg" \ - || ([ -f /etc/apk/repositories.d/distfeeds.list ] && echo "apk" ) ) || { - echo "Package manager not found - skipping" - exit 0 - } +[ -f /etc/apk/repositories.d/distfeeds.list ] && { + repo='apk' + feeds_file='/etc/apk/repositories.d/limefeeds.list' + dist_feeds_file='/etc/apk/repositories.d/distfeeds.list' + main_feed_path='apk/' +} || ([ -f /etc/opkg/distfeed.conf ] && { + repo='opkg' + feeds_file='/etc/opkg/limefeeds.conf' + dist_feeds_file='/etc/opkg/distfeeds.conf' + main_feed_path='' + key_name="a71b3c8285abd28b" + key_content="RWSnGzyChavSiyQ+vLk3x7F0NqcLa4kKyXCdriThMhO78ldHgxGljM/8" +}) -feeds_file=$([ $repo == 'opkg' ] && echo "/etc/opkg/limefeeds.conf" \ - || ([ $repo == 'apk' ] && echo "/etc/apk/repositories.d/limefeeds.list") ) - -dist_feeds_file=$([ $repo == 'opkg' ] && echo "/etc/opkg/distfeeds.conf" \ - || ([ $repo == 'apk' ] && echo "/etc/apk/repositories.d/distfeeds.list") ) +[ -z "$repo" ] && { + echo "Package manager not found - skipping" + exit 0 +} -$( ([ $repo == 'opkg' ] && [ -f "$feeds_file" ]) \ - || ([ $repo == 'apk' ] && $(grep -q '@libremesh' $feeds_file)) ) && -{ +[ -f "$feeds_file" ] && { echo "LibreMesh $repo feeds already defined - skipping" exit 0; } @@ -27,14 +32,18 @@ $( ([ $repo == 'opkg' ] && [ -f "$feeds_file" ]) \ arch="$(grep OPENWRT_ARCH /etc/os-release | sed 's/OPENWRT_ARCH=\"\(.*\)\"/\1/')" openwrt_branch_ref="$(grep -m 1 "openwrt.org/" $dist_feeds_file | sed 's|.*openwrt.org/\(.*\)|\1|' )" -openwrt_branch=$(echo $openwrt_branch_ref | grep -q 'snapshots' && echo 'openwrt_main' ) -$(echo $openwrt_branch_ref | grep -q 'releases') && { +echo $openwrt_branch_ref + +if [ '' != "$openwrt_branch_ref" ]; then +$(echo $openwrt_branch_ref | grep -q 'snapshots') && { + openwrt_branch='openwrt_main' +} || ($(echo $openwrt_branch_ref | grep -q 'releases') && { branch_n="$(echo $openwrt_branch_ref | sed 's/releases\///')" openwrt_branch="openwrt_${branch_n:0:5}" -} - -main_feed_path=$([ $repo == 'opkg' ] && echo "" \ - || ([ $repo == 'apk' ] && echo "apk/") ) +}) +else + echo "String not found 'openwrt.org' in default ${repo} feeds, cannot determine openwrt branch" +fi [ "$LIME_CODENAME" == "development" ] && { packages_url="http://feed.libremesh.org/${main_feed_path}master"; @@ -44,10 +53,7 @@ main_feed_path=$([ $repo == 'opkg' ] && echo "" \ arch_packages_url="http://feed.libremesh.org/arch_packages/$LIME_RELEASE/$openwrt_branch/$arch/"; } -profiles_url="http://feed.libremesh.org/profiles" - -key_name="a71b3c8285abd28b" -key_content="RWSnGzyChavSiyQ+vLk3x7F0NqcLa4kKyXCdriThMhO78ldHgxGljM/8" +profiles_url="http://feed.libremesh.org/${main_feed_path}profiles" echo "Configuring official LibreMesh $repo feeds" [ $repo == 'opkg' ] && { @@ -58,7 +64,8 @@ echo "untrusted comment: signed by libremesh.org key $key_name" > "/etc/opkg/key echo "$key_content" >> "/etc/opkg/keys/$key_name" } [ $repo == 'apk' ] && { -echo "@libremesh $packages_url/packages.adb" >> "$feeds_file" -echo "@libremesh_arch_packages $arch_packages_url/packages.adb" >> "$feeds_file" -echo "@profiles $profiles_url/packages.adb" >> "$feeds_file" -} \ No newline at end of file +proto=https +echo "$packages_url/packages.adb" > "$feeds_file" +echo "${arch_packages_url}packages.adb" >> "$feeds_file" +echo "$profiles_url/packages.adb" >> "$feeds_file" +} From 2b84a28c95490b9c6166b243c232d6aec62a9615 Mon Sep 17 00:00:00 2001 From: a-gave Date: Tue, 19 Nov 2024 07:42:40 +0100 Subject: [PATCH 5/7] fix: build.yml do not assume 24.10 will stay with opkg; multi-arch-build: calculate DEST_DIR once --- .github/workflows/build.yml | 11 +++++------ .github/workflows/multi-arch-build.yml | 18 ++++++++---------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4995060ee..661622df8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,10 +15,10 @@ on: workflow_dispatch: jobs: -# Build all packages for x86_64 -# Use openwrt branches 'main' and 'openwrt-24.10' to produce two feeds: -# one for 'apk' and one for the older 'opkg'. -# NOTE: this doesn't sign packages for apk + # Build all packages for x86_64 using the openwrt sdk + # use latest branch of openwrt with opkg to produce feed at https://feed.libremesh.org/master + # use main branch of openwrt with apk to produce feed at https://feed.libremesh.org/apk/master + # NOTE: this doesn't sign packages for apk build: name: Build ${{ matrix.version }} ${{ github.ref }} runs-on: ubuntu-latest @@ -28,7 +28,7 @@ jobs: matrix: include: - { version: main, output_path: 'apk/'} - - { version: openwrt-24.10, output_path: ''} + - { version: openwrt-23.05, output_path: ''} steps: - uses: actions/checkout@v4 @@ -70,4 +70,3 @@ jobs: # AWS_S3_ENDPOINT: ${{ secrets.AWS_S3_ENDPOINT }} # SOURCE_DIR: bin/packages/x86_64/libremesh/ # DEST_DIR: ${{ env.DEST_DIR }} - diff --git a/.github/workflows/multi-arch-build.yml b/.github/workflows/multi-arch-build.yml index 38f9a6f90..a16470241 100644 --- a/.github/workflows/multi-arch-build.yml +++ b/.github/workflows/multi-arch-build.yml @@ -17,7 +17,7 @@ on: # Build packages using the openwrt sdk # for each architecture supported -# in openwrt branchs 'main', 'stable', 'old-stable' +# in openwrt branches 'main', 'stable', 'old-stable' # # NOTE: # This list of branches will be updated manually @@ -36,7 +36,13 @@ jobs: outputs: matrix_builds: ${{ steps.define_matrix.outputs.matrix_builds }} steps: - - name: Define matrix of branchs and archs + - name: Set package destination + run: | + export TAG=$(echo "${{ github.ref }}" | cut -d '/' -f 3- | perl -pe 's/v([0-9])/$1/') + echo "$TAG" + echo "DEST_DIR=$TAG" >> $GITHUB_ENV + + - name: Define matrix of branches and archs id: define_matrix run: | JSON='[' @@ -127,13 +133,6 @@ jobs: name: "${{ matrix.arch }}-${{ matrix.version }}" path: artifacts - - name: Set package destination - run: | - ls ./artifacts - export TAG=$(echo "${{ github.ref }}" | cut -d '/' -f 3- | perl -pe 's/v([0-9])/$1/') - echo "$TAG" - echo "DEST_DIR=$TAG" >> $GITHUB_ENV - - name: Upload packages to GitHub Pages uses: peaceiris/actions-gh-pages@v4 with: @@ -141,4 +140,3 @@ jobs: external_repository: libremesh/lime-feed publish_dir: ./artifacts/ destination_dir: arch_packages/${{ env.DEST_DIR }}/${{ matrix.output_path }}/${{ matrix.arch }}/ - From afe622f2327ea13f12ef242b9bb627b47e249671 Mon Sep 17 00:00:00 2001 From: a-gave Date: Fri, 22 Nov 2024 21:58:43 +0100 Subject: [PATCH 6/7] fix: add-lime-repos: read arch from apk + minors; multi-arch-build: rename openwrt_branch_path --- .github/workflows/multi-arch-build.yml | 16 +++++++------- .../files/etc/uci-defaults/92_add-lime-repos | 22 +++++++++---------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/.github/workflows/multi-arch-build.yml b/.github/workflows/multi-arch-build.yml index a16470241..52cb03ce8 100644 --- a/.github/workflows/multi-arch-build.yml +++ b/.github/workflows/multi-arch-build.yml @@ -58,9 +58,9 @@ jobs: && echo "snapshots/packages" || echo "releases/packages-$version") echo $VERSION_PATH - OUTPUT_PATH=$([ "$version" == "main" ] \ + OPENWRT_BRANCH_PATH=$([ "$version" == "main" ] \ && echo "openwrt_main" || echo "openwrt_$version") - echo $OUTPUT_PATH + echo $OPENWRT_BRANCH_PATH wget -r -nH --no-parent --level 1 --accept html -P. \ --directory-prefix=. https://downloads.openwrt.org/$VERSION_PATH/ @@ -69,7 +69,7 @@ jobs: [[ $FIRST_BUILD -ne 1 ]] && JSON="$JSON"',' FIRST_BUILD=0 - JSON="$JSON"'{"version": "'"$VERSION"'" ,"arch": "'"$arch"'", "output_path": "'"$OUTPUT_PATH"'" }' + JSON="$JSON"'{"version": "'"$VERSION"'" ,"arch": "'"$arch"'", "openwrt_branch_path": "'"$OPENWRT_BRANCH_PATH"'" }' echo $JSON done done @@ -87,8 +87,8 @@ jobs: matrix: ${{ fromJson(needs.generate_matrix.outputs.matrix_builds) }} # matrix: # include: - # - { version: main, arch: x86_64, output_path: 'openwrt_main'} - # - { version: main, arch: arc_archs, output_path: 'openwrt_main'} + # - { version: main, arch: x86_64, openwrt_branch_path: 'openwrt_main'} + # - { version: main, arch: arc_archs, openwrt_branch_path: 'openwrt_main'} steps: - uses: actions/checkout@v4 @@ -123,8 +123,8 @@ jobs: matrix: ${{ fromJson(needs.generate_matrix.outputs.matrix_builds) }} # matrix: # include: - # - { version: main, arch: x86_64, output_path: 'openwrt_main'} - # - { version: main, arch: arc_archs, output_path: 'openwrt_main'} + # - { version: main, arch: x86_64, openwrt_branch_path: 'openwrt_main'} + # - { version: main, arch: arc_archs, openwrt_branch_path: 'openwrt_main'} steps: - uses: actions/checkout@v4 @@ -139,4 +139,4 @@ jobs: deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} external_repository: libremesh/lime-feed publish_dir: ./artifacts/ - destination_dir: arch_packages/${{ env.DEST_DIR }}/${{ matrix.output_path }}/${{ matrix.arch }}/ + destination_dir: arch_packages/${{ env.DEST_DIR }}/${{ matrix.openwrt_branch_path }}/${{ matrix.arch }}/ diff --git a/packages/lime-system/files/etc/uci-defaults/92_add-lime-repos b/packages/lime-system/files/etc/uci-defaults/92_add-lime-repos index 1c8245f28..4433e1acf 100755 --- a/packages/lime-system/files/etc/uci-defaults/92_add-lime-repos +++ b/packages/lime-system/files/etc/uci-defaults/92_add-lime-repos @@ -10,11 +10,13 @@ feeds_file='/etc/apk/repositories.d/limefeeds.list' dist_feeds_file='/etc/apk/repositories.d/distfeeds.list' main_feed_path='apk/' + arch="$(cat /etc/apk/arch)" } || ([ -f /etc/opkg/distfeed.conf ] && { repo='opkg' feeds_file='/etc/opkg/limefeeds.conf' dist_feeds_file='/etc/opkg/distfeeds.conf' main_feed_path='' + arch="$(grep OPENWRT_ARCH /etc/os-release | sed 's/OPENWRT_ARCH=\"\(.*\)\"/\1/')" key_name="a71b3c8285abd28b" key_content="RWSnGzyChavSiyQ+vLk3x7F0NqcLa4kKyXCdriThMhO78ldHgxGljM/8" }) @@ -29,10 +31,7 @@ exit 0; } -arch="$(grep OPENWRT_ARCH /etc/os-release | sed 's/OPENWRT_ARCH=\"\(.*\)\"/\1/')" - openwrt_branch_ref="$(grep -m 1 "openwrt.org/" $dist_feeds_file | sed 's|.*openwrt.org/\(.*\)|\1|' )" -echo $openwrt_branch_ref if [ '' != "$openwrt_branch_ref" ]; then $(echo $openwrt_branch_ref | grep -q 'snapshots') && { @@ -47,25 +46,24 @@ fi [ "$LIME_CODENAME" == "development" ] && { packages_url="http://feed.libremesh.org/${main_feed_path}master"; - arch_packages_url="http://feed.libremesh.org/arch_packages/master/$openwrt_branch/$arch/"; + arch_packages_url="http://feed.libremesh.org/arch_packages/master/$openwrt_branch/$arch"; } || { packages_url="http://feed.libremesh.org/${main_feed_path}$LIME_RELEASE" - arch_packages_url="http://feed.libremesh.org/arch_packages/$LIME_RELEASE/$openwrt_branch/$arch/"; + arch_packages_url="http://feed.libremesh.org/arch_packages/$LIME_RELEASE/$openwrt_branch/$arch"; } profiles_url="http://feed.libremesh.org/${main_feed_path}profiles" echo "Configuring official LibreMesh $repo feeds" +[ $repo == 'apk' ] && { +echo "$packages_url/packages.adb" > "$feeds_file" +echo "${arch_packages_url}/packages.adb" >> "$feeds_file" +echo "$profiles_url/packages.adb" >> "$feeds_file" +} || ( [ $repo == 'opkg' ] && { echo "src/gz libremesh $packages_url" > "$feeds_file" echo "src/gz libremesh_arch_packages $arch_packages_url" >> "$feeds_file" echo "src/gz profiles $profiles_url" >> "$feeds_file" echo "untrusted comment: signed by libremesh.org key $key_name" > "/etc/opkg/keys/$key_name" echo "$key_content" >> "/etc/opkg/keys/$key_name" -} -[ $repo == 'apk' ] && { -proto=https -echo "$packages_url/packages.adb" > "$feeds_file" -echo "${arch_packages_url}packages.adb" >> "$feeds_file" -echo "$profiles_url/packages.adb" >> "$feeds_file" -} +}) From a78341b214f1da5acb61820ae376ebc909ff034f Mon Sep 17 00:00:00 2001 From: a-gave Date: Sat, 7 Dec 2024 20:20:46 +0100 Subject: [PATCH 7/7] fix: avoid uncommon format of openwrt_branch_path replace openwrt_branch_path from 'openwrt_main' to 'openwrt-main' --- .github/workflows/multi-arch-build.yml | 13 +++++++------ .../files/etc/uci-defaults/92_add-lime-repos | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/multi-arch-build.yml b/.github/workflows/multi-arch-build.yml index 52cb03ce8..1e05c8468 100644 --- a/.github/workflows/multi-arch-build.yml +++ b/.github/workflows/multi-arch-build.yml @@ -26,7 +26,8 @@ on: env: BUILD_BRANCHES: "main 24.10 23.05" -# workaround: 'make package/shared-state-async/check' fails with 'Package HASH check failed' +# workaround: build a package that selects '+shared-state-async' +# as 'make package/shared-state-async/check' fails with 'Package HASH check failed' PACKAGES: "shared-state-bat_hosts" jobs: @@ -59,7 +60,7 @@ jobs: echo $VERSION_PATH OPENWRT_BRANCH_PATH=$([ "$version" == "main" ] \ - && echo "openwrt_main" || echo "openwrt_$version") + && echo "openwrt-main" || echo "openwrt-$version") echo $OPENWRT_BRANCH_PATH wget -r -nH --no-parent --level 1 --accept html -P. \ @@ -87,8 +88,8 @@ jobs: matrix: ${{ fromJson(needs.generate_matrix.outputs.matrix_builds) }} # matrix: # include: - # - { version: main, arch: x86_64, openwrt_branch_path: 'openwrt_main'} - # - { version: main, arch: arc_archs, openwrt_branch_path: 'openwrt_main'} + # - { version: main, arch: x86_64, openwrt_branch_path: 'openwrt-main'} + # - { version: main, arch: arc_archs, openwrt_branch_path: 'openwrt-main'} steps: - uses: actions/checkout@v4 @@ -123,8 +124,8 @@ jobs: matrix: ${{ fromJson(needs.generate_matrix.outputs.matrix_builds) }} # matrix: # include: - # - { version: main, arch: x86_64, openwrt_branch_path: 'openwrt_main'} - # - { version: main, arch: arc_archs, openwrt_branch_path: 'openwrt_main'} + # - { version: main, arch: x86_64, openwrt_branch_path: 'openwrt-main'} + # - { version: main, arch: arc_archs, openwrt_branch_path: 'openwrt-main'} steps: - uses: actions/checkout@v4 diff --git a/packages/lime-system/files/etc/uci-defaults/92_add-lime-repos b/packages/lime-system/files/etc/uci-defaults/92_add-lime-repos index 4433e1acf..6b7a49270 100755 --- a/packages/lime-system/files/etc/uci-defaults/92_add-lime-repos +++ b/packages/lime-system/files/etc/uci-defaults/92_add-lime-repos @@ -35,10 +35,10 @@ openwrt_branch_ref="$(grep -m 1 "openwrt.org/" $dist_feeds_file | sed 's|.*openw if [ '' != "$openwrt_branch_ref" ]; then $(echo $openwrt_branch_ref | grep -q 'snapshots') && { - openwrt_branch='openwrt_main' + openwrt_branch='openwrt-main' } || ($(echo $openwrt_branch_ref | grep -q 'releases') && { branch_n="$(echo $openwrt_branch_ref | sed 's/releases\///')" - openwrt_branch="openwrt_${branch_n:0:5}" + openwrt_branch="openwrt-${branch_n:0:5}" }) else echo "String not found 'openwrt.org' in default ${repo} feeds, cannot determine openwrt branch"