forked from mdeters/Packages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
68 lines (66 loc) · 2.67 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
language: cpp
compiler: gcc
env:
# - TRAVIS_CVC4_PACKAGE=rpm
- TRAVIS_CVC4_PACKAGE=debian
before_install:
# dhart/ppa is for cxxtest package, which doesn't appear officially until quantal
- travis_retry sudo apt-add-repository -y ppa:dhart/ppa
- travis_retry sudo apt-get update -qq
- travis_retry sudo apt-get install -qq libgmp3-dev antlr3 libantlr3c-dev libboost-dev libboost-thread-dev swig2.0 libcln-dev cxxtest openjdk-7-jdk rpm devscripts doxygen graphviz
- travis_retry git clone -b 1.4 git://github.com/CVC4/CVC4.git cvc4
before_script:
- export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
- export PATH=$PATH:$JAVA_HOME/bin
- export JAVA_CPPFLAGS=-I$JAVA_HOME/include
script: |
normal="$(echo -e '\033[0m')" red="$normal$(echo -e '\033[01;31m')" green="$normal$(echo -e '\033[01;32m')"
DATE=`date +"%Y-%m-%d"`;
rpmvers=`echo $DATE | tr - _`;
DEBVERSION="1.3.1~`date +%Y%m%d`";
rpmdate=`date '+%a %b %d %Y'`;
(cd cvc4 && ./autogen.sh && ./configure && make dist) &&
case "$TRAVIS_CVC4_PACKAGE" in
rpm)
mkdir rpmbuild &&
cd rpmbuild &&
echo "%_topdir `pwd`" > "$HOME/.rpmmacros" &&
echo "%_smt_mflags -j2" >> "$HOME/.rpmmacros" &&
mkdir -p SPECS SOURCES &&
cp ../rpm/cvc4-nightly.spec SPECS &&
cp ../rpm/cvc4-rpm.patch SOURCES &&
cp ../cvc4/builds/cvc4*tar.gz SOURCES/cvc4-$DATE.tar.gz &&
perl -pi -e 's,^(Version: *).*,${1}'$rpmvers',;s,^(Source:.*/cvc4-)[0-9-]*(\.tar\.gz)$,${1}'$DATE'$2,;s,^(%setup -q -n cvc4-)[0-9-]*$,${1}'$DATE',;s,^%changelog$,%changelog\\n* '"$rpmdate"' Morgan Deters <mdeters\@cs.nyu.edu> '$DATE'-1\\n- Automated Travis-CI build of CVC4.,' SPECS/cvc4-nightly.spec &&
rpmbuild -ba SPECS/cvc4-nightly.spec &&
echo && echo "${green}RPM BUILD PASSED${normal}" && echo
;;
debian)
mkdir debwork &&
cd debwork &&
cp ../cvc4/builds/cvc4*tar.gz cvc4_$DEBVERSION.orig.tar.gz &&
tar xfz cvc4_$DEBVERSION.orig.tar.gz &&
mv cvc4-* cvc4-$DEBVERSION &&
cd cvc4-$DEBVERSION &&
cp -a ../../debian debian &&
cat > changelog.tmp <<EOF &&
cvc4 ($DEBVERSION-1) unstable; urgency=low
* Automated Travis-CI build of Debian package from master sources.
-- Morgan Deters <mdeters@cs.nyu.edu> `date -R`
EOF
cat debian/changelog >> changelog.tmp &&
mv -v changelog.tmp debian/changelog &&
debuild -j2 -us -uc &&
echo && echo "${green}DEBIAN BUILD PASSED${normal}" && echo
;;
*)
echo && echo "${red}ERROR: unknown package to build: \"$TRAVIS_CVC4_PACKAGE\"${normal}" && echo;
exit 1
;;
esac
matrix:
fast_finish: true
notifications:
email:
recipients: mdeters@cs.nyu.edu
on_success: change
on_failure: always