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

%define         package_version 0.8.1
%define         package_release 1%{?_dist_release}

Name:           rest
Version:        %{package_version}
Release:        %{package_release}
Summary:        RESTful web api query library

Group:          System Environment/Libraries
License:        LGPLv2+
URL:            http://git.gnome.org/browse/librest
Source0:        http://ftp.gnome.org/pub/GNOME/sources/%{name}/0.7/%{name}-%{version}.tar.xz

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

BuildRequires:	glib2-devel
BuildRequires:	gobject-introspection-devel
BuildRequires:	libsoup-devel
BuildRequires:	ca-certificates
BuildRequires:	gtk-doc

Requires:	ca-certificates

Vendor: Project Vine
Distribution: Vine Linux
Packager: Takemikaduchi

%description
This library has been designed to make it easier to access web services that
claim to be "RESTful". A reasonable definition of what this means can be found
on Wikipedia [1]. However a reasonable description is that a RESTful service
should have urls that represent remote objects which methods can then be
called on.


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

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


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


%description    doc
This package contains documentation for rest.


# compat32
%package -n compat32-%{name}
Summary:        RESTful web api query library
Group:          System Environment/Libraries

%description -n compat32-%{name}
This library has been designed to make it easier to access web services that
claim to be "RESTful". A reasonable definition of what this means can be found
on Wikipedia [1]. However a reasonable description is that a RESTful service
should have urls that represent remote objects which methods can then be
called on.


%prep
%setup -q

%build
%configure \
	--enable-gtk-doc \
	--disable-static \
	--enable-introspection=yes 

make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT

make DESTDIR=$RPM_BUILD_ROOT install

rm -f $RPM_BUILD_ROOT%{_libdir}/*.la

%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
%defattr(-,root,root,-)
%doc ChangeLog AUTHORS COPYING README
%{_libdir}/*.so.*
%{_libdir}/girepository-1.0/*.typelib

%files devel
%defattr(-, root, root)
%{_includedir}/%{name}-0.7
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%{_datadir}/gir-1.0/*.gir

%files doc
%defattr(-, root, root)
%{_datadir}/gtk-doc/html/%{name}-0.7

%if %{build_compat32}
%files -n compat32-%{name}
%defattr(-,root,root,-)
%{_libdir}/*.so.*
%endif

%changelog
* Sat Jan 06 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.8.1-1
- new upstream release.

* Sat Feb 13 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.7.93-2
- create compat32-rest subpakcage

* Sat Mar 28 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.7.93-1
- new upstream release

* Sun Oct 26 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.7.92-1
- new upstream release

* Sat Mar 29 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.7.91-1
- new upstream release

* Sat Jan 04 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.7.90-2
- rebuild with VineSeed environment

* Sat Sep 29 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.7.90-1
- new upstream release
- change BuildRequires: ca-certificates instead of openssl-devel

* Sun Apr 08 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.7.12-2
- fix URL

* Wed Nov 16 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.7.12-1
- new upstream release
- add BuildRequires: openssl

* Thu Nov 03 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.7.11-1
- new upstream release

* Mon Aug 15 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.7.10-1
- initial build for Vine Linux