From 603296e468ae5c906fd574e164fcdc5343fcecfb Mon Sep 17 00:00:00 2001 From: Seamus Tuohy Date: Tue, 13 Aug 2013 17:30:03 -0400 Subject: [PATCH 1/8] added commotion-luci-i18n module --- packages/commotion-luci-i18n/Makefile | 50 +++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 packages/commotion-luci-i18n/Makefile diff --git a/packages/commotion-luci-i18n/Makefile b/packages/commotion-luci-i18n/Makefile new file mode 100644 index 0000000..fa9d627 --- /dev/null +++ b/packages/commotion-luci-i18n/Makefile @@ -0,0 +1,50 @@ +# Copyright (C) 2010 Commotion +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +include $(TOPDIR)/rules.mk + +PKG_NAME:=commotion-luci-i18n +PKG_VERSION:=Feature_582 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=git://github.com/opentechinstitute/commotion-luci-i18n.git: +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_VERSION) + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/commotion-luci-i18n + SECTION:=commotion + CATEGORY:=Commotion + TITLE:=Commotion LuCI Translation + DEPENDS:=+luci-commotion +luci-theme-commotion + URL:=https://commotionwireless.net + MENU:=1 +endef + +define Build/Compile +endef + +define Package/commotion-luci-i18n/config + source "$(SOURCE)/Config.in" +endef + +define Package/commotion-debug-helper/description + Commotion tranlation installation manager. +endef + +define Package/commotion-debug-helper/install + for LANG in SPANISH FRENCH do + ifeq ($(CONFIG_COMMOTION_LUCI_I18N_$$LANG),y) + lang=`echo ${LANG:0:2} | tr [:upper:] [:lower:]` + $(CP) $(PKG_BUILD_DIR)/lang/commotion-$$lang.lmo $(1)/usr/lib/lua/luci/i18n/ || true + endif + done +endef + +$(eval $(call BuildPackage,commotion-luci-i18n)) From 64a4eef34f8da93097b2a91d7805a6ffff63a378 Mon Sep 17 00:00:00 2001 From: Seamus Tuohy Date: Tue, 13 Aug 2013 18:17:53 -0400 Subject: [PATCH 2/8] added menu config files to commotion i18n file so they will actually show up --- packages/commotion-luci-i18n/Config.in | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 packages/commotion-luci-i18n/Config.in diff --git a/packages/commotion-luci-i18n/Config.in b/packages/commotion-luci-i18n/Config.in new file mode 100644 index 0000000..7df186d --- /dev/null +++ b/packages/commotion-luci-i18n/Config.in @@ -0,0 +1,13 @@ +if PACKAGE_commotion-luci-i18n + +menu "Commotion i18n Languages" + +config COMMOTION_LUCI_I18N_SPANISH + bool "Enable Spanish language set" + default n + select PACKAGE_luci-i18n-spanish + help + Enable spanish language set on Commotion LuCI pages +endchoice + +endif From f9d5232af5ed6493e526a6c41f4f0926193b5374 Mon Sep 17 00:00:00 2001 From: Seamus Tuohy Date: Tue, 13 Aug 2013 18:27:43 -0400 Subject: [PATCH 3/8] added french menu item and made all language menu items add the commotion language package. (circular dep...) --- packages/commotion-luci-i18n/Config.in | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/commotion-luci-i18n/Config.in b/packages/commotion-luci-i18n/Config.in index 7df186d..9b753ce 100644 --- a/packages/commotion-luci-i18n/Config.in +++ b/packages/commotion-luci-i18n/Config.in @@ -1,13 +1,19 @@ if PACKAGE_commotion-luci-i18n -menu "Commotion i18n Languages" - config COMMOTION_LUCI_I18N_SPANISH bool "Enable Spanish language set" default n select PACKAGE_luci-i18n-spanish + select PACKAGE_commotion-luci-i18n help Enable spanish language set on Commotion LuCI pages -endchoice + +config COMMOTION_LUCI_I18N_FRENCH + bool "Enable French language set" + default n + select PACKAGE_luci-i18n-french + select PACKAGE_commotion-luci-i18n + help + Enable french language set on Commotion LuCI pages endif From 56f0ab570f71e67400dd8f0fc40bf2088e9990da Mon Sep 17 00:00:00 2001 From: Seamus Tuohy Date: Wed, 14 Aug 2013 16:21:02 -0400 Subject: [PATCH 4/8] updated to current version of test --- packages/commotion-luci-i18n/#Makefile# | 51 +++++++++++++++++++++++++ packages/commotion-luci-i18n/Config.in | 8 ---- packages/commotion-luci-i18n/Makefile | 1 + 3 files changed, 52 insertions(+), 8 deletions(-) create mode 100644 packages/commotion-luci-i18n/#Makefile# diff --git a/packages/commotion-luci-i18n/#Makefile# b/packages/commotion-luci-i18n/#Makefile# new file mode 100644 index 0000000..0d665bf --- /dev/null +++ b/packages/commotion-luci-i18n/#Makefile# @@ -0,0 +1,51 @@ +# Copyright (C) 2010 Commotion +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +include $(TOPDIR)/rules.mk + +PKG_NAME:=commotion-luci-i18n +PKG_VERSION:=Feature_582 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=git://github.com/opentechinstitute/commotion-luci-i18n.git: +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_VERSION) + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/commotion-luci-i18n + SECTION:=commotion + CATEGORY:=Commotion + TITLE:=Commotion LuCI Translation + DEPENDS:=+luci-commotion +luci-theme-commotion + URL:=https://commotionwireless.net + MENU:=1 +endef + +define Build/Compile +endef + +define Package/commotion-luci-i18n/config + source "$(SOURCE)/Config.in" +endef + +define Package/commotion-debug-helper/description + Commotion tranlation installation manager. +endef + +define Package/commotion-debug-helper/install + for LANG in SPANISH FRENCH do + ifeq ($(CONFIG_COMMOTION_LUCI_I18N_$$LANG),y) + lang=`echo ${LANG:0:2} | tr [:upper:] [:lower:]` + $(CP) $(PKG_BUILD_DIR)/lang/commotion.$$lang.lmo $(1)/usr/lib/lua/luci/i18n/ + endif + done + $(CP) $(PKG_BUILD_DIR)/lang/test.lmo $(1)/usr/lib/lua/luci/i18n/ +endef + +$(eval $(call BuildPackage,commotion-luci-i18n)) diff --git a/packages/commotion-luci-i18n/Config.in b/packages/commotion-luci-i18n/Config.in index 9b753ce..9ab1aa4 100644 --- a/packages/commotion-luci-i18n/Config.in +++ b/packages/commotion-luci-i18n/Config.in @@ -1,13 +1,5 @@ if PACKAGE_commotion-luci-i18n -config COMMOTION_LUCI_I18N_SPANISH - bool "Enable Spanish language set" - default n - select PACKAGE_luci-i18n-spanish - select PACKAGE_commotion-luci-i18n - help - Enable spanish language set on Commotion LuCI pages - config COMMOTION_LUCI_I18N_FRENCH bool "Enable French language set" default n diff --git a/packages/commotion-luci-i18n/Makefile b/packages/commotion-luci-i18n/Makefile index fa9d627..d9e6cf3 100644 --- a/packages/commotion-luci-i18n/Makefile +++ b/packages/commotion-luci-i18n/Makefile @@ -45,6 +45,7 @@ define Package/commotion-debug-helper/install $(CP) $(PKG_BUILD_DIR)/lang/commotion-$$lang.lmo $(1)/usr/lib/lua/luci/i18n/ || true endif done + $(CP) $(PKG_BUILD_DIR)/lang/test.lmo $(1)/usr/lib/lua/luci/i18n/ || true endef $(eval $(call BuildPackage,commotion-luci-i18n)) From 9e99b4b217d79c48d323d5aebceb1e4eb172e635 Mon Sep 17 00:00:00 2001 From: Seamus Tuohy Date: Wed, 21 Aug 2013 15:01:03 -0400 Subject: [PATCH 5/8] PARTIALLY working makefile. Has system requirements to be added in momentarily. --- packages/commotion-luci-i18n/#Makefile# | 51 ------------------------- packages/commotion-luci-i18n/Config.in | 2 +- packages/commotion-luci-i18n/Makefile | 36 +++++++++++------ 3 files changed, 26 insertions(+), 63 deletions(-) delete mode 100644 packages/commotion-luci-i18n/#Makefile# diff --git a/packages/commotion-luci-i18n/#Makefile# b/packages/commotion-luci-i18n/#Makefile# deleted file mode 100644 index 0d665bf..0000000 --- a/packages/commotion-luci-i18n/#Makefile# +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright (C) 2010 Commotion -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -include $(TOPDIR)/rules.mk - -PKG_NAME:=commotion-luci-i18n -PKG_VERSION:=Feature_582 -PKG_RELEASE:=1 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=git://github.com/opentechinstitute/commotion-luci-i18n.git: -PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=$(PKG_VERSION) - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) - -include $(INCLUDE_DIR)/package.mk - -define Package/commotion-luci-i18n - SECTION:=commotion - CATEGORY:=Commotion - TITLE:=Commotion LuCI Translation - DEPENDS:=+luci-commotion +luci-theme-commotion - URL:=https://commotionwireless.net - MENU:=1 -endef - -define Build/Compile -endef - -define Package/commotion-luci-i18n/config - source "$(SOURCE)/Config.in" -endef - -define Package/commotion-debug-helper/description - Commotion tranlation installation manager. -endef - -define Package/commotion-debug-helper/install - for LANG in SPANISH FRENCH do - ifeq ($(CONFIG_COMMOTION_LUCI_I18N_$$LANG),y) - lang=`echo ${LANG:0:2} | tr [:upper:] [:lower:]` - $(CP) $(PKG_BUILD_DIR)/lang/commotion.$$lang.lmo $(1)/usr/lib/lua/luci/i18n/ - endif - done - $(CP) $(PKG_BUILD_DIR)/lang/test.lmo $(1)/usr/lib/lua/luci/i18n/ -endef - -$(eval $(call BuildPackage,commotion-luci-i18n)) diff --git a/packages/commotion-luci-i18n/Config.in b/packages/commotion-luci-i18n/Config.in index 9ab1aa4..9912c85 100644 --- a/packages/commotion-luci-i18n/Config.in +++ b/packages/commotion-luci-i18n/Config.in @@ -1,6 +1,6 @@ if PACKAGE_commotion-luci-i18n -config COMMOTION_LUCI_I18N_FRENCH +config commotion-luci-i18n-french bool "Enable French language set" default n select PACKAGE_luci-i18n-french diff --git a/packages/commotion-luci-i18n/Makefile b/packages/commotion-luci-i18n/Makefile index d9e6cf3..ba0ec2e 100644 --- a/packages/commotion-luci-i18n/Makefile +++ b/packages/commotion-luci-i18n/Makefile @@ -5,17 +5,20 @@ include $(TOPDIR)/rules.mk PKG_NAME:=commotion-luci-i18n -PKG_VERSION:=Feature_582 +PKG_VERSION:=0.2 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=git://github.com/opentechinstitute/commotion-luci-i18n.git: +PKG_SOURCE_URL:=git://github.com/opentechinstitute/commotion-luci-i18n.git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_VERSION:=$(PKG_VERSION) PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +SVN = svn +MAKE = make + include $(INCLUDE_DIR)/package.mk define Package/commotion-luci-i18n @@ -34,18 +37,29 @@ define Package/commotion-luci-i18n/config source "$(SOURCE)/Config.in" endef -define Package/commotion-debug-helper/description +define Package/commotion-luci-i18n/description Commotion tranlation installation manager. endef -define Package/commotion-debug-helper/install - for LANG in SPANISH FRENCH do - ifeq ($(CONFIG_COMMOTION_LUCI_I18N_$$LANG),y) - lang=`echo ${LANG:0:2} | tr [:upper:] [:lower:]` - $(CP) $(PKG_BUILD_DIR)/lang/commotion-$$lang.lmo $(1)/usr/lib/lua/luci/i18n/ || true - endif - done - $(CP) $(PKG_BUILD_DIR)/lang/test.lmo $(1)/usr/lib/lua/luci/i18n/ || true +languages := french spanish + + +define Package/commotion-luci-i18n/install + $(LS) $(PKG_BUILD_DIR)/translations/ + $(SVN) co http://svn.luci.subsignal.org/luci/branches/luci-0.9/libs/lmo $(PKG_BUILD_DIR)/po2lmo/. + $(MAKE) -C $(PKG_BUILD_DIR)/po2lmo/ + #!/bin/bash + IFS=' '; \ + for i in $(foreach lang, $(languages), $(lang):$(CONFIG_commotion-luci-i18n-$(lang))); do \ + lang=`echo $$$$i |sed s/:.*//`; \ + lg=`echo $$$$lang |cut -c1-2`;\ + bool=`echo $$$$i |sed s/^.*://`; \ + if [ "$$$$bool" = "y" ]; then \ + $(PKG_BUILD_DIR)/po2lmo/src/po2lmo $(PKG_BUILD_DIR)/translations/commotion-luci-$$$$lg.po $(PKG_BUILD_DIR)/lang/commotion-luci-$$$$lg.lmo; \ + fi ; \ + done; + + $(CP) $(PKG_BUILD_DIR)/lang/* $(1)/usr/lib/lua/luci/i18n/ || true endef $(eval $(call BuildPackage,commotion-luci-i18n)) From 170b16dac68a1a90cbbe98596512a74a1b2c1906 Mon Sep 17 00:00:00 2001 From: Seamus Tuohy Date: Thu, 22 Aug 2013 15:17:19 -0400 Subject: [PATCH 6/8] finished makefile --- packages/commotion-luci-i18n/Makefile | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/packages/commotion-luci-i18n/Makefile b/packages/commotion-luci-i18n/Makefile index ba0ec2e..6ee9963 100644 --- a/packages/commotion-luci-i18n/Makefile +++ b/packages/commotion-luci-i18n/Makefile @@ -18,6 +18,8 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) SVN = svn MAKE = make +MAKE_po2lmo = $(MAKE) -C $(PKG_BUILD_DIR)/po2lmo/ +MKDIR = mkdir include $(INCLUDE_DIR)/package.mk @@ -43,11 +45,21 @@ endef languages := french spanish +define Package/preinst +#!/bin/bash +#wget -P $(PKG_BUILD_DIR) #http://ftp.de.debian.org/debian/pool/main/l/lua5.1/lua5.1_5.1.5-4.debian.tar.gz +endef -define Package/commotion-luci-i18n/install - $(LS) $(PKG_BUILD_DIR)/translations/ + +ifdef ERROR_DEP +$(error Missing Lua Dev package. This is a build dependency. Please install liblua5.1-dev)) +endif + +define Build/Prepare + $(call Build/Prepare/Default,) $(SVN) co http://svn.luci.subsignal.org/luci/branches/luci-0.9/libs/lmo $(PKG_BUILD_DIR)/po2lmo/. - $(MAKE) -C $(PKG_BUILD_DIR)/po2lmo/ + $(MKDIR) $(PKG_BUILD_DIR)/lang + $(MAKE_po2lmo) || ("Missing Lua Dev package. This is a build dependency. Please install liblua5.1-dev" && false) #!/bin/bash IFS=' '; \ for i in $(foreach lang, $(languages), $(lang):$(CONFIG_commotion-luci-i18n-$(lang))); do \ @@ -58,7 +70,9 @@ define Package/commotion-luci-i18n/install $(PKG_BUILD_DIR)/po2lmo/src/po2lmo $(PKG_BUILD_DIR)/translations/commotion-luci-$$$$lg.po $(PKG_BUILD_DIR)/lang/commotion-luci-$$$$lg.lmo; \ fi ; \ done; +endef +define Package/commotion-luci-i18n/install $(CP) $(PKG_BUILD_DIR)/lang/* $(1)/usr/lib/lua/luci/i18n/ || true endef From 551c8edf9ef11ea4cb980da1cf27da28d8442d8c Mon Sep 17 00:00:00 2001 From: Seamus Tuohy Date: Thu, 22 Aug 2013 15:20:32 -0400 Subject: [PATCH 7/8] added a todo --- packages/commotion-luci-i18n/Makefile | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/commotion-luci-i18n/Makefile b/packages/commotion-luci-i18n/Makefile index 6ee9963..70ebb43 100644 --- a/packages/commotion-luci-i18n/Makefile +++ b/packages/commotion-luci-i18n/Makefile @@ -43,14 +43,9 @@ define Package/commotion-luci-i18n/description Commotion tranlation installation manager. endef +#TODO add the language code for future compatability with standard country codes germany:de then modify parsing in build/prepare languages := french spanish -define Package/preinst -#!/bin/bash -#wget -P $(PKG_BUILD_DIR) #http://ftp.de.debian.org/debian/pool/main/l/lua5.1/lua5.1_5.1.5-4.debian.tar.gz -endef - - ifdef ERROR_DEP $(error Missing Lua Dev package. This is a build dependency. Please install liblua5.1-dev)) endif From 93b7895b2f16792eb41a5cc1c2ee08b07a4567ca Mon Sep 17 00:00:00 2001 From: Seamus Tuohy Date: Thu, 22 Aug 2013 18:22:12 -0400 Subject: [PATCH 8/8] last bits of twiddling --- packages/commotion-luci-i18n/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/commotion-luci-i18n/Makefile b/packages/commotion-luci-i18n/Makefile index 70ebb43..3603b4e 100644 --- a/packages/commotion-luci-i18n/Makefile +++ b/packages/commotion-luci-i18n/Makefile @@ -52,7 +52,7 @@ endif define Build/Prepare $(call Build/Prepare/Default,) - $(SVN) co http://svn.luci.subsignal.org/luci/branches/luci-0.9/libs/lmo $(PKG_BUILD_DIR)/po2lmo/. + $(SVN) co http://svn.luci.subsignal.org/luci/trunk/libs/web/ $(PKG_BUILD_DIR)/po2lmo/. $(MKDIR) $(PKG_BUILD_DIR)/lang $(MAKE_po2lmo) || ("Missing Lua Dev package. This is a build dependency. Please install liblua5.1-dev" && false) #!/bin/bash @@ -62,12 +62,13 @@ define Build/Prepare lg=`echo $$$$lang |cut -c1-2`;\ bool=`echo $$$$i |sed s/^.*://`; \ if [ "$$$$bool" = "y" ]; then \ - $(PKG_BUILD_DIR)/po2lmo/src/po2lmo $(PKG_BUILD_DIR)/translations/commotion-luci-$$$$lg.po $(PKG_BUILD_DIR)/lang/commotion-luci-$$$$lg.lmo; \ + $(PKG_BUILD_DIR)/po2lmo/src/po2lmo $(PKG_BUILD_DIR)/translations/commotion-luci-$$$$lg.po $(PKG_BUILD_DIR)/lang/commotion-luci.$$$$lg.lmo; \ fi ; \ done; endef define Package/commotion-luci-i18n/install + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n/ $(CP) $(PKG_BUILD_DIR)/lang/* $(1)/usr/lib/lua/luci/i18n/ || true endef