mirror of
https://github.com/jarun/nnn.git
synced 2024-11-04 18:33:12 +00:00
41235445e7
* Add automatic RPM builds via travis * readline.h must be imported after stdio.h to pick up def of FILE
26 lines
653 B
Bash
Executable file
26 lines
653 B
Bash
Executable file
#!/bin/bash
|
|
|
|
set -xe
|
|
|
|
# create the rpm tree
|
|
rpmdir=$(mktemp -d)
|
|
install -d -m0755 $rpmdir/{BUILD,BUILDROOT,RPMS/$(uname -m),SOURCES,SPECS,SRPMS}
|
|
|
|
# copy the sources into place
|
|
cp redhat/nnn.spec $rpmdir/SPECS/nnn.spec
|
|
vers=$(git describe --always | sed 's/^v//' | tr - .)
|
|
sed -i -e "s/Version:\s*\(\S\+\)/Version: $vers/" $rpmdir/SPECS/nnn.spec
|
|
git archive --prefix=nnn-$vers/ --format=tar.gz -o $rpmdir/SOURCES/nnn-$vers.tar.gz HEAD
|
|
|
|
# do the build
|
|
( cd $rpmdir/SPECS && rpmbuild --define="%_topdir $rpmdir" -ba nnn.spec )
|
|
|
|
# retreive the artifacts
|
|
mkdir -p dist
|
|
cp $rpmdir/{SRPMS,RPMS/*}/*.rpm dist/
|
|
|
|
# clean up
|
|
rm -rf $rpmdir
|
|
|
|
# vim: et:ai:ts=4:sw=4
|