diff --git a/ChangeLog b/ChangeLog index c16e396..0b88339 100644 --- a/ChangeLog +++ b/ChangeLog @@ -45,6 +45,12 @@ Changes in version 1.9.3 Preliminary support for scon. (Feature asked by Silvan Calarco.) + * spec-create - Davide Madrisan: + Add a build requirent for cmake and scons when required. + + * templetes/{library,standard,standard-daemon} - Davide Madrisan: + Add a 'buildrequires_buildtool' conditional block. + -------------------------------------------------------------------------------- Changes in version 1.9.2 diff --git a/plugins/spec-create.in b/plugins/spec-create.in index 47c03b9..de43f3d 100644 --- a/plugins/spec-create.in +++ b/plugins/spec-create.in @@ -256,6 +256,7 @@ shared-libraries:,debug-package:,\ local standard_docs local standard_docs_devel local build_technology + local buildrequires_buildtool local i18n="0" local icons_mimetypes="0" @@ -329,6 +330,7 @@ shared-libraries:,debug-package:,\ spec_cmd_configure="$spec_cmd_configure_cmake" spec_cmd_make="$spec_cmd_make_cmake" spec_cmd_makeinstall="$spec_cmd_makeinstall_cmake" + buildrequires_buildtool="cmake" ;; autotools) spec_cmd_configure="$spec_cmd_configure_autotools" @@ -344,6 +346,7 @@ shared-libraries:,debug-package:,\ spec_cmd_configure="$spec_cmd_configure_scons" spec_cmd_make="$spec_cmd_make_scons" spec_cmd_makeinstall="$spec_cmd_makeinstall_scons" + buildrequires_buildtool="scons" ;; unknown) notify.warning $"unknown build techonology" @@ -355,6 +358,8 @@ shared-libraries:,debug-package:,\ notify.debug "$FUNCNAME: spec_cmd_configure = \"$spec_cmd_configure\"" notify.debug "$FUNCNAME: spec_cmd_make = \"$spec_cmd_make\"" notify.debug "$FUNCNAME: spec_cmd_makeinstall = \"$spec_cmd_makeinstall\"" + notify.debug "\ +$FUNCNAME: buildrequires_buildtool = \"$buildrequires_buildtool\"" [ -r "$templatefile" ] || notify.error $"file not found"": $templatefile" @@ -370,7 +375,9 @@ shared-libraries:,debug-package:,\ $spec_type ("$"line""#$template_linenum): "$"too many nested @if blocks" if_level=$(($if_level + 1)) currvar="$(echo "$line" | sed "s,@if:\([^ \t]*\).*,\1,")" - [ "${!currvar}" = 1 ] || if_value[$if_level]='0' + [[ "${!currvar}" = 1 || \ + ( -n "${!currvar}" && "${!currvar}" != 0 ) ]] || \ + if_value[$if_level]='0' notify.debug "\ $FUNCNAME: @if:$currvar lev:$if_level val:${if_value[$if_level]})" continue @@ -417,6 +424,7 @@ s,^\(%setup.*\),${spec_setup_macro}, s,^\([ \t]*Source[ \t]*:[ \t]*\).*,\1${spec_source}, s,@make@,$spec_cmd_make, s,@makeinstall@,$spec_cmd_makeinstall, +s,@build_tool@,$buildrequires_buildtool, 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, diff --git a/templates/library b/templates/library index f7d48f1..d1e7ce1 100644 --- a/templates/library +++ b/templates/library @@ -17,6 +17,9 @@ License: ... ## AUTOBUILDREQ-BEGIN ## note: run 'autospec -u -a6 @pck_name@' to get the list of build requirements. ## AUTOBUILDREQ-END +@if:buildrequires_buildtool +BuildRequires: @build_tool@ +@fi:buildrequires_buildtool @if:pck_library Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release} @fi:pck_library diff --git a/templates/standard b/templates/standard index 12bde22..d7d6750 100644 --- a/templates/standard +++ b/templates/standard @@ -13,6 +13,9 @@ License: ... ## AUTOBUILDREQ-BEGIN ## note: run 'autospec -u -a6 @pck_name@' to get the list of build requirements. ## AUTOBUILDREQ-END +@if:buildrequires_buildtool +BuildRequires: @build_tool@ +@fi:buildrequires_buildtool @if:infopages Requires(post): %{__install_info} @fi:infopages diff --git a/templates/standard-daemon b/templates/standard-daemon index 4dc9047..0aa5844 100644 --- a/templates/standard-daemon +++ b/templates/standard-daemon @@ -13,6 +13,9 @@ License: ... ## AUTOBUILDREQ-BEGIN ## note: run 'autospec -u -a6 @pck_name@' to get the list of build requirements. ## AUTOBUILDREQ-END +@if:buildrequires_buildtool +BuildRequires: @build_tool@ +@fi:buildrequires_buildtool @if:infopages Requires(post): %{__install_info} @fi:infopages