PavolVican | 5d37752 | 2017-06-07 15:08:14 +0200 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
PavolVican | 6fd3e27 | 2017-06-20 17:46:55 +0200 | [diff] [blame] | 3 | LOCAL_LC_TIME=$LC_TIME |
| 4 | export LC_TIME="en_US.UTF-8" |
PavolVican | 5d37752 | 2017-06-07 15:08:14 +0200 | [diff] [blame] | 5 | cd "@PROJECT_SOURCE_DIR@" && tar --exclude="@EXCLUDE_BUILD_DIR@" --exclude=./.git* -zcvf "@PROJECT_BINARY_DIR@/@GIT_BRANCH@.tar.gz" . --transform 's/./libyang-@GIT_BRANCH@/' |
| 6 | cd @PROJECT_BINARY_DIR@ |
| 7 | mkdir -p rpms/{BUILD,RPMS,SOURCES,SPECS,SRPMS,tmp} |
| 8 | mv @GIT_BRANCH@.tar.gz rpms/SOURCES |
PavolVican | 8738eee | 2018-02-27 01:47:02 +0100 | [diff] [blame^] | 9 | sed -e '7d' build-packages/libyang.spec > rpms/SPECS/libyang.spec |
PavolVican | 5d37752 | 2017-06-07 15:08:14 +0200 | [diff] [blame] | 10 | git log -1 --date=format:'%a %b %d %Y' --pretty=format:"* %ad %aN <%aE>" 2>/dev/null >>rpms/SPECS/libyang.spec || printf "* `date +"%a %b %d %Y"` ${USER} <${USER}@`hostname`>" >>rpms/SPECS/libyang.spec |
| 11 | echo " @LIBYANG_VERSION@" >>rpms/SPECS/libyang.spec |
| 12 | git log -10 --pretty=format:"- %s (%aN)" >>rpms/SPECS/libyang.spec 2>/dev/null || echo "- unknown changes" >>rpms/SPECS/libyang.spec |
| 13 | rpmbuild --ba rpms/SPECS/libyang.spec --define "%_topdir @PROJECT_BINARY_DIR@/rpms" |
PavolVican | 6fd3e27 | 2017-06-20 17:46:55 +0200 | [diff] [blame] | 14 | export LC_TIME=$LOCAL_LC_TIME |