From: Bastian Dehn Date: Sat, 26 Sep 2026 10:10:12 +0000 (+0200) Subject: copy files to build X-Git-Tag: v1.0.0^2~1^2~10 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=6058d067934d4f0725ee50d5a0be790e428b147f;p=albentohandy.git copy files to build --- diff --git a/Makefile b/Makefile index 1715a9b..8595b63 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,20 @@ -.PHONY: all test +VERSION=1.0.0 +REVISION=1 +BUILDDIR=build +SRCDIR=src +BINDIR=usr/bin +LIBDIR=usr/lib/albentohandy +PACKAGE=albentohandy_$(VERSION)-$(REVISION)_x86_64 -all: test +.PHONY: all build test clean + +all: build test + +build: $(BUILDDIR)/$(PACKAGE)/$(BINDIR)/albentohandy \ + $(BUILDDIR)/$(PACKAGE)/$(LIBDIR)/vorbis.sh \ + $(BUILDDIR)/$(PACKAGE)/$(LIBDIR)/mp3.sh \ + $(BUILDDIR)/$(PACKAGE)/$(LIBDIR)/opus.sh \ + $(BUILDDIR)/$(PACKAGE)/$(LIBDIR)/flac.sh test: ./tests/albentohandy.bats @@ -8,3 +22,31 @@ test: ./tests/mp3.bats ./tests/opus.bats ./tests/flac.bats + +clean: + rm --recursive --force build + +$(BUILDDIR)/$(PACKAGE)/$(BINDIR)/albentohandy: + mkdir --parents $(@D) + cp $(SRCDIR)/albentohandy $(@) + shellcheck $(@) + +$(BUILDDIR)/$(PACKAGE)/$(LIBDIR)/vorbis.sh: + mkdir --parents $(@D) + cp $(SRCDIR)/lib/vorbis.sh $(@) + shellcheck $(@) + +$(BUILDDIR)/$(PACKAGE)/$(LIBDIR)/mp3.sh: + mkdir --parents $(@D) + cp $(SRCDIR)/lib/mp3.sh $(@) + shellcheck $(@) + +$(BUILDDIR)/$(PACKAGE)/$(LIBDIR)/opus.sh: + mkdir --parents $(@D) + cp $(SRCDIR)/lib/opus.sh $(@) + shellcheck $(@) + +$(BUILDDIR)/$(PACKAGE)/$(LIBDIR)/flac.sh: + mkdir --parents $(@D) + cp $(SRCDIR)/lib/flac.sh $(@) + shellcheck $(@) \ No newline at end of file diff --git a/src/albentohandy b/src/albentohandy index 0e22cb4..a33788c 100755 --- a/src/albentohandy +++ b/src/albentohandy @@ -43,6 +43,7 @@ load_config() || errlog "missing $CONFIG_FILE" \ || return $? + # shellcheck disable=SC1090 source "$CONFIG_FILE" [ -n "$MUSIC_PATH" ] \ || errlog "missing MUSIC_PATH in $CONFIG_FILE" \ @@ -61,6 +62,7 @@ load_library() [ -f "$LIB_PATH/$lib" ] \ || errlog "lib $LIB_PATH/$lib not found" \ || return $? + # shellcheck disable=SC1090 source "$LIB_PATH/$lib" \ || errlog "could not load library $LIB_PATH/$lib" \ || return $? diff --git a/src/lib/vorbis.sh b/src/lib/vorbis.sh index 99446a8..a93dd72 100644 --- a/src/lib/vorbis.sh +++ b/src/lib/vorbis.sh @@ -43,7 +43,8 @@ vorbis_cover_to_metadata() { local cover="$1" local covermetadata="${cover/.jpg/.txt}" - local filesize=$(wc --bytes "$cover") + local filesize= + filesize=$(wc --bytes "$cover") filesize=${filesize/ */} { diff --git a/tests/albentohandy.bats b/tests/albentohandy.bats index 604b6e8..f348924 100755 --- a/tests/albentohandy.bats +++ b/tests/albentohandy.bats @@ -30,7 +30,7 @@ setup() { } teardown() { - rm --recursive --force "build" + rm --recursive --force "build/tests" rm --force "$ENCODE_LOG" unset TEST_MODE unset CONFIG_FILE diff --git a/tests/flac.bats b/tests/flac.bats index b8f2919..af592f5 100755 --- a/tests/flac.bats +++ b/tests/flac.bats @@ -17,7 +17,7 @@ setup_file() { } teardown_file() { - rm --recursive --force "build" + rm --recursive --force "build/tests" } # bats test_tags=flac:check_programs diff --git a/tests/vorbis.bats b/tests/vorbis.bats index 6077b95..eadff22 100755 --- a/tests/vorbis.bats +++ b/tests/vorbis.bats @@ -11,7 +11,7 @@ setup_file() { } teardown_file() { - rm --recursive --force "build" + rm --recursive --force "build/tests" } # bats test_tags=vorbis:check_programs