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

Re: %doc and -n fullpath

Circa 2003-01-13 13:10:22 -0600 dixit mw-list-rpm-list@csi.hu:

: > For example, RPM expects that unpacking beverlyhills-9.0210.tar.gz
: > creates the directory beverlyhills-9.0210, which contains the rest of
: > the beverlyhills source.


: > That's when you use '%setup -n <directory-name>'.  Using it
: > with ${RPM_BUILD_ROOT} makes no sense.
: It certainly does make sense for the package I am trying to build an
: rpm for: it is Dan Bernstein's daemontools package.  The installation
: of the package has some hardcoded paths in it.  When you do 
: tar zxvf daemontools-0.76
: all the sources are installed under
: ./admin/daemontools-0.76/
: The build then builds in the directory
: ./admin/daemontools-0.76/compile
: and then installs the binaries in
: admin/daemontools-0.76/command
: (the programs become available by creating symlinks in /command)
: So you see that the build- and destdirs are under the same subdir:
: admin/daemontools-0.76/.

Doesn't matter.  RPM_BUILD_ROOT should be an absolute path.  The
argument to %setup's '-n' should be a relative path---preferably a
single path element that names a directory:

  Name: daemontools
  Version: 0.76

  %setup -n admin
  cd %{name}-%{version}
That said, if you want to follow DJB's slashpackage system, why are you
building an RPM package?  Why not unpack the archive undir /package,
build, and then tar it up?

If you don't intend to follow the slashpackage system, then you should
not use ${RPM_BUILD_DIR}/admin/daemontools-0.76 as RPM_BUILD_ROOT;
rather, you should use a different buildroot--for example:

  BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot

and then create the hierarchy you want and install the necessary files
there in the %install section.  If you are really sure that you want to
make a slashpackage-compatible RPM package, you can even do that, and
it is likely to be a much more reliable solution:

  rm -rf "${RPM_BUILD_ROOT}"
  mkdir -p "${RPM_BUILD_ROOT}/package/admin/%{name}-%{version}"
  chmod +t "${RPM_BUILD_ROOT}/package/admin"
  # If you used 'setup -n admin' in the prep section above,
  # then you're currently located in ${RPM_BUILD_DIR}/admin.
  cd "%{name}-%{version}"
  cp -pR command "${RPM_BUILD_ROOT}/package/admin/%{name}-%{version}"

Good luck.

jim knoble  |  jmknoble@pobox.com  |  http://www.pobox.com/~jmknoble/
(GnuPG fingerprint: 31C4:8AAC:F24E:A70C:4000::BBF4:289F:EAA8:1381:1491)
"I am non-refutable."  --Enik the Altrusian

Attachment: pgp00012.pgp
Description: PGP signature

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