1
0
mirror of https://github.com/QSCTech/zjunet.git synced 2026-01-22 19:54:48 +08:00
zjunet/build/build.sh
2020-11-12 23:40:37 +08:00

53 lines
829 B
Bash
Executable File

#!/bin/bash
VERSION=$(cat ../VERSION)
fail() {
echo -e "\033[31mERROR: Failed to build $1\033[0m" 1>&2
}
if [[ $# -gt 0 ]]; then
for arg in $*; do
case $arg in
rpm)
USE_RPM=1
;;
debian)
USE_DEB=1
;;
openwrt)
USE_OPK=1
;;
*)
echo "Invalid package $arg"
exit 1
esac
done
else
USE_RPM=1
USE_DEB=1
USE_OPK=1
fi
if [[ ! -z $USE_RPM ]]; then
pushd rpm > /dev/null
./build.sh $VERSION || fail 'RPM package'
popd > /dev/null
fi
if [[ ! -z $USE_DEB ]]; then
pushd debian > /dev/null
./build.sh $VERSION || fail 'Debian package'
popd > /dev/null
fi
if [[ ! -z $USE_OPK ]]; then
pushd openwrt > /dev/null
./build.sh $VERSION || fail 'OpenWrt package'
popd > /dev/null
fi
echo -ne "\033[0;32m"
find . -regextype posix-egrep -regex ".*\.(opk|deb|rpm)$"
echo -ne "\033[0m"