]> wolfpit.net Git - tool/wolfaur/.git/blob - build_package.sh
ignores faulty version checks (for now)
[tool/wolfaur/.git] / build_package.sh
1 #!/bin/bash
2 set -e
3
4 target=$(basename "$1")
5 src_dir=${SRCDIR:-build}/$target
6
7 echo "Building $target in $src_dir"
8
9 if [[ $(< "$src_dir/$VERSION_FILE") == "$SKIP_TAG" ]]
10 then
11 echo Found "$SKIP_TAG in $src_dir/$VERSION_FILE"
12 echo Skipping package "$target"
13 exit 0
14 else
15 if [ -n "$CHROOT_DIR" ]
16 then
17 echo "CHROOT_DIR is set, so we will build it!"
18 mkdir --parent "$CHROOT_DIR/$target"
19 mkarchroot "$CHROOT_DIR/$target/root" base-devel
20 export BUILD_ARGS="-r $CHROOT_DIR/$target $BUILD_ARGS"
21 fi
22 (
23 cd "$src_dir" && "$BUILD_SCRIPT" "$BUILD_ARGS" -- "$MAKECHROOTPKG_ARGS" &&
24 makepkg --packagelist > "$VERSION_FILE"
25 )
26 fi