Skip to content

Commit

Permalink
Merge PR #188 (use luci.mk build support)
Browse files Browse the repository at this point in the history
  • Loading branch information
SvenRoederer committed Dec 25, 2019
2 parents e0531d4 + 21662a4 commit c212966
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 138 deletions.
7 changes: 2 additions & 5 deletions addons/freifunk-berlin-lib-guard/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=freifunk-berlin-lib-guard
PKG_VERSION:=0.0.4
PKG_RELEASE:=1
PKG_RELEASE:=2

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk
include ../../freifunk-berlin-generic.mk

define Package/freifunk-berlin-lib-guard
SECTION:=freifunk-berlin
Expand Down
6 changes: 1 addition & 5 deletions defaults/freifunk-berlin-dhcp-defaults/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=freifunk-berlin-dhcp-defaults
PKG_VERSION:=0.0.3
PKG_RELEASE:=1

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk
include ../../freifunk-berlin-generic.mk

define Package/freifunk-berlin-dhcp-defaults
SECTION:=freifunk-berlin
Expand Down
6 changes: 1 addition & 5 deletions defaults/freifunk-berlin-firewall-defaults/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=freifunk-berlin-firewall-defaults
PKG_VERSION:=0.0.6
PKG_RELEASE:=1

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk
include ../../freifunk-berlin-generic.mk

define Package/freifunk-berlin-firewall-defaults
SECTION:=freifunk-berlin
Expand Down
6 changes: 1 addition & 5 deletions defaults/freifunk-berlin-freifunk-defaults/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=freifunk-berlin-freifunk-defaults
PKG_VERSION:=0.0.2
PKG_RELEASE:=3

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk
include ../../freifunk-berlin-generic.mk

define Package/freifunk-berlin-freifunk-defaults
SECTION:=freifunk-berlin
Expand Down
6 changes: 1 addition & 5 deletions defaults/freifunk-berlin-network-defaults/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=freifunk-berlin-network-defaults
PKG_VERSION:=0.2.0
PKG_RELEASE:=1

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk
include ../../freifunk-berlin-generic.mk

define Package/freifunk-berlin-network-defaults
SECTION:=freifunk-berlin
Expand Down
6 changes: 1 addition & 5 deletions defaults/freifunk-berlin-olsrd-defaults/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=freifunk-berlin-olsrd-defaults
PKG_VERSION:=0.0.6
PKG_RELEASE:=2

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk
include ../../freifunk-berlin-generic.mk

define Package/freifunk-berlin-olsrd-defaults
SECTION:=freifunk-berlin
Expand Down
6 changes: 1 addition & 5 deletions defaults/freifunk-berlin-openvpn-files/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=freifunk-berlin-openvpn-files
PKG_VERSION:=0.1.1
PKG_RELEASE:=1

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk
include ../../freifunk-berlin-generic.mk

define Package/freifunk-berlin-openvpn-files
SECTION:=freifunk-berlin
Expand Down
6 changes: 1 addition & 5 deletions defaults/freifunk-berlin-statistics-defaults/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=freifunk-berlin-statistics-defaults
PKG_VERSION:=0.0.2
PKG_RELEASE:=1

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk
include ../../freifunk-berlin-generic.mk

define Package/freifunk-berlin-statistics-defaults
SECTION:=freifunk-berlin
Expand Down
6 changes: 1 addition & 5 deletions defaults/freifunk-berlin-system-defaults/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=freifunk-berlin-system-defaults
PKG_VERSION:=0.0.2
PKG_RELEASE:=1

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk
include ../../freifunk-berlin-generic.mk

define Package/freifunk-berlin-system-defaults
SECTION:=freifunk-berlin
Expand Down
6 changes: 1 addition & 5 deletions defaults/freifunk-berlin-uhttpd-defaults/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=freifunk-berlin-uhttpd-defaults
PKG_VERSION:=0.0.1
PKG_RELEASE:=2

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk
include ../../freifunk-berlin-generic.mk

define Package/freifunk-berlin-uhttpd-defaults
SECTION:=freifunk-berlin
Expand Down
35 changes: 35 additions & 0 deletions freifunk-berlin-generic.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#
# This is free software, licensed under the GNU General Public License v3.0 .
#

LUCIMKFILE:=$(wildcard $(TOPDIR)/feeds/*/luci.mk)

# verify that there is only one single file returned
ifneq (1,$(words $(LUCIMKFILE)))
ifeq (0,$(words $(LUCIMKFILE)))
$(error did not find luci.mk in any feed)
else
$(error found multiple luci.mk files in the feeds)
endif
else
#$(info found luci.mk at $(LUCIMKFILE))
endif

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" \
)))

include $(LUCIMKFILE)
55 changes: 6 additions & 49 deletions utils/luci-app-ffwizard-berlin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,12 @@

include $(TOPDIR)/rules.mk

PKG_NAME:=luci-app-ffwizard-berlin
PKG_VERSION:=0.0.16
PKG_RELEASE:=3
LUCI_TITLE:=Freifunk Berlin configuration wizard
LUCI_DEPENDS:=+luci-mod-admin-full +freifunk-policyrouting +luci-lib-jsonc +community-profiles +luci-lib-ipkg
PKG_RELEASE:=4

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
include ../../freifunk-berlin-generic.mk

include $(INCLUDE_DIR)/package.mk
# URL:=http://berlin.freifunk.net

define Package/luci-app-ffwizard-berlin
SECTION:=luci
CATEGORY:=LuCI
SUBMENU:=3. Applications
TITLE:=Freifunk Berlin configuration wizard
URL:=http://berlin.freifunk.net
DEPENDS+= +luci-mod-admin-full +freifunk-policyrouting +luci-lib-jsonc +community-profiles +luci-lib-ipkg
PKGARCH:=all
endef

define Package/luci-app-ffwizard-berlin/description
Freifunk Wizard for Berlin
endef

define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./luasrc $(PKG_BUILD_DIR)/
endef

define Build/Configure
endef

define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR)/luasrc
endef

define Package/luci-app-ffwizard-berlin/install
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/model
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/tools
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/view
$(CP) $(PKG_BUILD_DIR)/luasrc/controller/* $(1)/usr/lib/lua/luci/controller
$(CP) $(PKG_BUILD_DIR)/luasrc/model/* $(1)/usr/lib/lua/luci/model
$(CP) $(PKG_BUILD_DIR)/luasrc/tools/* $(1)/usr/lib/lua/luci/tools
$(CP) $(PKG_BUILD_DIR)/luasrc/view/* $(1)/usr/lib/lua/luci/view
$(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d/
$(CP) ./root/usr/share/rpcd/acl.d/ffwizard-berlin.json $(1)/usr/share/rpcd/acl.d/ffwizard-berlin.json
$(INSTALL_DIR) $(1)/etc
$(CP) ./root/etc/* $(1)/etc
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
$(CP) ./root/usr/libexec/rpcd/* $(1)/usr/libexec/rpcd/
endef

$(eval $(call BuildPackage,luci-app-ffwizard-berlin))
# call BuildPackage - OpenWrt buildroot signature
45 changes: 6 additions & 39 deletions utils/luci-mod-freifunk-ui/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,11 @@

include $(TOPDIR)/rules.mk

PKG_NAME:=luci-mod-freifunk-ui
PKG_VERSION:=0.0.4
PKG_RELEASE:=2
LUCI_TITLE:=Freifunk Public and Admin LuCI UI
LUCI_DEPENDS:=+luci-mod-admin-full +luci-lib-json +community-profiles +luci-lib-ipkg
LUCI_PKGARCH:=all
PKG_RELEASE:=3

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
include ../../freifunk-berlin-generic.mk

include $(INCLUDE_DIR)/package.mk

define Package/luci-mod-freifunk-ui
SECTION:=luci
CATEGORY:=LuCI
SUBMENU:=2. Modules
TITLE:=Freifunk Public and Admin LuCI UI
DEPENDS:=+luci-mod-admin-full +luci-lib-json +community-profiles +luci-lib-ipkg
PKGARCH:=all
endef

define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./luasrc $(PKG_BUILD_DIR)/
endef

define Build/Configure
endef

define Build/Compile
# $(MAKE) -C $(PKG_BUILD_DIR)/luasrc
endef

define Package/luci-mod-freifunk-ui/install
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/model
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/view
$(CP) $(PKG_BUILD_DIR)/luasrc/controller/* $(1)/usr/lib/lua/luci/controller
$(CP) $(PKG_BUILD_DIR)/luasrc/model/* $(1)/usr/lib/lua/luci/model
$(CP) $(PKG_BUILD_DIR)/luasrc/view/* $(1)/usr/lib/lua/luci/view
$(INSTALL_DIR) $(1)/www
$(CP) ./htdocs/* $(1)/www
endef

$(eval $(call BuildPackage,luci-mod-freifunk-ui))
# call BuildPackage - OpenWrt buildroot signature

0 comments on commit c212966

Please sign in to comment.