Summary:        NFSv4 ID Mapping Library
Summary(ja):	NFSv4 ID マッピングライブラリ
Name:           libnfsidmap
Version:        0.26
Release:        1%{?_dist_release}

License:        BSD
Group:          System Environment/Libraries
URL:            http://nfs.sourceforge.net

Source0:        https://fedorapeople.org/~steved/%{name}/%{version}/%{name}-%{version}.tar.bz2
Patch10:        idmap.conf.patch

BuildRoot:      %{_tmppath}/%{name}-%{version}-root
BuildRequires:  pkgconfig
BuildRequires:  openldap-devel
BuildRequires:  tcp_wrappers

%description
In NFSv4, identities of users are conveyed by names rather than user ID
and group ID. Both the NFS server and client code in the kernel need to
translate these to numeric IDs.

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

%description devel
This package includes header files and libraries necessary for
developing programs which use the libnfsidmap library.


%prep
%setup -q
%patch10 -p1

%build
%configure --disable-static --with-pluginpath=%{_libdir}/%{name}
make %{?_smp_mflags} all

%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT

mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}
install -m 644 idmapd.conf $RPM_BUILD_ROOT%{_sysconfdir}/idmapd.conf

# Delete unneeded files
rm -rf $RPM_BUILD_ROOT%{_libdir}/*.{a,la}
rm -rf $RPM_BUILD_ROOT%{_libdir}/%{name}/*.{a,la}

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-, root, root)
%doc AUTHORS ChangeLog NEWS README COPYING
%config(noreplace) /etc/idmapd.conf
%{_libdir}/lib*.so.*
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/*.so
%{_mandir}/*/*

%files devel
%defattr(0644,root,root,755)
%{_includedir}/nfsidmap.h
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/libnfsidmap.pc


%changelog
* Wed Feb 18 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 0.26-1
- updated to 0.26
- split develop files into devel subpackage

* Sat Oct 20 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.25-1
- new upstream release 
- remove static libs

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

* Fri Jun 12 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 0.21-1
- new upstream release

* Sat Apr 04 2009 NAKAMURA Kenta <kenta@vinelinux.org> 0.20-3
- rebuilt with openldap-2.4.11

* Tue Mar 31 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 0.20-2
- spec in utf-8

* Thu May 15 2008 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 0.20-1
- new versioning policy
- add Patch10 and fix spec to install default idmapd.conf file
- remove *.la

* Wed Sep 12 2007 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.20-0vl1
- updated to 0.20

* Sun Aug 27 2006 NAKAMURA Kenta <kenta@vinelinux.org> 0.16-0vl3
- rebuilt with openldap-2.3.27-0vl1

* Sun Jul 02 2006 Satoshi MACHINO <machino@vinelinux.org> 0.16-0vl2
- rebuilt with openldap-2.3.24-0vl1

* Sun May 28 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.16-0vl1
- updated to 0.16
- added pkgconfig files
- changed Group to System Environment/Libraries

* Tue Mar 21 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 0.12-0vl1
- initial build for Vine Linux