Merge branch 'master' into silvan-v1.16.3

This commit is contained in:
Silvan Calarco 2013-10-22 01:32:49 +02:00
commit 0d39f9a839
12 changed files with 269 additions and 99 deletions

View File

@ -1,4 +1,66 @@
Changes in version 1.16.3 - Christmas Release
Changes in version 1.16.4 - "Korbielow" release
Sat Jul 13 2013 Madrisan <davide.madrisan(a)gmail.com>
+ bugfix
* lib/libtest.lib - Davide Madrisan:
Replace 'notify --error' by 'notify.error'.
* tests/test01_pkgquality - Davide Madrisan:
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.
+ update
* 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.
* 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.
+ 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
Mon Mar 04 2013 Madrisan <davide.madrisan(a)gmail.com>
+ bugfix

View File

@ -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

View File

@ -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-"

View File

@ -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

View File

@ -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

View File

@ -2263,7 +2263,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:'

View File

@ -82,7 +82,7 @@ or FITNESS FOR A PARTICULAR PURPOSE."
function version() {
echo "\
${me[0]} ${me[1]}
Copyright (C) 2004-2012 Davide Madrisan <davide.madrisan@gmail.com>"
Copyright (C) 2004-2013 Davide Madrisan <davide.madrisan@gmail.com>"
}
# $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="<FIXME>"
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'

View File

@ -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 <davide.madrisan@gmail.com>, 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 <davide.madrisan@gmail.com>\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 <davide.madrisan@gmail.com>, 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 <davide.madrisan@gmail.com>\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'"

View File

@ -1,5 +1,5 @@
# Makefile for autospec
# Copyright (C) 2008,2011 by Davide Madrisan <davide.madrisan@gmail.com>
# Copyright (C) 2008,2011,2013 by Davide Madrisan <davide.madrisan@gmail.com>
# 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:

102
templates/ocaml-libs Normal file
View File

@ -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@

View File

@ -1,6 +1,6 @@
#!/bin/bash
# test00_specsyntax -- @package@ test (syntax checks of a specfile)
# Copyright (C) 2012 Davide Madrisan <davide.madrisan@gmail.com>
# Copyright (C) 2012-2013 Davide Madrisan <davide.madrisan@gmail.com>
[ -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 [<subpackage>]
$([[ "$rpm_macro_installinfo" ]] &&
echo "$rpm_macro_installinfo %{name}.info" ||
echo "${path_installinfo:-/sbin/install-info} %{name}.info")
%preun [<subpackage>]
$([[ "$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

View File

@ -1,6 +1,6 @@
#!/bin/bash
# test01_pkgquality -- @package@ test (rpm quality checks)
# Copyright (C) 2008,2012 Davide Madrisan <davide.madrisan@gmail.com>
# Copyright (C) 2008,2012,2013 Davide Madrisan <davide.madrisan@gmail.com>
[ -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
@ -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 \
@ -326,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 [<subpackage>]
...
$(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 [<subpackage>]
$([[ "$rpm_macro_installinfo" ]] &&
echo "$rpm_macro_installinfo %{name}.info" ||
echo "${path_installinfo:-/sbin/install-info} %{name}.info")
exit 0
%preun [<subpackage>]
$([[ "$rpm_macro_uninstallinfo" ]] &&
@ -423,9 +434,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