Mailinglist Archive: opensuse-kernel (77 mails)

< Previous Next >
[opensuse-kernel] kernel-docs package
  • From: Jeff Mahoney <jeffm@xxxxxxxx>
  • Date: Wed, 09 Dec 2009 19:54:58 -0500
  • Message-id: <4B2046E2.5070508@xxxxxxxx>
Hash: SHA1

In going through the openSUSE kernel bug queue, I ran across one
against kernel-docs. The spec file for that package is... entertaining.
It starts off by doing a cp -a /usr/src/linux* into the build dir. That
might've been a good idea at one point, but it's hardly one anymore.

I propose that we make kernel-docs a linked package to the
kernel-source package and BuildRequires the kernel-source package. The
documentation can be generated with a make -C $SRC O=$PWD instead,
negating the need to copy _anything_. Making it a linked package means
that the version numbers get set automatically by mkspec. Right now, the
kernel-docs package is version 2.6.3 but built against whatever
kernel-source is in the repo.

- -Jeff

diff --git a/rpm/ b/rpm/
new file mode 100644
index 0000000..d7ff3b1
- --- /dev/null
+++ b/rpm/
@@ -0,0 +1,97 @@
+# spec file for package kernel-docs@VARIANT@ (Version @RPMVERSION@)
+# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# All modifications and additions to the file contributed by third parties
+# remain the property of their copyright owners, unless otherwise agreed
+# upon. The license for this file, and modifications and additions to the
+# file, is the same license as for the pristine package itself (unless the
+# license for the pristine package is not an Open Source License, in which
+# case the license is the MIT License). An "Open Source License" is a
+# license that conforms to the Open Source Definition (Version 1.9)
+# published by the Open Source Initiative.
+# Please submit bugfixes or comments via
+# norootforbuild
+%include %_sourcedir/kernel-spec-macros
+Name: kernel-docs
+BuildRequires: docbook-toys docbook-utils ghostscript_any libjpeg-devel
texlive transfig xmlto xorg-x11-devel
+BuildRequires: kernel-source = @RPMVERSION@
+License: GPL v2 or later
+Group: Documentation/Man
+AutoReqProv: on
+Version: @RPMVERSION@
+%if %using_buildservice
+Summary: Kernel Documentation
+BuildArch: noarch
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+Source: kernel-spec-macros
+These are the PDF documents and man pages (section 9) built from
+thecurrent kernel sources.
+cp -av /etc/texmf/web2c/texmf.cnf .
+cat << EOF >> texmf.cnf
+main_memory.pdfjadetex = 2500000
+hash_extra.pdfjadetex = 70000
+max_strings.pdfjadetex = 120000
+save_size.pdfjadetex = 10000
+%setup -T -c
+# use texmf.cnf from local source
+export LANG=en_US
+make -C /usr/src/linux-%{version}-%{release_major} O=$PWD -k -i mandocs
+make -C /usr/src/linux-%{version}-%{release_major} O=$PWD -k -i pdfdocs
+install -d $RPM_BUILD_ROOT/%{_mandir}/man9
+# filter out obscure device drivers - they clutter up the rpm and don't add
any real value
+find Documentation/DocBook/ -name '*.9.gz' |
+egrep -v
+while read i ; do
+ cp $i $RPM_BUILD_ROOT/%{_mandir}/man9
+install -d $RPM_BUILD_ROOT/usr/share/doc/kernel
+cp -a Documentation/DocBook/*.pdf $RPM_BUILD_ROOT/usr/share/doc/kernel || true
+if [ -d Documentation/kdb ] ; then
+ for i in Documentation/kdb/*.m* ; do
+ k=`basename $i`
+ k=${k/man/9}
+ k=${k/mm/9}
+ cp $i $RPM_BUILD_ROOT/%{_mandir}/man9/$k
+ done
+ln -s /usr/share/man/man9/request_threaded_irq.9.gz
+cp -a
+%docdir /usr/share/doc/kernel
diff --git a/rpm/ b/rpm/
index f3e160c..b951db9 100644
- --- a/rpm/
+++ b/rpm/
@@ -77,12 +77,13 @@ Source52: kernel-source%variant.changes
- -Source56:
- -Source57:
- -Source58: old-packages.conf
- -Source59: arch-symbols
- -Source60: package-descriptions
- -Source61: kernel-spec-macros
+Source62: old-packages.conf
+Source63: arch-symbols
+Source64: package-descriptions
+Source65: kernel-spec-macros
Source100: config.tar.bz2
Source101: patches.arch.tar.bz2
Source102: patches.drivers.tar.bz2
diff --git a/rpm/mkspec b/rpm/mkspec
index 7e49c36..905835c 100755
- --- a/rpm/mkspec
+++ b/rpm/mkspec
@@ -82,6 +82,9 @@ for my $flavor (sort keys(%flavor_archs)) {
# kernel-source.spec
do_spec('source', "kernel-source$variant.spec", %macros);

+# kernel-docs.spec
+do_spec('docs', "kernel-docs$variant.spec", %macros);
# kernel-syms.spec
my $requires = "";
@@ -128,7 +131,7 @@ sub parse_config_conf {
sub read_spec_templates {
my %res;

- - for my $template qw(binary source syms) {
+ for my $template qw(binary source syms docs) {
xopen(my $fh, '<', "$dir/kernel-$");
my @lines = <$fh>;
$res{$template} = join("", @lines);

- --
Jeff Mahoney
Version: GnuPG v2.0.12 (GNU/Linux)
Comment: Using GnuPG with SUSE -

To unsubscribe, e-mail: opensuse-kernel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-kernel+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups