diff --git a/scripts/conda/conda.sh b/scripts/conda/conda.sh old mode 100644 new mode 100755 index 644fde0f5..870f7eea3 --- a/scripts/conda/conda.sh +++ b/scripts/conda/conda.sh @@ -29,9 +29,9 @@ else fi sedi(){ - TEMPFILE=$(mktemp /tmp/rpz_conda_XXXXXXXX) - sed "$1" "$2" > $TEMPFILE - mv $TEMPFILE "$2" + TEMPFILE="$(mktemp /tmp/rr_conda_XXXXXXXX)" + sed "$1" "$2" > "$TEMPFILE" + mv "$TEMPFILE" "$2" } absolutepathname(){ @@ -40,48 +40,54 @@ absolutepathname(){ echo "$(pwd)/$(basename "$1")" } -for pkgname in reprozip reprounzip reprounzip-docker reprounzip-vagrant reprounzip-vistrails; do - TEMP_DIR=$(mktemp -d /tmp/rpz_conda_XXXXXXXX) - - cd "$TOPLEVEL/$pkgname" - - # Builds source distribution - if ! python setup.py sdist --dist-dir $TEMP_DIR; then - rm -Rf $TEMP_DIR - exit 1 - fi - - # Creates symlink - TEMP_FILE="$(echo $TEMP_DIR/*)" - ln -s "$TEMP_FILE" $TEMP_DIR/$pkgname.tar.gz - - # Copies conda recipe - cp -r $TOPLEVEL/scripts/conda/$pkgname $TEMP_DIR/$pkgname - - # Changes version in recipe - VERSION_ESCAPED="$(echo "$VERSION" | sed 's/\\/\\\\/g' | sed 's/\//\\\//g')" - sedi "s/_REPLACE_version_REPLACE_/$VERSION_ESCAPED/g" $TEMP_DIR/$pkgname/meta.yaml - - # Changes URL - URL_ESCAPED="$(echo "file://$TEMP_DIR/$pkgname.tar.gz" | sed 's/\\/\\\\/g' | sed 's/\//\\\//g')" - sedi "s/_REPLACE_url_REPLACE_/$URL_ESCAPED/g" $TEMP_DIR/$pkgname/meta.yaml - - # Builds Conda package - cd $TEMP_DIR - OUTPUT_PKG="$(conda build --output $pkgname)" - OUTPUT_PKG="$(absolutepathname "$OUTPUT_PKG")" - if ! conda build $pkgname; then - rm -Rf $TEMP_DIR - rm -f "$ANACONDA_CACHE" - exit 1 - fi - - # Copies result out - cd "$TOPLEVEL/$pkgname" - cp "$OUTPUT_PKG" "$DEST_DIR/" - - # Removes temporary directory - rm -Rf $TEMP_DIR +for PYTHONVER in 2.7 3.5; do + for PKGNAME in reprozip reprounzip reprounzip-docker reprounzip-vagrant reprounzip-vistrails; do + TEMP_DIR="$(mktemp -d /tmp/rr_conda_XXXXXXXX)" + + PKGDIR="$TOPLEVEL/$PKGNAME" + cd "$PKGDIR" + + # Builds source distribution + if ! python setup.py sdist --dist-dir "$TEMP_DIR"; then + rm -Rf "$TEMP_DIR" + exit 1 + fi + + # Creates symlink + TEMP_FILE="$(echo $TEMP_DIR/*)" + ln -s "$TEMP_FILE" "$TEMP_DIR/$PKGNAME.tar.gz" + + # Copies conda recipe + cp -r "$TOPLEVEL/scripts/conda/$PKGNAME" "$TEMP_DIR/$PKGNAME" + + # Changes version in recipe + VERSION_ESCAPED="$(echo "$VERSION" | sed 's/\\/\\\\/g' | sed 's/\//\\\//g')" + sedi "s/_REPLACE_version_REPLACE_/$VERSION_ESCAPED/g" "$TEMP_DIR/$PKGNAME/meta.yaml" + + # Changes URL + URL_ESCAPED="$(echo "file://$TEMP_DIR/$PKGNAME.tar.gz" | sed 's/\\/\\\\/g' | sed 's/\//\\\//g')" + sedi "s/_REPLACE_url_REPLACE_/$URL_ESCAPED/g" "$TEMP_DIR/$PKGNAME/meta.yaml" + + # Change build string + sedi "s/_REPLACE_buildstr_REPLACE_/py$PYTHONVER/g" "$TEMP_DIR/$PKGNAME/meta.yaml" + + # Builds Conda package + cd "$TEMP_DIR" + OUTPUT_PKG="$(conda build --python "$PYTHONVER" --output "$PKGNAME")" + OUTPUT_PKG="$(absolutepathname "$OUTPUT_PKG")" + if ! conda build --python "$PYTHONVER" "$PKGNAME"; then + rm -Rf "$TEMP_DIR" + rm -f "$ANACONDA_CACHE" + exit 1 + fi + + # Copies result out + cd "$PKGDIR" + cp "$OUTPUT_PKG" "$DEST_DIR/" + + # Removes temporary directory + rm -Rf "$TEMP_DIR" + done done # Clears Conda cache diff --git a/scripts/conda/reprounzip-docker/meta.yaml b/scripts/conda/reprounzip-docker/meta.yaml index 0e4690bdc..f64ce768f 100644 --- a/scripts/conda/reprounzip-docker/meta.yaml +++ b/scripts/conda/reprounzip-docker/meta.yaml @@ -19,6 +19,7 @@ build: # If this is a new build for the same version, increment the build # number. If you do not include this key, it defaults to 0. # number: 1 + string: _REPLACE_buildstr_REPLACE_ requirements: build: diff --git a/scripts/conda/reprounzip-vagrant/meta.yaml b/scripts/conda/reprounzip-vagrant/meta.yaml index f241936db..c46d7f7a9 100644 --- a/scripts/conda/reprounzip-vagrant/meta.yaml +++ b/scripts/conda/reprounzip-vagrant/meta.yaml @@ -19,6 +19,7 @@ build: # If this is a new build for the same version, increment the build # number. If you do not include this key, it defaults to 0. # number: 1 + string: _REPLACE_buildstr_REPLACE_ requirements: build: diff --git a/scripts/conda/reprounzip-vistrails/meta.yaml b/scripts/conda/reprounzip-vistrails/meta.yaml index c7ca3f4e9..5c02c7157 100644 --- a/scripts/conda/reprounzip-vistrails/meta.yaml +++ b/scripts/conda/reprounzip-vistrails/meta.yaml @@ -19,6 +19,7 @@ build: # If this is a new build for the same version, increment the build # number. If you do not include this key, it defaults to 0. # number: 1 + string: _REPLACE_buildstr_REPLACE_ requirements: build: diff --git a/scripts/conda/reprounzip/meta.yaml b/scripts/conda/reprounzip/meta.yaml index 5c027976f..d23772235 100644 --- a/scripts/conda/reprounzip/meta.yaml +++ b/scripts/conda/reprounzip/meta.yaml @@ -21,6 +21,7 @@ build: # If this is a new build for the same version, increment the build # number. If you do not include this key, it defaults to 0. # number: 1 + string: _REPLACE_buildstr_REPLACE_ requirements: build: diff --git a/scripts/conda/reprozip/meta.yaml b/scripts/conda/reprozip/meta.yaml index 6eac9f7ec..f4f4fba99 100644 --- a/scripts/conda/reprozip/meta.yaml +++ b/scripts/conda/reprozip/meta.yaml @@ -21,6 +21,7 @@ build: # If this is a new build for the same version, increment the build # number. If you do not include this key, it defaults to 0. # number: 1 + string: _REPLACE_buildstr_REPLACE_ requirements: build: