#!/bin/bash -e ########################################################################## DIST=$(cat /dist) ARTIFACTS=( 'bird' 'birdc' 'birdcl' ) VERSION=$(grep '^Version:' misc/bird.spec | cut -d' ' -f2) URLT="https://git.burble.dn42/api/packages/burble/generic/bird/${VERSION}/%s" echo "Building bird $VERSION for $DIST" ########################################################################## # clear any previous build if [ -f Makefile ] then make distclean fi if [ ! -f configure ]; then autoreconf fi # configure it ./configure \ --prefix=/usr \ --sysconfdir=/etc/bird \ --localstatedir=/var \ 2>&1 | tee conf.out # build it make -j2 2>&1 | tee build.out # push artifacts to gitea for artifact in "${ARTIFACTS[@]}" do echo "Uploading $artifact ..." url=$(printf "$URLT" "${DIST}.${artifact}") curl --user "burble:${TOKEN}" --upload-file "${artifact}" "$url" done echo "All done" ########################################################################## # end of file