star-build

Automation tool for project installation
git clone git://git.meso-star.fr/star-build.git
Log | Files | Refs | README | LICENSE

commit b1ff6ec81fa904e37cf85236fb23b575332aed82
parent 8f7d49364ad11587a473ccf0480b36735ae37d46
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Sun, 21 May 2023 17:23:03 +0200

Fix some weaknesses in the shell commands and the shell scripts

Diffstat:
MMakefile | 2+-
Mbuild.profile.in | 12++++++------
Mbuild.sh | 6+++---
Mgit.mk.in | 10+++++-----
4 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/Makefile b/Makefile @@ -40,4 +40,4 @@ prefix: @(p=$$(echo $(PREFIX)) && mkdir -p -- "$${p}" && cd -- "$${p}" && pwd) > .prefix lint: - shellcheck -o all $(BUILD) + shellcheck -o all build.sh $(BUILD) diff --git a/build.profile.in b/build.profile.in @@ -6,9 +6,9 @@ # permitted in any medium without royalty provided the copyright notice and # this notice are preserved. This file is offered as-is, without any warranty. -export CPATH="@PREFIX@/lib":${CPATH} -export LD_LIBRARY_PATH="@PREFIX@/lib":${LD_LIBRARY_PATH} -export LIBRARY_PATH="@PREFIX@/lib":${LIBRARY_PATH} -export MANPATH="@PREFIX@/share/man":${MANPATH} -export PATH="@PREFIX@/bin":${PATH} -export PKG_CONFIG_PATH="@PREFIX@/lib/pkgconfig":${PKG_CONFIG_PATH} +export CPATH="@PREFIX@/lib:${CPATH}" +export LD_LIBRARY_PATH="@PREFIX@/lib:${LD_LIBRARY_PATH}" +export LIBRARY_PATH="@PREFIX@/lib:${LIBRARY_PATH}" +export MANPATH="@PREFIX@/share/man:${MANPATH}" +export PATH="@PREFIX@/bin:${PATH}" +export PKG_CONFIG_PATH="@PREFIX@/lib/pkgconfig:${PKG_CONFIG_PATH}" diff --git a/build.sh b/build.sh @@ -44,9 +44,9 @@ git_repo() # - url: the URL of the package (required) bin_spkg() { - arch="$(echo ${url##*/})" - arch="$(echo ${arch%.*})" - path="$(echo ${url%/*})" + arch="${url##*/}" + arch="${arch%.*}" + path="${url%/*}" sed\ -e "s#@NAME@#${name}#g"\ diff --git a/git.mk.in b/git.mk.in @@ -1,6 +1,6 @@ @NAME@: build_@NAME@ prefix @prefix=$$(cat .prefix) &&\ - cd -- @NAME@/@TAG@ &&\ + cd -- "@NAME@/@TAG@" &&\ $(MAKE) PREFIX="$${prefix}" @OPT@ install # Delete the dependency file to force their regeneration. This is necessary @@ -8,7 +8,7 @@ # files may be outdated. build_@NAME@: @DEP@ fetch_@NAME@ prefix @prefix=$$(cat .prefix) &&\ - cd -- @NAME@/@TAG@ &&\ + cd -- "@NAME@/@TAG@" &&\ rm -f $$(find src -name "*.d") &&\ PKG_CONFIG_PATH="$${prefix}/lib/pkgconfig/" $(MAKE) @OPT@ @@ -16,19 +16,19 @@ build_@NAME@: @DEP@ fetch_@NAME@ prefix @git clone @URL@ $@ fetch_@NAME@: @NAME@/@TAG@ - @cd -- @NAME@/@TAG@ &&\ + @cd -- "@NAME@/@TAG@" &&\ git fetch origin &&\ git checkout -B star-build &&\ git reset --hard @TAG@ clean_@NAME@: @if [ -d @NAME@/@TAG@ ]; then\ - cd -- @NAME@/@TAG@ && make clean;\ + cd -- "@NAME@/@TAG@" && make clean;\ fi uninstall_@NAME@: fetch_@NAME@ prefix @prefix=$$(cat .prefix) &&\ - cd -- @NAME@/@TAG@ && make PREFIX="$${prefix}" uninstall + cd -- "@NAME@/@TAG@" && make PREFIX="$${prefix}" uninstall distclean_@NAME@: rm -rf @NAME@