RPM: Bulding Python package for Redis

To build RPM package for Python library is really easy task if developer has kindly included setup.py file in it.
Let’s build RPM for redis-py package by Andy Mccurdy.

First of all we need archive with last version of redis-py.

[root@develop ~]# wget https://github.com/downloads/andymccurdy/redis-py/redis-2.4.9.tar.gz

Unpack it.

[root@develop ~]# tar xzvf redis-2.4.9.tar.gz
[root@develop ~]# cd redis-2.4.9/

Change name of package to ‘python-redis’ since default value is ‘redis’ (and that is not what we want).


[root@develop redis-2.4.9]# python setup.py bdist --format=rpm

Change directory to dist where you can find built RPM.

[root@develop redis-2.4.9/]# cd dist/

Last step is to update package:

[root@develop dist]# rpm -Uvh python-redis-2.4.9-1.noarch.rpm
Preparing...                ########################################### [100%]
[root@develop dist]#

Now you have last python-redis package version in your system instead of old one from Fedora 15:

[root@develop dist]# rpm -q python-redis
python-redis-2.0.0-2.fc15.noarch
[root@develop dist]# rpm -Uvh python-redis-2.4.9-1.noarch.rpm
Preparing...                ########################################### [100%]
1:python-redis           ########################################### [100%]
[root@develop dist]# rpm -q python-redis
python-redis-2.4.9-1.noarch
[root@develop dist]#

Finally, you can use zcount Redis command which old version lacks.

Didn’t find the answer to your question? Ask it our administrators to reply we will publish on website.

Leave a Reply

Your email address will not be published. Required fields are marked *