net: Disable upnp by default
[bitcoinplatinum.git] / contrib / gitian-descriptors / gitian-linux.yml
bloba98a71e2f9add21f54801358033eb699da6fa92f
1 ---
2 name: "bitcoin-linux-0.12"
3 enable_cache: true
4 suites:
5 - "precise"
6 architectures:
7 - "amd64"
8 packages: 
9 - "g++-multilib"
10 - "git-core"
11 - "pkg-config"
12 - "autoconf2.13"
13 - "libtool"
14 - "automake"
15 - "faketime"
16 - "bsdmainutils"
17 - "binutils-gold"
18 - "libstdc++6-4.6-pic"
19 reference_datetime: "2015-06-01 00:00:00"
20 remotes:
21 - "url": "https://github.com/bitcoin/bitcoin.git"
22   "dir": "bitcoin"
23 files: []
24 script: |
25   WRAP_DIR=$HOME/wrapped
26   HOSTS="i686-pc-linux-gnu x86_64-unknown-linux-gnu"
27   CONFIGFLAGS="--enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++"
28   FAKETIME_HOST_PROGS=""
29   FAKETIME_PROGS="date ar ranlib nm strip"
31   export QT_RCC_TEST=1
32   export GZIP="-9n"
33   export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
34   export TZ="UTC"
35   export BUILD_DIR=`pwd`
36   mkdir -p ${WRAP_DIR}
37   if test -n "$GBUILD_CACHE_ENABLED"; then
38     export SOURCES_PATH=${GBUILD_COMMON_CACHE}
39     export BASE_CACHE=${GBUILD_PACKAGE_CACHE}
40     mkdir -p ${BASE_CACHE} ${SOURCES_PATH}
41   fi
43   # Create global faketime wrappers
44   for prog in ${FAKETIME_PROGS}; do
45     echo '#!/bin/bash' > ${WRAP_DIR}/${prog}
46     echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
47     echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
48     echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${prog}
49     echo "\$REAL \$@" >> $WRAP_DIR/${prog}
50     chmod +x ${WRAP_DIR}/${prog}
51   done
53   # Create per-host faketime wrappers
54   for i in $HOSTS; do
55     for prog in ${FAKETIME_HOST_PROGS}; do
56         echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog}
57         echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
58         echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
59         echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${i}-${prog}
60         echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog}
61         chmod +x ${WRAP_DIR}/${i}-${prog}
62     done
63   done
64   export PATH=${WRAP_DIR}:${PATH}
66   cd bitcoin
67   BASEPREFIX=`pwd`/depends
68   # Build dependencies for each host
69   for i in $HOSTS; do
70     make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}"
71   done
73   # Ubuntu precise hack: Not an issue in later versions.
74   # Precise's libstdc++.a is non-pic. There's an optional libstdc++6-4.6-pic
75   #   package which provides libstdc++_pic.a, but the linker can't find it.
76   # Symlink it to a path that will be included in our link-line so that the
77   # linker picks it up before the default libstdc++.a.
78   # This is only necessary for 64bit.
79   ln -s /usr/lib/gcc/x86_64-linux-gnu/4.6/libstdc++_pic.a ${BASEPREFIX}/x86_64-unknown-linux-gnu/lib/libstdc++.a
81   # Create the release tarball using (arbitrarily) the first host
82   ./autogen.sh
83   ./configure --prefix=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`
84   make dist
85   SOURCEDIST=`echo bitcoin-*.tar.gz`
86   DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'`
87   # Correct tar file order
88   mkdir -p temp
89   pushd temp
90   tar xf ../$SOURCEDIST
91   find bitcoin-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST
92   popd
94   ORIGPATH="$PATH"
95   # Extract the release tarball into a dir for each host and build
96   for i in ${HOSTS}; do
97     export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
98     mkdir -p distsrc-${i}
99     cd distsrc-${i}
100     INSTALLPATH=`pwd`/installed/${DISTNAME}
101     mkdir -p ${INSTALLPATH}
102     tar --strip-components=1 -xf ../$SOURCEDIST
104     ./configure --prefix=${BASEPREFIX}/${i} --bindir=${INSTALLPATH}/bin --includedir=${INSTALLPATH}/include --libdir=${INSTALLPATH}/lib --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS}
105     make ${MAKEOPTS}
106     make install-strip
107     cd installed
108     find . -name "lib*.la" -delete
109     find . -name "lib*.a" -delete
110     rm -rf ${DISTNAME}/lib/pkgconfig
111     find ${DISTNAME} | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}.tar.gz
112     cd ../../
113   done
114   mkdir -p $OUTDIR/src
115   mv $SOURCEDIST $OUTDIR/src
116   mv ${OUTDIR}/${DISTNAME}-x86_64-*.tar.gz ${OUTDIR}/${DISTNAME}-linux64.tar.gz
117   mv ${OUTDIR}/${DISTNAME}-i686-*.tar.gz ${OUTDIR}/${DISTNAME}-linux32.tar.gz