File perl-SGML.spec of Package perl-SGML

#
# spec file for package perl-SGML
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

%define modname perlsgml
%{?!perl_man1dir:%define perl_man1dir %{_mandir}/man1}

Name:           perl-SGML
Version:        1997Sep18+git.1728598337.0d0f5be
Release:        0%{?dist}
Summary:        Perl library for manipulating SGML documents
License:        GPL-2.0-or-later
Group:          Productivity/Publishing/SGML
URL:            https://savannah.nongnu.org/projects/perlsgml/
# URL https://metacpan.org/release/EHOOD/perlSGML.1997Sep18
Source0:        %{modname}-%{version}.tar.gz
BuildRequires:  perl-base
BuildRequires:  python3-docutils
BuildRequires:  python3-docutils
BuildRequires:  mandoc
BuildArch:      noarch

%description
Perl library for manipulating SGML documents.

Contains libraries and end-user utilities dtd2html, stripsgml, dtdtree,
dtddiff, and dtdview.

%prep
%autosetup -p1 -n %{modname}-%{version}


%build
sed -n -e '/KNOWN BUGS/,$p' README.1ST > ABOUT.BUGS		  	
for man in doc/manpages/*.rst ; do
    rst2man ${man} > "${man%*.rst}.1"
done
for man in doc/manpages/*.1 ; do
    mandoc -T html ${man} > "doc/html/$(basename ${man} .1).html"
done


%install
mkdir -p %{buildroot}{%{_bindir},%{perl_vendorlib}}
perl install.me -batch -binpath %{buildroot}%{_bindir} \
    -libpath %{buildroot}%{perl_vendorlib} \
    -noman -nodoc -perlpath %{__perl}

for script in %{buildroot}%{_bindir}/* ; do
    sed -i -e '/rpmbuild\/BUILDROOT/d' \
        -e 's!/usr/local/bin/perl!/usr/bin/perl!' $script
done 

mkdir -p %{buildroot}%{perl_man1dir}
install -m 644 -t %{buildroot}%{perl_man1dir} doc/manpages/*.1

%if 0%{?suse_version}
%perl_process_packlist
%endif

%files
%license COPYING
%doc CHANGES README.1ST VERSIONS doc ABOUT.BUGS

%{_bindir}/dtd*
%{_bindir}/*sgml
%{perl_vendorlib}/SGML
%{perl_vendorlib}/*.pm
%{perl_vendorlib}/*.pl
%{perl_man1dir}/*

%changelog
openSUSE Build Service is sponsored by