diff options
author | Einhard Leichtfuß <alguien@respiranto.de> | 2018-12-23 17:31:46 +0100 |
---|---|---|
committer | Einhard Leichtfuß <alguien@respiranto.de> | 2018-12-23 17:31:46 +0100 |
commit | 53fc988c4110e5a809d5780483c6a072c2dfae4e (patch) | |
tree | 12183aedea03c778d36629f894cc57de00cebb32 | |
parent | 92d20f8fd6b0e8036da83abe8e3c4e98b1e8e029 (diff) |
Allow for different licenses
Therefore, separate types of dictionaries in the configuration sections.
Reason: The dictionaries imported from wikdict are differently licensed.
-rw-r--r-- | TODO | 1 | ||||
-rw-r--r-- | basic.sh | 17 | ||||
-rw-r--r-- | bin/sample.PKGBUILD | 2 | ||||
-rw-r--r-- | src/sample.PKGBUILD | 2 | ||||
-rw-r--r-- | svn/sample.PKGBUILD | 2 | ||||
-rwxr-xr-x | update.sh | 24 |
6 files changed, 30 insertions, 18 deletions
@@ -4,7 +4,6 @@ TODO file for aur-fd-scripts * Move dictd make dependency to freedict-tools. * Use updpkgsums from pacman-contrib. * (Better) error handling. -* Allow for different licenses per package. * Avoid looping over all packages when only one is to be updated. * [consider] Unify the different sample.PKGBUILDs. * [consider] Split off a (bash) configuration file. @@ -25,14 +25,7 @@ # All methods operate on the file "$tmp". -typeset -a langs -langs=( - fra-deu deu-fra - deu-eng eng-deu - fra-eng eng-fra - spa-eng eng-spa - ) - +# Dictionaries in the VCS tree, GPL2 assumed. typeset -a vcs_langs vcs_langs=( deu-eng eng-deu @@ -40,6 +33,14 @@ vcs_langs=( spa-eng eng-spa ) +typeset -a wikdict_langs +wikdict_langs=( + fra-deu deu-fra + ) + +typeset -a langs +langs=( ${vcs_langs[@]} ${wikdict_langs[@]} ) + function init { tmp_d="$(mktemp -d)" diff --git a/bin/sample.PKGBUILD b/bin/sample.PKGBUILD index 8d6d3be..7b72147 100644 --- a/bin/sample.PKGBUILD +++ b/bin/sample.PKGBUILD @@ -9,7 +9,7 @@ pkgrel=1 pkgdesc="%LANG_A% -> %LANG_B% dictionary for dictd et al. from Freedict.org" arch=('any') url="https://freedict.org/" -license=('GPL') +license=(%LICENSES%) optdepends=('dictd: dict client and server') provides=(${_pkgname}) conflicts=(${_pkgname}) diff --git a/src/sample.PKGBUILD b/src/sample.PKGBUILD index 02a358c..b0fd9b8 100644 --- a/src/sample.PKGBUILD +++ b/src/sample.PKGBUILD @@ -8,7 +8,7 @@ pkgrel=1 pkgdesc="%LANG_A% -> %LANG_B% dictionary for dictd et al. from Freedict.org" arch=('any') url="https://freedict.org/" -license=('GPL') +license=(%LICENSES%) optdepends=('dictd: dict client and server') makedepends=('dictd' 'freedict-tools') install=${pkgname}.install diff --git a/svn/sample.PKGBUILD b/svn/sample.PKGBUILD index df2b604..75ece84 100644 --- a/svn/sample.PKGBUILD +++ b/svn/sample.PKGBUILD @@ -9,7 +9,7 @@ pkgrel=2 pkgdesc="%LANG_A% -> %LANG_B% dictionary for dictd et al. from Freedict.org" arch=('any') url="https://freedict.org/" -license=('GPL') +license=(%LICENSES%) optdepends=('dictd: dict client and server') makedepends=('subversion' 'dictd' 'freedict-tools') provides=(${_pkgname}) @@ -33,6 +33,7 @@ script_path="$(realpath "$0")" script_dir="${script_path%/*}" +. "${script_dir}/basic.sh" ## Some configuration. @@ -44,7 +45,7 @@ long[deu]=German long[eng]=English long[spa]=Spanish -# Contributors for some specific PKGBUILDs. +# Contributors for some specific PKGBUILDs (indexed by $lang$ext). typeset -A contrs contrs[deu-eng-bin]=\ '# Contributor: akane <grangerspit@gmail.com> <xmpp:heiß@neko.im>'$'\n' @@ -55,8 +56,22 @@ contrs[fra-eng-bin]=\ contrs[eng-fra-bin]=\ '# Contributor: Benjamin Vanderford <hazor_at_swrpg_dot_info>'$'\n' -# prepare() functions. +# Licenses (indexed by $lang) +typeset -A licenses +for lang in ${vcs_langs[@]} +do + licenses[$lang]="'GPL'" +done + +for lang in ${wikdict_langs[@]} +do + licenses[$lang]="'CCPL:by-sa' 'FDL'" +done + +# prepare() functions (indexed by $lang$ext). typeset -A prepare + +# Does not work for deu-fra-bin, since the index file must stay in sync. prepare[deu-fra]=\ 'prepare() { @@ -72,10 +87,6 @@ prepare[deu-fra]=\ ## End configuration - -. "${script_dir}/basic.sh" - - function main { if [ "$#" -lt 2 ] @@ -133,6 +144,7 @@ function update replace '%LANG_A%' "$lang_a" replace '%LANG_B%' "$lang_b" replace '%VER%' "$convver" + replace '%LICENSES%' "${licenses[$lang]}" replace '%CHECKSUM%' "$checksum" replace_line '%CONTRS%' "${contrs[${lang}${ext}]}" normal |