Building RPM packages from tar.gz archives

Building RPM packages from tar.gz archives

With working rpm -ta

If you are runnig a system with RPM support, the preferred way to install Kwave on your system will be the creation of a nice RPM package. First you should get the current source of Kwave, either as a tar.gz archive from the Kwave download page or check out an up-to-date copy via anonymous CVS (like described in the chapter about CVS) and read the next chapter.

If you have downloaded a tar-gz archives of Kwave, create and install the RPMs just by doing the following steps (where [arch] stands for the platform you have built the package and might be something like i386, i586, sparc or whatever, XXX stands for the version number you have downloaded).

To build the Kwave package and install it do:

% rpm -ta kwave-XXX.tar.gz
% rpm -i /usr/src/redhat/RPMS/[arch]/kwave-XXX.[arch].rpm

Note

Note for SuSE users: you have to specify the directory /usr/src/packages instead of /usr/src/redhat !

If you haven't seen any errors, then that's it and you can skip the rest of this chapter. If rpm was unable to build the packages and says something like "spec file not found", then go on and read the rest of this section.

Caution

The support for the rpm -ta ... might be broken on some versions of rpm. The rpm program originally shipped with SuSE-6.4 (rpm-3.0.4) didn't work. You should update your rpm package, e.g. from the SuSE ftp server.

With broken rpm -ta support

If you can't get rpm -ta working, here are the steps for making that manually (the hard way):

  1. Go to your RPM "topdir". This normally is /usr/src/redhat for the redhat distribution or /usr/src/packages if you have the SuSE distribution.

    % cd /usr/src/redhat
    

  2. Put the tar.gz archive into the SOURCES subdirectory (you have to replace "somewhere" with the real directory where the files are, of course).

    % cp /somewhere/kwave-XXX.tar.gz SOURCES
    

  3. Extract the spec file from the archives and put it into the SPEC subdirectory.

    % tar -xOzf SOURCES/kwave-XXX.tar.gz \*.spec > SPECS/kwave.spec
    

  4. Let rpm do the compile job and generate the rpm of Kwave. If you only want to make a binary package, you can specify -bb instead of -ba, or just -bs to build only a source package.

    % rpm -ba SPECS/kwave.spec
    

  5. If everything was ok, you can install the binary rpm of Kwave, it will be in the BUILD directory. If you already have a version of Kwave installed, please remove it first or use the parameter -U instead of -i for upgrading instead of installing.

    % rpm -i BUILD/[arch]/kwave-XXX.[arch].rpm
    

KDE Logo