File openclipart.spec of Package openclipart

#
# spec file for package openclipart (Version 0.18)
#
# Copyright (c) 2008 SUSE LINUX Products 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/
#

# norootforbuild


Name:           openclipart
License:        Public Domain, Freeware
Group:          Productivity/Graphics/Other
AutoReqProv:    on
Summary:        Open Clip Art Library
Version:        0.18
Release:        136
Url:            http://www.openclipart.org/
# This tarball has been generated using:
# sh generate-png-source.sh openclipart-0.18-svgonly.tar.bz2 2>&1 | tee generate-png-source.sh.log
Source0:        openclipart-%{version}-pngonly.tar.bz2
Source1:        openclipart-%{version}-svgonly.tar.bz2
Source2:        generate-png-source.sh
Source3:        generate-png-source.sh.log.bz2
Source4:        clean-up-sources.sh
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%description
An extensive set of clip art graphics that can be used for free.



%package svg
License:        Public Domain, Freeware
Summary:        Open Clip Art Library in the SVG File Format
Group:          Productivity/Graphics/Other

%description svg
An extensive set of clip art graphics that can be used for free.

This package includes the pictures in the original SVG graphics file
format.



%package png
License:        Public Domain, Freeware
Summary:        Open Clip Art Library in the PNG File Format
Group:          Productivity/Graphics/Other
Provides:       openclipart:/usr/share/clipart/openclipart-0.18/animals/birds/baby_tux_01.png
Provides:       openclipart <= 0.18
Obsoletes:      openclipart <= 0.18

%description png
An extensive set of clip art graphics that can be used for free.

This package includes the pictures converted to the PNG graphics file
format.



%prep
%setup -q -n openclipart-%{version}-pngonly -b 1
#
install -m 755 %{S:2} %{S:4} .
bzip2 -dc %{S:3} >generate-png-source.sh.log

%build

%install
install -m 755 -d $RPM_BUILD_ROOT%{_datadir}/clipart/%name-%version
cp -a ../openclipart-%{version}-pngonly/clipart/* \
      $RPM_BUILD_ROOT%{_datadir}/clipart/%name-%version
cp -a ../openclipart-%{version}-svgonly/clipart/* \
      $RPM_BUILD_ROOT%{_datadir}/clipart/%name-%version
find $RPM_BUILD_ROOT%{_datadir}/clipart/%name-%version -mindepth 1  -maxdepth 1 -type f -exec rm {} \;
rm -rf $RPM_BUILD_ROOT%{_datadir}/clipart/%name-%version/nsis
#
# do clean up ...
DESTDIR=$RPM_BUILD_ROOT ./clean-up-sources.sh %{_datadir}/clipart/%name-%version/
#
# compat symlink without version
ln -sf %name-%version $RPM_BUILD_ROOT%{_datadir}/clipart/%name
#
# file lists
for suffix in png svg ; do
    find $RPM_BUILD_ROOT%{_datadir}/clipart -type d | sed "s|^$RPM_BUILD_ROOT\(.*\)$|%dir \"\1\"|" >files.$suffix
    find $RPM_BUILD_ROOT%{_datadir}/clipart -name "*.$suffix" | sed "s|^$RPM_BUILD_ROOT\(.*\)$|\"\1\"|" >>files.$suffix
done

%clean
rm -rf $RPM_BUILD_ROOT
%posttrans svg
test -L %{_datadir}/clipart/%name && rm %{_datadir}/clipart/%name || true
test ! -e %{_datadir}/clipart/%name && ln -sf %name-%version %{_datadir}/clipart/%name || true;
%posttrans png
test -L %{_datadir}/clipart/%name && rm %{_datadir}/clipart/%name || true
test ! -e %{_datadir}/clipart/%name && ln -sf %name-%version %{_datadir}/clipart/%name || true;

%files -f files.svg svg
%defattr(-, root,root)
%doc AUTHORS ChangeLog INSTALL LICENSE NEWS README VERSION clipart/{PASSFAIL,TODO}
%ghost %{_datadir}/clipart/%name

%files -f files.png png
%defattr(-, root,root)
%doc AUTHORS ChangeLog INSTALL LICENSE NEWS README VERSION generate-png-source.sh* clipart/{PASSFAIL,TODO}
%ghost %{_datadir}/clipart/%name

%changelog
* Thu Nov 06 2008 pmladek@suse.cz
- split into openclipart-png and openclipart-svg
- the -png subpackage provides the PNG pictures for backward
  compatibility with the older openclipart package
- the -svg subpackage provides the same pictures in the original
  SVG file format; it is supported by OpenOffice.org finally
* Tue Jul 24 2007 pmladek@suse.cz
- optimized the PNGs by optipng -o5; reduced the size by about 20%
* Fri May 12 2006 pmladek@suse.cz
- bigger clean up; done by a separate script now:
  * removed more broken or less usable pictures
  * removed unwanted duplicities
  * used symlinks for the wanted duplicities
  * moved some more images to the right section
* Tue Apr 11 2006 pmladek@suse.cz
- removed some broken images
- moved some images to the right section
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Mon Jan 16 2006 pmladek@suse.cz
- updated to version 0.18 (many new cliparts)
- used pregenerated .png files to shrink the deep build dependency (base system,
  gnome, inkscape, openclipart, OpenOffice_org)
- changed installation path from /usr/share/openclipart to the new standard
  path /usr/share/clipart/openclipart-%%version
- added compat symlink /usr/share/clipart/openclipart
- added a script, which was used to convert .svg -> .png files
- added a log from the .svg -> .png conversion
- cleaned up BuildRequires
* Tue Nov 29 2005 ro@suse.de
- added loudmouth to nfb (for inkscape)
* Wed Aug 03 2005 pmladek@suse.cz
- added fam to neededforbuild; necessary by gnome-vfs2, so that inkscape
  works again
* Tue Jul 26 2005 pmladek@suse.cz
- updated to version 0.15
- used svgonly sources, added some documents from the full sources
- fixed build so the blacklisted files are really removed
- blacklisted some more ugly and controversial images
* Tue May 10 2005 pmladek@suse.cz
- package created, version 0.12
openSUSE Build Service is sponsored by