| 1 | #!/bin/bash |
| 2 | |
| 3 | echo "--> Create copy of spec file" |
| 4 | cp ${WORKSPACE}/.github/scripts/linux/rpm/ksnip.spec . |
| 5 | |
| 6 | echo "--> Update changelog entries" |
| 7 | cp CHANGELOG.md changelog |
| 8 | sed -i '1,2d' changelog #Remove header and empty line ad the beginning |
| 9 | sed -i 's/* /-- /g' changelog # Replace asterisk with double dash |
| 10 | sed -i 's/\[\(.*[^]]*\)\].*/\1)/g' changelog # Replace links to issues with only number |
| 11 | sed -i "s/## Release \([0-9]*\.[0-9]*\.[0-9]*\)/* ${BUILD_DATE} Damir Porobic <[email protected]> \1/" changelog # Format release headers |
| 12 | cat changelog >> ksnip.spec |
| 13 | |
| 14 | echo "--> Update version" |
| 15 | sed -i "s/Version: X.X.X/Version: ${VERSION_NUMBER}/" ksnip.spec |
| 16 | sed -i "s;cmake .;cmake . -DVERSION_SUFIX=${VERSION_SUFFIX} -DBUILD_NUMBER=${BUILD_NUMBER} -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} -DCMAKE_BUILD_TYPE=${BUILD_TYPE};" ksnip.spec # ; is the delimiter |