Re: Multiple packages out of a single build?

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

 



On Wed, 2011-11-09 at 10:40 +0100, Marco wrote:
> Let me clarify what I mean. I have a makefile that has some targets to
> create rpm packages. They are all the same; the only part that differs
> is that the files are installed to different target directories, so
> the target rpm-foo has a %install section where it installs to
> ${RPM_BUILD_ROOT}/usr/local/foo, the target rpm-bar has a %install
> section where it installs to ${RPM_BUILD_ROOT}/usr/local/bar, etc.
> Other than that, everything else is the same (including the expensive
> %build part where the source is compiled).
> Now I was wondering if there was a way to execute the %build only
> once, but still generate multiple packages (each one with its own
> target directory) without needing to repeat the whole process for each
> one (like eg having multiple %install - I don't even know if that is
> possible, but looking for ideas).

You could add a subpackage for each of these, e.g. a specfile like this
would produce packages mypkg-foo and mypkg-bar:

...
Name: mypkg
...
%package foo
...
%description foo
...
%package bar
...
%description bar
...
%build
# build both foo and bar
...
%install
# install both foo and bar
...
%files foo
%dir /usr/local/foo
/usr/local/foo/...
...
%files bar
%dir /usr/local/bar
/usr/local/bar/...
...

HTH,
Nils
-- 
Nils Philippsen      "Those who would give up Essential Liberty to purchase 
Red Hat               a little Temporary Safety, deserve neither Liberty
nils@xxxxxxxxxx       nor Safety."  --  Benjamin Franklin, 1759
PGP fingerprint:      C4A8 9474 5C4C ADE3 2B8F  656D 47D8 9B65 6951 3011

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxxxxx
http://lists.rpm.org/mailman/listinfo/rpm-list


[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux