Commit 6a235e8d authored by Daniel P. Berrange's avatar Daniel P. Berrange Committed by Michal Privoznik

Add automated build control script

* .gitignore: Ignore build directory
* autobuild.sh: Add automated build script
* autogen.sh: Helper for re-generating autotools files
* libvirt-snmp.spec.in: Add extra_release and remove
  substitution of mibdir since RPM path shouldn't change
  regardless of current configure args
parent 0de9b5ac
......@@ -9,6 +9,7 @@
*.orig
*.rej
*~
/build
/.git-module-status
Makefile
Makefile.in
......
#!/bin/sh
set -e
set -v
test -n "$1" && RESULTS=$1 || RESULTS=results.log
: ${AUTOBUILD_INSTALL_ROOT=$HOME/builder}
# Make things clean.
test -f Makefile && make -k distclean || :
rm -rf build
mkdir build
cd build
MIBDIR=$AUTOBUILD_INSTALL_ROOT/share/snmp/mibs
mkdir -p $MIBDIR
../autogen.sh --prefix=$AUTOBUILD_INSTALL_ROOT \
--with-mibdir=$MIBDIR
make
make install
make check | tee "$RESULTS"
rm -f *.tar.gz
make dist
if [ -n "$AUTOBUILD_COUNTER" ]; then
EXTRA_RELEASE=".auto$AUTOBUILD_COUNTER"
else
NOW=`date +"%s"`
EXTRA_RELEASE=".$USER$NOW"
fi
if [ -f /usr/bin/rpmbuild ]; then
rpmbuild --nodeps \
--define "extra_release $EXTRA_RELEASE" \
--define "_sourcedir `pwd`" \
-ba --clean libvirt-snmp.spec
fi
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
set -e
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
THEDIR=`pwd`
cd $srcdir
if test -z "$*"; then
echo "I am going to run ./configure with not arguments - if you "
echo "wish to pass any extra arguments to it, please specify them on "
echo "the $0 command line."
fi
autoreconf -i -f
cd $THEDIR
$srcdir/configure "$@" && {
echo
echo "Now type 'make' to compile libvirt-snmp."
}
Name: libvirt-snmp
Version: @VERSION@
Release: 1%{?dist}
Release: 1%{?dist}%{?extra_release}
Summary: SNMP functionality for libvirt
Group: Development/Libraries
......@@ -36,8 +36,8 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%{_bindir}/libvirtMib_subagent
@MIB_DIR@/LIBVIRT-MIB.txt
%doc
%{_datadir}/snmp/mibs/LIBVIRT-MIB.txt
%doc README NEWS ChangeLog AUTHORS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment