File eldap.spec of Package eldap

%define cvsdate 20061124
%define bname eldap
Name: %bname
Version: 1.5
%define Release 5
Release: 5
Summary: Erlang LDAP library
License: GPLv2+
Group: Development/Libraries/Other
URL: http://jungerl.sourceforge.net
%ifdef cvsdate
#cvs -z3 -d:pserver:anonymous@jungerl.cvs.sourceforge.net:/cvsroot/jungerl co jungerl/lib/eldap
Source: %bname-cvs-%cvsdate.tar.xz
%else
Source: %bname-%version.tar.xz
%endif
Patch: %bname-%version-cx.patch
BuildArch: noarch
%if "%name" == "%bname"
%define pname erlang-%bname
%else
%define pname %bname
%endif
Provides: %pname = %version-%release
Requires: erlang-otp
Buildroot: %buildroot

BuildRequires: xz tar >= 1.23
%define __find_provides %erlang_provides
%define __find_requires %erlang_requires
BuildRequires: rpm-build-erlang
BuildRequires: erlang symlinks

%description
This is '%bname', the Erlang LDAP library.
It exports an API that can do all possible operations you may want to do
against an LDAP server.


%package doc
Summary: Documentation for Erlang LDAP library
Group: Documentation/Other
Provides: %pname-doc = %version-%release

%description doc
This is '%bname', the Erlang LDAP library.
It exports an API that can do all possible operations you may want to do
against an LDAP server.
This package contains documentation for %bname.


%package devel
Summary: Files for development with Erlang LDAP library
Group: Development/Languages/Other
Provides: %pname-devel = %version-%release
Requires: %name = %version-%release

%description devel
This is '%bname', the Erlang LDAP library.
It exports an API that can do all possible operations you may want to do
against an LDAP server.
This package contains files for development with %bname.


%prep
%setup -q -n %bname
%patch -p1


%build
%if_enabled debug
%define eoptflags +debug_info
%else
%define eoptflags +slim +compressed
%endif
%make_build ERLC_FLAGS="%{?eoptflags:%eoptflags}"


%install
install -d %buildroot{%_otplibdir/%bname-%version/{doc,ebin,include},%_docdir}
install -m 0644 ebin/* %buildroot%_otplibdir/%bname-%version/ebin/
install -m 0644 README doc/* %buildroot%_otplibdir/%bname-%version/doc/
install -m 0644 include/* %buildroot%_otplibdir/%bname-%version/include/
ln -sf %buildroot{%_otplibdir/%bname-%version/doc,%_docdir/%name-%version}

symlinks -csd %buildroot%_docdir


%files
%defattr(-,root,root)
%dir %_otplibdir/%bname-%version
%_otplibdir/%bname-%version/ebin


%files doc
%defattr(-,root,root)
%doc %dir %_otplibdir/%bname-%version
%doc %_otplibdir/%bname-%version/doc
%doc %_docdir/%name-%version


%files devel
%defattr(-,root,root)
%_otplibdir/%bname-%version/include


%changelog
* Sat Mar 03 2012 Led <led@massivesolutions.co.uk> 1.5-5
- spec:
  + added Buildroot
  + updated BuildRequires

* Sat Feb 11 2012 Led <led@massivesolutions.co.uk> 1.5-4
- used %%erlang_requires

* Sat Feb 11 2012 Led <led@massivesolutions.co.uk> 1.5-3
- used %%erlang_provides

* Wed Feb 08 2012 Led <led@massivesolutions.co.uk> 1.5-2
- rename package from erlang-%%bname to %%bname

* Wed Feb 08 2012 Led <led@massivesolutions.co.uk> 1.5-1
- fixed parallel build

* Mon Feb 06 2012 Led <led@massivesolutions.co.uk> 1.5-0
- initial build for openSUSE