File propaganda05.spec of Package propaganda05

#
# spec file for package propaganda05 (Version 0)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

Name:           propaganda05
Version:        0
Release:        0
Summary:        Collection of Abstract Seamless Tiles for Wallpapers and Backgrounds
License:        GPL v2 or later
Group:          Amusement/Toys/Graphics
Source:         Propaganda-Vol-05.tar.gz
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Propaganda, at its core, is basically a collection of "seamless tiles".
Graphics which are drawn in such a way that they do not appear to repeat
at the edges. All the graphics for Propaganda are drawn with GIMP, an
excellent paint program also made available under the GNU GPL. Propaganda
tiles are painted in a wide variety of styles, textures and sizes, making
them ideal for use in 3D applications, or simply as desktop wallpaper.

Authors:
--------
    Bowie J. Poag

%define propagandadocdir %{_docdir}/Propaganda/Vol5
%define propagandaimgdir %{_datadir}/Propaganda/Vol5
%define propagandaimgsrc Vol5
%define propagandaname "Propaganda Vol 5"
%prep
%setup -q -n Propaganda
chmod -x [CR]*

%build
cd %{propagandaimgsrc}
cat >../%{name}.xml <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE wallpapers SYSTEM "gnome-wp-list.dtd">
<wallpapers>
EOF
mkdir -p nautilus-patterns wallpapers
for IMG in *.JPG ; do
    NEWBASE=${IMG%%.JPG}
    NEWIMG=$NEWBASE.jpg
    DESC="${NEWBASE//-/ }"
    ln $IMG $NEWIMG
    # FIXME: Nautilus provides no straightforward way to provide
    # name and I18N for third party patterns.
    ln -s %{propagandaimgdir}/$NEWIMG nautilus-patterns/"$DESC".jpg
    ln -s %{propagandaimgdir}/$NEWIMG wallpapers/$NEWIMG
    cat >>../%{name}.xml <<EOF
	<wallpaper deleted="false">
		<name>$DESC</name>
		<filename>%{propagandaimgdir}/$NEWIMG</filename>
		<options>wallpaper</options>
	</wallpaper>
EOF
    # FIXME: kdebase has translation for several names
    cat >>../$NEWBASE.desktop <<EOF
[Wallpaper]
Encoding=UTF-8
File=$NEWIMG
Name=$DESC
ImageType=pixmap
Author=Bowie J. Poag, %{propagandaname}
EOF
done

cat >>../%{name}.xml <<EOF
</wallpapers>
EOF

%install
install -d $RPM_BUILD_ROOT%{propagandaimgdir}
install -m 0644 %{propagandaimgsrc}/*.jpg $RPM_BUILD_ROOT%{propagandaimgdir}/
install -d $RPM_BUILD_ROOT%{_datadir}/gnome-background-properties
install -m 0644 %{name}.xml $RPM_BUILD_ROOT%{_datadir}/gnome-background-properties/
install -d $RPM_BUILD_ROOT%{_datadir}/nautilus/patterns
cp -a %{propagandaimgsrc}/nautilus-patterns/*.jpg $RPM_BUILD_ROOT%{_datadir}/nautilus/patterns/
install -d $RPM_BUILD_ROOT%{_datadir}/wallpapers
cp -a %{propagandaimgsrc}/wallpapers/*.jpg $RPM_BUILD_ROOT%{_datadir}/wallpapers/
install -m 0644 *.desktop $RPM_BUILD_ROOT%{_datadir}/wallpapers/
install -d $RPM_BUILD_ROOT/opt/kde3/share/apps/konqueror/tiles
cp -a %{propagandaimgsrc}/wallpapers/*.jpg $RPM_BUILD_ROOT/opt/kde3/share/apps/konqueror/tiles/
install -d $RPM_BUILD_ROOT%{_datadir}/kde4/apps/konqueror/tiles
cp -a %{propagandaimgsrc}/wallpapers/*.jpg $RPM_BUILD_ROOT%{_datadir}/kde4/apps/konqueror/tiles

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
# README-GPL == COPYING
%doc COPYING README README-PROPAGANDA
%dir %{_datadir}/Propaganda
%{propagandaimgdir}
%{_datadir}/gnome-background-properties/*.xml
%{_datadir}/kde4/apps/konqueror/tiles/*.jpg
%{_datadir}/nautilus/patterns/*.jpg
%{_datadir}/wallpapers/*.desktop
%{_datadir}/wallpapers/*.jpg
/opt/kde3/share/apps/konqueror/tiles/*.jpg
# Technically we should not own these directories, but we do not want to depend on GNOME:
%dir %{_datadir}/gnome-background-properties
%dir %{_datadir}/kde4
%dir %{_datadir}/kde4/apps
%dir %{_datadir}/kde4/apps/konqueror
%dir %{_datadir}/kde4/apps/konqueror/tiles
%dir %{_datadir}/nautilus
%dir %{_datadir}/nautilus/patterns
%dir %{_datadir}/wallpapers
%dir /opt/kde3
%dir /opt/kde3/share
%dir /opt/kde3/share/apps
%dir /opt/kde3/share/apps/konqueror
%dir /opt/kde3/share/apps/konqueror/tiles
openSUSE Build Service is sponsored by