mozldap/mozldap.spec

167 lines
4.9 KiB
RPMSpec

%define major %(echo %version | cut -d. -f -1)
%define minor %(echo %version | cut -d. -f 2-2)
%define submin %(echo %version | cut -d. -f 3-)
%define libsuffix %{major}0
Name: mozldap
Version: 6.0.6
Release: 2mamba
Summary: Mozilla LDAP C SDK
Group: System/Libraries
Vendor: openmamba
Distribution: openmamba
Packager: Automatic Build System <autodist@mambasoft.it>
URL: https://wiki.mozilla.org/LDAP_C_SDK
Source0: ftp://ftp.mozilla.org/pub/mozilla.org/directory/c-sdk/releases/v%{version}/src/mozldap-%{version}.tar.gz
Source1: fix_headers.sh
License: GPL,MPL 1.1,LGPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libgcc
BuildRequires: libnspr-devel
BuildRequires: libnss-devel
BuildRequires: libsasl2-devel
BuildRequires: libstdc++6-devel
BuildRequires: libsvrcore-devel
## AUTOBUILDREQ-END
%description
The Mozilla LDAP C SDK is a set of libraries that allow applications to communicate with LDAP directory servers. These libraries are derived from the University of Michigan and Netscape LDAP libraries. They use Mozilla NSPR and NSS for crypto.
%package devel
Group: Development/Libraries
Summary: Development libraries and examples for Mozilla LDAP C SDK
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
%description devel
The Mozilla LDAP C SDK is a set of libraries that allow applications to communicate with LDAP directory servers.
This package contains static libraries and header files need for development.
%package tools
Group: Development/Tools
Summary: Tools for the Mozilla LDAP C SDK
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
%description tools
The Mozilla LDAP C SDK is a set of libraries that allow applications to communicate with LDAP directory servers.
This package provides the ldapsearch, ldapmodify, and ldapdelete tools that use the Mozilla LDAP C SDK libraries.
%prep
%setup -q
%build
cd mozilla/directory/c-sdk
%configure \
--with-sasl \
--enable-clu \
--with-system-nss \
--with-system-nspr \
--with-system-svrcore \
--with-pthreads \
--enable-strip \
--enable-optimize="%{optflags}" \
--enable-mdupdate \
--disable-debug
#ifarch x86_64
# --enable-64bit \
#endif
# Enable compiler optimizations and disable debugging code
export BUILD_OPT=1
# Generate symbolic info for debuggers
export XCFLAGS="%{optflags} $(pkg-config --cflags-only-I nss) $(pkg-config --cflags-only-I nspr)"
export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1
export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1
make
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
mkdir -p %{buildroot}%{_exec_prefix}/lib/pkgconfig
sed \
-e "s,%%bindir%%,%{_libdir}/mozldap,g" \
-e "s,%%libdir%%,%{_libdir},g" \
-e "s,%%prefix%%,%{_prefix},g" \
-e "s,%%exec_prefix%%,%{_prefix},g" \
-e "s,%%includedir%%,%{_includedir}/mozldap,g" \
-e "s,%%major%%,%{major},g" \
-e "s,%%minor%%,%{minor},g" \
-e "s,%%submin%%,%{submin},g" \
-e "s,%%libsuffix%%,%{libsuffix},g" \
-e "s,%%NSPR_VERSION%%,$(pkg-config --modversion nspr),g" \
-e "s,%%NSS_VERSION%%,$(pkg-config --modversion nss),g" \
-e "s,%%MOZLDAP_VERSION%%,%{version},g" \
mozilla/directory/c-sdk/mozldap.pc.in > \
%{buildroot}%{_exec_prefix}/lib/pkgconfig/mozldap.pc
mkdir -p %{buildroot}%{_includedir}/mozldap
mkdir -p %{buildroot}%{_libdir}/mozldap
mkdir -p %{buildroot}%{_datadir}/mozldap/etc
for filel in mozilla/dist/lib/*.so ; do
install -m 755 $filel %{buildroot}%{_libdir}/
done
for fileb in mozilla/dist/bin/ldap* ; do
install -m 755 $fileb %{buildroot}%{_libdir}/mozldap
done
for fileh in mozilla/dist/public/ldap/*.h ; do
install -pm 644 $fileh %{buildroot}%{_includedir}/mozldap
done
cp -r mozilla/directory/c-sdk/ldap/examples %{buildroot}%{_datadir}/mozldap
install -m 644 mozilla/directory/c-sdk/ldap/examples/xmplflt.conf \
%{buildroot}%{_datadir}/mozldap/etc
install -m 644 mozilla/directory/c-sdk/ldap/libraries/libldap/ldap{searchprefs,templates,filter}.conf \
%{buildroot}%{_datadir}/mozldap/etc
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root)
%{_libdir}/libldap%{libsuffix}.so
%{_libdir}/libldif%{libsuffix}.so
%{_libdir}/libprldap%{libsuffix}.so
%{_libdir}/libssldap%{libsuffix}.so
%doc mozilla/directory/c-sdk/README.rpm
%files devel
%defattr(-,root,root)
%dir %{_includedir}/mozldap
%{_includedir}/mozldap/*.h
%{_datadir}/mozldap
%{_exec_prefix}/lib/pkgconfig/mozldap.pc
%files tools
%defattr(-,root,root)
%dir %{_libdir}/mozldap
%{_libdir}/mozldap/ldapcmp
%{_libdir}/mozldap/ldapcompare
%{_libdir}/mozldap/ldapdelete
%{_libdir}/mozldap/ldapmodify
%{_libdir}/mozldap/ldappasswd
%{_libdir}/mozldap/ldapsearch
%changelog
* Thu Oct 07 2021 Automatic Build System <autodist@mambasoft.it> 6.0.6-2mamba
- automatic rebuild by autodist
* Mon Dec 21 2009 gil <puntogil@libero.it> 6.0.6-1mamba
- package created by autospec