[lug] Building RPMs - alternate install directories

Kenneth D Weinert kenw at quarter-flash.com
Tue Jul 14 10:27:44 MDT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

OK, so it's coming along fairly well.

I am running into a specific problem - I've been told I need to install
into a separate directory, /tools.

Under /tools it will have the normal directory structure (bin, lib, etc)
but I'm having a difficult time sorting out exactly how to do that in
the spec file.

I'm building locally, and the install in my Makefile is going to the
right place, but stuff like the documentation is a problem.

If I use %doc  then it wants to put the documents in /usr/share/doc/...
but putting the full path doesn't get stuff installed and I end up with
errors.

Part of the spec file:

%files devel
%defattr(-,root,root)
/tools/include/config/config.h
/tools/include/config/log.h
/tools/share/doc/%{name}-%{version}/examples

%files
%defattr(-,root,root,-)
/tools/lib/libconfig.so.*
%doc /tools/share/doc/%{name}-%{version}/AUTHORS
%doc /tools/share/doc/%{name}-%{version}/ChangeLog
%doc /tools/share/doc/%{name}-%{version}/COPYING
%doc /tools/share/doc/%{name}-%{version}/NEWS
%doc /tools/share/doc/%{name}-%{version}/README


I don't recall that it made a difference whether or not I use the %doc
macro.  If I use it this way:

%doc AUTHORS ChangeLog COPYING NEWS README

then the files get installed, but into /usr/share/doc/...

- From rpmbuild -ba config.spec:
Processing files: config-1.0.0-7
error: File not found:
/var/tmp/config-1.0.0-7-root-kenw/tools/share/doc/config-
1.0.0/AUTHORS
error: File not found:
/var/tmp/config-1.0.0-7-root-kenw/tools/share/doc/config-
1.0.0/ChangeLog
/var/tmp/config-1.0.0-7-root-kenw/tools/share/doc/config-
1.0.0/COPYING
error: File not found:
/var/tmp/config-1.0.0-7-root-kenw/tools/share/doc/config-
1.0.0/NEWS
error: File not found:
/var/tmp/config-1.0.0-7-root-kenw/tools/share/doc/config-
1.0.0/README
Processing files: config-devel-1.0.0-7
error: File not found:
/var/tmp/config-1.0.0-7-root-kenw/tools/share/doc/config-
1.0.0/examples
Processing files: config-debuginfo-1.0.0-7
Checking for unpackaged file(s): /usr/lib/rpm/check-files
/var/tmp/config-1.0.0-
7-root-kenw
error: Installed (but unpackaged) file(s) found:
   /tools/lib/libconfig.so


Note that it's finding the soft linked library (the linking is done in
the Makefile as the ldconfig doesn't appear to do that, even when I was
putting it in /usr/local/lib, mainly, I think, because when ldconfig is
run I get an error:  /usr/lib is not a shared library) which I'll
probably need to fix at some time as well.

I'm still very willing to look at references, I'm just not finding
anything that addresses this situation. A result, I'm sure, of me not
using the right keywords. I usually end up finding how to *build* in an
alternate directory (which is working great), or how to make a package
relocatable, but not anything about using the normal macros and
installing into an alternate directory.

So, pointers and other advice are *greatly* appreciated.

Thanks.

- --
Ken
We're all just one decision away from Stupidity.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkpcsgAACgkQH0OpnUzq8fD62gCfWz7xrD83EuYcbibXo8sk/sT/
VMIAn1738x1SOd/fQ8v2sM2NWW9xRdkx
=1i9K
-----END PGP SIGNATURE-----



More information about the LUG mailing list