Files
dosbox-x/make-rpm.sh.in
Robert de Rooy 1f11baf298 Cleanup RPM spec file
I am working to submit dosbox-x to Fedora for possible inclusion,
but for that I need to ensure I had a suitable spec file. The
one included in the source tree had to be cleaned up.

This is still not 100% the same as the spec file I will use to
submit dosbox-x for a packaging review, but it is close.

One difference is, that this spec file generates a SDL1 binary,
while I will be submitting a SDL2 version upstream for 2 reasons
- SDL2 should be future
- Fedora is unlikely to accept the SDL1 version with customized SDL1

I can change the in-tree spec file to also generate the SDL2 version,
if there is no opposition.
2021-01-24 10:32:08 +01:00

32 lines
764 B
Bash
Executable File

#!/bin/bash
arch=`uname -m`
if [ -z "$arch" ]; then
echo Sorry, cannot identify architecture
exit 1
fi
if [ -f /etc/os-release ]; then
dist=`cat /etc/os-release | grep "^ID=" | cut -d \" -f 2`
else
dist=""
fi
if [ -z "$dist" ]; then
echo Sorry, cannot identify Linux distro
exit 1
fi
echo "Making RPM for $dist"
dir="release/linux-$dist"
mkdir -p "$dir" || exit 1
tar="../@PACKAGE_NAME@-@PACKAGE_VERSION@.tar.xz"
tar -cvJf "$tar" --exclude=\*.git --exclude=\*.tar.xz --exclude=\*.a --exclude=\*.la --exclude=\*.Po --exclude=\*.o -C .. dosbox-x || exit 1
cp -vf "$tar" ~/rpmbuild/SOURCES/ || exit 1
rpmbuild -bb contrib/linux/dosbox-x.spec || exit 1
rm -v "$tar" || exit 1
mv -v ~/rpmbuild/RPMS/$arch/@PACKAGE_NAME@-*@PACKAGE_VERSION@*.rpm "$dir/" || exit 1