Travis: When testing installation, build in separate dir, otherwise in checkout
[openssl.git] / .travis.yml
index a278cb2c9fbc7499e90b3790e5e2db63e52d6076..aee34cf8f977fa5d7e5d8e446285d2e208dfb5b9 100644 (file)
@@ -59,26 +59,38 @@ matrix:
           compiler: gcc
 
 before_script:
-    - sh .travis-create-release.sh $TRAVIS_OS_NAME
-    - tar -xvzf _srcdist.tar.gz
-    - mkdir _build;
-    - cd _build;
+    - if [ -n "$DESTDIR" ]; then
+          sh .travis-create-release.sh $TRAVIS_OS_NAME;
+          tar -xvzf _srcdist.tar.gz;
+          mkdir _build;
+          cd _build;
+          srcdir=../_srcdist;
+          top=..;
+      else
+          srcdir=.;
+          top=.;
+      fi
     - if [ "$CC" == i686-w64-mingw32-gcc ]; then
           export CROSS_COMPILE=${CC%%gcc}; unset CC;
-          ../_srcdist/Configure mingw $CONFIG_OPTS -Wno-pedantic-ms-format;
+          $srcdir/Configure mingw $CONFIG_OPTS -Wno-pedantic-ms-format;
       elif [ "$CC" == x86_64-w64-mingw32-gcc ]; then
           export CROSS_COMPILE=${CC%%gcc}; unset CC;
-          ../_srcdist/Configure mingw64 $CONFIG_OPTS -Wno-pedantic-ms-format;
+          $srcdir/Configure mingw64 $CONFIG_OPTS -Wno-pedantic-ms-format;
       else
           if which ccache >/dev/null && [ "$CC" != clang-3.6 ]; then
               CC="ccache $CC";
           fi;
-          ../_srcdist/config $CONFIG_OPTS;
+          $srcdir/config $CONFIG_OPTS;
       fi
-    - cd ..
+    - cd $top
 
 script:
-    - cd _build;
+    - if [ -n "$DESTDIR" ]; then
+          cd _build;
+          top=..;
+      else
+          top=.;
+      fi
     - make update
     - make
     - if [ -z "$BUILDONLY" ]; then
@@ -93,7 +105,7 @@ script:
           mkdir "../$DESTDIR";
           make install install_docs DESTDIR="../$DESTDIR";
       fi
-    - cd ..
+    - cd $top
 
 notifications:
     email: