mozldap/mozldap.spec

160 lines
4.7 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.7
Release: 1mamba
Summary: Mozilla LDAP C SDK
Group: System/Libraries
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://wiki.mozilla.org/LDAP_C_SDK
Source0: https://ftp.mozilla.org/pub/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 needed 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.
%debug_package
%prep
%setup -q
%build
cd 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}"
cd c-sdk
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" \
mozldap.pc.in > \
%{buildroot}%{_exec_prefix}/lib/pkgconfig/mozldap.pc
mkdir -p %{buildroot}%{_includedir}/mozldap
mkdir -p %{buildroot}%{_datadir}/mozldap/{etc,bin}
mkdir -p %{buildroot}%{_prefix}/lib/mozilla/plugins/
for filel in ldap/libraries/lib*/*.so ; do
install -m 755 $filel %{buildroot}%{_prefix}/lib/mozilla/plugins/
done
for fileb in ldap/clients/tools/bin/ldap* ; do
install -m 755 $fileb %{buildroot}%{_datadir}/mozldap/bin
done
for fileh in ldap/include/*.h ; do
install -pm 644 $fileh %{buildroot}%{_includedir}/mozldap
done
cp -r ldap/examples %{buildroot}%{_datadir}/mozldap
install -m 644 ldap/examples/xmplflt.conf \
%{buildroot}%{_datadir}/mozldap/etc
install -m 644 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)
%{_prefix}/lib/mozilla/plugins/lib*.so
%doc 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 %{_datadir}/mozldap/bin
%{_datadir}/mozldap/bin/*
%changelog
* Mon Dec 27 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 6.0.7-1mamba
- update to 6.0.7
* 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