New tools to help with building RPMS



Hello everyone,

I have been working on some tools to help build RPMs for gnome.  Unlike
other sets of tools, I have been trying to minimise the amount of
recompilation necessary when I update my source (which is important on my 
486:).  So rather than creating a tar archive of the distribution, then
run rpm on the spec file, I just run make, then followed by "make install"
with a temporary directory as prefix, then run my rpmbuild script with the
temporary directory as a build root.

The way my script works is that it takes a normal RPM spec file (such as
gnome-libs.spec), copies it to a temp file, removes build instructions,
sets the values of a few macros and then calls "rpm -bb" to build a binary
package.

In fact you can even call the script from the Makefile.  You might add
something like this to the Makefile:
  SPEC=gnome-libs.spec
  rpm: rpmbuild $(SPEC)
          make all
          make install prefix=/tmp/$(PACKAGE)-root$(prefix) \
            exec_prefix=/tmp/$(PACKAGE)-root$(exec_prefix)
          ./rpmbuild --prefix=$(prefix) --exec-prefix=$(exec_prefix) \
            --pkgversion=$(VERSION) --buildroot=/tmp/$(PACKAGE)-root \
            --spec=$(SPEC)
          rm -rf /tmp/$(PACKAGE)-root

This will output a binary RPM in the build directory when you type "make
rpm".

Another script I wrote is called modtimes, and can be run just before
rpmbuild.  What it does is to go through the temporary build root and
check which files are different from those currently on your system.  If a
file is the same, it sets the modification time to the current file's
time.  The reason to do this is so that when you install a new RPM of
gnome-libs-devel, automake doesn't rebuild everything that depends on it
(only those parts that really need to be rebuilt).

To enable this feature, add the line 
   ./modtimes --buildroot=/tmp/$(PACKAGE)-root
to the makefile fragment, just above the call to rpmbuild.

You can get these two scripts from
ftp://ftp.daa.com.au/pub/james/gnome/rpmbuild.tar.gz

If anyone has any questions about them or wants to tell me what they
think of them, just mail me.

Bye,

James Henstridge.

--
Email: james@daa.com.au
WWW:   http://www.daa.com.au/~james/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]