aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2018-02-07 13:46:33 +0100
committerJakub Jirutka <jakub@jirutka.cz>2018-02-07 13:47:19 +0100
commit120a747aea14fdcf1449a8264f90b048bcd5d97a (patch)
treea95c44241715f5f9bde728daac9cab16f012f07f
parent03c1bdba4241495011fc68cc4839efc34e21ae3f (diff)
downloadaports-120a747aea14fdcf1449a8264f90b048bcd5d97a.tar.bz2
aports-120a747aea14fdcf1449a8264f90b048bcd5d97a.tar.xz
testing/elektra: new aport
https://www.libelektra.org A universal and secure framework to access configuration parameters
-rw-r--r--testing/elektra/APKBUILD402
-rw-r--r--testing/elektra/cmake-allow-override-rpath.patch13
-rw-r--r--testing/elektra/elektra.post-deinstall9
-rw-r--r--testing/elektra/elektra.trigger57
-rw-r--r--testing/elektra/fix-augeas-internal-inconsistency.patch43
-rw-r--r--testing/elektra/fix-bash-shebang.patch254
6 files changed, 778 insertions, 0 deletions
diff --git a/testing/elektra/APKBUILD b/testing/elektra/APKBUILD
new file mode 100644
index 0000000000..7773db4f5b
--- /dev/null
+++ b/testing/elektra/APKBUILD
@@ -0,0 +1,402 @@
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
+# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
+# TODO: Add rest of the tools.
+# TODO: Fix some scripts/tools to not require bash.
+pkgname=elektra
+_pkgname=libelektra
+pkgver=0.8.21
+pkgrel=0
+pkgdesc="A universal and secure framework to access configuration parameters"
+url="https://www.libelektra.org"
+arch="all"
+license="BSD-3-Clause"
+_luaver=5.3
+# kdb doesn't work correctly without these plugins.
+depends="$pkgname-dump=$pkgver-r$pkgrel
+ $pkgname-list=$pkgver-r$pkgrel
+ $pkgname-spec=$pkgver-r$pkgrel
+ $pkgname-sync=$pkgver-r$pkgrel"
+checkdepends="bash gtest"
+makedepends="
+ augeas-dev
+ boost-dev
+ cmake
+ curl-dev
+ discount discount-dev
+ fts-dev
+ libdrm-dev
+ libgcrypt-dev
+ libgit2-dev
+ libressl-dev
+ lua$_luaver-dev
+ glib-dev
+ python3-dev
+ qt5-qtbase-dev
+ qt5-qtdeclarative-dev
+ qt5-qtsvg-dev
+ ruby ruby-dev
+ swig
+ yajl-dev
+ yaml-cpp-dev
+ "
+install="$pkgname.post-deinstall"
+triggers="$pkgname.trigger=/usr/lib/$pkgname"
+subpackages="
+ $pkgname-dev
+ $pkgname-doc
+ $pkgname-glib
+ lua$_luaver-elektra:_lua
+ py3-elektra:_py3
+ ruby-elektra:_ruby
+ $pkgname-qt-gui:_gui
+ $pkgname-libs
+ $pkgname-bash-completion:bashcomp:noarch
+ $pkgname-fish-completion:fishcomp:noarch
+ $pkgname-zsh-completion:zshcomp:noarch
+ $pkgname-plugins-all:_all:noarch
+ "
+source="$_pkgname-$pkgver.tar.gz::https://github.com/ElektraInitiative/$_pkgname/archive/$pkgver.tar.gz
+ fix-bash-shebang.patch
+ fix-augeas-internal-inconsistency.patch
+ cmake-allow-override-rpath.patch"
+builddir="$srcdir/$_pkgname-$pkgver"
+options="!check" # FIXME!
+
+# All plugins except:
+# * status:obsolete
+# * status:experimental
+# * journald - considered evil
+# * wresolver - resolver for non-POSIX, e.g. w32/w64 systems
+# * xerces - we don't have xerces package
+# * yamlcpp - segfaults FIXME
+_plugins="
+ augeas
+ base64
+ boolean
+ c
+ cachefilter
+ camel
+ ccode
+ conditionals
+ constants
+ counter
+ crypto_gcrypt
+ crypto_openssl
+ csvstorage
+ curlget
+ date
+ desktop
+ dini
+ directoryvalue
+ dpkg
+ dump
+ enum
+ error
+ fcrypt
+ filecheck
+ fstab
+ gitresolver
+ glob
+ hexcode
+ hidden
+ hosts
+ iconv
+ ini
+ ipaddr
+ keytometa
+ line
+ lineendings
+ list
+ logchange
+ lua
+ mathcheck
+ mini
+ multifile
+ network
+ ni
+ noresolver
+ null
+ path
+ profile
+ python
+ range
+ regexstore
+ rename
+ required
+ resolver_fm_b_b
+ resolver_fm_pb_b
+ resolver_fm_hb_b
+ resolver_fm_hp_b
+ resolver_fm_ub_x
+ resolver_fm_xb_x
+ resolver_fm_xp_x
+ resolver_fm_xhp_x
+ resolver_fm_uhb_xb
+ resolver_fm_hpu_b
+ shell
+ spec
+ struct
+ sync
+ syslog
+ tcl
+ timeofday
+ tracer
+ type
+ uname
+ validation
+ xmltool
+ yajl
+ "
+for _i in $_plugins; do
+ subpackages="$subpackages $pkgname-$_i:_plugin"
+done
+
+# All bindings except:
+# * status:experimental
+# * intercept_env - currently doesn't work on musl (0.8.21)
+_bindings="
+ cpp
+ glib
+ swig_lua
+ swig_python
+ swig_ruby
+ "
+
+build() {
+ mkdir -p "$builddir"/build
+ cd "$builddir"/build
+
+ cmake .. \
+ -DCMAKE_BUILD_TYPE=MinSizeRel \
+ -DCMAKE_C_FLAGS_MINSIZEREL_INIT="$CFLAGS" \
+ -DCMAKE_CXX_FLAGS_MINSIZEREL_INIT="$CXXFLAGS" \
+ -DCMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT="$LDFLAGS" \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_INSTALL_RPATH=/usr/lib/$pkgname \
+ -DTARGET_PLUGIN_FOLDER=$pkgname \
+ -DCMAKE_VERBOSE_MAKEFILE=OFF \
+ -DBUILD_DOCUMENTATION=OFF \
+ -DBUILD_SHARED_LIBS=ON \
+ -DBUILD_STATIC=OFF \
+ \
+ -DENABLE_DEBUG=OFF \
+ -DENABLE_LOGGER=OFF \
+ -DINSTALL_TESTING=OFF \
+ -DBINDINGS=$(printf '%s;' $_bindings) \
+ -DPLUGINS=$(printf '%s;' $_plugins) \
+ -DTOOLS='kdb;qt-gui' \
+ \
+ -DLUA_LIBRARIES="/usr/lib/liblua-$_luaver.so.0" \
+ -DLUA_INCLUDE_DIR=$(pkg-config --variable=includedir lua$_luaver ) \
+ -DTARGET_LUA_CMOD_FOLDER=$(pkg-config --variable=INSTALL_LMOD lua$_luaver) \
+ -DTARGET_LUA_CMOD_FOLDER=$(pkg-config --variable=INSTALL_CMOD lua$_luaver)
+ make
+}
+
+check() {
+ cd "$builddir"/build
+ make run_all
+}
+
+package() {
+ # These are virtual providers. abuild doesn't recognize them as
+ # produced by this APKBUILD and tries to install them as make
+ # dependencies. That's why they are defined in package().
+ depends="$depends $pkgname-resolver"
+
+ cd "$builddir"/build
+
+ make DESTDIR="$pkgdir" install
+
+ # This is a shell script that just executes /usr/lib/elektra/tool_exec/qt-gui.
+ # It was originally made as a workaround for some RPATH issue we don't have.
+ rm "$pkgdir"/usr/bin/elektra-qt-editor
+
+ cd "$pkgdir"/usr/lib/elektra
+
+ # We create these symlinks in trigger, so they are correctly updated
+ # when user install a different provider.
+ rm libelektra-resolver.so libelektra-storage.so
+
+ ## Delete some useless or unusable tools.
+
+ # Completions are in separate packages.
+ rm tool_exec/install-sh-completion
+ # This seems to be just for development.
+ rm tool_exec/benchmark-createtree
+ rm tool_exec/update-snippet-repository
+ # Needs experimental plugin mozprefs.
+ rm tool_exec/configure-firefox
+ # Needs binding intercept_env.
+ rm tool_exec/elektrify-getenv
+ # Needs experimental binding intercept_fs.
+ rm tool_exec/elektrify-open
+}
+
+libs() {
+ default_libs
+ mv "$pkgdir"/usr/lib/*.so.* "$subpkgdir"/usr/lib/
+}
+
+glib() {
+ pkgdesc="Glib bindings for Elektra"
+ depends=""
+
+ _submv usr/lib/libgelektra-*.so
+}
+
+_lua() {
+ pkgdesc="Lua $_luaver bindings for Elektra"
+ depends=""
+
+ _submv usr/lib/lua
+}
+
+_py3() {
+ pkgdesc="Python 3 bindings for Elektra"
+ depends=""
+
+ _submv usr/lib/python3.*
+}
+
+_ruby() {
+ pkgdesc="Ruby bindings for Elektra"
+ depends=""
+
+ _submv usr/lib/ruby
+}
+
+_gui() {
+ pkgdesc="Qt GUI for Elektra"
+ depends="$depends $pkgname-resolver"
+
+ _submv usr/lib/elektra/tool_exec/qt-gui usr/bin/elektra-qt-editor
+ _submv usr/share/appdata
+ _submv usr/share/applications
+ _submv usr/share/icons
+}
+
+bashcomp() {
+ pkgdesc="Bash completions for $pkgname"
+ depends=""
+ install_if="$pkgname=$pkgver-r$pkgrel bash"
+
+ _submv usr/share/bash-completion
+}
+
+fishcomp() {
+ pkgdesc="Fish completions for $pkgname"
+ depends=""
+ install_if="$pkgname=$pkgver-r$pkgrel fish"
+
+ _submv usr/share/fish/vendor_completions.d usr/share/fish/completions
+}
+
+zshcomp() {
+ pkgdesc="ZSH completions for $pkgname"
+ depends=""
+ install_if="$pkgname=$pkgver-r$pkgrel zsh"
+
+ _submv usr/share/zsh/vendor-completions usr/share/zsh/site-functions
+}
+
+_plugin() {
+ local name=${subpkgname#$pkgname-}
+ local readme="$builddir/src/plugins/${name%%_*}/README.md"
+
+ [ -f "$readme" ] || die "$readme doesn't exist!"
+
+ pkgdesc="Elektra plugin - $(_getinfo description "$readme")"
+ depends=$(_to_pkgnames $(_getinfo needs "$readme" '') | xargs)
+
+ if provides=$(_getinfo provides "$readme"); then
+ # Convert plugin names to package names.
+ provides=$(_to_pkgnames $provides)
+
+ # Remove pkgnames clashing with subpackages.
+ : ${_plugins_pkgname:="$(printf "$pkgname-%s\n" $_plugins dev doc libs)"}
+ provides=$(_set_difference "$provides" "$_plugins_pkgname" | xargs)
+ fi
+
+ # Overrides
+ case "$name" in
+ base64)
+ provider_priority=50;; # provides binary
+ crypto_gcrypt)
+ depends="$depends gnupg"
+ provider_priority=50;; # provides crypto
+ crypto_*)
+ depends="$depends gnupg";;
+ dini)
+ depends="$depends $pkgname-dump $pkgname-ini"
+ provider_priority=40;; # provides storage storage-ini
+ dump)
+ provider_priority=50;; # provides storage
+ hexcode)
+ provider_priority=50;; # provides code
+ resolver_fm_hpu_b)
+ provider_priority=50;; # provides resolver
+ esac
+ msg "Resolved provides: $provides"
+ msg "Resolved depends: $depends"
+
+ _submv usr/lib/elektra/libelektra-$name.so*
+}
+
+_all() {
+ pkgdesc="Virtual package that installs *all* plugins shipped with Elektra"
+ depends=$(printf "$pkgname-%s=$pkgver-r$pkgrel\n" $_plugins)
+
+ mkdir -p "$subpkgdir"
+}
+
+# Prints value of property $1 in the plugin's readme file $2,
+# or prints $3 if no value.
+_getinfo() {
+ local name="$1"
+ local file="$2"
+ local default="${3:-}"
+ local value
+
+ value=$(sed -n "s|^- infos/$name = *\(.*\) *|\1|p" "$file")
+ [ "$value$default" ] || return 1
+ printf '%s\n' "${value:-$default}"
+}
+
+# Converts plugin names $@ into package names, i.e. adds prefix $pkgname-
+# and replaces "/" with "-".
+_to_pkgnames() {
+ local item; for item in "$@"; do
+ case "$item" in
+ */*) echo "$pkgname-${item%%/*}"
+ echo "$pkgname-$item" | tr '/' '-';;
+ *) echo "$pkgname-$item";;
+ esac
+ done
+}
+
+# Prints space-separated items from $1 that are not in $2.
+_set_difference() {
+ printf '%s\n' $1 $2 $2 | sort | uniq -u
+}
+
+# Moves file/directory $1 from the $pkgdir to $2 (or $1 if $2 not given)
+# in the $subpkgdir.
+_submv() {
+ local src="$1"
+ local dest="${2:-}"
+
+ if [ "$dest" ]; then
+ mkdir -p "$subpkgdir"/${dest%/*}
+ mv "$pkgdir"/$src "$subpkgdir"/$dest
+ else
+ mkdir -p "$subpkgdir"/${src%/*}
+ mv "$pkgdir"/$src "$subpkgdir"/${src%/*}/
+ fi
+ rmdir -p "$pkgdir"/${src%/*} 2>/dev/null || true
+}
+
+sha512sums="9ad3bb7eeb36d921189d93cb347ec73262503d85397b574ef603080cee52d1959752740e5018a0e7eb5dc187bce8aae3b6fc0057a6385bce94e5338604c6bc57 libelektra-0.8.21.tar.gz
+cbfe8b96a806825d5f7194734a646bdb3fb273bf6be44b3b47e9b2f63bf90a7ece867e74808da743ff33211abba0682aba55d02a3dbfa0a5efc3dc821444bd87 fix-bash-shebang.patch
+48d645142bf63282e13d1c76c1ddedc5633e365a1a87d0cd49c75fa801eed44b57fb66eee49badc7a9e6210f6ccd2af82779f0658f90263fd23b959f4e70b84c fix-augeas-internal-inconsistency.patch
+717b343b6509d14949a154bbbf13d5722f47f97717dbd839763fc89f8f9033d5214f903df23b4ca7f196ae9dbfe6a3348542411c714e471ca4a50b39bdff3abc cmake-allow-override-rpath.patch"
diff --git a/testing/elektra/cmake-allow-override-rpath.patch b/testing/elektra/cmake-allow-override-rpath.patch
new file mode 100644
index 0000000000..bc7f106d0c
--- /dev/null
+++ b/testing/elektra/cmake-allow-override-rpath.patch
@@ -0,0 +1,13 @@
+Allow to override CMAKE_INSTALL_RPATH.
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -7,7 +7,7 @@
+
+ #fix macOS RPATH issues
+ set(CMAKE_MACOSX_RPATH 1)
+-SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
++SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib" CACHE STRING "The rpath to use for installed targets.")
+
+ #additional modules for loading libraries
+ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
diff --git a/testing/elektra/elektra.post-deinstall b/testing/elektra/elektra.post-deinstall
new file mode 100644
index 0000000000..24ba17c7e6
--- /dev/null
+++ b/testing/elektra/elektra.post-deinstall
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+ELEKTRA_LIBS=/usr/lib/elektra
+
+# Remove symlinks created by the trigger.
+rm -f $ELEKTRA_LIBS/libelektra-resolver.so
+rm -f $ELEKTRA_LIBS/libelektra-storage.so
+
+rmdir $ELEKTRA_LIBS 2>/dev/null || true
diff --git a/testing/elektra/elektra.trigger b/testing/elektra/elektra.trigger
new file mode 100644
index 0000000000..bc42f1dab1
--- /dev/null
+++ b/testing/elektra/elektra.trigger
@@ -0,0 +1,57 @@
+#!/bin/sh
+#
+# This trigger creates/updates symlinks for default resolver and storage based
+# on installed packages.
+#
+
+ELEKTRA_LIBS='/usr/lib/elektra'
+RESOLVER_LINK="$ELEKTRA_LIBS/libelektra-resolver.so"
+STORAGE_LINK="$ELEKTRA_LIBS/libelektra-storage.so"
+
+PREFERRED_RESOLVER='elektra-resolver_fm_hpu_b'
+PREFERRED_STORAGE='elektra-dump'
+
+
+# Prints name of some installed elektra package that *provides* $1
+# (e.g. resolver, storage). If package $2 is installed, then it prints that.
+# Otherwise it prints name of the first found package based on alphabetical
+# order.
+find_installed_provider() {
+ local provider="$1"
+ local preferred="$2"
+ local pkgname
+
+ if [ -e "$ELEKTRA_LIBS/lib$preferred.so" ]; then
+ echo "$preferred"
+ else
+ # NOTE: `apk info` doesn't work correctly here, probably
+ # due to apk DB lock or something like that.
+ for pkgname in $(apk search -aqx elektra-$provider | sort | uniq); do
+ if [ -e "$ELEKTRA_LIBS/lib$pkgname.so" ]; then
+ echo "$pkgname"
+ return 0
+ fi
+ done
+ return 1
+ fi
+}
+
+if ! [ -e "$RESOLVER_LINK" ]; then
+ if resolver=$(find_installed_provider resolver $PREFERRED_RESOLVER); then
+ echo "elektra: Switching default resolver to ${resolver#elektra-}" >&2
+ ln -sf "lib$resolver.so" "$RESOLVER_LINK"
+ else
+ echo "elektra: No resolver provider found!" >&2
+ fi
+fi
+
+if ! [ -e "$STORAGE_LINK" ]; then
+ if storage=$(find_installed_provider storage $PREFERRED_STORAGE); then
+ echo "elektra: Switching default storage to ${storage#elektra-}" >&2
+ ln -sf "lib$storage.so" "$STORAGE_LINK"
+ else
+ echo "elektra: No storage provider found!" >&2
+ fi
+fi
+
+exit 0
diff --git a/testing/elektra/fix-augeas-internal-inconsistency.patch b/testing/elektra/fix-augeas-internal-inconsistency.patch
new file mode 100644
index 0000000000..b003a90a43
--- /dev/null
+++ b/testing/elektra/fix-augeas-internal-inconsistency.patch
@@ -0,0 +1,43 @@
+From c93b4175480f7ded03e43b17108fed5434263069 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rene=CC=81=20Schwaiger?= <sanssecours@me.com>
+Date: Thu, 28 Dec 2017 12:17:08 +0100
+Subject: [PATCH] Augeas: Fix internal inconsistency
+
+Patch-Source: https://github.com/ElektraInitiative/libelektra/pull/1761
+---
+ src/plugins/augeas/CMakeLists.txt | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/src/plugins/augeas/CMakeLists.txt b/src/plugins/augeas/CMakeLists.txt
+index b4c9c7c15b..dc29fa8642 100644
+--- a/src/plugins/augeas/CMakeLists.txt
++++ b/src/plugins/augeas/CMakeLists.txt
+@@ -23,6 +23,9 @@ if (DEPENDENCY_PHASE)
+ else (LIBAUGEAS_FOUND)
+ remove_plugin (augeas "libaugeas not found (libaugeas-dev >= 0.16 needed)")
+ endif ()
++
++ set (AUGEAS_PLUGIN_INCLUDE_DIRS ${LIBAUGEAS_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR})
++ set (AUGEAS_PLUGIN_LIBRARIES ${LIBAUGEAS_LIBRARIES} ${LIBXML2_LIBRARIES})
+ endif ()
+
+ add_plugin(augeas
+@@ -32,16 +35,14 @@ add_plugin(augeas
+ ADD_TEST
+ INSTALL_TEST_DATA
+ INCLUDE_DIRECTORIES
+- ${LIBAUGEAS_INCLUDE_DIR}
+- ${LIBXML2_INCLUDE_DIR}
++ ${AUGEAS_PLUGIN_INCLUDE_DIRS}
+ COMPILE_DEFINITIONS
+ "${LIBAUGEAS_COMPILE_DEFINITIONS}"
+ LINK_ELEKTRA
+ elektra-meta
+ elektra-proposal
+ LINK_LIBRARIES
+- ${LIBAUGEAS_LIBRARIES}
+- ${LIBXML2_LIBRARIES}
++ ${AUGEAS_PLUGIN_LIBRARIES}
+ )
+
+ if (ADDTESTING_PHASE)
diff --git a/testing/elektra/fix-bash-shebang.patch b/testing/elektra/fix-bash-shebang.patch
new file mode 100644
index 0000000000..4e1668288a
--- /dev/null
+++ b/testing/elektra/fix-bash-shebang.patch
@@ -0,0 +1,254 @@
+From 1e1414e99cfe5e2934b500015a3edfa358a849c6 Mon Sep 17 00:00:00 2001
+From: Jakub Jirutka <jakub@jirutka.cz>
+Date: Mon, 5 Feb 2018 20:30:05 +0100
+Subject: [PATCH] fix bash shebang in scripts for better portability
+
+Bash is not always installed in /bin! For example BSDs install Bash into
+/usr/local/bin. Practically every *nix system has /usr/bin/env.
+
+Upstream-Issue: https://github.com/ElektraInitiative/libelektra/pull/1810
+---
+ doc/docker/buildelektra.sh | 2 +-
+ doc/vagrant/buildelektra.sh | 2 +-
+ scripts/benchmark-createtree | 2 +-
+ scripts/benchmark_augeas_hosts.sh | 2 +-
+ scripts/benchmark_libsplit.sh | 2 +-
+ scripts/build-homepage | 2 +-
+ scripts/check-env-dep | 2 +-
+ scripts/configure-firefox.in | 2 +-
+ scripts/convert-hosts | 2 +-
+ scripts/copy-template | 2 +-
+ scripts/elektra-merge | 2 +-
+ scripts/elektra-mount | 2 +-
+ scripts/elektra-umount | 2 +-
+ scripts/ffconfig/setupConfig | 2 +-
+ scripts/ffconfig/setupHomepage | 2 +-
+ scripts/ffconfig/setupProxy | 2 +-
+ scripts/fix-spelling | 2 +-
+ scripts/generate-seeds | 2 +-
+ scripts/install-sh-completion.in | 2 +-
+ scripts/kdb-bash-completion | 2 +-
+ scripts/metaini-to-c | 2 +-
+ tests/shell/shell_recorder/tutorial_wrapper/markdown_shell_recorder.sh | 2 +-
+ 22 files changed, 22 insertions(+), 22 deletions(-)
+
+diff --git a/doc/docker/buildelektra.sh b/doc/docker/buildelektra.sh
+index ed96e7955b..af54e4eacc 100755
+--- a/doc/docker/buildelektra.sh
++++ b/doc/docker/buildelektra.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/usr/bin/env bash
+
+ set -o errexit
+ set -o pipefail
+diff --git a/doc/vagrant/buildelektra.sh b/doc/vagrant/buildelektra.sh
+index c7210148e6..1abbd6b35d 100755
+--- a/doc/vagrant/buildelektra.sh
++++ b/doc/vagrant/buildelektra.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/usr/bin/env bash
+
+ set -o errexit
+ set -o pipefail
+diff --git a/scripts/benchmark-createtree b/scripts/benchmark-createtree
+index 56e9c1c584..34f29517ed 100755
+--- a/scripts/benchmark-createtree
++++ b/scripts/benchmark-createtree
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/usr/bin/env bash
+ # bash required for platform independent time
+
+ # $Id$
+diff --git a/scripts/benchmark_augeas_hosts.sh b/scripts/benchmark_augeas_hosts.sh
+index cd62e096a1..a7bca1087f 100755
+--- a/scripts/benchmark_augeas_hosts.sh
++++ b/scripts/benchmark_augeas_hosts.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/usr/bin/env bash
+ # bash required for platform independent time
+
+ if [ -z "$KDB" ]; then
+diff --git a/scripts/benchmark_libsplit.sh b/scripts/benchmark_libsplit.sh
+index d637f6ba4b..7dbc8daf2b 100755
+--- a/scripts/benchmark_libsplit.sh
++++ b/scripts/benchmark_libsplit.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/usr/bin/env bash
+ # bash required for platform independent time
+
+ if [ -z "$KDB" ]; then
+diff --git a/scripts/build-homepage b/scripts/build-homepage
+index 84eed66869..de605ca22f 100755
+--- a/scripts/build-homepage
++++ b/scripts/build-homepage
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/usr/bin/env bash
+ # This script is sourced on build server, shebang is for convenience
+ # bash is used to have a predictable ulimit behavior
+
+diff --git a/scripts/check-env-dep b/scripts/check-env-dep
+index ba9728e7a4..a6831647b6 100755
+--- a/scripts/check-env-dep
++++ b/scripts/check-env-dep
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/usr/bin/env bash
+
+ OLD_IFS="$IFS"
+ IFS="$(printf '\n+')"
+diff --git a/scripts/configure-firefox.in b/scripts/configure-firefox.in
+index 4f8361b633..ab20f52914 100755
+--- a/scripts/configure-firefox.in
++++ b/scripts/configure-firefox.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/usr/bin/env bash
+
+ SCRIPTS_DIR=$(dirname "$0")
+ . "${SCRIPTS_DIR}/configure-common"
+diff --git a/scripts/convert-hosts b/scripts/convert-hosts
+index 3f4ae9f158..a01c7d104c 100755
+--- a/scripts/convert-hosts
++++ b/scripts/convert-hosts
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/usr/bin/env bash
+
+ ########################################################################
+ ##
+diff --git a/scripts/copy-template b/scripts/copy-template
+index d34627139c..316e13f9ca 100755
+--- a/scripts/copy-template
++++ b/scripts/copy-template
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/usr/bin/env bash
+ #
+ # @author Markus Raab <elektra@markus-raab.org>
+ # @brief Creates a plugin out of the template plugin
+diff --git a/scripts/elektra-merge b/scripts/elektra-merge
+index ad367a25ac..70c024ea19 100755
+--- a/scripts/elektra-merge
++++ b/scripts/elektra-merge
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/usr/bin/env bash
+
+ ours=$1
+ base=$2
+diff --git a/scripts/elektra-mount b/scripts/elektra-mount
+index 5872ad60d8..67c9bf59b0 100755
+--- a/scripts/elektra-mount
++++ b/scripts/elektra-mount
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/usr/bin/env bash
+
+ help()
+ {
+diff --git a/scripts/elektra-umount b/scripts/elektra-umount
+index e958a62fc4..8ef1864d07 100755
+--- a/scripts/elektra-umount
++++ b/scripts/elektra-umount
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/usr/bin/env bash
+
+ help()
+ {
+diff --git a/scripts/ffconfig/setupConfig b/scripts/ffconfig/setupConfig
+index eb0f14d0c9..9031323fe3 100755
+--- a/scripts/ffconfig/setupConfig
++++ b/scripts/ffconfig/setupConfig
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/usr/bin/env bash
+ # main script for guided preference setup used by configure-firefox
+
+ prefType=
+diff --git a/scripts/ffconfig/setupHomepage b/scripts/ffconfig/setupHomepage
+index ef63d9e133..0744bf63f2 100755
+--- a/scripts/ffconfig/setupHomepage
++++ b/scripts/ffconfig/setupHomepage
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/usr/bin/env bash
+
+ # guided setup for homepage preferences used by configure-firefox
+
+diff --git a/scripts/ffconfig/setupProxy b/scripts/ffconfig/setupProxy
+index 748be213c3..426366b001 100755
+--- a/scripts/ffconfig/setupProxy
++++ b/scripts/ffconfig/setupProxy
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/usr/bin/env bash
+
+ # guided setup for proxy preferences used by configure-firefox
+
+diff --git a/scripts/fix-spelling b/scripts/fix-spelling
+index acd1d44448..3bda9c11a7 100755
+--- a/scripts/fix-spelling
++++ b/scripts/fix-spelling
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/usr/bin/env bash
+ #
+ # @author Markus Raab <elektra@markus-raab.org>
+ # @brief Fix spelling error in most files
+diff --git a/scripts/generate-seeds b/scripts/generate-seeds
+index b3b9cf7878..c38672bca4 100755
+--- a/scripts/generate-seeds
++++ b/scripts/generate-seeds
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/usr/bin/env bash
+ #
+ # @author Kurt Micheli <kurt.micheli@libelektra.org>
+ # @brief generate uniformly distributed seeds with R
+diff --git a/scripts/install-sh-completion.in b/scripts/install-sh-completion.in
+index 36544d642f..bc29c5be31 100755
+--- a/scripts/install-sh-completion.in
++++ b/scripts/install-sh-completion.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/usr/bin/env bash
+
+ # This script will install the necessary configuration for zsh and bash completion
+ #
+diff --git a/scripts/kdb-bash-completion b/scripts/kdb-bash-completion
+index 039142f155..d4e5c2318b 100644
+--- a/scripts/kdb-bash-completion
++++ b/scripts/kdb-bash-completion
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/usr/bin/env bash
+
+ ###########################################################################
+ ##
+diff --git a/scripts/metaini-to-c b/scripts/metaini-to-c
+index 79b812096a..df9c5f9742 100755
+--- a/scripts/metaini-to-c
++++ b/scripts/metaini-to-c
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/usr/bin/env bash
+
+ if [ "$#" -ne 1 ];
+ then
+diff --git a/tests/shell/shell_recorder/tutorial_wrapper/markdown_shell_recorder.sh b/tests/shell/shell_recorder/tutorial_wrapper/markdown_shell_recorder.sh
+index fbe5a8e7a3..bb8ca8e793 100755
+--- a/tests/shell/shell_recorder/tutorial_wrapper/markdown_shell_recorder.sh
++++ b/tests/shell/shell_recorder/tutorial_wrapper/markdown_shell_recorder.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/usr/bin/env bash
+
+ @INCLUDE_COMMON@
+