Last active
August 29, 2015 14:00
-
-
Save timonwong/11130336 to your computer and use it in GitHub Desktop.
Create Python libs rpm by fpm (setuptools, virtualenv, pip)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PYTHON_PACKAGE_PREFIX=python27 | |
PYTHON_INSTALL_DIR=/opt/python2.7 | |
SETUPTOOLS_VER=2.2 | |
SETUPTOOLS_TARBALL=setuptools-$(SETUPTOOLS_VER).tar.gz | |
VIRTUALENV_VER=1.11.4 | |
VIRTUALENV_TARBALL=virtualenv-$(VIRTUALENV_VER).tar.gz | |
PYPI_SOURCE_MIRROR=http://pypi.douban.com/packages/source | |
.PHONY: all setuptools virtualenv pip | |
all: clean setuptools virtualenv pip | |
clean: | |
rm -rf setuptools-*/ | |
rm -rf virtualenv-*/ | |
setuptools: | |
curl -LO $(PYPI_SOURCE_MIRROR)/s/setuptools/$(SETUPTOOLS_TARBALL) | |
tar xf $(SETUPTOOLS_TARBALL) | |
-rm -f "$(PYTHON_PACKAGE_PREFIX)-setuptools"-*.noarch.rpm | |
fpm --verbose -s python -t rpm \ | |
--python-bin $(PYTHON_INSTALL_DIR)/bin/python \ | |
--python-package-name-prefix $(PYTHON_PACKAGE_PREFIX) \ | |
-d '$(PYTHON_PACKAGE_PREFIX)' \ | |
setuptools-$(SETUPTOOLS_VER)/setup.py | |
virtualenv: | |
curl -LO $(PYPI_SOURCE_MIRROR)/v/virtualenv/$(VIRTUALENV_TARBALL) | |
tar xf $(VIRTUALENV_TARBALL) | |
-rm -f "$(PYTHON_PACKAGE_PREFIX)-virtualenv"-*.noarch.rpm | |
fpm --verbose -s python -t rpm \ | |
--python-bin $(PYTHON_INSTALL_DIR)/bin/python \ | |
--python-package-name-prefix $(PYTHON_PACKAGE_PREFIX) \ | |
-d '$(PYTHON_PACKAGE_PREFIX)' \ | |
virtualenv-$(VIRTUALENV_VER)/setup.py | |
pip: setuptools | |
-sudo yum -y install $(PYTHON_PACKAGE_PREFIX)-setuptools-*.noarch.rpm | |
-rm -f "$(PYTHON_PACKAGE_PREFIX)-pip"-*.noarch.rpm | |
fpm --verbose -s python -t rpm \ | |
--python-bin $(PYTHON_INSTALL_DIR)/bin/python \ | |
--python-easyinstall $(PYTHON_INSTALL_DIR)/bin/easy_install \ | |
--python-package-name-prefix $(PYTHON_PACKAGE_PREFIX) \ | |
-d '$(PYTHON_PACKAGE_PREFIX)' \ | |
-d '$(PYTHON_PACKAGE_PREFIX)-setuptools' \ | |
-v '1.5.4' \ | |
pip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment