2020-03-12 12:44:37 +00:00
|
|
|
#!/usr/bin/env bash
|
2020-03-15 22:02:34 +00:00
|
|
|
AARU_VERSION=5.1.99.2880.0.0.2879
|
2020-03-12 12:44:37 +00:00
|
|
|
OS_NAME=`uname`
|
|
|
|
|
|
|
|
|
|
mkdir -p build
|
|
|
|
|
|
|
|
|
|
# Create standalone versions
|
|
|
|
|
cd Aaru
|
|
|
|
|
for conf in Debug Release;
|
|
|
|
|
do
|
2020-03-12 14:38:08 +00:00
|
|
|
for distro in alpine-x64 linux-arm64 linux-arm linux-x64 osx-x64 win-arm64 win-arm win-x64 win-x86 debian-arm debian-arm64 debian-x64 rhel-arm64 rhel-x64 sles-x64;
|
2020-03-12 12:44:37 +00:00
|
|
|
do
|
|
|
|
|
dotnet publish -f netcoreapp2.1 -r ${distro} -c ${conf}
|
|
|
|
|
|
|
|
|
|
# Package the Linux packages
|
|
|
|
|
if [[ ${distro} == alpine* ]] || [[ ${distro} == linux* ]]; then
|
|
|
|
|
pkg="tarball"
|
|
|
|
|
elif [[ ${distro} == win* ]] || [[ ${distro} == osx* ]]; then
|
|
|
|
|
pkg="zip"
|
|
|
|
|
elif [[ ${distro} == rhel* ]] || [[ ${distro} == sles* ]]; then
|
|
|
|
|
pkg="rpm"
|
|
|
|
|
else
|
|
|
|
|
pkg="deb"
|
|
|
|
|
fi
|
|
|
|
|
dotnet ${pkg} -f netcoreapp2.1 -r ${distro} -c ${conf} -o ../build
|
|
|
|
|
done
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
|
|
# If we are compiling on Linux check if we are on Arch Linux and then create the Arch Linux package as well
|
|
|
|
|
if [[ ${OS_NAME} == Linux ]]; then
|
|
|
|
|
OS_RELEASE=`pcregrep -o1 -e "^ID=(?<distro_id>\w+)" /etc/os-release`
|
|
|
|
|
|
|
|
|
|
if [[ ${OS_RELEASE} != arch ]]; then
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
tar --exclude-vcs --exclude="*/bin" --exclude="*/obj" --exclude="build" --exclude="pkg/pacman/*/*.tar.xz" \
|
|
|
|
|
--exclude="pkg/pacman/*/src" --exclude="pkg/pacman/*/pkg" --exclude="pkg/pacman/*/*.tar" \
|
2020-03-12 14:38:47 +00:00
|
|
|
--exclude="pkg/pacman/*/*.asc" --exclude="*.user" --exclude=".idea" -cvf pkg/pacman/stable/aaru-src-${AARU_VERSION}.tar .
|
2020-03-12 12:44:37 +00:00
|
|
|
cd pkg/pacman/stable
|
|
|
|
|
xz -v9e aaru-src-${AARU_VERSION}.tar
|
|
|
|
|
gpg --armor --detach-sign aaru-src-${AARU_VERSION}.tar.xz
|
|
|
|
|
cp PKGBUILD PKGBUILD.bak
|
|
|
|
|
echo -e \\n >> PKGBUILD
|
|
|
|
|
makepkg -g >> PKGBUILD
|
|
|
|
|
makepkg
|
|
|
|
|
mv PKGBUILD.bak PKGBUILD
|
2020-03-12 14:38:55 +00:00
|
|
|
mv aaru-src-${AARU_VERSION}.tar.xz aaru-src-${AARU_VERSION}.tar.xz.asc ../../../build
|
|
|
|
|
cd ../../..
|
2020-03-12 12:44:37 +00:00
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
mv pkg/pacman/stable/*.pkg.tar.xz build/
|
|
|
|
|
|
|
|
|
|
cd build
|
2020-03-12 13:33:36 +00:00
|
|
|
for i in *.deb *.rpm *.zip *.tar.gz;
|
2020-03-12 12:44:37 +00:00
|
|
|
do
|
|
|
|
|
gpg --armor --detach-sign "$i"
|
|
|
|
|
done
|