1
0
mirror of https://github.com/QSCTech/zjunet.git synced 2026-01-22 11:44:48 +08:00
zjunet/build/build.sh

53 lines
829 B
Bash
Raw Normal View History

2014-09-30 20:34:58 +08:00
#!/bin/bash
VERSION=$(cat ../VERSION)
2014-09-30 20:34:58 +08:00
2019-06-04 15:44:12 +08:00
fail() {
echo -e "\033[31mERROR: Failed to build $1\033[0m" 1>&2
}
2020-11-12 23:06:51 +08:00
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
2014-09-30 20:34:58 +08:00
2020-11-12 23:06:51 +08:00
if [[ ! -z $USE_RPM ]]; then
pushd rpm > /dev/null
./build.sh $VERSION || fail 'RPM package'
popd > /dev/null
fi
2014-09-30 20:34:58 +08:00
2020-11-12 23:06:51 +08:00
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
2019-06-04 15:44:12 +08:00
echo -ne "\033[0;32m"
2015-02-08 22:56:20 +08:00
find . -regextype posix-egrep -regex ".*\.(opk|deb|rpm)$"
2019-06-04 15:44:12 +08:00
echo -ne "\033[0m"