Re: ... binary RPM question ...

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

 



On Wed, Jun 20, 2007 at 02:33:51PM -0700, Leland Ray wrote:

> There are two choices to how to call rpmbuild in this
> case. First method is if you wanted to use a
> tar/gzipped runtime direcotry as input to rpm
> packaging. Second method is if you want to just
> produce rpms at the end of your build process.
> 
> For method 1:
> 
> Your spec would skip the %pre and %build step, and
> would have no Source: tag. 

If you don't have a Source: tag, where do you get your files from?
Out of the blue?  From "what's there at that moment"?

This is against common RPM rules, even those that apply to packaging
binary software.

> The %install scriptlet would create $RPM_BUILD_ROOT,
> and untar / unzip your runtime tree.

Right, and your "runtime tree" should be included as "source".

> For %files, you can probably use just a wildcard,
> assuming your build system doesn't include extraneous
> files in the runtime directory.

This depends.  *Only* of that extracted tree contains, say,
/usr/lib/myproduct/... and nothing else, you can include
just /usr/lib/myproduct.  But never include a system
directory (like /usr, /usr/lib, etc.) in your binary RPM,
so wildcards like /usr/* or /* should never be used.

> The build system would call rpmbuild prior to tar/gzip
> of the runtime directory. You would redefine macros on
> the command line to rpmbuild so that to rpm, the build
> root is the same as the base of the runtime directory.
> 
> You may also need to define several other macros, but
> knowing about the one will get you started.

Also against the way RPM is intended to be used.

The proper way, IMHO, is using the tar'ed binary tree as source
file.

...
Source: myproduct.tar.gz
...

%prep
# create dir before untarring
%setup -c

%build
# probably empty

%install
mkdir -p %{buildroot}
# assuming you tar has a directory tree from the root
cp -a * %{buildroot}/

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
# whatever is appropriate
/usr/bin/*
/usr/lib/*


The shortcut could be to not extract the source in %prep, but to
untar that manually in %install:

cd %{buildroot}
tar -xzf %{SOURCE0}


But in my experience, having packaged many third-party binary stuff,
you often want to tweak some things (maybe not needed in your case).


Have fun,

-- 
--    Jos Vos <jos@xxxxxx>
--    X/OS Experts in Open Systems BV   |   Phone: +31 20 6938364
--    Amsterdam, The Netherlands        |     Fax: +31 20 6948204

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/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