blob: 23cec4ac4c0db48e70b5f197a7c6eded2c3e75d8 [file] [log] [blame]
PavolVican384786e2017-07-12 15:31:20 +02001#!/usr/bin/env bash
2
3LOCAL_LC_TIME=$LC_TIME
4export LC_TIME="en_US.UTF-8"
Michal Vasko4cb2d722020-04-23 13:49:16 +02005cd "@PROJECT_SOURCE_DIR@" && tar --exclude="@EXCLUDE_BUILD_DIR@" --exclude=./.git* -zcvf "@PROJECT_BINARY_DIR@/master.tar.gz" . --transform 's/./@PACKAGE@-master/'
PavolVican384786e2017-07-12 15:31:20 +02006cd @PROJECT_BINARY_DIR@
7mkdir -p rpms/{BUILD,RPMS,SOURCES,SPECS,SRPMS,tmp}
Michal Vasko4cb2d722020-04-23 13:49:16 +02008mv master.tar.gz rpms/SOURCES
9sed -e '7d' build-packages/@PACKAGE@.spec > rpms/SPECS/@PACKAGE@.spec
10git log -1 --date=format:'%a %b %d %Y' --pretty=format:"* %ad %aN <%aE>" 2>/dev/null >>rpms/SPECS/@PACKAGE@.spec || printf "* `date +"%a %b %d %Y"` ${USER} <${USER}@`hostname`>" >>rpms/SPECS/@PACKAGE@.spec
11echo " @LIBNETCONF2_VERSION@" >>rpms/SPECS/@PACKAGE@.spec
12git log -10 --pretty=format:"- %s (%aN)" >>rpms/SPECS/@PACKAGE@.spec 2>/dev/null || echo "- unknown changes" >>rpms/SPECS/@PACKAGE@.spec
13rpmbuild --ba rpms/SPECS/@PACKAGE@.spec --define "%_topdir @PROJECT_BINARY_DIR@/rpms"
PavolVican384786e2017-07-12 15:31:20 +020014export LC_TIME=$LOCAL_LC_TIME