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

Name: neon
Summary: An HTTP and WebDAV client library.
Summary(ja): HTTP と WebDAV クライアントのライブラリ
Version: 0.29.3
Release: 2%{?_dist_release}
License: LGPLv2+
Group: System Environment/Libraries
URL: http://www.webdav.org/neon/
Source0: http://www.webdav.org/neon/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Requires: expat
Requires: zlib >= 1.1.4
Requires: krb5-libs
BuildRequires: expat-devel
BuildRequires: gnutls-devel
BuildRequires: krb5-devel
BuildRequires: libxml2-devel
#BuildRequires: openssl-devel
BuildRequires: sed
BuildRequires: zlib-devel
BuildRequires: keyutils-libs-devel

%description
neon is an HTTP and WebDAV client library, with a C interface;
providing a high-level interface to HTTP and WebDAV methods along
with a low-level interface for HTTP request handling.  neon
supports persistent connections, proxy servers, basic, digest and
Kerberos authentication, and has complete SSL support.

%package devel
Summary: Development libraries and C header files for the neon library
Summary(ja): neon の開発用ライブラリおよび C言語ヘッダファイル
Group: Development/Libraries
Requires: %{name} = %{version}
Requires: zlib-devel
#Requires: openssl-devel
Requires: expat-devel
Requires: gnutls-devel
Requires: krb5-devel
Requires: keyutils-libs-devel

%description devel
The development library for the C language HTTP and WebDAV client library.

%description devel -l ja
C言語による HTTP と WebDAV クライアントのライブラリの開発用パッケージ

## to build compat32 for x86_64 architecture support
%package -n compat32-%{name}
Summary: C language HTTP and WebDAV client library.
Group: System Environment/Libraries
Requires: expat
Requires: zlib >= 1.1.4

%description -n compat32-%{name}
A C language HTTP and WebDAV client library.

%package -n compat32-%{name}-devel
Summary: A C language HTTP and WebDAV client library.
Group: Development/Libraries
Requires: compat32-%{name} = %{version}
Requires: compat32-zlib-devel
#Requires: compat32-openssl-devel
Requires: compat32-expat-devel
Requires: compat32-keyutils-libs-devel
Requires: compat32-krb5-devel

%description -n compat32-%{name}-devel
The development library for the C language HTTP and WebDAV client library.

%prep
%setup -q

%build
%configure \
	--with-expat \
	--with-ssl=gnutls \
        --enable-threadsafe-ssl=posix \
	--enable-shared \
	--disable-static \
	--with-force-ssl
%__make %{?_smp_mflags} 

%install
%__rm -rf %{buildroot}
%makeinstall

sed -ri "/^dependency_libs/{s,-l[^ ']*,,g}" \
      $RPM_BUILD_ROOT%{_libdir}/libneon.la

%find_lang %{name}

## remove unuse files
rm -rf $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 -f %{name}.lang
%defattr(-,root,root)
%doc AUTHORS BUGS ChangeLog INSTALL.win32 NEWS README THANKS TODO
%doc doc/html
%{_libdir}/*.so.*

%files devel
%defattr(-,root,root)
%{_bindir}/*
%{_includedir}/*
%{_mandir}/man1/*
%{_mandir}/man3/*
#{_libdir}/*.a
#{_libdir}/*.la
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc

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

%files -n compat32-%{name}-devel
%defattr(-,root,root)
#{_libdir}/*.a
#{_libdir}/*.la
%{_libdir}/pkgconfig/*.pc
%endif

%changelog
* Mon May 09 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.29.3-2
- add BuildRequires: keyutils-libs-devel
- add Requires: krb5-devel, keyutils-libs-devel (-devel package)

* Sun Apr 24 2011 IWAI, Masaharu <iwai@alib.jp> 0.29.3-1
- new upstream release

* Thu Mar 24 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.28.6-3
- rebuilt with krb5-libs-1.8.2
- removed BR: openssl-devel
- removed static library from devel package

* Sun Oct 03 2010 Shu KONNO <owa@bg.wakwak.com> 0.28.6-2
- rebuilt with rpm-4.8.1 for pkg-config

* Tue Aug 25 2009 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 0.28.6-1
- new upstream release with security fix (CVE-2009-2473, 2474)

* Sat Jan 17 2009 Toshiharu Kudoh <toshi.kd2@gmail.com> 0.28.3-3vl5
- rebuild with gnutls-2.6.3

* Sun Oct 19 2008 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 0.28.3-2vl5
- add Requires/BuildRequires krb5-libs/krb5-devel tags
- add _smp_mflags into make section

* Fri Oct 17 2008 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 0.28.3-1vl5
- new upstream release with security fix (CVE-2008-3746)

* Fri Sep 26 2008 Shu KONNO <owa@bg.wakwak.com> 0.28.2-3vl5
- removed *.la
- spec in utf-8

* Sat Apr 19 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.28.2-2vl5
- added --with-ssl=gnutls --enable-threadsafe-ssl
- added BuildRequires: gnutls-devel

* Fri Apr 18 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.28.2-1vl5
- new upstream release

* Mon Feb 25 2008 NAKAMURA Kenta <kenta@vinelinux.org> 0.26.3-0vl3
- removed %%if !%%{build_compat32} case condition

* Wed Feb 20 2008 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 0.26.3-0vl2
- rebuild with expat-2.0.1

* Wed May 16 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 0.26.3-0vl1
- new upstream release

* Mon Mar 12 2007 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 0.25.5-0vl3
- add Requires: zlib-devel, openssl-devel, expat-devel

* Mon May 15 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 0.25.5-0vl2
- move %%configure from %%prep to %%build
- remove unneeded locales.patch (for neon-0.26.x or later)

* Wed Apr 05 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 0.25.5-0vl1
- new upstream release
- drop doc.patch (patch0)
- use more macros
- drop BuildRequires: autoconf, automake
- add *.pc to -devel (and compat32's) package
- change group
- add Requires: %%{name} = %%{version} to -devel (and compat32's) package
- add doc/html instead of doc/* to %%doc
- move %%{_mandir}/man1/* and %%{_bindir}/* to -devel package
- run ldconfig in %%post,postun
- add locales.patch (patch0)

* Mon Feb 06 2006 Shu KONNO <owa@bg.wakwak.com> 0.24.7-0vl3
- moved macros (_lib, gcc -m32) to /usr/lib/rpm/rpmrc or macros files

* Fri Feb 03 2006 Shu KONNO <owa@bg.wakwak.com> 0.24.7-0vl2
- added compat32- packages for x86_64 architecture support
- added --libdir=%{_libdir} option to configure

* Sun Sep  5 2004 USAMI Kosuke <usami-k@yc5.so-net.ne.jp> - 0.24.7-0vl1
- new upstream release

* Sun Nov 23 2003 IWAI, Masaharu <iwai@alib.jp> 0.24.4-0vl1
- upstream release
- update URL and Source0 tag: valid URL

* Fri Sep 19 2003 IWAI, Masaharu <iwai@alib.jp> 0.24.2-0vl1
- upstream release
- add BuildRequires: openssl-devel, libxml2-devel, zlib-devel
- add Japanese Summary and %%description

* Sun Mar 30 2003 Kazuhisa TAKEI <takei@vinelinux.org> 0.23.5-1vl1
- build VineLinux 

* Mon Nov 04 2002 David Summers <david@summersoft.fay.ar.us> 0.23.5-1
- Updated to 0.23.5.

* Tue Aug 27 2002 David Summers <david@summersoft.fay.ar.us> 0.23.2-1
- Upgraded to 0.23.2.

* Fri Aug 16 2002 David Summers <david@summersoft.fay.ar.us> 0.22.0-1
- Upgraded to 0.22.0.
- Fixed compilation from CVS.
- Took out man pages until I can figure out xmlto program.

* Sat Aug 03 2002 David Summers <david@summersoft.fay.ar.us> 0.21.3-3
- Fixed compilation on RedHat 7.2 by upgrading libtool and auto* packages
  to RedHat 7.3 versions and fixing bug in spec file.
- Gave up on CVS version of neon until we can figure out why autogen.sh doesn't
  work.

* Wed Jul 24 2002 David Summers <david@summersoft.fay.ar.us> 0.21.3-2
- Fixed file ownership problems.  Made them owned by root.

* Fri Jul 19 2002 David Summers <david@summersoft.fay.ar.us> 0.21.3-1
- Updated to neon 0.21.3.

* Tue Jun 16 2002 David Summers <david@summersoft.fay.ar.us> 0.21.2-1
- Updated to neon 0.21.2.

* Mon Jun 03 2002 David Summers <david@summersoft.fay.ar.us> 0.21.1-1
- Updated to neon 0.21.1.
- Now requires zlib >= 1.1.4.
- Broke into zlib and zlib-devel.
- Now builds shared library.

* Sat Apr 27 2002 David Summers <david@summersoft.fay.ar.us> 0.19.4-1
- Updated to neon 0.19.4.

* Fri Feb 22 2002 David Summers <david@summersoft.fay.ar.us> 0.19.2-1
- Updated to neon 0.19.2.

* Thu Dec 20 2001 David Summers <david@summersoft.fay.ar.us> 0.18.2-1
- Updated to neon 0.18.2.

* Wed Oct 31 2001 David Summers <david@summersoft.fay.ar.us> 0.17.2-2
- Took out dependency on libxml and w3c-libwww packages.
- Added dependency on expat.

* Sat Oct 27 2001 David Summers <david@summersoft.fay.ar.us> 0.17.2-1
- Release 0.17.2-1: Updated neon.

* Thu Oct 24 2001 David Summers <david@summersoft.fay.ar.us>
- Release 2: Fixed prefix to be /usr instead of /usr/local.

* Sat Oct 20 2001 David Summers <david@summersoft.fay.ar.us>
- Release 2001-10-20: Initial Version.