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

Re: still confusion with the %doc directive in a spec file



On Mon, 2001-12-31 at 03:15, rpjday wrote:
> On Mon, 31 Dec 2001, Franz Sirl wrote:
> 
> > On Monday 31 December 2001 11:38, Giulio Orsero wrote:
> > > On Mon, 31 Dec 2001 05:12:09 -0500 (EST), you wrote:
> > > >%description
> > > >This package contains WonderPics, just random images as
> > > >a test for building a noarch RPM.
> > > >%prep
> > > >exit 0
> > > >%build
> > > >exit 0
> > > >%install
> > > >exit 0
> > > >%clean
> > > >exit 0
> > >
> > > The %setup macro is also missing.
> > 
> > yeah, the %setup does an implicit "cd <...>/BUILD/<package>" all other stages 
> > rely on (I always stumble over that when I temporarily hack specs after the 
> > packaging failed). It would be nice if each of %build/%install/%files would 
> > do that themselves, but unfortunately only %setup has the necessary knowledge 
> > about the path.
> > Hmm, one could say the default is always BUILD/<package-version>, unless a 
> > %setup -n was given, but that sounds quite ugly.
> 
> ok, this is getting decidedly ugly.  given that all i'm trying to do is
> create a simple noarch RPM with a few files inside it, it's not 
> unreasonable that i might have a spec file that has no %prep, %setup,
> %build or %install steps, as well as no source.

Actually, I disagree.  It -is- unreasonable.  
Check out the rpm design goals statement in the "Maximum RPM" book. 
I'll quote some of it here:
"
Make it easy to get packages on and off the system
Make it easy to verify a package was installed correctly
Make it easy for the package builder
Make it start with the original source code
Make it work on different computer architectures
"

You've missed out on the second to last design goal; "Make it start with
the original source code".  I've got quite a few noarch rpms that don't
do anything other than install some files onto the filesystem, but they
all have a source rpm, and source tag, that is meaningful.

You don't need to create a tarball to contain your sources either.  You
can simply list all of the files in different source tags, then put them
in place in the %install section.  Something like this:

Name:     foo
...
Source0:  README
Source1:  baz.png
Source2:  bar.jpg
...

%prep
mkdir %{_builddir}/%{name}-%{version}
cp %{Source0} .
cp %{Source1} .
cp %{Source2} .

%install

mkdir $RPM_BUILD_ROOT/tmp/wonderpics
install baz.png $RPM_BUILD_ROOT/tmp/wonderpics
install bar.jpg $RPM_BUILD_ROOT/tmp/wonderpics

%files
%defattr(-, root, root)
/tmp/wonderpics
%doc README


That's completely untested.

> and, finally, does this explain why the %doc files i add to the rpm can't
> be excluded on installation using "--excludedocs"?

Not sure about this one, I'll look into it a little bit further.  It's
possible that this is broken, as I don't know of very many rpms that
actually correctly tag their documentation files as %doc.
	Greg

-- 
Portland, Oregon, USA.





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