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

Summary:	A library for bits of crypto UI and parsing etc.
Name:		gcr
Version:	3.6.2
Release:	1%{?_dist_release}
License:	GPL/LGPL
Group:		System Environment/Libraries 
URL:		http://www.gnome.org 

Source0:	http://ftp.gnome.org/pub/GNOME/sources/%{name}/3.6/%{name}-%{version}.tar.xz

BuildRequires:	gtk3-devel 
BuildRequires:	p11-kit-devel 
BuildRequires:	libtasn1-devel 
BuildRequires:	libgcrypt-devel 

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

Vendor: Project Vine
Distribution: Vine Linux
Packager: Takemikaduchi


%description
GCR is a library for displaying certificates, and crypto UI, accessing
key stores. It also provides the viewer for crypto files on the GNOME
desktop.

GCK is a library for accessing PKCS#11 modules like smart cards, in a
(G)object oriented way.


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

%description	devel
Header files and libraries for building a extension library for the
gcr.


%package        doc
Summary:        Documentation for gcr
Summary(ja):    gcr 用のドキュメント
Group:          Documentation
Requires:       %{name} = %{version}-%{release}
BuildArch:      noarch

%description	doc
This package contains documentation for gcr.


# compat32
%package -n compat32-%{name}
Summary:	A library for bits of crypto UI and parsing etc.
Group:          System Environment/Libraries
Requires:	%{name} = %{version}-%{release}

%description -n compat32-%{name}
GCR is a library for displaying certificates, and crypto UI, accessing
key stores. It also provides the viewer for crypto files on the GNOME
desktop.

GCK is a library for accessing PKCS#11 modules like smart cards, in a
(G)object oriented way.


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

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


%prep
%setup -q


%build
%configure --disable-static
%{__make} %{?_smp_mflags}


%install
%{__rm} -rf ${RPM_BUILD_ROOT}
%{__make} install DESTDIR=${RPM_BUILD_ROOT}

find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} \;
rm -f $RPM_BUILD_ROOT%{_libdir}/libmock-test-module.so

%find_lang %{name}


%clean
%{__rm} -rf ${RPM_BUILD_ROOT}

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%post -n compat32-%{name} -p /sbin/ldconfig
%postun -n compat32-%{name} -p /sbin/ldconfig


%files -f %{name}.lang
%defattr(-,root,root)
%doc COPYING ChangeLog NEWS README
%{_bindir}/gcr-viewer
%{_libdir}/libgck-1.so.*
%{_libdir}/libgcr-3.so.*
%{_libdir}/libgcr-base-3.so.*
%{_libdir}/girepository-1.0/Gck-1.typelib
%{_libdir}/girepository-1.0/Gcr-3.typelib
%{_libexecdir}/gcr-prompter
%{_datadir}/GConf/gsettings/org.gnome.crypto.pgp.convert
%{_datadir}/GConf/gsettings/org.gnome.crypto.pgp_keyservers.convert
%{_datadir}/applications/gcr-prompter.desktop
%{_datadir}/applications/gcr-viewer.desktop
%{_datadir}/dbus-1/services/org.gnome.keyring.PrivatePrompter.service
%{_datadir}/dbus-1/services/org.gnome.keyring.SystemPrompter.service
%{_datadir}/gcr-3/ui/gcr-pkcs11-import-dialog.ui
%{_datadir}/gcr-3/ui/gcr-unlock-options-widget.ui
%{_datadir}/glib-2.0/schemas/org.gnome.crypto.pgp.gschema.xml
%{_datadir}/icons/*/*/*
%{_datadir}/mime/packages/gcr-crypto-types.xml

%files devel
%defattr(-,root,root)
%{_includedir}/gck-1
%{_includedir}/gcr-3
%{_libdir}/libgck-1.so
%{_libdir}/libgcr-3.so
%{_libdir}/libgcr-base-3.so
%{_libdir}/pkgconfig/*.pc
%{_datadir}/gir-1.0/Gck-1.gir
%{_datadir}/gir-1.0/Gcr-3.gir

%files doc
%defattr(-,root,root)
%{_datadir}/gtk-doc/html/gck
%{_datadir}/gtk-doc/html/gcr-3

# compat32
%if %{build_compat32}
%files -n compat32-%{name}
%defattr(-,root,root)
%{_libdir}/libgck-1.so.*
%{_libdir}/libgcr-3.so.*
%{_libdir}/libgcr-base-3.so.*

%files -n compat32-%{name}-devel
%defattr(-,root,root)
%{_libdir}/libgck-1.so
%{_libdir}/libgcr-3.so
%{_libdir}/libgcr-base-3.so
%endif


%changelog
* Wed Nov 14 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.6.2-1
- new upstream release

* Tue Oct 16 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.6.1-1
- new upstream release

* Fri Sep 28 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.6.0-1
- new upstream release

* Sun Apr 22 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.4.1-1
- initial build for Vine Linux

