Name:           libpagemap
Version:        0.0.1 
Release:        1%{?_dist_release}
Summary:        Pagemap interface library
Summary(ja):    Pagemap インターフェイスライブラリ

Group:          System Environment/Libraries
License:        GPLv3+
URL:            https://fedorahosted.org/libpagemap/ 
Source0:        https://fedorahosted.org/released/libpagemap/%{name}-%{version}.tar.gz 
BuildRoot:      %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n)
BuildRequires:  python-devel


%description
Package contains library and headers for using kernel pagemap interface

%description -l ja
Linux カーネルの pagemap インターフェイスを利用するための
python インターフェイスが収録されたパッケージです。


%package        devel
Summary:        Development files for %{name}
Summary(ja):    %{name} 用開発ライブラリとヘッダファイル
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}


%description    devel
Development files for %{name}.

%description    devel -l ja
%{name} 用の開発ライブラリとヘッダファイル


%prep
%setup -q


%build
make CFLAGS="%{optflags} -std=c99" %{?_smp_mflags}


%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot} LIB64=%{_lib}
install -D -p -m 755 pagemapdata.py %{buildroot}/%{python_sitelib}/pagemapdata.py


%clean
rm -rf %{buildroot}


%post -p /sbin/ldconfig


%postun -p /sbin/ldconfig


%files
%defattr(-,root,root,-)
%{_bindir}/pgmap
%{_libdir}/libpagemap.so.*
%{python_sitelib}/pagemapdata.py*
%attr(0644,root,root) %{_mandir}/man1/pgmap.1*
%doc contrib/
%doc README
%doc COPYING


%files devel
%defattr(-, root, root,-) 
%{_includedir}/libpagemap.h
%{_libdir}/libpagemap.so


%changelog
* Tue Feb 28 2012 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 0.0.1-1
- initial build for Vine Linux

* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.1-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Tue Aug 09 2011 Petr Holasek <pholasek at redhat.com> - 0.0.1-9
- kernel version detecting was fixed for kernels 3.x

* Tue Apr 12 2011 Petr Holasek <pholasek at redhat.com> - 0.0.1-8
- python-devel was added to BuildRequires because of wrong expansion
  of %{python_sitelib} macro

* Wed Mar 30 2011 Petr Holasek <pholasek at redhat.com> - 0.0.1-7
- some compilator warnings were fixed

* Thu Mar 24 2011 Petr Holasek <pholasek at redhat.com> - 0.0.1-6
- pagemapvisual and pgmap utilities are able to print outputs in CSV 

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Fri Jan 28 2011 Petr Holasek <pholasek at redhat.com> 0.0.1-4
- added pagemapvisual script for plotting of memory metrics to contrib/
- basic parts of library were rewritten to python as pagemapdata.py module
- fixed memory leak in pgmap

* Fri Nov 26 2010 Petr Holasek <pholasek at redhat.com> 0.0.1-3
- fixed Makefile kernel's version detecting, it did problems in koji

* Mon Nov 22 2010 Petr Holasek <pholasek at redhat.com> 0.0.1-2
- development library libpagemap.so included in devel files
- %%doc attribute dropped from man page file entry
- wrong characters in man page corrected
- fixed access permissions for libpagemap.h file
- install argument -p added

* Fri Nov 19 2010 Petr Holasek <pholasek at redhat.com> 0.0.1-1
- Initial package 
