From 1d2c39f52c7eb16663f233231f78c751914ce077 Mon Sep 17 00:00:00 2001 From: Davide Madrisan Date: Fri, 16 Dec 2011 22:00:51 +0100 Subject: [PATCH] spec-create, templates: move part of package documemtation to the devel package or add a comment if the devel package is not provided by the template. --- ChangeLog | 6 ++++++ plugins/spec-create.in | 35 ++++++++++++++++++++++++++--------- templates/gnome | 2 ++ templates/kde3 | 2 ++ templates/kde4 | 2 ++ templates/library | 1 + templates/perl | 2 ++ templates/python | 2 ++ templates/standard | 2 ++ templates/standard-daemon | 2 ++ 10 files changed, 47 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index a85bdb5..5aa13bb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -29,6 +29,12 @@ Changes in version 1.8.1 Support source packages with a makefile but no configure script. (Issue reported by Silvan Calarco) ++ update + * spec-create, templates/* - Davide Madrisan: + Move part of package documemtation to the devel package or add a comment + if the devel package is not provided by the template. + (Pointed out by Silvan Calarco) + -------------------------------------------------------------------------------- Changes in version 1.8.0 diff --git a/plugins/spec-create.in b/plugins/spec-create.in index a0b09a6..3f12816 100644 --- a/plugins/spec-create.in +++ b/plugins/spec-create.in @@ -228,9 +228,9 @@ remember to modify the value for \`${NOTE}$id${NORM}'" ;; function template.expand() { local OPTIONS=`LANG=C getopt \ - -o t:T:n:v:s:l:S:d:b: \ + -o t:T:n:v:s:l:S:b: \ --long template:,type:,pckname:,pckversion:,setupmacro:,summary:,license:,\ -source:,standard-docs:,build-technology:,\ +source:,standard-docs:,standard-docs-devel:,build-technology:,\ i18n:,icons-mimetypes:,\ infopages:,manpages:,\ pck-apidocs:,pck-tools:,\ @@ -247,6 +247,7 @@ shared-libraries:,\ local spec_summary="$spec_default_summary" local spec_license="$spec_default_license" local standard_docs + local standard_docs_devel local build_technology local i18n="0" @@ -275,8 +276,10 @@ shared-libraries:,\ spec_license="$2"; shift ;; -S|--source) spec_source="$2"; shift ;; - -d|--standard-docs) + --standard-docs) standard_docs="$2"; shift ;; + --standard-docs-devel) + standard_docs_devel="$2"; shift ;; -b|--build-technology) build_technology="$2"; shift ;; --i18n) @@ -378,6 +381,7 @@ s,^\([ \t]*Source[ \t]*:[ \t]*\).*,\1${spec_source}, s,@make@,$spec_cmd_make, s,@makeinstall@,$spec_cmd_makeinstall, s,@standard_docs@,${standard_docs:+%doc $standard_docs}, +s,@standard_docs_devel@,${standard_docs_devel:+%doc $standard_docs_devel}, s,@spec_changelog_date@,$spec_changelog_date, s,@spec_changelog_comment@,$spec_changelog_comment, " @@ -658,21 +662,23 @@ looks like a python module (use \`-t python' if this is true)" ;; # + some other documentation files commonly found in several packages local standard_docs_list=' AUTHORS - BACKLOG - BUGS - CHANGES COPYING COPYING.DOC COPYING.LESSER COPYING.LIB CREDITS - ChangeLog* LICENCE LICENSE MANUAL + THANKS' + + local standard_docs_devel_list=' + BACKLOG + BUGS + CHANGES + ChangeLog* NEWS README* - THANKS TODO WHATSNEW WHERE' @@ -684,9 +690,19 @@ looks like a python module (use \`-t python' if this is true)" ;; for currdoc in $currdocs; do # ignore empty documentation files [ -s $tmpdir/$pck_rootdir/$currdoc ] && - standard_docs="${standard_docs:+$standard_docs }$currdoc" + standard_docs="\ +${standard_docs:+$standard_docs }$currdoc" done done + for doc in $standard_docs_devel_list; do + currdocs=$(cd $tmpdir/$pck_rootdir && ls $doc 2>/dev/null) + for currdoc in $currdocs; do + [ -s $tmpdir/$pck_rootdir/$currdoc ] && + standard_docs_devel="\ +${standard_docs_devel:+$standard_docs_devel }$currdoc" + done + done + # split the list of docs into multiple lines if necessary #[ "$docs" ] && docs=`echo $docs | fmt -u -w 77 | sed 's,.*,%doc &,'` @@ -761,6 +777,7 @@ $spec_cmd_configure_autotools --enable-gtk-doc" --license "$spec_license" \ --source "${spec_preamble_source:-$spec_preamble_tarball}" \ --standard-docs "$standard_docs" \ + --standard-docs-devel "$standard_docs_devel" \ --build-technology "$build_techology" \ --i18n "$spec_i18n" \ --icons-mimetypes "1" \ diff --git a/templates/gnome b/templates/gnome index 6651eae..be09bf4 100644 --- a/templates/gnome +++ b/templates/gnome @@ -56,6 +56,8 @@ Requires: gtk-doc %files %defattr(-,root,root) @standard_docs@ +## note: eventually add the remaining documents (if any) +# @standard_docs_devel@ @if:library_apidocs %files apidocs diff --git a/templates/kde3 b/templates/kde3 index 54cb1fb..2c43279 100644 --- a/templates/kde3 +++ b/templates/kde3 @@ -36,6 +36,8 @@ BuildRoot: @rpm_default_buildroot@ %files %defattr(-,root,root) @standard_docs@ +## note: eventually add the remaining documents (if any) +# @standard_docs_devel@ %changelog * @spec_changelog_date@ @packager_fullname@ <@packager_email@> @pck_version@-@spec_first_release@@DISTRO_rpm@ diff --git a/templates/kde4 b/templates/kde4 index dd1c519..e7530cb 100644 --- a/templates/kde4 +++ b/templates/kde4 @@ -107,6 +107,8 @@ exit 0 ## note: "man3" pages normally goes to devel package if any # %{_mandir}/man?/%{name}.* @standard_docs@ +## note: eventually add the remaining documents (if any) +# @standard_docs_devel@ %changelog * @spec_changelog_date@ @packager_fullname@ <@packager_email@> @pck_version@-@spec_first_release@@DISTRO_rpm@ diff --git a/templates/library b/templates/library index 3faefe7..2c15b0b 100644 --- a/templates/library +++ b/templates/library @@ -115,6 +115,7 @@ exit 0 @if:infopages # %{_infodir}/*.info.* @fi:infopages +@standard_docs_devel@ @if:pck_tools %files tools diff --git a/templates/perl b/templates/perl index faaa4c2..595b07c 100644 --- a/templates/perl +++ b/templates/perl @@ -52,6 +52,8 @@ done %files -f .packlist %defattr(-,root,root) @standard_docs@ +## note: eventually add the remaining documents (if any) +# @standard_docs_devel@ %changelog * @spec_changelog_date@ @packager_fullname@ <@packager_email@> @pck_version@-@spec_first_release@@DISTRO_rpm@ diff --git a/templates/python b/templates/python index e4733f7..808bc74 100644 --- a/templates/python +++ b/templates/python @@ -42,6 +42,8 @@ sed -i "\\,\\.egg-info/,d;s,.*/man/.*,&.gz," %{name}.filelist %files -f %{name}.filelist %defattr(-,root,root) @standard_docs@ +## note: eventually add the remaining documents (if any) +# @standard_docs_devel@ %changelog * @spec_changelog_date@ @packager_fullname@ <@packager_email@> @pck_version@-@spec_first_release@@DISTRO_rpm@ diff --git a/templates/standard b/templates/standard index 99b7540..bb697e9 100644 --- a/templates/standard +++ b/templates/standard @@ -82,6 +82,8 @@ exit 0 # %{_infodir}/*.info.* @fi:infopages @standard_docs@ +## note: eventually add the remaining documents (if any) +# @standard_docs_devel@ @if:pck_apidocs %files apidocs diff --git a/templates/standard-daemon b/templates/standard-daemon index 040b3ab..b153e89 100644 --- a/templates/standard-daemon +++ b/templates/standard-daemon @@ -106,6 +106,8 @@ exit 0 # %{_infodir}/*.info.* @fi:infopages @standard_docs@ +## note: eventually add the remaining documents (if any) +# @standard_docs_devel@ @if:pck_apidocs %files apidocs