Skip to content

Instantly share code, notes, and snippets.

@dropwhile
Last active June 3, 2019 13:51
Show Gist options
  • Select an option

  • Save dropwhile/7744519 to your computer and use it in GitHub Desktop.

Select an option

Save dropwhile/7744519 to your computer and use it in GitHub Desktop.
python-2.7.14 and python-3.7.0 -- for centos7 (rpm fpm recipes)
BUILD_VER=2.7.12
mkdir download /tmp/installdir; cd download;
curl -LO http://python.org/ftp/python/${BUILD_VER}/Python-${BUILD_VER}.tgz
tar xf Python-${BUILD_VER}.tgz
cd Python-${BUILD_VER}
yum -y install openssl-devel readline-devel bzip2-devel sqlite-devel zlib-devel ncurses-devel db4-devel expat-devel gdbm-devel
./configure --prefix=/usr/local --enable-unicode=ucs4 --enable-shared --enable-ipv6
make -j2
make install DESTDIR=/tmp/installdir
echo '/sbin/ldconfig' > /tmp/installdir/run-ldconfig.sh
fpm -s dir -t rpm -n python27 -v ${BUILD_VER} -C /tmp/installdir \
--after-install /tmp/installdir/run-ldconfig.sh \
-d 'openssl' \
-d 'bzip2' \
-d 'zlib' \
-d 'expat' \
-d 'db4' \
-d 'sqlite' \
-d 'ncurses' \
-d 'readline' \
-d 'gdbm' \
--directories=/usr/local/lib/python2.7/ \
--directories=/usr/local/include/python2.7/ \
usr/local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment