mirror of
https://github.com/joncampbell123/dosbox-x.git
synced 2025-10-14 02:17:36 +08:00

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.
32 lines
764 B
Bash
Executable File
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
|
|
|