blob: 776c8ddfe0fb12dff791c895d840763b3dda9bc0 [file] [log] [blame]
PavolVican5d377522017-06-07 15:08:14 +02001#!/usr/bin/env bash
2
PavolVican6fd3e272017-06-20 17:46:55 +02003LOCAL_LC_TIME=$LC_TIME
4export LC_TIME="en_US.UTF-8"
PavolVican5d377522017-06-07 15:08:14 +02005cd "@PROJECT_SOURCE_DIR@" && tar --exclude="@EXCLUDE_BUILD_DIR@" --exclude=./.git* -zcvf "@PROJECT_BINARY_DIR@/@GIT_BRANCH@.tar.gz" . --transform 's/./libyang-@GIT_BRANCH@/'
6cd @PROJECT_BINARY_DIR@
7mkdir -p rpms/{BUILD,RPMS,SOURCES,SPECS,SRPMS,tmp}
8mv @GIT_BRANCH@.tar.gz rpms/SOURCES
9cp build-packages/libyang.spec rpms/SPECS
10git 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
11echo " @LIBYANG_VERSION@" >>rpms/SPECS/libyang.spec
12git log -10 --pretty=format:"- %s (%aN)" >>rpms/SPECS/libyang.spec 2>/dev/null || echo "- unknown changes" >>rpms/SPECS/libyang.spec
13rpmbuild --ba rpms/SPECS/libyang.spec --define "%_topdir @PROJECT_BINARY_DIR@/rpms"
PavolVican6fd3e272017-06-20 17:46:55 +020014export LC_TIME=$LOCAL_LC_TIME