Accepting request 1176806 from system:packagemanager

OBS-URL: https://build.opensuse.org/request/show/1176806
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/devscripts?expand=0&rev=13
This commit is contained in:
Ana Guerrero 2024-05-28 15:27:31 +00:00 committed by Git OBS Bridge
commit 88a20c60ac
3 changed files with 76 additions and 7 deletions

4
_multibuild Normal file
View File

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

View File

@ -1,3 +1,31 @@
-------------------------------------------------------------------
Fri May 24 12:16:13 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>
- Fix minor issues:
+ Do not build devscripts main package (empty) in checkbashisms
flavor.
+ Ensure the two flavors have different .src.rpm names, not
overwriting each other.
-------------------------------------------------------------------
Tue May 21 10:43:58 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>
- Mark %{buildroot}%{_bindir}/checkbashisms executable: sed … >
%{buildroot}%{_bindir}/checkbashisms creates a non-executable,
regular file.
-------------------------------------------------------------------
Mon Feb 26 07:58:09 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>
- Use %autosetup macro. Allows to eliminate the usage of deprecated
PatchN.
-------------------------------------------------------------------
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) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -16,8 +16,13 @@
#
%define flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "checkbashisms"
%define name_suffix -checkbashisms
%endif
%define _xsl_stylesheet %{_datadir}/xml/docbook/stylesheet/nwalsh/current/manpages/docbook.xsl
Name: devscripts
Name: devscripts%{?name_suffix}
Version: 2.22.2
Release: 0
Summary: Scripts to make the life of a Debian Package maintainer easier
@ -32,17 +37,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 +82,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,21 +96,34 @@ 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}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%autosetup -p1 -n devscripts-v%{version}
%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
chmod a+x %{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,21 +131,31 @@ 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
%if "%{flavor}" == ""
%files
%license debian/copyright COPYING
%doc %{_docdir}/devscripts/
@ -135,11 +169,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