blob: 7aedca0db5ab1134f51eebf12599677357ac2fcd [file] [log] [blame]
#!/usr/bin/env bash
LOCAL_LC_TIME=$LC_TIME
export LC_TIME="en_US.UTF-8"
cd "@PROJECT_SOURCE_DIR@" && tar --exclude="@EXCLUDE_BUILD_DIR@" --exclude=./.git* -zcvf "@PROJECT_BINARY_DIR@/@GIT_BRANCH@.tar.gz" . --transform 's/./libnetconf2-@GIT_BRANCH@/'
cd @PROJECT_BINARY_DIR@
mkdir -p rpms/{BUILD,RPMS,SOURCES,SPECS,SRPMS,tmp}
mv @GIT_BRANCH@.tar.gz rpms/SOURCES
cp build-packages/libnetconf2.spec rpms/SPECS
git log -1 --date=format:'%a %b %d %Y' --pretty=format:"* %ad %aN <%aE>" 2>/dev/null >>rpms/SPECS/libnetconf2.spec || printf "* `date +"%a %b %d %Y"` ${USER} <${USER}@`hostname`>" >>rpms/SPECS/libnetconf2.spec
echo " @LIBNETCONF2_VERSION@" >>rpms/SPECS/libnetconf2.spec
git log -10 --pretty=format:"- %s (%aN)" >>rpms/SPECS/libnetconf2.spec 2>/dev/null || echo "- unknown changes" >>rpms/SPECS/libnetconf2.spec
rpmbuild --ba rpms/SPECS/libnetconf2.spec --define "%_topdir @PROJECT_BINARY_DIR@/rpms"
export LC_TIME=$LOCAL_LC_TIME