From b597848f6b66fe77b6bbb073b2692365db3ea995 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Wed, 17 Jul 2013 14:32:17 +0200 Subject: [PATCH 01/12] pck-update: fix build requirements generation with multiple providers When --whatprovides returns multiple requirements only consider the first one. Seen with mono(..) requirements in monodevelop. --- plugins/pck-update.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/pck-update.in b/plugins/pck-update.in index ff83fb0..70dae54 100644 --- a/plugins/pck-update.in +++ b/plugins/pck-update.in @@ -2262,7 +2262,7 @@ $(echo $solibpath | sed "s|-[0-9.]*\.so|.so|")" elif [[ "$req" =~ .*\(.*\) || "$req" =~ .*\.so ]]; then # a(b) requirement or *.so library rpm -q --qf %{name} --whatprovides "$req" &>/dev/null && - buildreq="$(rpm -q --qf %{name} --whatprovides "$req")" || + buildreq="$(rpm -q --qf "%{name}\n" --whatprovides "$req"|head -n1)" || echo "#$req: unidentified build requirement" else # other requirements probably coming from static 'Requires:' From 69a4080a61a1fc874c73bf8fb5da0784c4af082d Mon Sep 17 00:00:00 2001 From: Davide Madrisan Date: Fri, 19 Jul 2013 18:35:36 +0200 Subject: [PATCH 02/12] libtest.lib: fix two broken calls to 'notify()' Signed-off-by: Davide Madrisan --- ChangeLog | 11 ++++++++++- lib/libtest.lib.in | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index cf4aede..fd68502 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,13 @@ -Changes in version 1.16.3 - Christmas Release +Changes in version 1.16.4 +Sat Jul 13 2013 Madrisan + ++ bugfix + * lib/libtest.lib - Davide Madrisan: + Replace 'notify --error' by 'notify.error'. + +------------------------------------------------------------------------------- + +Changes in version 1.16.3 Mon Mar 04 2013 Madrisan + bugfix diff --git a/lib/libtest.lib.in b/lib/libtest.lib.in index 972ff04..f2d7beb 100644 --- a/lib/libtest.lib.in +++ b/lib/libtest.lib.in @@ -93,11 +93,11 @@ can't create temporary directory"": $tmpextractdir/$i" pushd $tmpextractdir/$i >/dev/null rpm2cpio $pck > rpm_extract_tmp.cpio [ $? -eq 0 ] || - notify --error $"cannot extract files from rpm archive" + notify.error $"cannot extract files from rpm archive" cpio --quiet --extract --make-directories < rpm_extract_tmp.cpio [ $? -eq 0 ] || - notify --error $"cannot extract files from cpio archive" + notify.error $"cannot extract files from cpio archive" rm -f rpm_extract_tmp.cpio popd >/dev/null From b4f20819f9d8a38ba14edcecdf3663a33f106cef Mon Sep 17 00:00:00 2001 From: Davide Madrisan Date: Fri, 19 Jul 2013 18:37:44 +0200 Subject: [PATCH 03/12] t01_pkgquality: modify regexp to catch OCaml library files when testing for bad BuildArch tags Signed-off-by: Davide Madrisan --- ChangeLog | 3 +++ tests/test01_pkgquality.in | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index fd68502..f925f6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ Sat Jul 13 2013 Madrisan * lib/libtest.lib - Davide Madrisan: Replace 'notify --error' by 'notify.error'. + * tests/test01_pkgquality - Davide Madrisan: + Test fo bad BuildArch tags: modify regexp to catch OCaml library files. + ------------------------------------------------------------------------------- Changes in version 1.16.3 diff --git a/tests/test01_pkgquality.in b/tests/test01_pkgquality.in index 481bc72..4f8d497 100644 --- a/tests/test01_pkgquality.in +++ b/tests/test01_pkgquality.in @@ -423,9 +423,11 @@ $"checking for packages with bad BuildArch tag""${NORM}..." let "i = 0" for pck in ${rpmpkg_name[@]}; do pushd $tmpextractdir/$i >/dev/null - for f in $(find -mindepth 2 -perm +111 -type f \ - -exec file {} \; | grep -E "( ELF | library )"); do - notify.debug "found a ELF file: \`${NOTE}${f/./}${NORM}'" + for f in $(LC_ALL=C find -mindepth 2 -type f \ + -exec file {} \; 2>/dev/null | grep -E "(\ + ELF | OCaml library | ar archive |\ + dynamically linked | statically linked )"); do + notify.debug "found binary or library file: \`${NOTE}${f/./}${NORM}'" let "warning = 1" break done From b21d192d8f46c8696559e48a78ad3bd88e0403d7 Mon Sep 17 00:00:00 2001 From: Davide Madrisan Date: Fri, 19 Jul 2013 18:39:18 +0200 Subject: [PATCH 04/12] test01_pkgquality: Check for wrong file attributes in bin and lib directories. Do ignore files with name matching '*.so.owner'. These are text files needed by OCaml, not libraries. Signed-off-by: Davide Madrisan --- ChangeLog | 7 ++++++- tests/test01_pkgquality.in | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index f925f6b..e9bc7bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,7 +6,12 @@ Sat Jul 13 2013 Madrisan Replace 'notify --error' by 'notify.error'. * tests/test01_pkgquality - Davide Madrisan: - Test fo bad BuildArch tags: modify regexp to catch OCaml library files. + Test for bad BuildArch tags: modify regexp to catch OCaml library files. + + * tests/test01_pkgquality - Davide Madrisan: + Check for wrong file attributes in bin and lib directories: + Do ignore files with name matching '*.so.owner'. These are text files + used by OCaml. ------------------------------------------------------------------------------- diff --git a/tests/test01_pkgquality.in b/tests/test01_pkgquality.in index 4f8d497..a61c534 100644 --- a/tests/test01_pkgquality.in +++ b/tests/test01_pkgquality.in @@ -218,8 +218,9 @@ $"checking for wrong file attributes in bin and lib directories""${NORM}..." for pck in ${rpmpkg_name[@]}; do pushd $tmpextractdir/$i >/dev/null for f in $( find . -type f \( \ - \( -name '*.so.*' -not -perm 755 \) -or \ - \( -name '*.so' -not -perm 755 \) -or \ + \( -name '*.so.*' -and -not -name '*.so.owner' \ + -and -not -perm 755 \) -or \ + \( -name '*.so' -and -not -perm 755 \) -or \ \( \( -path './bin/*' -or \ -path './sbin/*' -or \ -path './usr/bin/*' -or \ From b4e680004a5838501785d522d618a42cc80bbb06 Mon Sep 17 00:00:00 2001 From: Davide Madrisan Date: Fri, 19 Jul 2013 18:41:45 +0200 Subject: [PATCH 05/12] conf/02-specfile-rpm-groups.conf: Add rpm groups for OCaml libraries and development packages. Signed-off-by: Davide Madrisan --- ChangeLog | 4 ++++ conf/02-specfile-rpm-groups.conf | 2 ++ 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index e9bc7bc..428bfe4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,10 @@ Sat Jul 13 2013 Madrisan Do ignore files with name matching '*.so.owner'. These are text files used by OCaml. ++ update + * conf/02-specfile-rpm-groups.conf - Davide Madrisan: + Add specific rpm groups for OCaml libraries and development packages. + ------------------------------------------------------------------------------- Changes in version 1.16.3 diff --git a/conf/02-specfile-rpm-groups.conf b/conf/02-specfile-rpm-groups.conf index 258b928..d8d5bf2 100644 --- a/conf/02-specfile-rpm-groups.conf +++ b/conf/02-specfile-rpm-groups.conf @@ -36,6 +36,7 @@ Development/Kernel Development/Languages Development/Libraries Development/Libraries/Java +Development/Libraries/OCaml Development/Libraries/Perl Development/Libraries/Python Development/Tools @@ -85,6 +86,7 @@ System/Hardware System/Internationalization System/Libraries System/Libraries/Java +System/Libraries/OCaml System/Libraries/Perl System/Libraries/PHP System/Libraries/Python From 5e8e99ecdcf7a7d143b0515ed2bfeac2c003e8c7 Mon Sep 17 00:00:00 2001 From: Davide Madrisan Date: Fri, 19 Jul 2013 21:33:20 +0200 Subject: [PATCH 06/12] New autospec template ocaml-libs for OCaml libraries. Signed-off-by: Davide Madrisan --- ChangeLog | 20 ++++- conf/02-specfile-rpm-macros-ocaml.conf | 5 ++ man/it/autospec.1.in | 4 +- plugins/spec-create.in | 36 ++++++++- po/it/autospec.po | 41 +++++----- templates/Makefile | 4 +- templates/ocaml-libs | 102 +++++++++++++++++++++++++ 7 files changed, 189 insertions(+), 23 deletions(-) create mode 100644 conf/02-specfile-rpm-macros-ocaml.conf create mode 100644 templates/ocaml-libs diff --git a/ChangeLog b/ChangeLog index 428bfe4..d863577 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -Changes in version 1.16.4 +Changes in version 1.16.4 Sat Jul 13 2013 Madrisan + bugfix @@ -17,6 +17,24 @@ Sat Jul 13 2013 Madrisan * conf/02-specfile-rpm-groups.conf - Davide Madrisan: Add specific rpm groups for OCaml libraries and development packages. ++ improvement + * templates/ocaml-libs, templates/Makefile - Davide Madrisan: + New autospec template for OCaml libraries. + + * plugins/spec-create - Davide Madrisan: + Add support for the new template ocaml-libs. + + * conf/02-specfile-rpm-macros-ocaml.conf - Davide Madrisan: + New configuration file for the OCaml (library) modules. + ++ update + + * po/it/pck-update.po - Davide Madrisan: + Update the italian translation strings. + + * italian manpage - Davide Madrisan: + Document the new template ocaml-libs. + ------------------------------------------------------------------------------- Changes in version 1.16.3 diff --git a/conf/02-specfile-rpm-macros-ocaml.conf b/conf/02-specfile-rpm-macros-ocaml.conf new file mode 100644 index 0000000..2e684c2 --- /dev/null +++ b/conf/02-specfile-rpm-macros-ocaml.conf @@ -0,0 +1,5 @@ +## Macros for OCaml packages -------------------------------------------------- + +# Force a name structure for OCaml packages +# Set to "" if you don't want to fix a structure +ocaml_module_name_structure="^ocaml-" diff --git a/man/it/autospec.1.in b/man/it/autospec.1.in index f7c50b1..58de2fe 100644 --- a/man/it/autospec.1.in +++ b/man/it/autospec.1.in @@ -24,7 +24,7 @@ \fBlibtest.lib\fR - libreria con le funzioni del framework di test. .SH VERSIONE -Questo documento e' aggiornato alla versione 1.16.3 di +Questo documento e' aggiornato alla versione 1.16.4 di .B @package@. .SH DESCRIZIONE @@ -204,6 +204,8 @@ categoria dello specfile da generare: .br \fIlibrary\fR : specfile per librerie .br +\fIocaml-libs\fR : specfile per librerie OCaml +.br \fIperl\fR : specfile per singoli moduli perl .br \fIpython\fR : specfile per moduli python diff --git a/plugins/spec-create.in b/plugins/spec-create.in index 4b310d6..72cc7ed 100644 --- a/plugins/spec-create.in +++ b/plugins/spec-create.in @@ -82,7 +82,7 @@ or FITNESS FOR A PARTICULAR PURPOSE." function version() { echo "\ ${me[0]} ${me[1]} -Copyright (C) 2004-2012 Davide Madrisan " +Copyright (C) 2004-2013 Davide Madrisan " } # $1: optional exit code (default is '1') @@ -106,6 +106,7 @@ function usage() { kde3 : "$"specfile for kde3 packages"" kde4 : "$"specfile for kde4 packages"" library : "$"specfile for common library packages"" + ocaml-libs : "$"specfile for OCaml library packages"" perl : "$"specfile for single-package perl modules"" python : "$"specfile for python modules"" standard-daemon : "$"standard specfile for system/network services"" @@ -404,6 +405,10 @@ $FUNCNAME: buildrequires_buildtool = \"$buildrequires_buildtool\"" [ -r "$templatefile" ] || notify.error $"file not found"": $templatefile" + local pck_name_tail="" + case "$pck_name" in *-*) pck_name_tail="${pck_name#*-}" ;; esac + notify.debug "$FUNCNAME: pck_name_tail = \"$pck_name_tail\"" + local currvar line if_value if_level=0 # FIXME: at most two nested @if statements are supported if_value[0]='N/A'; if_value[1]='1'; if_value[2]='1'; @@ -454,6 +459,7 @@ s,@packager_fullname@,${packager_fullname:-?packager_fullname?}, s,@packager_email@,${packager_email:-?packager_email?}, s,@rpm_default_buildroot@,${rpm_default_buildroot:-?rpm_default_buildroot?}, s,@pck_name@,$pck_name, +s,@pck_name_tail@,$pck_name_tail, s,@pck_version@,$pck_version, s,@spec_first_release@,${spec_first_release:-1}, s,@spec_run_ldconfig@,$spec_run_ldconfig, @@ -591,6 +597,11 @@ ${proxy:+--proxy $proxy} ${proxy_user:+--proxy-user $proxy_user} \ [[ "$pck_name" =~ $library_name_structure ]] || notify.error $"\ libraries must have this name structure (use \`-n'):"" \ \`$library_name_structure'" + ;; + ocaml-libs) + [[ "$pck_name" =~ $ocaml_module_name_structure ]] || notify.error $"\ +ocaml modules must have this name structure (use \`-n'):"" \ +\`$ocaml_module_name_structure'" ;; perl) [[ "$pck_name" =~ $perl_module_name_structure ]] || notify.error $"\ @@ -701,7 +712,8 @@ looks like a python module (use \`-t python' if this is true)" ;; # 2. set 'spec_summary' local spec_summary="$spec_default_summary" local perl_pckname_from_makefile="" - case "$spec_type" in perl) + case "$spec_type" in + perl) if [ -e $tmpdir/$pck_rootdir/Makefile.PL ]; then # look for the variable `NAME' in Makefile.PL inside the # 'WriteMakefile(' ... ')' block @@ -717,6 +729,26 @@ looks like a python module (use \`-t python' if this is true)" ;; fi [ -n "$perl_pckname_from_makefile" ] && spec_summary="$perl_pckname_from_makefile - ..." + ;; + ocaml-libs) + local metafile + metafile=$(find $tmpdir/$pck_rootdir/ -type f -name "META" 2>/dev/null) + [ "$metafile" ] || metafile="$(\ +find $tmpdir/$pck_rootdir/ -type f -name "META.in" 2>/dev/null)" + if [ "$metafile" ]; then + #notify.debug "$FUNCNAME: OCaml META file found" + while read line; do + if [[ "$line" =~ ^description[\ \t]*=[\ \t]*\".*\"$ ]]; then + spec_summary="... $(\ +echo "$line" | sed "s|.*=[\ \t]*\"\(.*\)\"|\1|") ..." # vim highlight need a " + notify.debug "$FUNCNAME: spec_summary = \"$spec_summary\"" + break + fi + #if [[ "$line" =~ ^description[\ \t]*=[\ \t]*$ ]]; then + # ... FIXME + done < $metafile + fi + ;; esac # 3. set 'spec_license' diff --git a/po/it/autospec.po b/po/it/autospec.po index fd5aec9..d4ec706 100644 --- a/po/it/autospec.po +++ b/po/it/autospec.po @@ -1,3 +1,21 @@ +# Italian translation. +# Copyright (C) 2004-2013 Davide Madrisan +# This file is distributed under the same license as the autospec package. +# Davide Madrisan , 2004-2013. +# + +msgid "" +msgstr "Project-Id-Version: autospec 1.16.4\n" + "Report-Msgid-Bugs-To: davide.madrisan@gmail.com\n" + "POT-Creation-Date: 2013-07-13 19:30+0100\n" + "PO-Revision-Date: 2013-07-13 19:30+0100\n" + "Last-Translator: Davide Madrisan \n" + "Language-Team: \n" + "Language: Italian \n" + "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=UTF-8\n" + "Content-Transfer-Encoding: 8bit\n" + msgid "this script requires bash version 2 or better" msgstr "questo script richiede bash versione 2 o superiore" @@ -817,6 +835,9 @@ msgstr "specfile per pacchetti kde4" msgid "specfile for common library packages" msgstr "specfile per librerie" +msgid "specfile for OCaml library packages" +msgstr "specfile per pacchetti librerie OCaml" + msgid "specfile for single-package perl modules" msgstr "specfile per singoli moduli perl" @@ -886,6 +907,9 @@ msgstr "modo" msgid "libraries must have this name structure (use \\`-n'):" msgstr "i nomi delle librerie devono avere questa struttura (usare \\`-n'):" +msgid "ocaml modules must have this name structure (use \\`-n'):" +msgstr "i nomi dei moduli ocaml devono avere questa struttura (usare \\`-n'):" + msgid "perl modules must have this name structure (use \\`-n'):" msgstr "i nomi dei moduli perl devono avere questa struttura (usare \\`-n'):" @@ -923,23 +947,6 @@ msgstr "manca almeno una direttiva \\`%defattr'" msgid "use rpm macros if possible:" msgstr "utilizzare le macro rpm quando possibile:" -# Italian translation. -# Copyright (C) 2004-2012 Davide Madrisan -# This file is distributed under the same license as the autospec package. -# Davide Madrisan , 2004-2012. -# -msgid "" -msgstr "Project-Id-Version: autospec 1.16.0\n" - "Report-Msgid-Bugs-To: davide.madrisan@gmail.com\n" - "POT-Creation-Date: 2012-11-23 22:50+0100\n" - "PO-Revision-Date: 2012-11-19 23:37+0100\n" - "Last-Translator: Davide Madrisan \n" - "Language-Team: \n" - "Language: Italian \n" - "MIME-Version: 1.0\n" - "Content-Type: text/plain; charset=UTF-8\n" - "Content-Transfer-Encoding: 8bit\n" - msgid "localization files must be packaged via \\`%find_lang'" msgstr "trovati file di localizzazione non gestiti da \\`%find_lang'" diff --git a/templates/Makefile b/templates/Makefile index ed4a51b..4c9ede6 100644 --- a/templates/Makefile +++ b/templates/Makefile @@ -1,5 +1,5 @@ # Makefile for autospec -# Copyright (C) 2008,2011 by Davide Madrisan +# Copyright (C) 2008,2011,2013 by Davide Madrisan # This program is free software; you can redistribute it and/or modify it under # the terms of version 2 of the GNU General Public License as published by the @@ -18,7 +18,7 @@ srcdir = .. include $(srcdir)/Makefile.env -pck_templates := gnome kde3 kde4 library perl python standard standard-daemon web +pck_templates := gnome kde3 kde4 library ocaml-libs perl python standard standard-daemon web all: diff --git a/templates/ocaml-libs b/templates/ocaml-libs new file mode 100644 index 0000000..06c4a09 --- /dev/null +++ b/templates/ocaml-libs @@ -0,0 +1,102 @@ +## this macro only works for packages with name matching the regexp "ocaml-.*" +%define ocamlpck @pck_name_tail@ + +Name: @pck_name@ +Version: @pck_version@ +Release: @spec_first_release@@DISTRO_rpm@ +Summary: ... +Group: System/Libraries/OCaml +Vendor: @VENDOR@ +Distribution: @DISTRO@ +Packager: @packager_fullname@ <@packager_email@> +URL: ... +Source: ... +License: ... +## AUTOBUILDREQ-BEGIN +## note: run 'autospec -u -a6 @pck_name@' to get the list of build requirements. +## AUTOBUILDREQ-END +BuildRequires: ocaml +BuildRequires: ocaml-camlp4-devel +BuildRequires: ocaml-findlib +## remove the following build requirement if this package is compiled +## by using the OCaml native-code compiler (ocamlopt) +Requires: ocaml-runtime +BuildRoot: @rpm_default_buildroot@ + +%description +... + +@if:pck_devel +## remove the following two blocks if there's no devel files +%package devel +Group: Development/Libraries/OCaml +Summary: Development files for %{name} +Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} + +%description devel +This package contains libraries and signature files for developing applications that use %{name}. +@fi:pck_devel + +%prep +%setup -q + +%build +## remove the unsupported options (no real standard exists...) +./configure \\ +\ --prefix %{_prefix} \\ +\ --localstatedir %{_localstatedir} \\ +\ --sharedstatedir %{_sharedstatedir} \\ +\ --sysconfdir %{_sysconfdir} \\ +\ --enable-tests \\ +\ --enable-docs \\ +\ --enable-examples \\ +\ --disable-ldconf +## extra arguments that sometimes can be passed to './configure' +## -host %{_host} +## -cc "gcc ${RPM_OPT_FLAGS/-fomit-frame-pointer/}" +## --destdir %{buildroot} + +%make all +%make opt + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +export OCAMLFIND_DESTDIR=%{buildroot}$(ocamlfind printconf destdir) +export DLLDIR=$OCAMLFIND_DESTDIR/stublibs + +install -d $OCAMLFIND_DESTDIR/%{ocamlpck} +install -d $OCAMLFIND_DESTDIR/stublibs + +make install + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%files +%defattr(-,root,root) +## note: this list is just an example; modify as required +# %dir %{_libdir}/ocaml/%{ocamlpck} +# %{_libdir}/ocaml/%{ocamlpck}/META +# %{_libdir}/ocaml/%{ocamlpck}/*.cma +# %{_libdir}/ocaml/%{ocamlpck}/*.cmi +# %{_libdir}/ocaml/%{ocamlpck}/*.cmxs +# %{_libdir}/ocaml/stublibs/*.so* +# %doc COPYING + +@if:pck_devel +## remove this block if there are no devel files +## note: this list is just an example; modify as required +%files devel +%defattr(-,root,root) +# %{_libdir}/ocaml/%{ocamlpck}/*.a +# %{_libdir}/ocaml/%{ocamlpck}/*.cmx +# %{_libdir}/ocaml/%{ocamlpck}/*.cmxa +# %{_libdir}/ocaml/%{ocamlpck}/*.mli +# %doc CHANGES README +# %doc doc/html/ +# %doc examples/ +@fi:pck_devel + +%changelog +* @spec_changelog_date@ @packager_fullname@ <@packager_email@> @pck_version@-@spec_first_release@@DISTRO_rpm@ +- @spec_changelog_comment@ From f1ba975689983e315ef3a116182bba24eea7c9eb Mon Sep 17 00:00:00 2001 From: Davide Madrisan Date: Fri, 19 Jul 2013 21:47:18 +0200 Subject: [PATCH 07/12] test framework: remove the duplicate check for poor infopages installation implemented in the module 'test00_specsyntax' and improve the test coded in 'test01_pkgquality' and its related help message. Signed-off-by: Davide Madrisan --- ChangeLog | 9 ++++++ tests/test00_specsyntax.in | 61 ++------------------------------------ tests/test01_pkgquality.in | 30 ++++++++++++------- 3 files changed, 32 insertions(+), 68 deletions(-) diff --git a/ChangeLog b/ChangeLog index d863577..6980554 100644 --- a/ChangeLog +++ b/ChangeLog @@ -35,6 +35,15 @@ Sat Jul 13 2013 Madrisan * italian manpage - Davide Madrisan: Document the new template ocaml-libs. + * test00_specsyntax - Davide Madrisan: + Remove the test about the provided infopages because it's a duplicate of + the test implemented in 'test01_pkgquality'. + ++ improvement + * test01_pkgquality - Davide Madrisan: + Improve the test for not or badly installed infopages and make a better + help message. + ------------------------------------------------------------------------------- Changes in version 1.16.3 diff --git a/tests/test00_specsyntax.in b/tests/test00_specsyntax.in index dd680ab..ff43c1e 100644 --- a/tests/test00_specsyntax.in +++ b/tests/test00_specsyntax.in @@ -1,6 +1,6 @@ #!/bin/bash # test00_specsyntax -- @package@ test (syntax checks of a specfile) -# Copyright (C) 2012 Davide Madrisan +# Copyright (C) 2012-2013 Davide Madrisan [ -z "$BASH" ] || [ ${BASH_VERSION:0:1} -lt 2 ] && echo $"this script requires bash version 2 or better" >&2 && exit 1 @@ -182,62 +182,7 @@ ${NOTE}"$"Hint"":${NORM} } test_number=$(($test_number + 1)) - # 7. check if the install/uninstall code is present - test.skip $test_number || { - notify.note "$(test.num2str). ${NOTE}"\ -$"info pages""${NORM}..." - - local infopages errors - # FIXME: non LSB compliant systems are unsupported - infopages="$(\ -grep "/share/info/\|^[ ]*%_infodir\|^[ ]*%{_infodir}" $specfile | \ -grep -v "^[ ]*#\|^[a-zA-Z]")" - - if [[ "$infopages" ]]; then - let "errors = 0" - if [ "$rpm_macro_installinfo" ]; then - grep -q "$rpm_macro_installinfo" $specfile || - { let "errors += 1" - notify.debug "rpm_macro_installinfo check failed"; } - fi - if [ "$rpm_macro_uninstallinfo" ]; then - grep -q "$rpm_macro_uninstallinfoo" $specfile || - { let "errors += 1" - notify.debug "rpm_macro_uninstallinfo check failed"; } - fi - if [ "$rpm_macro_installinfo_binary" ]; then - grep -q "\ -Requires(post)[ \t]*:[ \t]*${rpm_macro_installinfo_binary}" $specfile || - { let "errors += 1" - notify.debug "rpm_macro_installinfo_binary check failed"; } - fi - - [ "$errors" = "0" ] || - { notify.error "\ -"$"info pages are not installed/uninstalled in the correct way""${NORM} ---------------------------------------- -${NOTE}"$"Hint"":${NORM} -$([[ "$rpm_macro_installinfo_binary" ]] && - echo "Requires(post): $rpm_macro_installinfo_binary" || - echo "Requires(post): ${path_installinfo:-/sbin/install-info}") - -%post [] -$([[ "$rpm_macro_installinfo" ]] && - echo "$rpm_macro_installinfo %{name}.info" || - echo "${path_installinfo:-/sbin/install-info} %{name}.info") - -%preun [] -$([[ "$rpm_macro_uninstallinfo" ]] && - echo "$rpm_macro_uninstallinfo %{name}.info" || - echo "${path_installinfo:-/sbin/install-info} --delete %{name}.info") -exit 0 ---------------------------------------- -" - let "total_issues += $errors"; } - fi; } - test_number=$(($test_number + 1)) - - # 8. check for illegal 'Group's (see configuration file) + # 7. check for illegal 'Group's (see configuration file) test.skip $test_number || { if [ "${#rpm_allowed_groups[*]}" = 0 ]; then # 'rpm_allowed_groups' unset in the configuration files @@ -274,7 +219,7 @@ ${NOTE}@package@ --eval=rpm_allowed_groups${NORM} fi; } test_number=$(($test_number + 1)) - # 9. check for no approved 'License's (see configuration file) + # 8. check for no approved 'License's (see configuration file) test.skip $test_number || { if [ "${#rpm_approved_licenses[*]}" = 0 ]; then # 'rpm_approved_licenses' unset in the configuration files diff --git a/tests/test01_pkgquality.in b/tests/test01_pkgquality.in index a61c534..d196ea2 100644 --- a/tests/test01_pkgquality.in +++ b/tests/test01_pkgquality.in @@ -1,6 +1,6 @@ #!/bin/bash # test01_pkgquality -- @package@ test (rpm quality checks) -# Copyright (C) 2008,2012 Davide Madrisan +# Copyright (C) 2008,2012,2013 Davide Madrisan [ -z "$BASH" ] || [ ${BASH_VERSION:0:1} -lt 2 ] && echo $"this script requires bash version 2 or better" >&2 && exit 1 @@ -21,7 +21,7 @@ me=("test01_pkgquality" "@version@" "@date@") notify.debug $"loading"": \`test01_pkgquality'..." # check if all the needed tools are available -for tool in file find getopt grep ls ldd; do +for tool in file find getopt grep ls ldd wc; do [ "$(type -p $tool)" ] || notify.error $"utility not found"": \`$tool'" done @@ -327,26 +327,36 @@ $"checking if the info catalog is updated when necessary""${NORM}..." { let "i += 1"; continue; } # no info pages found #notify.debug "$FUNCNAME: info page(s) found" - [[ "$(rpm -p -q --scripts $pck | sed -n ' -/postinstall /,${/\/sbin\/install-info \/.*/p}')" ]] || let "error+=1" + [[ "$(rpm -p -q --requires $pck 2>/dev/null | sed -n ' +/^[ \t]*\/sbin\/install-info/p')" ]] || let "error+=1" - [[ "$(rpm -p -q --scripts $pck | sed -n ' -/preuninstall /,${/\/sbin\/install-info.*--[delete\|remove].*/p}')" ]] || \ - let "error+=1" + # note: we just check for at list two occurences of the command + # '/sbin/install-info' in the package scriptlets + [[ "$(rpm -p -q --scripts $pck 2>/dev/null | sed -n ' +/^[ \t]*\/sbin\/install-info/p' | wc -l)" -ge 2 ]] || let "error+=1" [ "$error" = "0" ] || { notify.warning "${NOTE}${pck##*/}${NORM}" notify.note $"info pages should be installed/uninstalled""${NORM} --------------------------------------- ${NOTE}"$"Hint"":${NORM} -$([[ "$rpm_macro_installinfo_binary" ]] && - echo "Requires(post):$rpm_macro_installinfo_binary" || - echo "Requires(post):${path_installinfo:-/sbin/install-info}") +%package [] +... +$(if [[ "$rpm_macro_installinfo_binary" ]]; then + echo "\ +Requires(post):$rpm_macro_installinfo_binary +Requires(preun):$rpm_macro_installinfo_binary" + else + echo "\ +Requires(post):${path_installinfo:-/sbin/install-info} +Requires(preun):${path_installinfo:-/sbin/install-info}" + fi) %post [] $([[ "$rpm_macro_installinfo" ]] && echo "$rpm_macro_installinfo %{name}.info" || echo "${path_installinfo:-/sbin/install-info} %{name}.info") +exit 0 %preun [] $([[ "$rpm_macro_uninstallinfo" ]] && From 42400bcded2302dd43f565639bf453f53d7b97c5 Mon Sep 17 00:00:00 2001 From: Davide Madrisan Date: Fri, 19 Jul 2013 21:50:44 +0200 Subject: [PATCH 08/12] Mark the new autospec version as "Korbielow". Signed-off-by: Davide Madrisan --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6980554..40aab33 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -Changes in version 1.16.4 +Changes in version 1.16.4 - "Korbielow" release Sat Jul 13 2013 Madrisan + bugfix From 46ec87de31c02094a0052882f931dc00bddfae85 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Wed, 19 Jun 2013 10:40:18 +0200 Subject: [PATCH 09/12] pck-update: don't clone from git repository at every build is source with current version already exists --- plugins/pck-update.in | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/pck-update.in b/plugins/pck-update.in index 70dae54..a4442b8 100644 --- a/plugins/pck-update.in +++ b/plugins/pck-update.in @@ -1971,9 +1971,10 @@ rpmvars.solve "$fullURL" "$SRPM_SPECFILE_WITH_PATH") case "$fullURL" in git://*|http://*.git|https://*.git) - git.download \ - --pck-version "$pck_rpmversion" \ - --destdir="$source_dir" "$fullURL" + [ -e "${source_dir}/${fullURL/*\/}" -a "$force_download" != "1" ] || \ + git.download \ + --pck-version "$pck_rpmversion" \ + --destdir="$source_dir" "$fullURL" ;; *) curl.download --options "$curl_options" $sdflag \ ${proxy:+--proxy $proxy} ${proxy_user:+--proxy-user $proxy_user} \ From eb1d352c92016a6eb2216a386fb098a62b3a1774 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sun, 28 Jul 2013 18:09:05 +0200 Subject: [PATCH 10/12] pck-update: fix update of git urls starting with http:// and https:// Source URLs from git don't just end with '.git', btw they can be detected by searching for '.git/' --- plugins/pck-update.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/pck-update.in b/plugins/pck-update.in index a4442b8..1568ea3 100644 --- a/plugins/pck-update.in +++ b/plugins/pck-update.in @@ -1135,7 +1135,7 @@ rpmvars.solve "$fullURL_new" "$SRPM_SPECFILE_WITH_PATH") notify.debug "fullURL_new = $fullURL_new" case "$fullURL_new" in - git://*|http://*.git|https://*.git) + git://*|http://*.git/*|https://*.git/*) git.download \ --pck-version "$pck_newver" \ --destdir="$source_dir" "$fullURL_new" @@ -1970,7 +1970,7 @@ rpmvars.solve "$fullURL" "$SRPM_SPECFILE_WITH_PATH") notify.debug "fullURL = $fullURL" case "$fullURL" in - git://*|http://*.git|https://*.git) + git://*|http://*.git/*|https://*.git/*) [ -e "${source_dir}/${fullURL/*\/}" -a "$force_download" != "1" ] || \ git.download \ --pck-version "$pck_rpmversion" \ From 653fc9cd35e1bc1b50b25e0fb436d54baeeb5874 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sun, 28 Jul 2013 18:13:22 +0200 Subject: [PATCH 11/12] libnetwork.lib: never use '--depth=1' when cloning from http and https git urls - fix necessary and tested with code.google.com - additionally print full 'git clone ..' command line used in debug output --- lib/libnetwork.lib.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/libnetwork.lib.in b/lib/libnetwork.lib.in index 7e81789..6a9f4b0 100644 --- a/lib/libnetwork.lib.in +++ b/lib/libnetwork.lib.in @@ -1015,9 +1015,11 @@ not the expected package version"" (${NOTE}${today}git${NORM})..." notify.note \ "${NOTE}"$"cloning git repository""\ <$git_repository> ${git_branch:+($git_branch)}${NORM}""..." - if [ "$preserve_dot_git" = "0" ]; then + if [ "$preserve_dot_git" = "0" -a "${git_repository:0:4}" != "http" ]; then + notify.debug "$FUNCNAME: git clone --depth=1 ${git_branch:+-b $git_branch} \"$git_repository\"" git clone --depth=1 ${git_branch:+-b $git_branch} "$git_repository" else + notify.debug "$FUNCNAME: git clone ${git_branch:+-b $git_branch} \"$git_repository\"" git clone ${git_branch:+-b $git_branch} "$git_repository" fi [ $? -eq 0 ] || From 0cc7bf9f89da8f5b93c0e6f56e50d8dca64629a1 Mon Sep 17 00:00:00 2001 From: Davide Madrisan Date: Sun, 4 Aug 2013 22:42:06 +0200 Subject: [PATCH 12/12] ChangeLog: add missing entries Signed-off-by: Davide Madrisan --- ChangeLog | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index 40aab33..b3c14db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -44,6 +44,20 @@ Sat Jul 13 2013 Madrisan Improve the test for not or badly installed infopages and make a better help message. ++ bugfix + * pck-update - Silvan Calarco: + Don't clone from git repository at every build is source with current + version already exists. + + * pck-update - Silvan Calarco: + Fix update of git urls starting with and https:// + Source URLs from git don't just end with '.git', btw they can be detected + by searching for '.git/'. + + * lib/libnetwork.lib - Silvan Calarco: + Fix necessary and tested with code.google.com + Additionally print full 'git clone ..' command line used in debug output. + ------------------------------------------------------------------------------- Changes in version 1.16.3