File mingw-liboauth.spec of Package mingw-liboauth

%{?mingw_package_header}
%define _pkg_name liboauth

Name:		mingw-%{_pkg_name}
Version:	1.0.0
Release:	1%{?dist}
Summary:	MinGW build of OAuth library functions

BuildArch:	noarch

License:	MIT
URL:		http://liboauth.sourceforge.net/
Source0:	liboauth-%{version}.tar.gz

Patch0:		liboauth-1.0.0-noundefined.patch

BuildRequires:	mingw32-filesystem >= 95
BuildRequires:	mingw64-filesystem >= 95
BuildRequires:	mingw32-gcc mingw64-gcc
BuildRequires:	mingw32-binutils mingw64-binutils
BuildRequires:	mingw32-gcc-c++ mingw64-gcc-c++
BuildRequires:	mingw32-pkg-config mingw64-pkg-config
BuildRequires:	mingw32-curl mingw64-curl
#BuildRequires: mingw32-nss mingw64-nss
BuildRequires:	mingw32-openssl mingw64-openssl
BuildRequires:	autoconf automake libtool

%description
liboauth is a collection of POSIX-c functions implementing the OAuth
Core RFC 5849 standard. liboauth provides functions to escape and
encode parameters according to OAuth specification and offers
high-level functionality to sign requests or verify OAuth signatures
as well as perform HTTP requests.


%package -n mingw32-%{_pkg_name}
Summary:	%{summary}

%description -n mingw32-%{_pkg_name}
liboauth is a collection of POSIX-c functions implementing the OAuth
Core RFC 5849 standard. liboauth provides functions to escape and
encode parameters according to OAuth specification and offers
high-level functionality to sign requests or verify OAuth signatures
as well as perform HTTP requests.

%package -n mingw32-%{_pkg_name}-static
Summary:	%{summary}
Requires:	mingw32-%{_pkg_name} = %{version}

%description -n mingw32-%{_pkg_name}-static
liboauth is a collection of POSIX-c functions implementing the OAuth
Core RFC 5849 standard. liboauth provides functions to escape and
encode parameters according to OAuth specification and offers
high-level functionality to sign requests or verify OAuth signatures
as well as perform HTTP requests.

%package -n mingw64-%{_pkg_name}
Summary:	%{summary}

%description -n mingw64-%{_pkg_name}
liboauth is a collection of POSIX-c functions implementing the OAuth
Core RFC 5849 standard. liboauth provides functions to escape and
encode parameters according to OAuth specification and offers
high-level functionality to sign requests or verify OAuth signatures
as well as perform HTTP requests.

%package -n mingw64-%{_pkg_name}-static
Summary:	%{summary}
Requires:	mingw64-%{_pkg_name} = %{version}

%description -n mingw64-%{_pkg_name}-static
liboauth is a collection of POSIX-c functions implementing the OAuth
Core RFC 5849 standard. liboauth provides functions to escape and
encode parameters according to OAuth specification and offers
high-level functionality to sign requests or verify OAuth signatures
as well as perform HTTP requests.

%{?mingw_debug_package}

%prep
%setup -q -n %{_pkg_name}-%{version}

%patch0 -p1 -b .noundefined

%build
libtoolize --force --copy --install
autoreconf -f -i
%mingw_configure \
	--enable-shared \
	--enable-libcurl \
	--disable-curl \
	--disable-nss

%mingw_make %{?_smp_flags}

%install
%mingw_make install DESTDIR=%{buildroot}

find %{buildroot} -name '*.la' -delete

rm -rf %{buildroot}%{mingw32_mandir}
rm -rf %{buildroot}%{mingw64_mandir}

%files -n mingw32-%{_pkg_name}
%doc ChangeLog COPYING COPYING.GPL COPYING.MIT LICENSE.OpenSSL README
%{mingw32_bindir}/liboauth-0.dll
%{mingw32_includedir}/oauth.h
%{mingw32_libdir}/pkgconfig/oauth.pc
%{mingw32_libdir}/liboauth.dll.a

%files -n mingw32-%{_pkg_name}-static
%{mingw32_libdir}/liboauth.a

%files -n mingw64-%{_pkg_name}
%doc ChangeLog COPYING COPYING.GPL COPYING.MIT LICENSE.OpenSSL README
%{mingw64_bindir}/liboauth-0.dll
%{mingw64_includedir}/oauth.h
%{mingw64_libdir}/pkgconfig/oauth.pc
%{mingw64_libdir}/liboauth.dll.a

%files -n mingw64-%{_pkg_name}-static
%{mingw64_libdir}/liboauth.a

%changelog
* Tue Dec 11 2012 Greg Hellings <greg.hellings@gmail.com> - 1.0.0-1
- Initial build