Commit Graph

80 Commits

Author SHA1 Message Date
Florian Eckert
b1968d9cdd
Merge pull request #7115 from TDT-AG/pr/20240510-luci-base
luci-base: add PKG_LICENSE_FILES references to this packages
2024-12-02 08:35:39 +01:00
Hannu Nyman
384790944d luci.mk: Add apk compatibility to PKG_RELEASE handling
Most LuCI packages have automatic versioning, but some
use manual versioning, and compatibility with apk requires
'r' to be added into PKG_RELEASE in style of 1.2.7-r17

Modify luci.mk to behave similarly as the the generic
packages Makefile. Add 'r' prefix to PKG_RELEASE.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2024-11-09 21:13:50 +02:00
Florian Eckert
f17fa682d1 luci-base: Extending packages prepare handling
With this change, packages that do not have the source files in the
generic location (luasrc,ucode,htdocs,root,src) can still copy there
build files into the build directory if they add the following make
target 'Build/Prepare/<luci-packages-name>' to the Makefile.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2024-05-10 10:24:56 +02:00
Hannu Nyman
fb776a6645 luci.mk: remove unnecessary i18n postinst script
OpenWrt master has since 2016 run the uci-defaults also in run-time installations
as postinst:
openwrt/openwrt@9b9c78e

Remove the older separate implementation from LuCI.

Fixes #7070 and #7073

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2024-04-20 12:19:26 +03:00
Hannu Nyman
10be7a3438
Merge pull request #7042 from stangri/master-luci.mk
luci.mk: include release in version number
2024-04-13 10:58:20 +03:00
Stan Grishin
a9664a78b2 luci.mk: include release in version number
Fixes issue mentioned in https://github.com/openwrt/luci/pull/7009#issuecomment-2035504461
where the IPK filename doesn't contain release from the luci-app Makefile.

Signed-off-by: Stan Grishin <stangri@melmac.ca>
2024-04-08 17:52:55 +00:00
Paul Spooren
110bb46831 luci.mk: more APK version compatibility changes
The initial commit did not take care of corner cases which could happen
if building under build conditions other than using Git.

There are three cases for the `findrev` function:

- git -> 24.079.58964~7943616 (remove prefixed `git-`)

APK can't handle `git-` as prefix, it could be `0_git<integer>` but this
seems rather confusing.

- date -> 0.240326.34906 ( add leading 0)

Add a leading zero so the version is always lower compared to using
Git. This makes it easier to distinguish from a Git based version.

- unknown -> 0 (instead of `unknown`)

APK can't handle `unknown` so set it to a simple zero instead.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2024-04-07 13:17:01 +02:00
Paul Spooren
82fb0d7b0d luci.mk: make APK version compliant
APK expects hashes to be prefixed with a ~

Signed-off-by: Paul Spooren <mail@aparcar.org>
2024-03-21 14:56:42 +01:00
Paul Donald
b98d8c526e build: update build/i18n-* tools
modify i18n-add-language.sh so it can:
- be run from any path
- bootstrap any (or all) po folder(s) with existing language(s)
- (partially) update luci.mk with new languages

deprecate build/i18n-init.sh

Signed-off-by: Paul Donald <newtwen@gmail.com>
2024-01-03 13:14:06 +00:00
Jo-Philipp Wich
66ddb2f747 build: enable packaging of Lithuanian translations
Ref: https://github.com/openwrt/luci/issues/3183#issuecomment-1652824925
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2023-07-27 10:35:31 +02:00
Jo-Philipp Wich
639e7faa1a luci.mk: fix compatibility with GNU Make 4.2
GNU Make version 4.2 chokes on `#` characters embedded in variable
substitutions, leading to the following error:

    ../../luci.mk:114: *** unterminated call to function 'if': missing ')'.  Stop.

Avoid this problem by replacing variable substitutions with Git branch
format arguments.

Ref: https://github.com/openwrt/luci/pull/5976#issuecomment-1289935106
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-10-25 12:20:22 +02:00
Jo-Philipp Wich
b15d768c9a luci.mk: automatically depend on luci-lua-runtime
Make packages having a non-empty luasrc/ directory automatically depend
on the LuCI Lua runtime package.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-10-25 01:03:37 +02:00
Jo-Philipp Wich
e0650da41e luci.mk: add basic support for ucode sources
Add special handling for ucode/ package subdirs, analogeous to luasrc/.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-10-25 01:03:37 +02:00
Jo-Philipp Wich
2e93fa669b luci.mk: adjust path of purged index cache files
The index cache files have been split into separate, dynamically named
Lua and JSON files a while ago, so adjust the remove command in the
postinstall script accordingly.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-10-25 01:03:37 +02:00
Jo-Philipp Wich
22bc7ca5a4 luci.mk: typo and indentation fixes
- Fix misspelled comment
 - Fix wrong variable in Lua SrcDiet condition
 - Fix wrong indentation

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-10-25 01:03:37 +02:00
Jo-Philipp Wich
447e362f0b luci.mk: rework logic to determine current branch
In case `git branch --remote` yields no result, fall back to `git branch`
without `--remote` since it is possible that the local branch has not
been pushed yet.

Also simplify extraction of the branch name by not passing `--verbose`
and utilizing variable substitutions instead of sed expressions.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-10-25 01:03:36 +02:00
Jo-Philipp Wich
3393e15815 luci.mk: refactor install recipe
Detect the presence of directories using Make $(wildcard ...) and emit
plain install commands depending on the outcome instead of relying on
shell conditionals which impose syntax constraints on code outside of
the scope of the LuCI repo.

Fixes: #5936
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-09-30 09:58:31 +02:00
Jo-Philipp Wich
94a1821c3b luci.mk: disable english translation packages
Since english is the implementation language of LuCI, it makes no sense to
ship translation packages for it.

Ref: #5860
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-07-22 16:21:23 +02:00
Jo-Philipp Wich
5650e163d1 luci.mk: ignore language directories not explicitly mentioned
Only create translation packages for languages mentioned in luci.mk

Fixes: #5886
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-07-22 16:21:23 +02:00
Jo-Philipp Wich
3646b0cd1f build: introduce official way to opt out of source minification
Introduce three new default enabled variables `LUCI_MINIFY_JS`,
`LUCI_MINIFY_LUA` and `LUCI_MINIFY_CSS`  that allow LuCI component
Makefiles to opt out of JavaScript, Lua and CSS compression respectively.

To e.g. inhibit CSSTidy postprocessing in a theme, the corresponding
Makefile can set `LUCI_MINIFY_CSS:=0` prior to including `luci.mk`.

Fixes: #5755
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-04-06 11:42:15 +02:00
Hannu Nyman
887d8a8fd0 translation: add Danish to luci.mk
Define Dansk/Danish language in luci.mk.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2021-11-07 22:28:08 +02:00
Sven Roederer
70631277db
luci.mk: don't run uci-defaults scripts ourself
Do not run the uci-defaults scripts of a package in the package-postinst, but leave this
for the default_postinst() of the OpenWrt base-files package.

Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
2021-06-04 23:04:37 +02:00
Sven Roederer
2b11ec6fd0 luci.mk: make SUBMENU package define customizable and optional
When including luci.mk in external repos it's sometimes usefull to not use
the default LuCI-submenu hierarchy.
This change defines the LUCI_SUBMENU_FORCED variable which completely overrides
the default submenu of the LuCI config-section. When LUCI_SUBMENU_FORCED is not
defined, the default submenu derrived from LUCI_TYPE or "Application" fallback
is used.
Defining LUCI_SUBMENU_FORCED in the package Makefile will just use this value.
Setting it to "none" will not define a submenu at all.
Together with LUCI_SECTION and LUCI_CATEGORY menu items can now created at any
place in the menu structure.

Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
2021-06-02 07:07:22 -10:00
Sven Roederer
209141d491 luci.mk: add PKG_PROVIDES make-macro to set package/provides option
Add PKG_PROVIDES macro to be passed down to buildpackage defines as  PROVIDES variable.

Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
2021-06-02 07:07:22 -10:00
Sven Roederer
ae0795deb0 luci.mk: add URL and MAINTAINER fields to package-definitions
Add the LUCI_URL and LUCI_MAINTAINER variables to pass them to the buildpackage
defines. Give them some sane defaults and allow overwritting by the individual
package.

Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
2021-06-02 07:07:22 -10:00
Hauke Mehrtens
c80fcd2375 build: luci.mk: Fix warning in Kconfig for Dutch language
When the Dutch translation was added there was no name for the language
added, this created such a Kconfig entry:

     config LUCI_LANG_nl
	   tristate " (nl)"

This entry created the following warning message when doing make
oldconfig in OpenWrt:
tmp/.config-package.in:24525:warning: leading whitespace ignored

This is fixed here by adding a name to the language.

Fixes: 1e301ca2df ("Translated using Weblate (Dutch)")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-10-25 13:57:51 +02:00
Jo-Philipp Wich
de2c0451f3 build: luci.mk: allow overriding menu category and section values
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-07-20 18:46:02 +02:00
Sven Roederer
3b2a1e9e11 luci.mk: reorder to have common-things in a block
The luci.mk file has grown over the years and became more complex. This
change reorders some sections to make it more easy to read and understand
on the first view.

* move all constants into a common block
* put all standard package definitons together
* put the specific sections for the "luci-base" behind the common things
* have the defines for the translations at the very end

Signed-off-by: Sven Roederer <freifunk@it-solutions.geroedel.de>
2020-07-19 19:49:16 +02:00
Paul Spooren
a777cc796f translation: add Arabic to luci.mk
Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-05-21 08:21:00 -10:00
Hannu Nyman
4d8647500f i18n: add Finnish to supported languages
There is some translation effort ongoing in weblate,
so add also Finnish to the list of supported languages.

Katsotaan riittääkö innostuneita kääntäjiä...

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2020-05-15 22:01:44 +03:00
Paul Spooren
72942a9cca translation: add Bengali to luci.mk
This includes `bn_BD` and `bn` via an alias.

Weblate currently does not support `bn_IN` (Indian Bangla), so I think
the alias is reasonable.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-04-29 14:32:09 -10:00
Jo-Philipp Wich
62be45c466 build: luci.mk: fix compatibility with older Git versions
Fixes: 9d8e99f9b build: gracefully handle non-Git source trees
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-15 12:44:57 +02:00
Jo-Philipp Wich
0705657747 build: luci.mk: gracefully handle missing or unversioned po subdirectories
Fixes: #3911
Fixes: 9d8e99f9b build: gracefully handle non-Git source trees
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-14 18:42:59 +02:00
Jo-Philipp Wich
b9dda90716 Revert "build: luci.mk: gracefully handle missing or unversioned po subdirectories"
This reverts commit e6f77d5d72.
Commit contained unrelated changes.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-14 18:42:36 +02:00
Jo-Philipp Wich
e6f77d5d72 build: luci.mk: gracefully handle missing or unversioned po subdirectories
Fixes: #3911
Fixes: 9d8e99f9b build: gracefully handle non-Git source trees
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-14 18:29:13 +02:00
Jo-Philipp Wich
9d8e99f9be build: gracefully handle non-Git source trees
Fixes: #3911
Fixes: 59fe4086f ("build: luci.mk: drop support for non-Git SCMs")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-14 17:43:08 +02:00
Jo-Philipp Wich
0fa1bce8cf build: luci.mk: honour PKG_VERSION if set
Also pass correct variable to builds to ensure that version.lua and cache
buster strings are properly interpolated.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-11 21:26:16 +02:00
DENG Qingfang
b7ac596937 luci.mk: correct titles of zh_Hans and zh_Hant
zh_Hans: 简体中文 (Chinese Simplified)
zh_Hant: 繁體中文 (Chinese Traditional)

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
2020-04-11 08:02:32 +08:00
Jo-Philipp Wich
372c54ec6f build: luci.mk: rework package version handling
- Derive the version of packages from the last change of the sources
 - Derive the version of i18n packages from the last change of the po dir

Fixes: #2257
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-09 23:23:33 +02:00
Jo-Philipp Wich
59fe4086f3 build: luci.mk: drop support for non-Git SCMs
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-09 23:23:33 +02:00
Jo-Philipp Wich
ca558f4f93 build: reload rpcd in package postinstall
Send a SIGHUP to rpcd after installing LuCI packages to reload ACL rules.

Also remove redundant code while we're at it.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-03-03 15:21:55 +01:00
Florian Eckert
b448008b47 luci.mk: Only install a default post-install script if there is none defined
If a postinst script is defined in the package Makefile, it will
not be included because it will be replaced by the default postinst
script. To solve the problem, we now check, if we have a postinst script.
And if so, it will be installed instead of the default postinst script.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-02-27 15:50:46 +01:00
Wellington Uemura
151787b561 luci.mk: correcting a misspell for Brazilian Portuguese
Reported-by: Wellington Uemura

* update message header
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-02-27 15:00:29 +01:00
Florian Eckert
b9292a6f57 luci.mk: move /tmp/luci-modulecache remove to package postinst script
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-02-14 09:20:48 +01:00
Florian Eckert
1f8a3c0417 luci.mk: move /tmp/luci-indexcache remove to package postinst script
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-02-14 09:20:33 +01:00
Jo-Philipp Wich
48749ca873 treewide: switch to bcp47 language codes
Fixes: #3477
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-01-29 13:37:46 +01:00
Florian Eckert
359379078e
Merge pull request #3400 from TDT-AG/pr/20191210-luci-mk
luci.mk: move indexcache delete into postinst
2019-12-29 14:37:40 +01:00
Jo-Philipp Wich
04bb544937
Merge pull request #3352 from NeoRaider/move-luasrcdiet
luci-base: use luasrcdiet from separate package
2019-12-25 18:04:28 +01:00
Paul Spooren
14deec75bf translation: add Marāṭhī to luci.mk
Signed-off-by: Paul Spooren <mail@aparcar.org>
2019-12-11 02:56:23 -10:00
Florian Eckert
1f84f268cc luci.mk: move indexcache delete into postinst
Almost every uci-defaults script for ucitrack execute after the uci
commands the following line '/tmp/luci-indexcache'.
So that we don't always write the same thing, we now do this in
postinst.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2019-12-10 13:28:19 +01:00