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

Re: Automating revision changes

On Jul 29, 2006, at 5:06 AM, John Calcote wrote:

I was wondering if there was already a well-considered way to add rpm
build capabilities to an Automake build system.

Here's my root-level Makefile.am:


EXTRA_DIST = arf.spec schema win32 doxygen examples
SUBDIRS = src test

        rm -rf `find $(distdir) -name .svn`

.PHONY: rpmdir srcrpm rpms

        -mkdir -p rpm/BUILD rpm/RPMS rpm/SOURCES rpm/SPECS rpm/SRPMS

Unless you *really* want the clutter of {BUILD,RPMS,SOURCES,SPECS,SRPMS}, you might want to think about configuring rpmbuild to put all the build elements into one

See ftp://wraptastic.org/pub/jbj/{xrpm,rpmrc,macros} for an explicit example.

My build cycle looks like
    xrpm -ivh foo*.src.rpm
    cd /X/foo
    xrpm -ba foo.spec
    xrpm -Uvh foo*.i386.rpm
    cd ..
    rm -rf foo
which is probably far simpler to write and maintain as Makefile rules.

xrpm is just a stupid wrapper to invoke
    rpmbuild --rcfile /X/rpmrc ...
in order to bring in the per-package-directory build configuration.

srcrpm: dist-bzip2 rpmdir
        rpmbuild -ts --define='_topdir $(PWD)/rpm' $(distdir).tar.bz2

rpms: dist-bzip2 rpmdir
        rpmbuild -ta --define='_topdir $(PWD)/rpm'
--buildroot=$(PWD)/rpm/tmp $(distdir).tar.bz2


I was also wondering if there was a good way to automate revision
changes in spec files, makefiles, etc. I use subversion for my
repository, and it occurs to me that a good way to tell if I even need a
build is to compare the root-level "svn info" Revision: tag with the
last time I built. -- Revisions the same? No need to build again! --

There's a number of ways to automate the revision, depending on
what you wish to achieve.

For starters, there is a CvsID: tag in spec files (in rpm-4.4.7, I fergit when added), that will permit tracking what CVS revision was used for then build. IIRC, there is
SvnID: as well, an alias for the same header tag.

There's certainly no reason why the Release: tag cannot be used to carry the repository identifier. One would have to insure that the repository identifier
preserved upgradeability.

Automating is probably achieved most simply by modifying a spec file template using sed or m4 before building. Not hard at all with Makefile rules and file
timestamp dependencies.


73 de Jeff

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