overte-JulianGro/pkg-scripts/make-rpm-server
2021-02-23 23:08:14 -05:00

54 lines
2.1 KiB
Bash
Executable file

#!/bin/sh
if [ "$VIRCADIA" = "" ]; then
VIRCADIA=`realpath ../..`
fi
GITDATE=`git -C $VIRCADIA/source log -n 1 --format=raw | grep author | cut -d">" -f 2 | cut -d" " -f 2 | xargs -I {} date -d @{} +"%Y%m%d"`
GITCOMMIT=`git -C $VIRCADIA/source rev-parse HEAD | cut -c 1-7`
VERSION=${RPMVERSION}_${GITDATE}_${GITCOMMIT}
SOFILES=`ls \
$VIRCADIA/build/libraries/*/*.so \
$VIRCADIA/qt5-install/lib/libQt5Network.so.*.*.* \
$VIRCADIA/qt5-install/lib/libQt5Core.so.*.*.* \
$VIRCADIA/qt5-install/lib/libQt5Widgets.so.*.*.* \
$VIRCADIA/qt5-install/lib/libQt5Gui.so.*.*.* \
$VIRCADIA/qt5-install/lib/libQt5Script.so.*.*.* \
$VIRCADIA/qt5-install/lib/libQt5WebSockets.so.*.*.* \
$VIRCADIA/qt5-install/lib/libQt5Qml.so.*.*.* \
$VIRCADIA/qt5-install/lib/libQt5Quick.so.*.*.* \
$VIRCADIA/qt5-install/lib/libQt5ScriptTools.so.*.*.* \
| sed 's/\./\\\./g' \
| paste -d'|' -s`
DEPENDS=mesa-libGL,`ls \
$VIRCADIA/build/assignment-client/assignment-client \
$VIRCADIA/build/domain-server/domain-server \
$VIRCADIA/build/tools/oven/oven \
$VIRCADIA/build/libraries/*/*.so \
$VIRCADIA/qt5-install/lib/libQt5Network.so.*.*.* \
$VIRCADIA/qt5-install/lib/libQt5Core.so.*.*.* \
$VIRCADIA/qt5-install/lib/libQt5Widgets.so.*.*.* \
$VIRCADIA/qt5-install/lib/libQt5Gui.so.*.*.* \
$VIRCADIA/qt5-install/lib/libQt5Script.so.*.*.* \
$VIRCADIA/qt5-install/lib/libQt5WebSockets.so.*.*.* \
$VIRCADIA/qt5-install/lib/libQt5Qml.so.*.*.* \
$VIRCADIA/qt5-install/lib/libQt5Quick.so.*.*.* \
$VIRCADIA/qt5-install/lib/libQt5ScriptTools.so.*.*.* \
$VIRCADIA/build/assignment-client/plugins/*.so \
$VIRCADIA/build/assignment-client/plugins/*/*.so \
| xargs -I {} sh -c 'objdump -p {} | grep NEEDED' \
| awk '{print $2}' \
| sort | uniq \
| egrep -v "^($SOFILES)$" \
| grep -v ^libGL \
| xargs -I {} sh -c "ldconfig -p | grep {} | tr ' ' '\n' | grep /" \
| xargs rpm -qf --queryformat "%{NAME}\n" \
| sort | uniq \
| paste -d',' -s`
sudo yum install chrpath
export VERSION DEPENDS VIRCADIA
rpmbuild --target x86_64 -bb ./vircadia-server.spec
mv ~/rpmbuild/RPMS/x86_64/*.rpm .