package created by autospec [release 6.0.6-1mamba;Mon Dec 21 2009]

This commit is contained in:
gil 2024-01-06 07:19:35 +01:00
parent 3f1710e536
commit 08250b0a93
3 changed files with 248 additions and 0 deletions

View File

@ -1,2 +1,4 @@
# mozldap
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.

82
fix_headers.sh Normal file
View File

@ -0,0 +1,82 @@
#!/bin/sh -euf
# -*- mode: Ksh; tab-width: 8; fill-column: 70; -*-
# $Id: fix_headers.sh,v 0.0.1 2006/04/05 15:39:57 legion Exp $
PROG="${0##*/}"
usage() {
[ "$1" = 0 ] || exec >&2
cat <<EOF
Program to correct headers at mozilla-based projects.
Usage: $PROG <include_dir> <project_include_dir> <prefix>
include_dir - system includes location
project_include_dir - project includes
Examle:
$PROG '/usr/include' '/var/tmp/firefox-buildroot/usr/include/firefox'
EOF
[ -n "$1" ] && exit "$1" || exit
}
msg() {
printf %s\\n "$@"
}
err() {
msg "Error: $@" >&2
}
find_header() {
local path="$1" && shift
local fn="$1" && shift
while [ -n "$path" ]; do
[ -f "$path/$fn" ] && break
path="${path%/*}"
done
[ -f "$path/$fn" ] && msg "$path/$fn" || return 1
}
[ "$#" -eq 2 ] || usage 1
include_dir="$(readlink -ve "$1")" && shift
indir="$(readlink -ve "$1")" && shift
exclude_list=
indir="$indir/"
for p in nss nspr mozldap; do
[ "$indir" != "${indir#*/$p/}" ] || exclude_list="$exclude_list $p"
done
indir="${indir%/}"
find "$indir/" -name '*.h' |
while read h; do
sed -ne 's|^[[:space:]]*#[[:space:]]*include[[:space:]]\+"\([^"]\+\)".*$|\1|p' -- "$h" | sort -u |
while read ih; do
ih_name="${ih##*/}"
eh="$(find "$include_dir" -name "$ih_name")" || err "$h: '$ih'"
if [ -z "$eh" ]; then
if ! eh="$(find_header "${h%/*}" "$ih")"; then
eh="$(find "$indir/" -name "$ih_name")" || err "$h: '$ih'"
[ "$(printf %s\\n "$eh" |wc -l)" = "1" ] || { err "$h: '$(msg "$eh" |tr \\n \ )'"; continue; }
fi
if [ -z "$eh" ]; then
err "not found: $h: '$ih'"
continue
fi
subst "s%^\([[:space:]]*#[[:space:]]*include\)[[:space:]]\+\"$ih\"%\1 <${eh#*$include_dir/}>%" -- "$h" ||
err "$h"
continue
fi
nh="${eh#$include_dir/}"
for p in $exclude_list; do
nh="${nh#*$p/}"
done
subst "s%^\([[:space:]]*#[[:space:]]*include\)[[:space:]]\+\"$ih\"%\1 <$nh>%" -- "$h" ||
err "$h: 's%^\([[:space:]]*#[[:space:]]*include\)[[:space:]]\+\"$ih\"%\1 <$nh>%'"
done
done

164
mozldap.spec Normal file
View File

@ -0,0 +1,164 @@
%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: 1mamba
Summary: Mozilla LDAP C SDK
Group: System/Libraries
Vendor: openmamba
Distribution: openmamba
Packager: gil <puntogil@libero.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: libsasl-devel
BuildRequires: libstdc++6-devel
BuildRequires: libsvrcore-devel
## AUTOBUILDREQ-END
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%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
* Mon Dec 21 2009 gil <puntogil@libero.it> 6.0.6-1mamba
- package created by autospec