File linkchecker.spec of Package linkchecker

# spec file for package linkchecker
# Copyright (c) 2016 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

%define project_name LinkChecker

Name:           linkchecker
%define _prefix /usr
Summary:        Check Websites and HTML Documents for Broken Links
License:        GPL-2.0+
Group:          Productivity/Networking/Web/Utilities
Version:        9.3
Release:        0
Source0:        %{project_name}-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Prefix:         %{_prefix}
BuildRequires:  libqt4-devel-doc
BuildRequires:  python-cssutils
BuildRequires:  python-devel
BuildRequires:  python-optcomplete
BuildRequires:  python-xml
BuildRequires:  update-desktop-files
Requires:       python-cssutils
Requires:       python-optcomplete
Requires:       python-requests
Requires:       tidy

LinkChecker checks websites and HTML documents for broken links.
Features are:

* recursive checking

* multithreaded

* output in colored or normal text, HTML, SQL, CSV, XML or a sitemap
   graph in different formats

* HTTP/1.1, HTTPS, FTP, mailto:, news:, nntp:, Gopher, Telnet and
   local file links support

* restriction of link checking with regular expression filters for

* proxy support

* username/password authorization for HTTP and FTP

* robots.txt exclusion protocol support

* i18n support

* a command line interface

* a (Fast)CGI web interface (requires HTTP server)

%setup -q -n %{project_name}-%{version}
cp -a doc/examples .

make -C doc/html
python build
chmod -x examples/*.sh

python install --root=%{buildroot} --prefix=%{_prefix}
# 'brp-compress' compresses the manpages without distutils knowing.
# So append ".gz" suffixes to the affected manpage filenames.
sed -i -e 's@/usr/share/man/man\([[:digit:]]\)/\(.\+\.[[:digit:]]\)$@%doc /usr/share/man/man\1/\2.gz@g'
sed -i -e 's@/usr/share/man/de/man\([[:digit:]]\)/\(.\+\.[[:digit:]]\)$@%doc /usr/share/man/de/man\1/\2.gz@g'
sed -i -e 's@/usr/share/man/fr/man\([[:digit:]]\)/\(.\+\.[[:digit:]]\)$@%doc /usr/share/man/fr/man\1/\2.gz@g'
rm -rf examples
mv %{buildroot}%{_datadir}/%{name}/examples ./
grep -E -v '/usr/share/linkchecker/examples|/usr/share/locale' > INSTALLED_FILES
echo "%{py_sitedir}/_LinkChecker_configdata.pyc" >> INSTALLED_FILES
find %{buildroot}/%{_mandir} -name \*.1 -o -name \*.5 -exec gzip -9 {} \;
pushd doc/html
install -d -m 0755 %{buildroot}%{_datadir}/pixmaps
install -D -m 644 logo128x128.png  logo16x16.png  logo32x32.png logo48x48.png  logo64x64.png %{buildroot}%{_datadir}/pixmaps

%suse_update_desktop_file -n linkchecker
%suse_update_desktop_file -n linkchecker-gui
%find_lang %name

%files -f INSTALLED_FILES -f %name.lang
%doc examples doc/upgrading.txt doc/changelog.txt