summaryrefslogtreecommitdiff
path: root/mozldap.spec
blob: 194972e3cb6b89d73a34d99dbd59922e0c22dfa9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
%define	nspr_version	1:4.6
%define	nss_version	1:3.11
%define	svrcore_version	4.0.1
%define	major		5
%define	minor		17
Summary:	Mozilla LDAP C SDK
Summary(pl):	Mozilla LDAP C SDK
Name:		mozldap
Version:	%{major}.%{minor}
Release:	0.1
License:	MPL/GPL/LGPL
Group:		System
Source0:	ftp://ftp.mozilla.org/pub/mozilla.org/directory/c-sdk/releases/v%{major}.17/src/ldapcsdk-%{version}.tar.gz
# Source0-md5	453341111111111
URL:		http://www.mozilla.org/directory/csdk.html
BuildRequires:	gawk
BuildRequires:	nspr-devel >= %{nspr_version}
BuildRequires:	nss-devel >= %{nss_version}
BuildRequires:	pkgconfig
BuildRequires:	svrcore-devel >= %{svrcore_version}
Requires:	nspr >= %{nspr_version}
Requires:	nss >= %{nss_version}
Provides:	mozldap
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

%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 tools
Summary:	Tools for the Mozilla LDAP C SDK
Group:		System
BuildRequires:	nspr-devel >= %{nspr_version}
BuildRequires:	nss-devel >= %{nss_version}
BuildRequires:	svrcore-devel >= %{svrcore_version}
Requires:	mozldap = %{version}-%{release}
Provides:	mozldap-tools

%description tools
The mozldap-tools package provides the ldapsearch, ldapmodify, and
ldapdelete tools that use the Mozilla LDAP C SDK libraries.

%package devel
Summary:	Development libraries and examples for Mozilla LDAP C SDK
Group:		Development/Libraries
BuildRequires:	nspr-devel >= %{nspr_version}
BuildRequires:	nss-devel >= %{nss_version}
Requires:	mozldap = %{version}-%{release}
Provides:	mozldap-devel

%description devel
Header and Library files for doing development with the Mozilla LDAP C
SDK

%prep
%setup -q

%build
%ifarch x86_64 ppc64 ia64 s390x
arg64="--enable-64bit"
%endif

%configure $arg64 \
		--with-nss		\
		--with-system-svrcore	\
		--enable-optimize	\
		--disable-debug

# Enable compiler optimizations and disable debugging code
BUILD_OPT=1
export BUILD_OPT

# Generate symbolic info for debuggers
XCFLAGS=%{rpmcflags}
export XCFLAGS

PKG_CONFIG_ALLOW_SYSTEM_LIBS=1
PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1

export PKG_CONFIG_ALLOW_SYSTEM_LIBS
export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS

%ifarch x86_64 ppc64 ia64 s390x
USE_64=1
export USE_64
%endif

cd mozilla/directory/c-sdk
%{__make} BUILDCLU=1 HAVE_SVRCORE=1 BUILD_OPT=1

# Set up our package file
install -d $RPM_BUILD_ROOT%{_libdir}/pkgconfig
%{__cat} mozldap.pc.in | sed -e "s,%%libdir%%,%{_libdir},g" \
						  -e "s,%%prefix%%,%{_prefix},g" \
						  -e "s,%%exec_prefix%%,%{_prefix},g" \
						  -e "s,%%includedir%%,%{_includedir}/mozldap,g" \
						  -e "s,%%NSPR_VERSION%%,%{nspr_version},g" \
						  -e "s,%%NSS_VERSION%%,%{nss_version},g" \
						  -e "s,%%SVRCORE_VERSION%%,%{svrcore_version},g" \
						  -e "s,%%MOZLDAP_VERSION%%,%{version},g" > \
						  $RPM_BUILD_ROOT%{_libdir}/pkgconfig/mozldap.pc

%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_includedir}/mozldap
install -d $RPM_BUILD_ROOT%{_libdir}
install -d $RPM_BUILD_ROOT%{_libdir}/mozldap

# Copy the binary libraries we want
for file in libssldap50.so libprldap50.so libldap50.so; do
	install mozilla/dist/lib/$file $RPM_BUILD_ROOT%{_libdir}
done

# Copy the binaries we want
for file in ldapsearch ldapmodify ldapdelete ldapcmp ldapcompare; do
	install mozilla/dist/bin/$file $RPM_BUILD_ROOT%{_libdir}/mozldap
done

# Copy the include files
for file in mozilla/dist/public/ldap/*.h; do
	install -m 644 $file $RPM_BUILD_ROOT%{_includedir}/mozldap
done

# Copy the developer files
install -d $RPM_BUILD_ROOT%{_datadir}/mozldap
cp -r mozilla/directory/c-sdk/ldap/examples $RPM_BUILD_ROOT%{_datadir}/mozldap
install -d $RPM_BUILD_ROOT%{_datadir}/mozldap%{_sysconfdir}
install mozilla/directory/c-sdk/ldap/examples/xmplflt.conf $RPM_BUILD_ROOT%{_datadir}/mozldap%{_sysconfdir}
install mozilla/directory/c-sdk/ldap/libraries/libldap/ldaptemplates.conf $RPM_BUILD_ROOT%{_datadir}/mozldap%{_sysconfdir}
install mozilla/directory/c-sdk/ldap/libraries/libldap/ldapfilter.conf $RPM_BUILD_ROOT%{_datadir}/mozldap%{_sysconfdir}
install mozilla/directory/c-sdk/ldap/libraries/libldap/ldapsearchprefs.conf $RPM_BUILD_ROOT%{_datadir}/mozldap%{_sysconfdir}

# Rename the libraries and create the symlinks
cd $RPM_BUILD_ROOT%{_libdir}
for file in libssldap50.so libprldap50.so libldap50.so; do
	mv $file $file.%{major}.${minor}
	ln -s $file.%{major}.%{minor} $file.%{major}
	ln -s $file.%{major} $file
done

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%files
%defattr(644,root,root,755)
%{_libdir}/libssldap50.so
%{_libdir}/libprldap50.so
%{_libdir}/libldap50.so
%attr(755,root,root) %{_libdir}/libssldap50.so.%{major}
%attr(755,root,root) %{_libdir}/libprldap50.so.%{major}
%attr(755,root,root) %{_libdir}/libldap50.so.%{major}
%attr(755,root,root) %{_libdir}/libssldap50.so.%{major}.%{minor}
%attr(755,root,root) %{_libdir}/libprldap50.so.%{major}.%{minor}
%attr(755,root,root) %{_libdir}/libldap50.so.%{major}.%{minor}

%files tools
%defattr(644,root,root,755)
%{_libdir}/mozldap/ldapsearch
%{_libdir}/mozldap/ldapmodify
%{_libdir}/mozldap/ldapdelete
%{_libdir}/mozldap/ldapcmp
%{_libdir}/mozldap/ldapcompare

%files devel
%defattr(644,root,root,755)
%{_pkgconfigdir}/mozldap.pc
%{_includedir}/mozldap
%{_datadir}/mozldap