Results 1 to 4 of 4

Thread: Building an RPM on Mandriva Linux

  1. #1
    Join Date
    Nov 2005
    Posts
    1,203

    Building an RPM on Mandriva Linux

    Compile and install an application are two different things.Here installation of software is not mention.

    Why compile a Packetage source (SRPM)?

    • create rpms from source, it avoids to put across its disk (case tarball>. / Configure & & make & & make install). On a distrib that handles packages with urpmi Mandriva as it also allows the system to aware of what is installed / uninstalled
    • Optimize the application to its system with its specific FLAGS CPU
    • Ie cross-compiler. compile on a machine could one tarball or src.rpm for an old Pentium that it would take hours


    1. Building an RPM from a source RPM (SRPM)
    2. Building an RPM from the source raw *. tar.gz

  2. #2
    Join Date
    Nov 2005
    Posts
    1,203

    Re: Building an RPM on Mandriva Linux

    1. Building an RPM from a source RPM (SRPM)

    Configuration

    Tools:

    We present here those under Mandriva:
    • The rpm package is the Red Hat patched for Mandriva. (version 4.2.2 on mdk-10.0, as rpm-build)
    • The rpm-build package contains the scripts used to build packages.
    • The package spec-helper is a tool to minimize the spec files realizing automatically certain actions, such as "stripping" the binaries & compress man pages.
    • The libtool package are used by some configure scripts to build shared libraries.


    Tree & rpm configuration files

    Create the tree needed to rpm :

    To build packages, rpm needs a special tree in the home user. This tree can be created with the following command:
    mkdir-p ~ / rpm / (BUILD, RPMS / $ ARCH, RPMS / noarch, SOURCES, SRPMS, SPECS, tmp)
    In this line, replace $ ARCH in architecture ,for which they will be built these packages but generally i586, and it can also be sparc / alpha / ppc or (i386, i586, athlon ).
    You will therefore ultimately something like this:
    rpm /:
    BUILD / RPMS / SOURCES / SPECS / SRPMS / tmp /
    / RPMS:
    athlon / i386 / i486 / i586 / i686 / noarch /
    Note: do everything as root at your own risk , as all that "root" key, the packages are built and created in / usr / src / rpm / (Mandriva 2009.)
    Configuration files "standards" on mandrake 10:

    RPM is configured by:

    / usr / share / rpm / rpmrc or / usr / lib / rpm / rpmrc on later versions of Mandriva): default configuration for the distrib> Do not edit!
    / etc / rpmrc configuration for the machine (not by default, see sample below)
    ~ /. rpmrc & ~ /. rpmmmacros: personal configuration to avoid risks, or to compile another machine (ie another CPU architecture).
    ~ /. rpmrc:

    buildarchtranslate: i386: i586
    buildarchtranslate: i486: i586
    buildarchtranslate: i586: i586
    buildarchtranslate: i686: i586
    ~ /. rpmmacros
    _topdir% $ HOME / rpm
    % _tmppath $ HOME / rpm / tmp

    % gpg _signature
    Mandrakelinux _gpg_name%
    _gpg_path% ~ /. gnupg
    Mandrakelinux%
    % vendor Mandrakesoft
    By replacing '$ HOME' in your home directory.

  3. #3
    Join Date
    Nov 2005
    Posts
    1,203

    Re: Building an RPM on Mandriva Linux

    Optimize or not

    customize $ HOME / .rpmrc with optflags for the CPU on which you need to install the application!
    • Use urpmi sources with expanded and updated allows for better results. After all equipment is the need to optimize .not the apps.
    • We can build an RPM from a tarball if there is not yet packaged version to keep the system clean, fully manageable with urpmi but without optimization.
    • In this case create and use configuration files and follow the standard method on MandrivaRpmHowTo below.


    Note:
    One of the mantras of software development is do not optimize. Let the hardware do that. You stick to keeping the bugs out. Somebody else can work putting them.
    AMD Athlon XP

    If you have an AMD Athlon XP, you can leave only the following in your $ HOME / .rpmrc:
    buildarchtranslate: i386: athlon
    buildarchtranslate: i486: athlon
    buildarchtranslate: i586: athlon
    buildarchtranslate: i686: athlon
    buildarchtranslate: athlon: athlon
    We must customize $ HOME / .rpmrc with optflags referred to the CPU.
    The decision to optimize or not its belong to you, so you must know that the optimization is often at the expense of stability. Hence the need to change only the configuration files rpm in $ HOME, this helps to make some tests

  4. #4
    Join Date
    Nov 2005
    Posts
    1,203

    Re: Building an RPM on Mandriva Linux

    Put a particular software update by rebuilding a binary package:

    1. Download the source rpm
    2. The rebuild as root:
      pmbuild - rebuild <non_du_source_rpm>
      FLAGS use to compile, add the parameter - target athlon:
      rpmbuild - rebuild - target athlon <not_the_source_rpm>
    3. Install the binary that is in the directory configured earlier, such home/src/RPM/RPMS/i586 $ .There is two options .
      • you defined in your urpmi sources, a local source that you put in days when you "rebuild": / usr / src / RPM / RPMS / athlon
      • If you go in the reply. * urpmi and works just as well as an rpm-U (It's even better if you need a library that is not on your machine).
    4. If the request SRPM bookshops for the installation before continuing ...

    Advantages:
    You can compile the sources according to the spec file of source_rpm (three phases: configure install).Cf man rpmbuild In addition.

    2. Building an RPM from the source raw *. tar.gz

    In other words how to transform a source package *. tar.gz to *. src.rpm? You can have a interesting application freshmeat that will warns you and available for all.Download it and place the file in the source directory.Well all organized around the spec file and it depends greatly on the distribution tree.The spec files of Mdk links to organize the applications, they are based on the Debian menu to update menus, etc..So your tar.gz contains a spec file that should probably change.This is the time you start studying to become a specfiles Mandriva contributor.

Similar Threads

  1. Java problem with Mandriva Linux
    By Bricklayer in forum Operating Systems
    Replies: 4
    Last Post: 26-07-2010, 01:41 PM
  2. Can not access USB on Mandriva Linux
    By Amy Adams in forum Operating Systems
    Replies: 5
    Last Post: 11-03-2010, 09:40 AM
  3. Mandriva Linux issues
    By NetworkeR in forum Operating Systems
    Replies: 4
    Last Post: 12-12-2009, 06:13 PM
  4. Need a List of Mandriva Based Linux
    By KDE_RuLeZ in forum Operating Systems
    Replies: 5
    Last Post: 11-12-2009, 08:47 AM
  5. Which Linux : Mandriva or Kubuntu
    By Baker in forum Operating Systems
    Replies: 3
    Last Post: 22-04-2009, 12:14 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,874,428.23743 seconds with 17 queries