[opensuse-packaging] rpmbuild - %doc keeps wiping out additional %docdir files?
All, I need help. I am working on packaging WordNet. Doing so, I have 5 doc files in the base directory of the source packages I want in the documentation directory of the final package: %doc AUTHORS ChangeLog COPYING LICENSE README Fine - works, puts the files in /usr/share/doc/packages/WordNet where I want them. However, I also have the html, pdf, and ps documentation directories I want to put in that SAME directory. In the %install section I create the directory and move the documentation dirs (html,pdf,ps) to /usr/share/doc/packages/WordNet with the following: # Make proper document dir, mv doc files, rm old doc dir mkdir -p %{buildroot}/usr/share/doc/packages/WordNet mv %{buildroot}/usr/doc/* %{buildroot}/usr/share/doc/packages/WordNet rm -rf %{buildroot}/usr/doc/ I then add: %files ... %docdir /usr/share/doc /usr/share/doc rpmbuild completes fine, but NONE of the (html,pdf,or ps) directories are present in the final package. None of these exists: /usr/share/doc/packages/WordNet/html /usr/share/doc/packages/WordNet/pdf /usr/share/doc/packages/WordNet/ps Grr.. From research I found that this was due to the %doc AUTHORS... line wiping out everything else in the /usr/share/doc/packages/WordNet directory -- the reason given: "that is just rpm being dumb, that's just the way it has always been." But there was no explanation how to fix this issue. It seems simple. All I want to do is move the documentation from %{buildroot}/usr/doc/{html,pdf,ps} to %{buildroot}/usr/doc/packages/WordNet/{html,pdf,ps} and include those directories along with the files AUTHORS ChangeLog COPYING LICENSE and README. But how do I do it without the first %doc line wiping them out? I have given up in the interim and just created a %{buildroot}/usr/doc/packages/WordNet-docs directory and move the html, pdf and ps directories there, but I really would like all documentation under /usr/share/doc/packages/WordNet. How do I do that?? Here is my current %files setup. %files %defattr(-,root,root) /usr/bin /usr/include /usr/lib64 /usr/lib /usr/share/applications /usr/share/pixmaps /usr/share/wordnet %doc AUTHORS ChangeLog COPYING LICENSE README %docdir /usr/share/doc/packages/WordNet-docs /usr/share/doc/packages/WordNet-docs What say the masters? What is the trick? The full spec file is here: http://www.3111skyline.com/dl/openSUSE/pkg/wordnet.spec -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Sun 16 Feb 2014 08:13:01 PM CST, David C. Rankin wrote:
All,
I need help. I am working on packaging WordNet. Doing so, I have 5 doc files in the base directory of the source packages I want in the documentation directory of the final package:
Hi Just remove them after install, then use the %doc in the %files to install them.... eg; %doc AUTHORS ChangeLog COPYING LICENSE README %doc html/* pdf/* ps/* -- Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890) openSUSE 13.1 (Bottle) (x86_64) GNOME 3.10.2 Kernel 3.11.10-7-desktop up 4 days 22:58, 3 users, load average: 0.05, 0.05, 0.05 CPU Intel® B840@1.9GHz | GPU Intel® Sandybridge Mobile -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
"David C. Rankin"
All,
I need help. I am working on packaging WordNet. Doing so, I have 5 doc files in the base directory of the source packages I want in the documentation directory of the final package:
%doc AUTHORS ChangeLog COPYING LICENSE README
Fine - works, puts the files in /usr/share/doc/packages/WordNet where I want them. However, I also have the html, pdf, and ps documentation directories I want to put in that SAME directory. In the %install section I create the directory and move the documentation dirs (html,pdf,ps) to /usr/share/doc/packages/WordNet with the following:
# Make proper document dir, mv doc files, rm old doc dir mkdir -p %{buildroot}/usr/share/doc/packages/WordNet mv %{buildroot}/usr/doc/* %{buildroot}/usr/share/doc/packages/WordNet rm -rf %{buildroot}/usr/doc/
I then add:
%files ... %docdir /usr/share/doc /usr/share/doc
rpmbuild completes fine, but NONE of the (html,pdf,or ps) directories are present in the final package. None of these exists:
/usr/share/doc/packages/WordNet/html /usr/share/doc/packages/WordNet/pdf /usr/share/doc/packages/WordNet/ps
Grr.. From research I found that this was due to the %doc AUTHORS... line wiping out everything else in the /usr/share/doc/packages/WordNet directory -- the reason given: "that is just rpm being dumb, that's just the way it has always been." But there was no explanation how to fix this issue.
It seems simple. All I want to do is move the documentation from
%{buildroot}/usr/doc/{html,pdf,ps}
to
%{buildroot}/usr/doc/packages/WordNet/{html,pdf,ps}
and include those directories along with the files AUTHORS ChangeLog COPYING LICENSE and README. But how do I do it without the first %doc line wiping them out?
I have given up in the interim and just created a %{buildroot}/usr/doc/packages/WordNet-docs directory and move the html, pdf and ps directories there, but I really would like all documentation under /usr/share/doc/packages/WordNet. How do I do that??
Here is my current %files setup.
%files %defattr(-,root,root) /usr/bin /usr/include /usr/lib64 /usr/lib /usr/share/applications /usr/share/pixmaps /usr/share/wordnet %doc AUTHORS ChangeLog COPYING LICENSE README %docdir /usr/share/doc/packages/WordNet-docs /usr/share/doc/packages/WordNet-docs
What say the masters? What is the trick?
The full spec file is here:
If you have a bugzilla account, you have build.opensuse.com account. Using OBS and the associated osc command is one of the greatest benefits of being a opensuse user/packager. You should check it out. And all opensuse lists except the user lists like this one and the equivalent language (e.g.. German) lists are open to non-subscribers. Just email the appropriate address and say you aren't subscribed and ask to be kept in copy of replies. As to your question, I think you can have directories on the %doc line, so assuming there is a folder named "documentation" in the source folder, just do %doc AUTHORS ChangeLog COPYING LICENSE README documentation %doc is a macro that creates the doc dir, copies files (and I think folders) to it, then includes the copied files (and folders?) in the rpm. If you don't want to have a directory and have just the files, then list them individually. %doc AUTHORS ChangeLog COPYING LICENSE README documentation/* If the files have to be created, then create them in them in the %build section. Don't install anything for that folder manually at all. Greg -- Sent from my Android phone with K-9 Mail. Please excuse my brevity. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Monday 2014-02-17 03:13, David C. Rankin wrote:
# Make proper document dir, mv doc files, rm old doc dir mkdir -p %{buildroot}/usr/share/doc/packages/WordNet mv %{buildroot}/usr/doc/* %{buildroot}/usr/share/doc/packages/WordNet rm -rf %{buildroot}/usr/doc/
You could just use %configure --docdir="%_docdir/%name"
"that is just rpm being dumb, that's just the way it has always been."
And that is in fact the reason :^) Either you (1) use "%doc foobar" in %files, *or* (2) you copy things in %install (as you already did) and use "%_docdir/%name/" in %files instead. You won't lose anything doing it style 2. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On 02/17/2014 01:53 AM, Jan Engelhardt wrote:
On Monday 2014-02-17 03:13, David C. Rankin wrote:
# Make proper document dir, mv doc files, rm old doc dir mkdir -p %{buildroot}/usr/share/doc/packages/WordNet mv %{buildroot}/usr/doc/* %{buildroot}/usr/share/doc/packages/WordNet rm -rf %{buildroot}/usr/doc/
You could just use %configure --docdir="%_docdir/%name"
"that is just rpm being dumb, that's just the way it has always been."
And that is in fact the reason :^) Either you (1) use "%doc foobar" in %files, *or* (2) you copy things in %install (as you already did) and use "%_docdir/%name/" in %files instead.
You won't lose anything doing it style 2.
Thank you Jan, Greg, What made the --docdir="%_docdir/%name" option undoable was the limited control provided by the configure script in WordNet itself: Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] That and the fact that it installs the documentation by default in PREFIX/doc. That prompted the manual move of the files in %buildroot after %build. I'll give the %doc ... /html /pdf /ps idea a go, but in reading the rpmbuild documentation and the Maximum RPM documentation, it does not mention that %doc will also handle directories. If that fails, we'll use %docdir on all. Will report back with success/failure. Thanks. -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Mon, Feb 17, 2014 at 2:09 PM, David C. Rankin
On 02/17/2014 01:53 AM, Jan Engelhardt wrote:
On Monday 2014-02-17 03:13, David C. Rankin wrote:
# Make proper document dir, mv doc files, rm old doc dir mkdir -p %{buildroot}/usr/share/doc/packages/WordNet mv %{buildroot}/usr/doc/* %{buildroot}/usr/share/doc/packages/WordNet rm -rf %{buildroot}/usr/doc/
You could just use %configure --docdir="%_docdir/%name"
"that is just rpm being dumb, that's just the way it has always been."
And that is in fact the reason :^) Either you (1) use "%doc foobar" in %files, *or* (2) you copy things in %install (as you already did) and use "%_docdir/%name/" in %files instead.
You won't lose anything doing it style 2.
Thank you Jan, Greg,
What made the --docdir="%_docdir/%name" option undoable was the limited control provided by the configure script in WordNet itself:
David, Is there something wrong with the way it is currently done in the Education project for the wordnet package? https://build.opensuse.org/package/view_file/Education/wordnet/wordnet.spec?...
From the %install section:
# Remove duplicate copies of docs installed by make install rm -rf %{buildroot}%{_datadir}/%{name}-%{version}/doc # Remove useless Makefiles installed by %%doc rm -rf doc/{html,ps,pdf}/Makefile*
From the %files section:
%doc AUTHORS COPYING INSTALL ChangeLog README doc/{html,ps,pdf} Greg -- Greg Freemyer -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On 02/17/2014 01:09 PM, David C. Rankin wrote:
And that is in fact the reason :^) Either you (1) use "%doc foobar" in %files, *or* (2) you copy things in %install (as you already did) and use "%_docdir/%name/" in %files instead.
Ok, No dir on %doc line: %doc AUTHORS ChangeLog COPYING LICENSE README /usr/doc/html /usr/doc/pdf /usr/doc/ps <snip> Processing files: WordNet-3.0-2.x86_64 error: Two files on one line: /usr/doc/html error: Two files on one line: /usr/doc/pdf error: Can't mix special %doc with other forms: /usr/doc/ps So trying the %docdir for-all approach: # Make proper document dir, mv doc files, rm old doc dir mkdir -p %{buildroot}/usr/share/doc/packages/WordNet mv %{buildroot}/usr/doc/* %{buildroot}/usr/share/doc/packages/WordNet rm -rf %{buildroot}/usr/doc/ cp %{_builddir}/%{name}-%{version}/{AUTHORS,ChangeLog,COPYING,LICENSE,README} %{buildroot}/usr/share/doc/packages/WordNet <snip> %files <snip> %docdir /usr/share/doc /usr/share/doc Success! Thanks Jan. Full spec here: http://www.3111skyline.com/dl/openSUSE/pkg/wordnet.spec -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Hello, On Mon, 17 Feb 2014, David C. Rankin wrote:
No dir on %doc line:
%doc AUTHORS ChangeLog COPYING LICENSE README /usr/doc/html /usr/doc/pdf /usr/doc/ps
%doc wants _relative_ paths as seen from the builddir. Well, except stuff outside of %docdir like %doc %{_mandir}/man1/foo.1.gz
<snip> Processing files: WordNet-3.0-2.x86_64 error: Two files on one line: /usr/doc/html error: Two files on one line: /usr/doc/pdf error: Can't mix special %doc with other forms: /usr/doc/ps
Move/copy /usr/doc stuff to ./ (i.e. the builddir) or copy/prune the doc subdirectories / stuff in the builddir (and delete the /usr/doc/ stuff). As done in the wordnet-package in Education (rm {html,pdf,ps}/Makefile or something like that). In other cases, I copy stuff from doc/ (where there are manpages, generated html etc. inside in doc or subdirs) to a temp-dir and then list the _contents_ of that temp-dir. Like I already wrote on the os-ML: %install [..] rm -rf tempdocs mkdir -p tempdocs/html cp -a doc/html/* tempdocs/html/ %files [..] %doc README FAQ doc/*.ps doc/*.pdf tempdocs/html IIRC, you'll see, it'll all nicely end up in the package. This is especially useful if you want subdirs in your docdir, in the example above, README, FAQ, *.ps and *.pdf will end up in the package docdir and tempdocs/html will be a subdir html inside that, e.g. /usr/share/doc/packages/foo/README /usr/share/doc/packages/foo/foo.pdf /usr/share/doc/packages/foo/html/index.html The trick is to use wildcards with purpose and I think that %doc takes names only (files or dirs) and discards directories. I'd have to dig in my .specs for a real sample.
So trying the %docdir for-all approach:
Don't.
HTH,
-dnh
--
"Being disintegrated makes me ve-ry an-gry!"
On 02/19/2014 05:43 PM, David Haller wrote:
Hello,
On Mon, 17 Feb 2014, David C. Rankin wrote:
No dir on %doc line:
%doc AUTHORS ChangeLog COPYING LICENSE README /usr/doc/html /usr/doc/pdf /usr/doc/ps
%doc wants _relative_ paths as seen from the builddir. Well, except stuff outside of %docdir like %doc %{_mandir}/man1/foo.1.gz
<snip> Processing files: WordNet-3.0-2.x86_64 error: Two files on one line: /usr/doc/html error: Two files on one line: /usr/doc/pdf error: Can't mix special %doc with other forms: /usr/doc/ps
Move/copy /usr/doc stuff to ./ (i.e. the builddir) or copy/prune the doc subdirectories / stuff in the builddir (and delete the /usr/doc/ stuff). As done in the wordnet-package in Education (rm {html,pdf,ps}/Makefile or something like that).
In other cases, I copy stuff from doc/ (where there are manpages, generated html etc. inside in doc or subdirs) to a temp-dir and then list the _contents_ of that temp-dir. Like I already wrote on the os-ML:
%install [..] rm -rf tempdocs mkdir -p tempdocs/html cp -a doc/html/* tempdocs/html/
%files [..] %doc README FAQ doc/*.ps doc/*.pdf tempdocs/html
IIRC, you'll see, it'll all nicely end up in the package.
This is especially useful if you want subdirs in your docdir, in the example above, README, FAQ, *.ps and *.pdf will end up in the package docdir and tempdocs/html will be a subdir html inside that, e.g.
/usr/share/doc/packages/foo/README /usr/share/doc/packages/foo/foo.pdf /usr/share/doc/packages/foo/html/index.html
The trick is to use wildcards with purpose and I think that %doc takes names only (files or dirs) and discards directories. I'd have to dig in my .specs for a real sample.
So trying the %docdir for-all approach:
Don't.
HTH, -dnh
Thanks dnh. I'll get all this digested -- I think. Jan, yes the complete reconf does need tk/tcl for it's ui. The 3.0 release in 2007 was the last full release, Princeton continues to put out database releases. The 3.1 update is from 2009. I guess the English language hasn't changed much since then ;p. Since I needed it for the kthesaurus extension in TDE (KDE3) there were no recent lib problems. -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Monday 2014-02-17 20:09, David C. Rankin wrote:
What made the --docdir="%_docdir/%name" option undoable was the limited control provided by the configure script in WordNet itself:
It would seem to be unmaintained. The tarball contents are from 2007, which is about the time autoconf 2.60 (with --docdir support) started to just enter distributions. You can attempt to `autoreconf -fi` (seems to require some tcl for Wordnet). -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (5)
-
David C. Rankin
-
David Haller
-
Greg Freemyer
-
Jan Engelhardt
-
Malcolm