534d585
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
534d585
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
534d585
534d585
Name:           libkml
534d585
Version:        0.6.1
062fadd
Release:        8%{?dist}
534d585
Summary:        A KML library written in C++ with bindings to other languagues
534d585
534d585
Group:          Development/Libraries
534d585
License:        BSD
534d585
URL:            http://code.google.com/p/%{name}/
534d585
Source0:        http://%{name}.googlecode.com/files/%{name}-%{version}.tar.gz
2e2ec7c
Patch0:         libkml-third_party_removal.diff
2e2ec7c
Patch1:         libkml-0.6.1.configure_ac.patch
b8e12a3
Patch2:         libkml-fix-gcc-warning.patch
534d585
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
534d585
534d585
# requires swig >= 1.3.35
534d585
BuildRequires:  cppunit, swig >= 1.3.35
534d585
BuildRequires:  java-devel, libcurl-devel
534d585
BuildRequires:  expat-devel, python-devel, chrpath
534d585
BuildRequires:  minizip-devel, uriparser-devel, zlib-devel
534d585
BuildRequires:  boost-devel
534d585
BuildRequires:  autoconf, libtool
93db3f0
BuildRequires:  libgcj-devel
534d585
Requires:       python, java
534d585
534d585
%description
534d585
Libkml is an implementation of the OGC KML 2.2 standard. is written in
534d585
C++ and bindings are available via SWIG to other languages. It can be
534d585
used in applications that want to parse, generate and operate on KML.
534d585
534d585
%package        devel
534d585
Summary:        Development files for %{name}
534d585
Group:          Development/Libraries
534d585
Requires:       %{name} = %{version}-%{release}
534d585
534d585
%description    devel
534d585
The %{name}-devel package contains libraries and header files for
534d585
developing applications that use %{name}.
534d585
534d585
%prep
534d585
%setup -q
534d585
rm -rf third_party
2e2ec7c
%patch0 -p0 -b .third_party
2e2ec7c
%patch1 -p1 -b .configure_ac
b8e12a3
%patch2 -p1 -b .fixwarning
534d585
534d585
%build
534d585
autoreconf -fi
534d585
%configure --disable-static \
534d585
           --with-java-include-dir=%{_jvmdir}/java
534d585
make %{?_smp_mflags}
534d585
534d585
%install
534d585
rm -rf $RPM_BUILD_ROOT
534d585
534d585
make install DESTDIR=$RPM_BUILD_ROOT
534d585
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
534d585
534d585
# remove compiled examples
534d585
cd examples; make clean;cd ..
534d585
534d585
# remove x permssion from examples folder files
534d585
find examples -type f -print | xargs chmod a-x
534d585
534d585
# move libs to kml (for keeping third party libs away)
534d585
mkdir -p $RPM_BUILD_ROOT%{_libdir}/libkml/
534d585
mv $RPM_BUILD_ROOT%{_libdir}/*.so* $RPM_BUILD_ROOT%{_libdir}/libkml/
534d585
534d585
#removing rpaths with chrpath
534d585
chrpath --delete $RPM_BUILD_ROOT%{_libdir}/libkml/libkmldom_swig_java.so.0.0.0
534d585
chrpath --delete $RPM_BUILD_ROOT%{_libdir}/libkml/libkmlengine_swig_python.so.0.0.0
534d585
chrpath --delete $RPM_BUILD_ROOT%{_libdir}/libkml/libkmlengine.so.0.0.0
534d585
chrpath --delete $RPM_BUILD_ROOT%{_libdir}/libkml/libkmldom_swig_python.so.0.0.0
534d585
chrpath --delete $RPM_BUILD_ROOT%{_libdir}/libkml/libkmlengine_swig_java.so.0.0.0
534d585
chrpath --delete $RPM_BUILD_ROOT%{python_sitearch}/_kmlengine.so
534d585
chrpath --delete $RPM_BUILD_ROOT%{python_sitearch}/_kmldom.so
534d585
chrpath --delete $RPM_BUILD_ROOT%{python_sitearch}/_kmlbase.so
534d585
534d585
# remove .libs and .deps directories
534d585
find . -name '.libs'  -type d -print | xargs rm -rf
534d585
find . -name '.deps'  -type d -print | xargs rm -rf
534d585
534d585
# fix unstripping-binary-or-object warning
534d585
chmod a+x $RPM_BUILD_ROOT%{python_sitearch}/_kmlengine.so
534d585
chmod a+x $RPM_BUILD_ROOT%{python_sitearch}/_kmldom.so
534d585
534d585
%clean
534d585
rm -rf $RPM_BUILD_ROOT
534d585
534d585
%post -p /sbin/ldconfig
534d585
534d585
%postun -p /sbin/ldconfig
534d585
534d585
%files
534d585
%defattr(-,root,root,-)
534d585
%doc COPYING
534d585
%doc AUTHORS
534d585
%doc README
534d585
%doc ChangeLog
534d585
%dir %{_libdir}/libkml
534d585
%{_libdir}/libkml/*.so.*
534d585
%{python_sitearch}/*.so
534d585
%{python_sitearch}/*.py
93db3f0
%{python_sitearch}/*.pyc
93db3f0
%{python_sitearch}/*.pyo
534d585
534d585
%files devel
534d585
%defattr(-,root,root,-)
534d585
%doc examples
534d585
%{_includedir}/*
534d585
%dir %{_libdir}/libkml
534d585
%{_libdir}/libkml/*.so
534d585
534d585
%changelog
062fadd
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-8
062fadd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
062fadd
b8e12a3
* Mon Aug 02 2010 Orcan Ogetbil <oget[dot]fedora[at]gmail[dot]com> - 0.6.1-7
b8e12a3
- Fix gcc warning that lead to failure due to -Werror flag
b8e12a3
f88dd63
* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 0.6.1-6
f88dd63
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
f88dd63
a1263f8
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-5
a1263f8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
a1263f8
93db3f0
* Sun Apr 12 2009 Rakesh Pandit <rakesh@fedoraproject.org> 0.6.1-4
93db3f0
- Included *pyc and pyo files in %%files and added BuildRequires libgcj-devel.
93db3f0
2e2ec7c
* Sun Apr 12 2009 Rakesh Pandit <rakesh@fedoraproject.org> 0.6.1-3
2e2ec7c
- libkml-0.6.1.configure_ac.patch patch for swig > 1.3.35
2e2ec7c
534d585
* Sat Mar 07 2009 Rakesh Pandit <rakesh@fedoraproject.org> 0.6.1-2
534d585
- updated to 0.6.1
534d585
- libkml-third_party_removal.diff Removes third part dependency
534d585
- (provided by Peter Lemenkov)
534d585
534d585
* Fri Jan 16 2009 Rakesh Pandit <rakesh@fedoraproject.org> 0.6.1-1
534d585
- Updated to 0.6.1
534d585
534d585
* Mon Oct 05 2008 Rakesh Pandit <rakesh@fedoraproject.org> 0.4.0-2
534d585
- Added >= 1.3.35 for swing
534d585
534d585
* Sat Aug 09 2008 Rakesh Pandit <rakesh@fedoraproject.org> 0.4.0-1
534d585
- Initial package