---
name: "litecoin"
suites:
- "lucid"
architectures:
- "i386"
packages: 
- "mingw32"
- "git-core"
- "unzip"
- "nsis"
- "faketime"
reference_datetime: "2011-01-30 00:00:00"
remotes:
- "url": "https://github.com/litecoin-project/litecoin.git"
  "dir": "litecoin"
files:
- "qt-win32-4.7.4-gitian.zip"
- "boost-win32-1.47.0-gitian.zip"
- "litecoin-deps-0.0.4.zip"
script: |
  #
  mkdir $HOME/qt
  cd $HOME/qt
  unzip ../build/qt-win32-4.7.4-gitian.zip
  cd $HOME/build/
  export PATH=$PATH:$HOME/qt/bin/
  #
  mkdir boost_1_47_0
  cd boost_1_47_0
  mkdir -p stage/lib
  unzip ../boost-win32-1.47.0-gitian.zip
  cd bin/$GBUILD_BITS
  for lib in *; do
    i586-mingw32msvc-ar rc ../../stage/lib/libboost_${lib}-mt-s.a $lib/*.o
    i586-mingw32msvc-ranlib ../../stage/lib/libboost_${lib}-mt-s.a
  done
  cd ../..
  mv include/boost .
  cd ..
  #
  unzip litecoin-deps-0.0.4.zip
  #
  find -type f | xargs touch --date="$REFERENCE_DATETIME"
  #
  cd litecoin
  mkdir -p $OUTDIR/src
  git archive HEAD | tar -x -C $OUTDIR/src
  cp $OUTDIR/src/doc/README_windows.txt $OUTDIR/readme.txt
  cp $OUTDIR/src/COPYING $OUTDIR/license.txt
  export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
  export FAKETIME=$REFERENCE_DATETIME
  export TZ=UTC
  $HOME/qt/src/bin/qmake -spec unsupported/win32-g++-cross MINIUPNPC_LIB_PATH=$HOME/build/miniupnpc MINIUPNPC_INCLUDE_PATH=$HOME/build/ BDB_LIB_PATH=$HOME/build/db-4.8.30.NC/build_unix BDB_INCLUDE_PATH=$HOME/build/db-4.8.30.NC/build_unix BOOST_LIB_PATH=$HOME/build/boost_1_47_0/stage/lib BOOST_INCLUDE_PATH=$HOME/build/boost_1_47_0 BOOST_LIB_SUFFIX=-mt-s BOOST_THREAD_LIB_SUFFIX=_win32-mt-s OPENSSL_LIB_PATH=$HOME/build/openssl-1.0.1b OPENSSL_INCLUDE_PATH=$HOME/build/openssl-1.0.1b/include QRENCODE_LIB_PATH=$HOME/build/qrencode-3.2.0/.libs QRENCODE_INCLUDE_PATH=$HOME/build/qrencode-3.2.0 USE_QRCODE=1 INCLUDEPATH=$HOME/build DEFINES=BOOST_THREAD_USE_LIB BITCOIN_NEED_QT_PLUGINS=1 QMAKE_LRELEASE=lrelease QMAKE_CXXFLAGS=-frandom-seed=bitcoin QMAKE_LFLAGS=-frandom-seed=bitcoin USE_BUILD_INFO=1
  make $MAKEOPTS
  i586-mingw32msvc-strip release/litecoin-qt.exe
  cp release/litecoin-qt.exe $OUTDIR/
  #
  cd src
  export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
  export FAKETIME=$REFERENCE_DATETIME
  export TZ=UTC
  make -f makefile.linux-mingw $MAKEOPTS DEPSDIR=$HOME/build litecoind.exe USE_UPNP=0 DEBUGFLAGS="-frandom-seed=litecoin"
  i586-mingw32msvc-strip litecoind.exe
  mkdir $OUTDIR/daemon
  cp litecoind.exe $OUTDIR/daemon
  cd ..
  mkdir nsis
  git archive HEAD | tar -x -C nsis
  cd nsis/src
  mkdir ../release
  cp ../../release/* ../release/
  cp ../../src/*.exe .
  makensis ../share/setup.nsi
  cp ../share/litecoin-*-win32-setup.exe $OUTDIR/
