blob: f9c66c2ca6142ada27d7ed27c8864dc73b8f079b [file] [log] [blame]
#!/usr/bin/env bash
cd "@PROJECT_SOURCE_DIR@" && tar --exclude="@EXCLUDE_BUILD_DIR@" --exclude=./.git* -zcvf "@PROJECT_BINARY_DIR@/@GIT_BRANCH@.tar.gz" . --transform 's/./libyang-@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/libyang.spec rpms/SPECS
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
echo " @LIBYANG_VERSION@" >>rpms/SPECS/libyang.spec
git log -10 --pretty=format:"- %s (%aN)" >>rpms/SPECS/libyang.spec 2>/dev/null || echo "- unknown changes" >>rpms/SPECS/libyang.spec
rpmbuild --ba rpms/SPECS/libyang.spec --define "%_topdir @PROJECT_BINARY_DIR@/rpms"