Name:           pugixml
Version:        1.4
Release:        1%{?_dist_release}
Summary:        A light-weight C++ XML processing library
Group:          Development/Libraries
License:        MIT
URL:            http://pugixml.org

Source0:        http://github.com/zeux/pugixml/releases/download/v%{version}/pugixml-%{version}.tar.gz
# Add pugixml-config.cmake
# https://github.com/zeux/pugixml/pull/7
Patch0:         pugixml-export.patch

BuildRequires:  cmake

%description
pugixml is a light-weight C++ XML processing library.
It features:
- DOM-like interface with rich traversal/modification capabilities
- Extremely fast non-validating XML parser which constructs the DOM tree from
  an XML file/buffer
- XPath 1.0 implementation for complex data-driven tree queries
- Full Unicode support with Unicode interface variants and automatic encoding
  conversions


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

%description devel
Development files for package %{name}


%package docs
Summary:        Documentation for %{name}
Group:          Documentation
BuildArch:		noarch

%description docs
Documentation for package %{name}


%prep
%setup -q
%patch0 -p1 -b .export


%build
mkdir -p ./build && pushd build
%cmake -DCMAKE_INSTALL_LIBDIR=%{_lib} ../scripts
make


%install
make -C build install DESTDIR=%{buildroot}
mkdir -p %{buildroot}%{_datadir}/%{name}/contrib
install -p -m 0644 contrib/* %{buildroot}%{_datadir}/%{name}/contrib/


%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files
%doc readme.txt
%{_libdir}/*.so.*

%files devel
%{_libdir}/*.so
%{_libdir}/cmake/%{name}/
%{_datadir}/%{name}
%{_includedir}/*.hpp

%files docs
%doc docs/*


%changelog
* Sun Jan 18 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 1.4-1
- initial build for Vine Linux


* Wed Sep 03 2014 Orion Poplawski <orion@cora.nwra.com> - 1.4-1
- Update to 1.4
- Split documentation out into -doc sub-package
- Add cmake export information

* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Thu Jan 05 2012 Richard Shaw <hobbes1069@gmail.com> - 1.0-2
- Rebuild for GCC 4.7.0.

* Fri Jul 08 2011 Richard Shaw <hobbes1069@gmail.com> - 1.0-1
- Initial Release
