From aecfb601ece1c39758ee9c693482aff7ff4b6ea30e8f8a52a930bd6f217b75df Mon Sep 17 00:00:00 2001 From: Martin Wilck Date: Wed, 17 Jan 2024 10:13:46 +0000 Subject: [PATCH] Accepting request 1129735 from home:fcrozat:branches:system:packagemanager - Move checkbashisms to a separate multibuild flavor, reduce build cycle when only checkbashisms is needed. OBS-URL: https://build.opensuse.org/request/show/1129735 OBS-URL: https://build.opensuse.org/package/show/system:packagemanager/devscripts?expand=0&rev=29 --- _multibuild | 4 ++++ devscripts.changes | 6 ++++++ devscripts.spec | 40 ++++++++++++++++++++++++++++++++++++++-- 3 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 _multibuild diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..ef04d70 --- /dev/null +++ b/_multibuild @@ -0,0 +1,4 @@ + + checkbashisms + + diff --git a/devscripts.changes b/devscripts.changes index 165edf2..f337a4d 100644 --- a/devscripts.changes +++ b/devscripts.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Nov 28 13:33:03 UTC 2023 - Frederic Crozat + +- Move checkbashisms to a separate multibuild flavor, reduce + build cycle when only checkbashisms is needed. + ------------------------------------------------------------------- Tue Jul 12 09:38:54 UTC 2022 - Dirk Müller diff --git a/devscripts.spec b/devscripts.spec index c587ab8..ba315be 100644 --- a/devscripts.spec +++ b/devscripts.spec @@ -1,7 +1,7 @@ # # spec file for package devscripts # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,6 +16,8 @@ # +%define flavor @BUILD_FLAVOR@%{nil} + %define _xsl_stylesheet %{_datadir}/xml/docbook/stylesheet/nwalsh/current/manpages/docbook.xsl Name: devscripts Version: 2.22.2 @@ -32,17 +34,22 @@ Patch1: devscripts-fix-python-install-layout.patch # PATCH-FEATURE-OPENSUSE devscripts-debcommit-hg16.patch -- Mercurial cannot commit empty, fix it. Patch2: devscripts-debcommit-hg16.patch BuildRequires: bash-completion-devel +%if "%{flavor}" == "" BuildRequires: docbook-xsl-stylesheets BuildRequires: dpkg-devel >= 1.18.19 BuildRequires: help2man BuildRequires: libxslt +%endif BuildRequires: perl BuildRequires: perl-macros +%if "%{flavor}" == "" +BuildRequires: po4a BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: sgmltool BuildRequires: texlive-latex BuildRequires: zlib-devel +%endif Requires: checkbashisms >= %{version} Requires: dpkg Requires: html2text @@ -72,6 +79,7 @@ Examples: - licensecheck: Attempt to determine the license of source files. - uscan: Scan upstream sites for new releases of packages. +%if "%{flavor}" == "checkbashisms" %package -n checkbashisms Summary: Tool for checking /bin/sh scripts for possible bashisms License: GPL-2.0-or-later @@ -85,7 +93,8 @@ BuildArch: noarch checkbashisms performs basic checks on /bin/sh shell scripts for the possible presence of bashisms. It takes the names of the shell scripts on the command line, and outputs warnings if possible -bashisms are detected. +bashisms are detected.* +%endif %prep %setup -q -n devscripts-v%{version} @@ -93,13 +102,27 @@ bashisms are detected. %patch1 -p1 %patch2 -p1 +%if "%{flavor}" == "foo" +echo %{version} > version +%endif + %build +%if "%{flavor}" == "" make %{?_smp_mflags} V=1 \ XSL_STYLESHEET="%{_xsl_stylesheet}" +%endif %install +%if "%{flavor}" == "" %make_install \ XSL_STYLESHEET="%{_xsl_stylesheet}" +%endif + +%if "%{flavor}" == "checkbashisms" +mkdir -p %{buildroot}%{_bindir} +sed -e "s/###VERSION###/%{version}/" scripts/checkbashisms.pl > %{buildroot}%{_bindir}/checkbashisms +install -D -m755 scripts/checkbashisms.bash_completion %{buildroot}%{_datadir}/bash-completion/completions/checkbashisms +%endif # remove completion that was provided in older bash completion %if 0%{?suse_version} <= 1500 @@ -107,22 +130,32 @@ rm %{buildroot}%{_datadir}/bash-completion/completions/bts %endif mkdir -p %{buildroot}%{_mandir}/man1/ +%if "%{flavor}" == "" install -Dpm 0644 scripts/*.1 -t %{buildroot}%{_mandir}/man1/ +%endif +%if "%{flavor}" == "checkbashisms" +install -Dpm 0644 scripts/checkbashisms.1 -t %{buildroot}%{_mandir}/man1/ +%endif +%if "%{flavor}" == "" while read target link; do if [ -d $(dirname "%{buildroot}$link") ]; then ln -sf "$target" "%{buildroot}$link" fi done < debian/links +%endif # Fix documentation. +%if "%{flavor}" == "" mkdir -p %{buildroot}%{_docdir}/ if [ "%{_datadir}/doc" != "%{_docdir}" ]; then mv %{buildroot}%{_datadir}/doc/devscripts %{buildroot}%{_docdir}/ fi install -Dpm 0644 debian/changelog %{buildroot}%{_docdir}/devscripts/changelog +%endif %files +%if "%{flavor}" == "" %license debian/copyright COPYING %doc %{_docdir}/devscripts/ %{_bindir}/* @@ -135,11 +168,14 @@ install -Dpm 0644 debian/changelog %{buildroot}%{_docdir}/devscripts/changelog %exclude %{_datadir}/bash-completion/completions/checkbashisms %{_mandir}/man?/*.?%{?ext_man} %exclude %{_mandir}/man1/checkbashisms.1%{?ext_man} +%endif +%if "%{flavor}" == "checkbashisms" %files -n checkbashisms %license debian/copyright COPYING %{_bindir}/checkbashisms %{_datadir}/bash-completion/completions/checkbashisms %{_mandir}/man1/checkbashisms.1%{?ext_man} +%endif %changelog