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

Re: %file questions



In regard to: %file questions, Faheem Mitha said (at 10:37pm on Sep 22, 2000):

>1) Why is it not possible to have spec -ba work with the short-circuit
>option? Aargh! Ie. why can't we have an rpm built from an already
>installed buildroot? Or at least skip the make part?

Because that would defeat the reproducability of builds, which is one of
the primary goals of RPM.

You can circumvent this by modifying your spec files so that %prep/%build
and possibly other "do something" sections just "exit 0".  You're running
the risk of building RPMs that can't be reliably reproduced, though.  This
may make you unpopular.  :-)

>2) I need to install a bunch of files into the /etc directory. However,
>only some of these are to be treated as config files. Now, I would like to
>put
>
>%files  ...
>
>%config /etc/foo
>/etc    ...

That last line says that you own the /etc directory and everything underneath
it that RPM can find at build time.  You certainly don't own /etc, and if
you happen to *not* be using a BuildRoot, it also says that you own everything
under /etc.  That's not nice.

If you can construct a glob that includes only the files you're interested
in and doesn't result in any file getting listed twice (once explicitly like

%config /etc/foo/myfile

and once via a glob like

/etc/foo/m*e

then you can do what you want.  Otherwise, it's list them explicitly, or
use multiple carefully constructed globs, i.e.

%config /etc/foo/BigConfigFile
%config /etc/foo/somefile
%config /etc/foo/someotherfile
...

/etc/foo/[AC-Z]*
/etc/foo/[a-r]*
/etc/foo/[t-z]*

>thus designating only foo to be a config file and having all the other etc
>files be treated as `ordinary' files. However, rpm objects to files being
>listed twice. What would be a good way to handle this? One possible way
>would be if there was some macro that did, essentially

Carefully constructed globs, if you have a lot of files.  Explicitly listing
them if you don't.

>%files 
>
>%config /etc/foo
>/etc  except not /etc/foo

Sorry, does not exist.

Tim
-- 
Tim Mooney                              mooney@dogbert.cc.ndsu.NoDak.edu
Information Technology Services         (701) 231-1076 (Voice)
Room 242-J1, IACC Building              (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164





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