Build Python-2.4.6 RPM for Centos 6

Discussion in 'Other Operating Systems' started by NigeMar, Dec 18, 2012.

  1. NigeMar

    NigeMar Member

    Joined:
    Jul 21, 2007
    Messages:
    389
    Hello,

    I seem to to having some difficulty build and RPM to redistribute Python 2.4 as the place I work for has a dependency on legacy Python.

    At present I can build an empty rpm package from the spec file I have created. From what I can work out is the %files secion is no putting the files in the package and I cant seem to find out from the package itself whether not by default it grabs the files form the BUILDROOT, which case why does it not place the files in the package.

    Code:
    %define version 2.4.6
    %define name Python
    
    Summary: Python Programming Langunage
    License: GPL v2
    Group: Devlopement Languages
    Name: %{name}
    Source: %{name}-%{version}.tar.gz
    Version: %{version}
    Release: 1
    URL: http://www.python.org/ftp/python/2.4.6/Python-2.4.6.tgz
    Packager: Name Surname <name.surname@company.com>
    
    %description
    Python is an interpreted, interactive, object-oriented programming
    language often compared to Tcl, Perl, Scheme or Java. Python includes
    modules, classes, exceptions, very high level dynamic data types and
    dynamic typing. Python supports interfaces to many system calls and
    libraries, as well as to various windowing systems (X11, Motif, Tk,
    Mac and MFC).
    
    Programmers can write new built-in modules for Python in C or C++.
    Python can be used as an extension language for applications that need
    a programmable interface. This package contains most of the standard
    Python modules, as well as modules for interfacing to the Tix widget
    set for Tk and RPM.
    
    %prep
    %setup
    
    echo "BUILDROOT = $RPM_BUILD_ROOT"
    
    %build
    ./configure --prefix=/opt/Python/2.4.6 --disable-ipv6
    make
    
    %install
    make install PREFIX=$RPM_BUILD_ROOT
    
    %files
    %defattr(-,root,root)
    /
    
    %clean
    #rm -fr $RPM_BUILD_ROOT
    
    Any guidance would be greatly appreciated.

    I have been using the following pages:
    Fedora RPM Guide
    RPM Org Guide which is a little out of date.

    Thanks
    -Nigel
     
  2. mwil7034

    mwil7034 Member

    Joined:
    Jan 15, 2003
    Messages:
    612
    Location:
    Woy Woy
    you need to list all the files with their full path,

    ie taken from the fedora guide,

    %files
    /usr/X11R6/bin/xtoolwait
    /usr/X11R6/man/man1/xtoolwait.1

    filename wildcards are acceptable
    /usr/X11R6/bin/xtool* for example

    or directories
    /usr/X11R6/bin

    these would be relative to the root of the target system, or build root in this case
     
    Last edited: Dec 19, 2012
  3. wellonchompy

    wellonchompy Member

    Joined:
    May 29, 2002
    Messages:
    747
    Location:
    Sydney
    I just tried to build the SRPM of Python 2.4.3 from CentOS 5 on CentOS 6, but it looks like the source has errors that weren't critical on older versions of gcc.

    You might want to download the SRPM yourself to check out the spec file. Hundreds of patches aside, the spec is pretty detailed.

    http://vault.centos.org/5.8/updates/SRPMS/python-2.4.3-46.el5_8.2.src.rpm
     
  4. OP
    OP
    NigeMar

    NigeMar Member

    Joined:
    Jul 21, 2007
    Messages:
    389
    Hi Guys,

    Thanks for the help, I have finally got the thing to package and install. Ran into a few dependency problems but they are now fixed. I can post my spec file if anyone is interested :)

    -Nigel
     

Share This Page

Advertisement: