]> gitweb.hhaalo.de Git - albentohandy.git/commitdiff
copy files to build
authorBastian Dehn <hhaalo@arcor.de>
Sat, 26 Sep 2026 10:10:12 +0000 (12:10 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 26 Sep 2026 10:10:12 +0000 (12:10 +0200)
Makefile
src/albentohandy
src/lib/vorbis.sh
tests/albentohandy.bats
tests/flac.bats
tests/vorbis.bats

index 1715a9bfb2a5c74549fc9c16f282bae320a147ec..8595b63c5bbd164578ff4c94a6e1f04a5082d37a 100644 (file)
--- 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
index 0e22cb43d4515b38936687f482f7680b52111a2e..a33788c8165fc5de1cba4b922040cce449304a7c 100755 (executable)
@@ -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 $?
index 99446a867eb6e5cce5527b8373e3d8f775a1f7aa..a93dd726ac4c2f3c5b3ba96264df06da877ecd7a 100644 (file)
@@ -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/ */}
 
        {
index 604b6e84835f7536ecfb6a6ccd9326d582ba789c..f348924d976950b10f298a908edb3e223ec98cdb 100755 (executable)
@@ -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
index b8f2919cbd82c207142230d02ebccde9c65b16b0..af592f55e08748bb4cd7378e60b201e5e9e52f57 100755 (executable)
@@ -17,7 +17,7 @@ setup_file() {
 }
 
 teardown_file() {
-       rm --recursive --force "build"
+       rm --recursive --force "build/tests"
 }
 
 # bats test_tags=flac:check_programs
index 6077b95baf702eec9b58d364051c0d8c890c85af..eadff2289287250fa35aae0832db4492392950c1 100755 (executable)
@@ -11,7 +11,7 @@ setup_file() {
 }
 
 teardown_file() {
-       rm --recursive --force "build"
+       rm --recursive --force "build/tests"
 }
 
 # bats test_tags=vorbis:check_programs