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

Re: question re: best practices,



Jeff Johnson writes:
> Point me at any RPM doco that sez' not to use find to generate %files, and I
> will eradicate immediately.

http://www.rpm.org/support/RPM-HOWTO-6.html#ss6.8 sez:

    This is the section where you must list the files for the binary
    package. RPM has no way to know what binaries get installed as a
    result of make install. There is NO way to do this. Some have
    suggested doing a find before and after the package install. With
    a multiuser system, this is unacceptable as other files may be
    created during a package building process that have nothing to do
    with the package itself.

> Generating the %files manifest correctly is *THE* most painful part
> pf packaging, and there's no reason not to use find if it does a
> better job.

In my experience, the hardest part is not generating the files list
(for which we always use find), but getting the install to perform
correctly and cleanly into the ephemeral build root (which should be
called install root imiho).  For example, we use the following
incantations for make and install of Makefile.PL-based packages:

sub _perl_make {
    return
	'%define perl_make umask 022 && perl Makefile.PL < /dev/null && '
	. " make POD2MAN=true\n"
	. '%define perl_make_install umask 022; make '
	. join(' ', map {
	    my($n) = "install$_";
	    $Config::Config{$n}
		? (uc($n) . '=$RPM_BUILD_ROOT' . $Config::Config{$n})
	        : '';
	} qw(archlib bin man1dir man3dir privlib script
             sitearch sitebin sitelib usrbinperl))
	.  ' POD2MAN=true pure_install && '
        . ' find $RPM_BUILD_ROOT%{_libdir}/perl? -name "*.bs" '
	. " -o -name .packlist -o -name perllocal.pod | xargs rm -f\n";
}
    
I believe the MakeMaker guys are working on fixing this, but for now
this is the simplest solution which always seems to work.

Rob






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