1
0
mirror of https://bitbucket.org/svk28/rac-gui synced 2024-12-04 18:46:52 +00:00
1c_rac-gui/docker/redhat/build-rpm.sh
2020-08-12 14:31:41 +03:00

22 lines
825 B
Bash
Executable File

#!/bin/bash
git clone https://bitbucket.org/svk28/rac-gui.git
WORKDIR=/home/rpmbuild
VERSION=$(grep Version ${WORKDIR}/rac-gui/rac_gui.tcl | grep -oE '\b[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}\b')
RELEASE=$(grep Release ${WORKDIR}/rac-gui/rac_gui.tcl | grep -oE '\b[0-9]{1,3}\b')
tar czf ${WORKDIR}/rpmbuild/SOURCES/rac-gui-${VERSION}-${RELEASE}.tar.gz rac-gui
cp ${WORKDIR}/rac-gui/rac_gui.spec ${WORKDIR}/rpmbuild/SPECS/rac_gui.spec
sed -i "s/.*Version:.*/Version:\t${VERSION}/" ${WORKDIR}/rpmbuild/SPECS/rac_gui.spec
sed -i "s/.*Release:.*/Release:\t${RELEASE}/" ${WORKDIR}/rpmbuild/SPECS/rac_gui.spec
rpmbuild -ba ${WORKDIR}/rpmbuild/SPECS/rac_gui.spec
#exit
cp ${WORKDIR}/rpmbuild/RPMS/noarch/rac-gui-${VERSION}-${RELEASE}.noarch.rpm /files/
cp ${WORKDIR}/rpmbuild/SRPMS/rac-gui-${VERSION}-${RELEASE}.src.rpm /files/