%define build_compat32 %{?_with_compat32:1}%{!?_with_compat32:0}

Summary:        Theme engines for GTK+ 3.x
Summary(ja):    GTK+ 3.x 用テーマエンジン
Name:           gtk3-engines
Version:        2.91.1
Release:		2%{?_dist_release}
License:        GPL
Group:          System Environment/Libraries
Source:		ftp://ftp.gnome.org/pub/gnome/sources/gtk-engines/2.91/gtk-engines-%{version}.tar.bz2

Requires:       gtk3 >= 2.91.0
BuildRequires:  gtk3-devel >= 2.91.0
Conflicts:	gnome-themes < 2.8.2-0vl1
Conflicts:	gnome-themes-extras < 0.8-0vl2

URL:            http://www.gnome.org/

BuildRoot:      %{_tmppath}/%{name}-%{version}-root

Vendor: Project Vine
Distribution: Vine Linux

%description
The gtk3-engines package contains shared objects and configuration
files that implement a number of GTK+ theme engines. Theme engines
provide different looks for GTK+, some of which resemble other
toolkits or operating systems. This package is for GTK+ 3.0, 
the gtk+-engines package is for GTK+ 1.2.
the gtk2-engines package is for GTK+ 2.x.


%package devel
Summary:        Development environment for gtk3-engines
Summary(ja):    gtk3-enginesの開発環境
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}
Requires:       pkgconfig

%description devel
Header files and libraries for building a extension library for the
gtk3-engines.


# compat32
%package -n compat32-%{name}
Summary:        Theme engines for GTK+ 3.x
Summary(ja):    GTK+ 3.x 用テーマエンジン
Group:          System Environment/Libraries
Requires:       %{name} = %{version}-%{release}

%description -n compat32-%{name}
The gtk3-engines package contains shared objects and configuration
files that implement a number of GTK+ theme engines. Theme engines
provide different looks for GTK+, some of which resemble other
toolkits or operating systems. This package is for GTK+ 3.0, 
the gtk+-engines package is for GTK+ 1.2.
the gtk2-engines package is for GTK+ 2.x.

%package -n compat32-%{name}-devel
Summary:        Development environment for gtk3-engines
Summary(ja):    gtk3-enginesの開発環境
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}
Requires:       pkgconfig

%description -n compat32-%{name}-devel
Header files and libraries for building a extension library for the
gtk3-engines.

%prep
%setup -q -n gtk-engines-%{version}

%build

%configure
%__make

%install
rm -rf $RPM_BUILD_ROOT

%makeinstall

# remove backup files that shouldn't be here.  Fix me.
find $RPM_BUILD_ROOT%{_datadir}/themes -name \*~ | xargs rm -rvf

# No, we don't need to package these either
find $RPM_BUILD_ROOT%{_datadir}/themes -type d -name ".xvpics" | xargs rm -rvf

# sanitize permissions
find $RPM_BUILD_ROOT%{_datadir}/themes -type d -exec chmod 755 {} \;
find $RPM_BUILD_ROOT%{_datadir}/themes -type f -name "*.png" -exec chmod 644 {} \;
find $RPM_BUILD_ROOT%{_datadir}/themes -name "gtkrc*" -perm +111 -exec chmod 644 {} \;

# remove unpackaged files
rm -f $RPM_BUILD_ROOT%{_libdir}/gtk-3.0/*/engines/lib*.la

%clean
rm -rf $RPM_BUILD_ROOT

%files 
%defattr(-, root, root, -)
%doc COPYING README ChangeLog
%attr (755, root, root) %{_libdir}/gtk-3.0/*/engines/*.so
%dir %{_libdir}/gtk-3.0
%dir %{_libdir}/gtk-3.0/*
%dir %{_libdir}/gtk-3.0/*/engines
%{_datadir}/themes/*
%{_datadir}/gtk-engines/3.0/*.xml
%{_datadir}/locale

%files devel
%defattr(-, root, root, -)
%{_libdir}/pkgconfig/*

# compat32
%if %{build_compat32}
%files -n compat32-%{name}
%defattr(-, root, root, -)
%attr (755, root, root) %{_libdir}/gtk-3.0/*/engines/*.so
%dir %{_libdir}/gtk-3.0
%dir %{_libdir}/gtk-3.0/*
%dir %{_libdir}/gtk-3.0/*/engines
%{_libdir}/pkgconfig/*

%files -n compat32-%{name}-devel
%defattr(-, root, root, -)
%{_libdir}/pkgconfig/*
%endif

%changelog
* Tue Dec 31 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.91.1-2
- rebuild with VineSeed environment

* Sat May 28 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.91.1-1
- initial build for Vine Linux

