SHA256
1
0
forked from pool/devscripts

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
This commit is contained in:
Martin Wilck 2024-01-17 10:13:46 +00:00 committed by Git OBS Bridge
parent 664d8c3169
commit aecfb601ec
3 changed files with 48 additions and 2 deletions

4
_multibuild Normal file
View File

@ -0,0 +1,4 @@
<multibuild>
<package>checkbashisms</package>
</multibuild>

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Nov 28 13:33:03 UTC 2023 - Frederic Crozat <fcrozat@suse.com>
- 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 <dmueller@suse.com>

View File

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