Skip to content

Commit

Permalink
Try use downloaded openssl again.
Browse files Browse the repository at this point in the history
  • Loading branch information
zw963 committed Aug 19, 2021
1 parent 211eef7 commit f889949
Show file tree
Hide file tree
Showing 2 changed files with 159 additions and 160 deletions.
2 changes: 1 addition & 1 deletion linux/RUBY_VERSIONS.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.6 2.2.2 2.3.4 2.4.3 2.5.1 2.5.3 2.6.4 2.7.0 2.7.1 2.7.2 3.0.1
2.1.6 2.2.2 2.3.4 2.4.3 2.5.1 2.5.3 2.6.4 2.7.0 2.7.1 2.7.2 3.0.1 3.0.2
317 changes: 158 additions & 159 deletions linux/internal/setup-runtime-inside-mock
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@ ARCHITECTURE=`cat /system/ARCHITECTURE`

function download_and_extract()
{
local BASENAME="$1"
local URL="$2"
local regex='\.bz2$'

run rm -f "$BASENAME"
run wget -O "$BASENAME" "$URL"
if [[ "$URL" =~ $regex ]]; then
run tar xjf "$BASENAME"
else
run tar xzf "$BASENAME"
fi
run rm "$BASENAME"
local BASENAME="$1"
local URL="$2"
local regex='\.bz2$'

run rm -f "$BASENAME"
run wget -O "$BASENAME" "$URL"
if [[ "$URL" =~ $regex ]]; then
run tar xjf "$BASENAME"
else
run tar xzf "$BASENAME"
fi
run rm "$BASENAME"
}


CONCURRENCY=2
export PATH=/usr/local/override/bin:$PATH
if [[ "$ARCHITECTURE" = x86_64 ]]; then
ARCHITECTURE_BITS=64
export PATH=/system/bin64:$PATH
ARCHITECTURE_BITS=64
export PATH=/system/bin64:$PATH
else
ARCHITECTURE_BITS=32
export PATH=/system/bin32:$PATH
ARCHITECTURE_BITS=32
export PATH=/system/bin32:$PATH
fi

AUTOCONF_VERSION=2.69
Expand All @@ -48,189 +48,188 @@ LIBSSH2_VERSION=1.7.0
echo "----- chroot entered -----"
# Clear /tmp.
for F in *; do
# During the first 'mock' run, mock somehow mounts /tmp/ccache which we
# can't remove. So we skip this.
if [[ "$F" != ccache ]]; then
run rm -rf "/tmp/$F"
fi
# During the first 'mock' run, mock somehow mounts /tmp/ccache which we
# can't remove. So we skip this.
if [[ "$F" != ccache ]]; then
run rm -rf "/tmp/$F"
fi
done
run rpm --rebuilddb
run yum install -y @development-tools gcc gcc-c++ wget m4 sudo zlib-devel \
readline-devel ncurses-devel ccache compat-libtermcap \
autoconf automake libtool openssl-devel
autoconf automake libtool
run mkdir -p /ccache
echo

# header "Installing CMake..."
# if [[ ! -e /usr/local/override/bin/cmake ]]; then
# download_and_extract cmake-$CMAKE_VERSION.tar.gz \
# http://www.cmake.org/files/v3.5/cmake-$CMAKE_VERSION.tar.gz
# echo "Entering cmake-$CMAKE_VERSION"
# pushd cmake-$CMAKE_VERSION >/dev/null
header "Installing CMake..."
if [[ ! -e /usr/local/override/bin/cmake ]]; then
download_and_extract cmake-$CMAKE_VERSION.tar.gz \
http://www.cmake.org/files/v3.5/cmake-$CMAKE_VERSION.tar.gz
echo "Entering cmake-$CMAKE_VERSION"
pushd cmake-$CMAKE_VERSION >/dev/null

# run ./configure --prefix=/usr/local/override --no-qt-gui --parallel=$CONCURRENCY
# run make -j$CONCURRENCY
# run make install
run ./configure --prefix=/usr/local/override --no-qt-gui --parallel=$CONCURRENCY
run make -j$CONCURRENCY
run make install

# echo "Leaving source directory"
# popd >/dev/null
# run rm -rf cmake-$CMAKE_VERSION
# fi
# echo
echo "Leaving source directory"
popd >/dev/null
run rm -rf cmake-$CMAKE_VERSION
fi
echo

# header "Installing OpenSSL"
# yum install -y openssl
# if [[ ! -e /usr/local/override/bin/openssl ]]; then
# download_and_extract openssl-$OPENSSL_VERSION.tar.gz \
# https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz
# echo "Entering openssl-$OPENSSL_VERSION"
# pushd openssl-$OPENSSL_VERSION >/dev/null

# run ./config --prefix=/usr/local/override --openssldir=/usr/local/override/openssl \
# threads zlib no-shared no-sse2 -fPIC -fvisibility=hidden
# run make
# run make install_sw
# run strip --strip-all /usr/local/override/bin/openssl
# run strip --strip-debug /usr/local/override/lib/libcrypto.a
# run strip --strip-debug /usr/local/override/lib/libssl.a
# run sed -i 's/^Libs:.*/Libs: -L${libdir} -lssl -lcrypto -ldl/' /usr/local/override/lib/pkgconfig/openssl.pc
# run sed -i 's/^Libs.private:.*/Libs.private: -L${libdir} -lssl -lcrypto -ldl -lz/' /usr/local/override/lib/pkgconfig/openssl.pc
# run sed -i 's/^Libs:.*/Libs: -L${libdir} -lssl -lcrypto -ldl/' /usr/local/override/lib/pkgconfig/libssl.pc
# run sed -i 's/^Libs.private:.*/Libs.private: -L${libdir} -lssl -lcrypto -ldl -lz/' /usr/local/override/lib/pkgconfig/libssl.pc

# echo "Leaving source directory"
# popd >/dev/null
# run rm -rf openssl-$OPENSSL_VERSION
# fi
header "Installing OpenSSL"
if [[ ! -e /usr/local/override/bin/openssl ]]; then
download_and_extract openssl-$OPENSSL_VERSION.tar.gz \
https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz
echo "Entering openssl-$OPENSSL_VERSION"
pushd openssl-$OPENSSL_VERSION >/dev/null

run ./config --prefix=/usr/local/override --openssldir=/usr/local/override/openssl \
threads zlib no-shared no-sse2 -fPIC -fvisibility=hidden
run make
run make install_sw
run strip --strip-all /usr/local/override/bin/openssl
run strip --strip-debug /usr/local/override/lib/libcrypto.a
run strip --strip-debug /usr/local/override/lib/libssl.a
run sed -i 's/^Libs:.*/Libs: -L${libdir} -lssl -lcrypto -ldl/' /usr/local/override/lib/pkgconfig/openssl.pc
run sed -i 's/^Libs.private:.*/Libs.private: -L${libdir} -lssl -lcrypto -ldl -lz/' /usr/local/override/lib/pkgconfig/openssl.pc
run sed -i 's/^Libs:.*/Libs: -L${libdir} -lssl -lcrypto -ldl/' /usr/local/override/lib/pkgconfig/libssl.pc
run sed -i 's/^Libs.private:.*/Libs.private: -L${libdir} -lssl -lcrypto -ldl -lz/' /usr/local/override/lib/pkgconfig/libssl.pc

echo "Leaving source directory"
popd >/dev/null
run rm -rf openssl-$OPENSSL_VERSION
fi
echo

header "Installing libffi"
# yum install -y
# LIBFFI_FILE=`echo /usr/local/override/lib*/libffi.so.6`
# if [[ ! -e "$LIBFFI_FILE" ]]; then
# download_and_extract libffi-$FFI_VERSION.tar.gz \
# ftp://sourceware.org/pub/libffi/libffi-$FFI_VERSION.tar.gz
# echo "Entering libffi-$FFI_VERSION"
# pushd libffi-$FFI_VERSION >/dev/null

# run ./configure --prefix=/usr/local/override --enable-shared --disable-static \
# --enable-portable-binary
# run make -j$CONCURRENCY
# run make install-strip
# if [[ "$ARCHITECTURE" = x86_64 ]]; then
# run strip --strip-debug /usr/local/override/lib64/libffi.so.6
# else
# run strip --strip-debug /usr/local/override/lib/libffi.so.6
# fi

# echo "Leaving source directory"
# popd >/dev/null
# run rm -rf libffi-$FFI_VERSION
# download_and_extract libffi-$FFI_VERSION.tar.gz \
# ftp://sourceware.org/pub/libffi/libffi-$FFI_VERSION.tar.gz
# echo "Entering libffi-$FFI_VERSION"
# pushd libffi-$FFI_VERSION >/dev/null

# run ./configure --prefix=/usr/local/override --enable-shared --disable-static \
# --enable-portable-binary
# run make -j$CONCURRENCY
# run make install-strip
# if [[ "$ARCHITECTURE" = x86_64 ]]; then
# run strip --strip-debug /usr/local/override/lib64/libffi.so.6
# else
# run strip --strip-debug /usr/local/override/lib/libffi.so.6
# fi

# echo "Leaving source directory"
# popd >/dev/null
# run rm -rf libffi-$FFI_VERSION
# fi
# echo

# header "Installing SQLite3"
# if [[ ! -e /usr/local/override/lib/libsqlite3.a ]]; then
# download_and_extract sqlite-autoconf-$SQLITE3_VERSION.tar.gz \
# http://www.sqlite.org/2017/sqlite-autoconf-$SQLITE3_VERSION.tar.gz
# echo "Entering sqlite-autoconf-$SQLITE3_VERSION"
# pushd sqlite-autoconf-$SQLITE3_VERSION >/dev/null

# run ./configure --prefix=/usr/local/override --disable-shared \
# --disable-dynamic-extensions CFLAGS='-O2 -fPIC -fvisibility=hidden'
# run make -j$CONCURRENCY
# run make install-strip

# echo "Leaving source directory"
# popd >/dev/null
# run rm -rf sqlite-autoconf-$SQLITE3_VERSION
# download_and_extract sqlite-autoconf-$SQLITE3_VERSION.tar.gz \
# http://www.sqlite.org/2017/sqlite-autoconf-$SQLITE3_VERSION.tar.gz
# echo "Entering sqlite-autoconf-$SQLITE3_VERSION"
# pushd sqlite-autoconf-$SQLITE3_VERSION >/dev/null

# run ./configure --prefix=/usr/local/override --disable-shared \
# --disable-dynamic-extensions CFLAGS='-O2 -fPIC -fvisibility=hidden'
# run make -j$CONCURRENCY
# run make install-strip

# echo "Leaving source directory"
# popd >/dev/null
# run rm -rf sqlite-autoconf-$SQLITE3_VERSION
# fi
# echo

# header "Installing MySQL"
# if [[ ! -e /usr/local/override/lib/libmysqlclient.a ]]; then
# download_and_extract mysql-connector-c-$MYSQL_LIB_VERSION-src.tar.gz \
# http://dev.mysql.com/get/Downloads/Connector-C/mysql-connector-c-$MYSQL_LIB_VERSION-src.tar.gz
# echo "Entering mysql-connector-c-$MYSQL_LIB_VERSION-src"
# pushd mysql-connector-c-$MYSQL_LIB_VERSION-src >/dev/null

# run cmake -DCMAKE_INSTALL_PREFIX=/usr/local/override \
# -DCMAKE_C_FLAGS="-fPIC -fvisibility=hidden" \
# -DCMAKE_CXX_FLAGS="-fPIC -fvisibility=hidden" . \
# -DDISABLE_SHARED=1
# run make -j$CONCURRENCY libmysql
# run make -C libmysql install
# run make -C include install
# run make -C scripts install
# run sed -i "s|^ldflags=''|ldflags='-lstdc++'|" /usr/local/override/bin/mysql_config

# echo "Leaving source directory"
# popd >/dev/null
# run rm -rf mysql-connector-c-$MYSQL_LIB_VERSION-src
# download_and_extract mysql-connector-c-$MYSQL_LIB_VERSION-src.tar.gz \
# http://dev.mysql.com/get/Downloads/Connector-C/mysql-connector-c-$MYSQL_LIB_VERSION-src.tar.gz
# echo "Entering mysql-connector-c-$MYSQL_LIB_VERSION-src"
# pushd mysql-connector-c-$MYSQL_LIB_VERSION-src >/dev/null

# run cmake -DCMAKE_INSTALL_PREFIX=/usr/local/override \
# -DCMAKE_C_FLAGS="-fPIC -fvisibility=hidden" \
# -DCMAKE_CXX_FLAGS="-fPIC -fvisibility=hidden" . \
# -DDISABLE_SHARED=1
# run make -j$CONCURRENCY libmysql
# run make -C libmysql install
# run make -C include install
# run make -C scripts install
# run sed -i "s|^ldflags=''|ldflags='-lstdc++'|" /usr/local/override/bin/mysql_config

# echo "Leaving source directory"
# popd >/dev/null
# run rm -rf mysql-connector-c-$MYSQL_LIB_VERSION-src
# fi
# echo

# header "Installing PostgreSQL"
# if [[ ! -e /usr/local/override/lib/libpq.a ]]; then
# download_and_extract postgresql-$POSTGRESQL_VERSION.tar.bz2 \
# http://ftp.postgresql.org/pub/source/v9.3.5/postgresql-$POSTGRESQL_VERSION.tar.bz2
# echo "Entering postgresql-$POSTGRESQL_VERSION"
# pushd postgresql-$POSTGRESQL_VERSION >/dev/null

# run ./configure --prefix=/usr/local/override CFLAGS="-O2 -fPIC -fvisibility=hidden"
# run make -j$CONCURRENCY -C src/common
# run make -j$CONCURRENCY -C src/backend
# run make -j$CONCURRENCY -C src/interfaces/libpq
# run make -C src/interfaces/libpq install-strip
# run make -j$CONCURRENCY -C src/include
# run make -C src/include install-strip
# run make -j$CONCURRENCY -C src/bin/pg_config
# run make -C src/bin/pg_config install-strip
# run rm /usr/local/override/lib/libpq.so*

# echo "Leaving source directory"
# popd >/dev/null
# run rm -rf postgresql-$POSTGRESQL_VERSION
# download_and_extract postgresql-$POSTGRESQL_VERSION.tar.bz2 \
# http://ftp.postgresql.org/pub/source/v9.3.5/postgresql-$POSTGRESQL_VERSION.tar.bz2
# echo "Entering postgresql-$POSTGRESQL_VERSION"
# pushd postgresql-$POSTGRESQL_VERSION >/dev/null

# run ./configure --prefix=/usr/local/override CFLAGS="-O2 -fPIC -fvisibility=hidden"
# run make -j$CONCURRENCY -C src/common
# run make -j$CONCURRENCY -C src/backend
# run make -j$CONCURRENCY -C src/interfaces/libpq
# run make -C src/interfaces/libpq install-strip
# run make -j$CONCURRENCY -C src/include
# run make -C src/include install-strip
# run make -j$CONCURRENCY -C src/bin/pg_config
# run make -C src/bin/pg_config install-strip
# run rm /usr/local/override/lib/libpq.so*

# echo "Leaving source directory"
# popd >/dev/null
# run rm -rf postgresql-$POSTGRESQL_VERSION
# fi
# echo

# header "Installing ICU"
# if [[ ! -e /usr/local/override/lib/libicudata.a ]]; then
# download_and_extract icu4c-$ICU_DIR_VERSION-src.tgz \
# http://download.icu-project.org/files/icu4c/$ICU_VERSION/icu4c-$ICU_DIR_VERSION-src.tgz
# echo "Entering $RUNTIME_DIR/icu4c-$ICU_DIR_VERSION-src"
# pushd icu/source >/dev/null

# run ./configure --prefix=/usr/local/override --disable-samples --disable-tests \
# --enable-static --disable-shared --with-library-bits=$ARCHITECTURE_BITS \
# CFLAGS="-O2 -fPIC -fvisibility=hidden -DU_CHARSET_IS_UTF8=1 -DU_USING_ICU_NAMESPACE=0" \
# CXXFLAGS="-O2 -fPIC -fvisibility=hidden -DU_CHARSET_IS_UTF8=1 -DU_USING_ICU_NAMESPACE=0"
# run make -j$CONCURRENCY VERBOSE=1
# run make install -j$CONCURRENCY
# run strip --strip-debug /usr/local/override/lib/libicu*.a

# echo "Leaving source directory"
# popd >/dev/null
# run rm -rf icu
# download_and_extract icu4c-$ICU_DIR_VERSION-src.tgz \
# http://download.icu-project.org/files/icu4c/$ICU_VERSION/icu4c-$ICU_DIR_VERSION-src.tgz
# echo "Entering $RUNTIME_DIR/icu4c-$ICU_DIR_VERSION-src"
# pushd icu/source >/dev/null

# run ./configure --prefix=/usr/local/override --disable-samples --disable-tests \
# --enable-static --disable-shared --with-library-bits=$ARCHITECTURE_BITS \
# CFLAGS="-O2 -fPIC -fvisibility=hidden -DU_CHARSET_IS_UTF8=1 -DU_USING_ICU_NAMESPACE=0" \
# CXXFLAGS="-O2 -fPIC -fvisibility=hidden -DU_CHARSET_IS_UTF8=1 -DU_USING_ICU_NAMESPACE=0"
# run make -j$CONCURRENCY VERBOSE=1
# run make install -j$CONCURRENCY
# run strip --strip-debug /usr/local/override/lib/libicu*.a

# echo "Leaving source directory"
# popd >/dev/null
# run rm -rf icu
# fi
# echo

# header "Installing libssh2"
# if [[ ! -e /usr/local/override/lib/libssh2.a ]]; then
# download_and_extract libssh2-$LIBSSH2_VERSION.tar.gz \
# http://www.libssh2.org/download/libssh2-$LIBSSH2_VERSION.tar.gz
# echo "Entering $RUNTIME_DIR/libssh2-$LIBSSH2_VERSION"
# pushd libssh2-$LIBSSH2_VERSION >/dev/null

# run ./configure --prefix=/usr/local/override --enable-static --disable-shared \
# --with-openssl --with-libz --disable-examples-build --disable-debug \
# CFLAGS="-O2 -fPIC -fvisibility=hidden" \
# CXXFLAGS="-O2 -fPIC -fvisibility=hidden"
# run make -j$CONCURRENCY
# run make install-strip -j$CONCURRENCY

# echo "Leaving source directory"
# popd >/dev/null
# run rm -rf libssh2-$LIBSSH2_VERSION
# download_and_extract libssh2-$LIBSSH2_VERSION.tar.gz \
# http://www.libssh2.org/download/libssh2-$LIBSSH2_VERSION.tar.gz
# echo "Entering $RUNTIME_DIR/libssh2-$LIBSSH2_VERSION"
# pushd libssh2-$LIBSSH2_VERSION >/dev/null

# run ./configure --prefix=/usr/local/override --enable-static --disable-shared \
# --with-openssl --with-libz --disable-examples-build --disable-debug \
# CFLAGS="-O2 -fPIC -fvisibility=hidden" \
# CXXFLAGS="-O2 -fPIC -fvisibility=hidden"
# run make -j$CONCURRENCY
# run make install-strip -j$CONCURRENCY

# echo "Leaving source directory"
# popd >/dev/null
# run rm -rf libssh2-$LIBSSH2_VERSION
# fi
# echo

0 comments on commit f889949

Please sign in to comment.