Blob Blame History Raw
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

Name:           libkml
Version:        0.6.1
Release:        4%{?dist}
Summary:        A KML library written in C++ with bindings to other languagues

Group:          Development/Libraries
License:        BSD
URL:  {name}/
Source0:        http://%{name}{name}-%{version}.tar.gz
Patch0:         libkml-third_party_removal.diff
Patch1:         libkml-0.6.1.configure_ac.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

# requires swig >= 1.3.35
BuildRequires:  cppunit, swig >= 1.3.35
BuildRequires:  java-devel, libcurl-devel
BuildRequires:  expat-devel, python-devel, chrpath
BuildRequires:  minizip-devel, uriparser-devel, zlib-devel
BuildRequires:  boost-devel
BuildRequires:  autoconf, libtool
BuildRequires:  libgcj-devel
Requires:       python, java

Libkml is an implementation of the OGC KML 2.2 standard. is written in
C++ and bindings are available via SWIG to other languages. It can be
used in applications that want to parse, generate and operate on KML.

%package        devel
Summary:        Development files for %{name}
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}

%description    devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

%setup -q
rm -rf third_party
%patch0 -p0 -b .third_party
%patch1 -p1 -b .configure_ac

autoreconf -fi
%configure --disable-static \
make %{?_smp_mflags}


find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'

# remove compiled examples
cd examples; make clean;cd ..

# remove x permssion from examples folder files
find examples -type f -print | xargs chmod a-x

# move libs to kml (for keeping third party libs away)
mkdir -p $RPM_BUILD_ROOT%{_libdir}/libkml/
mv $RPM_BUILD_ROOT%{_libdir}/*.so* $RPM_BUILD_ROOT%{_libdir}/libkml/

#removing rpaths with chrpath
chrpath --delete $RPM_BUILD_ROOT%{_libdir}/libkml/
chrpath --delete $RPM_BUILD_ROOT%{_libdir}/libkml/
chrpath --delete $RPM_BUILD_ROOT%{_libdir}/libkml/
chrpath --delete $RPM_BUILD_ROOT%{_libdir}/libkml/
chrpath --delete $RPM_BUILD_ROOT%{_libdir}/libkml/
chrpath --delete $RPM_BUILD_ROOT%{python_sitearch}/
chrpath --delete $RPM_BUILD_ROOT%{python_sitearch}/
chrpath --delete $RPM_BUILD_ROOT%{python_sitearch}/

# remove .libs and .deps directories
find . -name '.libs'  -type d -print | xargs rm -rf
find . -name '.deps'  -type d -print | xargs rm -rf

# fix unstripping-binary-or-object warning
chmod a+x $RPM_BUILD_ROOT%{python_sitearch}/
chmod a+x $RPM_BUILD_ROOT%{python_sitearch}/


%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%doc ChangeLog
%dir %{_libdir}/libkml

%files devel
%doc examples
%dir %{_libdir}/libkml

* Sun Apr 12 2009 Rakesh Pandit <> 0.6.1-4
- Included *pyc and pyo files in %%files and added BuildRequires libgcj-devel.

* Sun Apr 12 2009 Rakesh Pandit <> 0.6.1-3
- libkml-0.6.1.configure_ac.patch patch for swig > 1.3.35

* Sat Mar 07 2009 Rakesh Pandit <> 0.6.1-2
- updated to 0.6.1
- libkml-third_party_removal.diff Removes third part dependency
- (provided by Peter Lemenkov)

* Fri Jan 16 2009 Rakesh Pandit <> 0.6.1-1
- Updated to 0.6.1

* Mon Oct 05 2008 Rakesh Pandit <> 0.4.0-2
- Added >= 1.3.35 for swing

* Sat Aug 09 2008 Rakesh Pandit <> 0.4.0-1
- Initial package