Python rpm: различия между версиями

Материал из noname.com.ua
Перейти к навигацииПерейти к поиску
Строка 16: Строка 16:
   
 
==Взять спеку==
 
==Взять спеку==
  +
Вообще то надо брать мою спеку но она еще не готова потому ссылка на оригинальную
 
  +
<PRE>
 
wget https://raw.github.com/nmilford/specfiles/master/python-2.7/python27-2.7.2.spec \
 
wget https://raw.github.com/nmilford/specfiles/master/python-2.7/python27-2.7.2.spec \
 
-O ~/rpmbuild/SPECS/python27-2.7.2.spec
 
-O ~/rpmbuild/SPECS/python27-2.7.2.spec
   
  +
</PRE>
  +
<PRE>
 
wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2 \
 
wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2 \
 
-O ~/rpmbuild/SOURCES/Python-2.7.2.tar.bz2
 
-O ~/rpmbuild/SOURCES/Python-2.7.2.tar.bz2
  +
</PRE>
 
   
 
сбилдить рпм
 
сбилдить рпм
 
(FYI, the QA_RPATHS variable tells the rpmbuild to skip some file path errors).
 
(FYI, the QA_RPATHS variable tells the rpmbuild to skip some file path errors).
  +
<PRE>
 
 
QA_RPATHS=$[ 0x0001|0x0010 ] rpmbuild -bb ~/rpmbuild/SPECS/python-2.7.2.spec
 
QA_RPATHS=$[ 0x0001|0x0010 ] rpmbuild -bb ~/rpmbuild/SPECS/python-2.7.2.spec
  +
</PRE>
 
Install the RPMs.
+
==Install the RPMs.==
  +
<PRE>
 
 
sudo rpm -Uvh ~/rpmbuild/RPMS/x86_64/python27*.rpm
 
sudo rpm -Uvh ~/rpmbuild/RPMS/x86_64/python27*.rpm
  +
</PRE>
 
Now on to the the setuptools.
+
==setuptools==
  +
<PRE>
 
Grab my spec file.
 
 
 
wget https://raw.github.com/nmilford/specfiles/master/python-2.7/python27-setuptools-0.6c11.spec \
 
wget https://raw.github.com/nmilford/specfiles/master/python-2.7/python27-setuptools-0.6c11.spec \
 
-O ~/rpmbuild/SPECS/python27-setuptools-0.6c11.spec
 
-O ~/rpmbuild/SPECS/python27-setuptools-0.6c11.spec
  +
</PRE>
 
  +
<PRE>
Grab the source.
 
 
 
wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz \
 
wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz \
 
-O ~/rpmbuild/SOURCES/setuptools-0.6c11.tar.gz
 
-O ~/rpmbuild/SOURCES/setuptools-0.6c11.tar.gz
  +
</PRE>
 
  +
<PRE>
Build the RPMs.
 
 
 
rpmbuild -bb ~/rpmbuild/SPECS/python27-setuptools-0.6c11.spec
 
rpmbuild -bb ~/rpmbuild/SPECS/python27-setuptools-0.6c11.spec
  +
</PRE>
 
  +
<PRE>
Install the RPMs.
 
 
 
sudo rpm -Uvh ~/rpmbuild/RPMS/noarch/python27-setuptools-0.6c11-milford.noarch.rpm
 
sudo rpm -Uvh ~/rpmbuild/RPMS/noarch/python27-setuptools-0.6c11-milford.noarch.rpm
  +
</PRE>
 
Now, we’ll install MySQL-python as an example.
 
 
Grab the mysql-dev package
 
 
yum -y install mysql-devel
 
 
Grab, build and install the MySQL-python package.
 
 
curl http://superb-sea2.dl.sourceforge.net/project/mysql-python/mysql-python/1.2.3/MySQL-python-1.2.3.tar.gz | tar zxv
 
cd MySQL-python-1.2.3
 
python2.7 setup.py build
 
python2.7 setup.py install
 
 
Like with the previous Python 2.6 article, note how I called the script explicitly using the following python binary: /usr/bin/python2.7
 
 
Now we’re good to give it the old test thus:
 
 
python2.7 -c "import MySQLdb"
 
 
If it doesn’t puke out some error message, you’re all set.
 
 
Happy pythoning.
 

Версия 11:15, 3 мая 2012

RPM для python 2.7

Надо собрать рпм-ку питон 2.7 для центос 6.2 Как выяснилось есть грабли. За основу взял туту (http://blog.milford.io/2012/01/building-and-installing-python-2-7-rpms-on-centos-5-7/) но слегка поправил.

Зависимости для сборки

sudo yum -y install rpmdevtools tk-devel tcl-devel expat-devel db4-devel \

                   gdbm-devel sqlite-devel bzip2-devel openssl-devel \
                   ncurses-devel readline-devel


Собрать дерево каталого

rpmdev-setuptree

Взять спеку

Вообще то надо брать мою спеку но она еще не готова потому ссылка на оригинальную

wget https://raw.github.com/nmilford/specfiles/master/python-2.7/python27-2.7.2.spec \
     -O ~/rpmbuild/SPECS/python27-2.7.2.spec 

wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2 \
     -O ~/rpmbuild/SOURCES/Python-2.7.2.tar.bz2

сбилдить рпм (FYI, the QA_RPATHS variable tells the rpmbuild to skip some file path errors).

QA_RPATHS=$[ 0x0001|0x0010 ] rpmbuild -bb ~/rpmbuild/SPECS/python-2.7.2.spec

Install the RPMs.

sudo rpm -Uvh ~/rpmbuild/RPMS/x86_64/python27*.rpm

setuptools

wget https://raw.github.com/nmilford/specfiles/master/python-2.7/python27-setuptools-0.6c11.spec \
     -O ~/rpmbuild/SPECS/python27-setuptools-0.6c11.spec 
wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz \
     -O ~/rpmbuild/SOURCES/setuptools-0.6c11.tar.gz
rpmbuild -bb ~/rpmbuild/SPECS/python27-setuptools-0.6c11.spec
sudo rpm -Uvh ~/rpmbuild/RPMS/noarch/python27-setuptools-0.6c11-milford.noarch.rpm