File selfhtml.spec of Package selfhtml

#
# spec file for package selfhtml
#
# 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/
#


Name:           selfhtml
Version:        8.1.2
Release:        80
License:        Public Domain, Freeware
Summary:        HTML reference
Url:            http://selfhtml.org/
Group:          Documentation/Other
BuildArch:      noarch
# Provides:       locale(susehelp:de)
AutoReqProv:    off
%if 0%{?suse_version}
BuildRequires:  apache2-devel
BuildRequires:  fdupes
BuildRequires:  update-desktop-files
%define         apache_sysconfdir   %(/usr/sbin/apxs2 -q SYSCONFDIR)
%endif
%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
BuildRequires:  desktop-file-utils
BuildRequires:  httpd-devel
%define         apache_sysconfdir   %(/usr/sbin/apxs -q SYSCONFDIR)
%endif
%if 0%{?mandriva_version}
BuildRequires:  apache2-devel
Requires(post): desktop-file-utils
Requires(postun): desktop-file-utils
%define         apache_sysconfdir   %(/usr/sbin/apxs2 -q SYSCONFDIR)
%endif
Source:         selfhtml812.tar.bz2
Source1:        %{name}.desktop
Source2:        %{name}.png
Source3:        %{name}.conf
Source4:        selfhtml-rpmlintrc
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
A very good documentation of HTML, CSS, JavaScript, DHTML, XML/XSLT,
CGI/Perl and more, with many additional tips for design, graphics,
project management, etc.

Up to now there is only a german version. Translations into english,
french, spanish and japanese are in progress but not yet completed.

%prep
%setup -q -n %{name}

%build

%install
mkdir -p %{buildroot}%{_datadir}/doc/%{name}
cp -a $RPM_BUILD_DIR/%{name}/* %{buildroot}%{_datadir}/doc/%{name}/
for file in $(find %{buildroot}%{_datadir}/doc/%{name}/ -type f | grep -v .zip$); do
	sed -i "s|\r$||" $file
done

# create desktop entries
%{__mkdir_p} %{buildroot}%{_datadir}/{applications,pixmaps}
## %{__install} -m 644 %{SOURCE1} %{buildroot}%{_datadir}/applications/
%{__install} -m 644 %{SOURCE2} %{buildroot}%{_datadir}/pixmaps/
%if 0%{?suse_version}
%suse_update_desktop_file -i selfhtml
# entry for susehelp
mkdir -p %{buildroot}%{_datadir}/susehelp/meta/SelfHTML
%{__install} -m 644 %{SOURCE1} %{buildroot}%{_datadir}/susehelp/meta/SelfHTML/
# save space
%fdupes -s %{buildroot}
%endif
%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
# install desktop file
desktop-file-install --vendor="%{vendor}" \
  --dir=%{buildroot}%{_datadir}/applications \
  %{SOURCE1}
%endif
%if 0%{?mandriva_version}
desktop-file-install --vendor="%{vendor}" \
  --dir=%{buildroot}%{_datadir}/applications \
  %{SOURCE1}
%endif

# create apache configuration
%{__mkdir_p} %{buildroot}%{apache_sysconfdir}/conf.d
%{__install} -m 644 %{SOURCE3} %{buildroot}%{apache_sysconfdir}/conf.d/%{name}.conf

%clean
rm -rf %{buildroot}

%if 0%{?mandriva_version}
%post
%{update_menus}

%postun
%{clean_menus}
%endif

%files
%defattr(-,root,root)
%if 0%{?suse_version}
%dir %{_datadir}/susehelp/
%dir %{_datadir}/susehelp/meta
%{_datadir}/susehelp/meta/SelfHTML
%endif
%{_datadir}/doc/selfhtml
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
%config (noreplace) %{apache_sysconfdir}/conf.d/%{name}.conf

%changelog
openSUSE Build Service is sponsored by