How to create mod_wsgi RPM package in case of upgrade of RPMs.

$ ssh inspirevm20 #(SLC6 support both Python-2.6 and Python-2.7)
$ rpm -ivh http://linuxsoft.cern.ch/cern/slc6X/updates/SRPMS/mod_wsgi-3.2-6.el6_5.src.rpm
$ wget https://github.com/GrahamDumpleton/mod_wsgi/archive/3.5.tar.gz -O rpmbuild/SOURCES/mod_wsgi-3.5.tar.gz
$ cd SPECS
$ cp mod_wsgi.spec mod_wsgi.spec-orig
$ vim mod_wsgi.spec ## increase versioning and remove back-ported patches that are already part of the current version
$ diff mod_wsgi.spec mod_wsgi.spec-orig
2,3c2,3
< Version:        3.5
< Release:        1%{?dist}
---
> Version:        3.2
> Release:        6%{?dist}
33a34,37
> %patch2 -p1 -b .nokeyerror
> %patch3 -p1 -b .sslfuncs
> %patch4 -p1 -b .cve0240
> %patch5 -p1 -b .cve0242
$ rpmbuild -bb mod_wsgi.spec
cat: /usr/include/httpd/.mmn: No such file or directory
error: Failed build dependencies:
        httpd-devel is needed by mod_wsgi-3.5-1.el6.x86_64
$ sudo yum install httpd-devel -y
$ rpmbuild -bb mod_wsgi.spec
$ ls ../RPMS/x86_64
mod_wsgi-3.5-1.el6.x86_64.rpm  mod_wsgi-debuginfo-3.5-1.el6.x86_64.rpm
$ ## Yay! Now let's do the Python 2.7 version :-)
$ vim mod_wsgi.spec ## Add python2.7 to the minor version
$ diff mod_wsgi.spec mod_wsgi.spec-orig
2,3c2,3
< Version:        3.5
< Release:        1python27%{?dist}
---
> Version:        3.2
> Release:        6%{?dist}
33a34,37
> %patch2 -p1 -b .nokeyerror
> %patch3 -p1 -b .sslfuncs
> %patch4 -p1 -b .cve0240
> %patch5 -p1 -b .cve0242
$ scl enable python27 "rpmbuild -bb mod_wsgi.spec"
$ ls ../RPMS/x86_64
mod_wsgi-3.5-1.el6.x86_64.rpm  mod_wsgi-3.5-1python27.el6.x86_64.rpm  mod_wsgi-debuginfo-3.5-1.el6.x86_64.rpm  mod_wsgi-debuginfo-3.5-1python27.el6.x86_64.rpm
$ cp ../RPMS/x86_64/mod_wsgi* /afs/cern.ch/project/inspire/rpms

-- KaplunSamuele - 13 Oct 2014

Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2014-10-13 - KaplunSamuele
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Inspire All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback