wiki:RebuildRpms
Last modified 11 years ago Last modified on 10/18/06 16:13:45

Many RPMs rebuild are not available for RHEL, here is a rough guide on rebuilding RPMs for RHEL.

  • Set up fedora-rpmdevtools from Fedora Extras
  • Add a user just for building RPMs:
    adduser machbuild
    su - machbuild
    fedora-buildrpmtree
    
  • Edit ~/.rpmmacros, for example:
    %_topdir      %(echo $HOME)/rpmbuild
    %packager       Joshua Daniel Franklin <joshuadf@u>
    %_tmpdir      %(echo $HOME)/tmp
    
    #%_smp_mflags  -j3
    
    # have built RPMs land in RPMS/ instead of RPMS/<arch>/
    %_rpmfilename  %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
    
    # don't use check-rpaths, it's a little too strict
    #%__arch_install_post   /usr/lib/rpm/check-rpaths   /usr/lib/rpm/check-buildroot
    %__arch_install_post   /usr/lib/rpm/check-buildroot
    
    # don't build debug RPMs
    %debug_package %{nil}
    
    

DKMS kernel modules

In the future, a better way of doing binary kernel modules would probably be DKMS which provides an automatic way of rebuilding a kernel modules for a newer kernel. FreshRPMs has SRPMs of binary graphics drivers using DKMS, for example Nvidia X11 drivers.

JPackage RPMs of Java software

http://jpackage.org/

Java is a popular programming language, but since running Java applications usually requires a proprietary interpreter, using Linux as a platform for developing Java applications has been difficult. The JPackage Project aims to make the process simpler.

First import the JPackage RPM key:

wget http://www.jpackage.org/jpackage.asc    
rpm --import jpackage.asc

Then, add the JPackage repositories to /etc/sysconfig/rhn/sources

cat >> /etc/sysconfig/rhn/sources <<EOF
yum jpackage16-generic http://mirrors.dotsrc.org/jpackage/1.6/generic/free/
yum jpackage16-rhes-4 http://mirrors.dotsrc.org/jpackage/1.6/redhat-el-4.0/free/
EOF

Now you can easily install packages from JPackage. But wait! Jpackage doesn't have permission to distribute Java itself or several other packages, so how do you get those? The answer is the JPackage "non-free" section which provide SRPMs and some small tips on where to get the source files. Often it takes some clicking around on a confusing Sun webpage to find the download. It can be helpful to install the SRPM and see where the build fails just to find out the name of the file you're looking for:

rpmbuild -ba rpmbuild/SPECS/java3d.spec 
error: File /home/brainj3d/rpmbuild/SOURCES/java3d-sdk-1.3.2-linux-i386.bin: No such file or directory

After you find the download, install the SRPM and put the source file in rpmbuild/SOURCES/. Here's an example with Java3d:

fedora-buildrpmtree 
wget http://mirrors.dotsrc.org/jpackage/1.6/generic/non-free/SRPMS/java3d-1.3.2-1jpp.nosrc.rpm
rpm -ihv java3d-1.3.2-1jpp.nosrc.rpm
less rpmbuild/SPECS/java3d.spec # find the source, click through agreements, etc.
mv java3d-sdk-1.3.1-linux-i386.bin rpmbuild/SOURCES/
rpmbuild -ba --without javadoc rpmbuild/SPECS/java3d.spec 

Nvidia and ATI drivers and kernel modules

On several machines including uvula, stylus, and femur I installed binary RPMs based on a guide at http://rpm.livna.org/kernel-modules.html This appears to be out of date regarding DKMS and modular xorg, but scripts on those machines use that methodology; for more information see #63.