]>
Commit | Line | Data |
---|---|---|
42ecd1b3 MWP |
1 | # |
2 | # TODO: | |
3 | # Conditional build: | |
4 | %define nspr_version 4.6 | |
5 | %define nss_version 3.11 | |
6 | %define svrcore_version 4.0.1 | |
7 | %define major 5 | |
8 | %define minor 17 | |
9 | Summary: Mozilla LDAP C SDK | |
10 | Summary(pl): Mozilla LDAP C SDK | |
11 | Name: mozldap | |
12 | Version: %{major}.%{minor} | |
13 | Release: 0.1 | |
14 | License: MPL/GPL/LGPL | |
15 | Group: System | |
16 | ###### Unknown group! | |
17 | Source0: ftp://ftp.mozilla.org/pub/mozilla.org/directory/c-sdk/releases/v%{version}/src/ldapcsdk-%{version}.tar.gz | |
18 | # Source0-md5 453341111111111 | |
19 | URL: http://www.mozilla.org/directory/csdk.html | |
20 | Requires: nspr >= %{nspr_version} | |
21 | Requires: nss >= %{nss_version} | |
22 | BuildRequires: nspr-devel >= %{nspr_version} | |
23 | BuildRequires: nss-devel >= %{nss_version} | |
24 | BuildRequires: svrcore-devel >= %{svrcore_version} | |
25 | BuildRequires: pkgconfig | |
26 | BuildRequires: gawk | |
27 | Provides: mozldap | |
28 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
29 | ||
30 | %description | |
31 | The Mozilla LDAP C SDK is a set of libraries that allow applications | |
32 | to communicate with LDAP directory servers. These libraries are | |
33 | derived from the University of Michigan and Netscape LDAP libraries. | |
34 | They use Mozilla NSPR and NSS for crypto. | |
35 | ||
36 | %description -l pl | |
37 | x | |
38 | ||
39 | %package tools | |
40 | Summary: Tools for the Mozilla LDAP C SDK | |
41 | Group: System | |
42 | ###### Unknown group! | |
43 | Requires: mozldap = %{version}-%{release} | |
44 | BuildRequires: nspr-devel >= %{nspr_version} | |
45 | BuildRequires: nss-devel >= %{nss_version} | |
46 | BuildRequires: svrcore-devel >= %{svrcore_version} | |
47 | Provides: mozldap-tools | |
48 | ||
49 | %description tools | |
50 | The mozldap-tools package provides the ldapsearch, ldapmodify, and | |
51 | ldapdelete tools that use the Mozilla LDAP C SDK libraries. | |
52 | ||
53 | %description tools -l pl | |
54 | x | |
55 | ||
56 | %package devel | |
57 | Summary: Development libraries and examples for Mozilla LDAP C SDK | |
58 | Group: Development/Libraries | |
59 | Requires: mozldap = %{version}-%{release} | |
60 | BuildRequires: nspr-devel >= %{nspr_version} | |
61 | BuildRequires: nss-devel >= %{nss_version} | |
62 | Provides: mozldap-devel | |
63 | ||
64 | %description devel | |
65 | Header and Library files for doing development with the Mozilla LDAP C | |
66 | SDK | |
67 | ||
68 | %description devel -l pl | |
69 | x | |
70 | ||
71 | %prep | |
72 | ||
73 | %setup -q | |
74 | #-n | |
75 | #cd mozilla/directory/c-sdk | |
76 | ||
77 | %build | |
78 | ||
79 | %ifarch x86_64 ppc64 ia64 s390x | |
80 | arg64="--enable-64bit" | |
81 | %endif | |
82 | ||
83 | %configure $arg64 \ | |
84 | --with-nss \ | |
85 | --with-system-svrcore \ | |
86 | --enable-optimize \ | |
87 | --disable-debug | |
88 | ||
89 | # Enable compiler optimizations and disable debugging code | |
90 | BUILD_OPT=1 | |
91 | export BUILD_OPT | |
92 | ||
93 | # Generate symbolic info for debuggers | |
94 | XCFLAGS=%{rpmcflags} | |
95 | export XCFLAGS | |
96 | ||
97 | PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 | |
98 | PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 | |
99 | ||
100 | export PKG_CONFIG_ALLOW_SYSTEM_LIBS | |
101 | export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS | |
102 | ||
103 | %ifarch x86_64 ppc64 ia64 s390x | |
104 | USE_64=1 | |
105 | export USE_64 | |
106 | %endif | |
107 | ||
108 | cd mozilla/directory/c-sdk | |
109 | %{__make} BUILDCLU=1 HAVE_SVRCORE=1 BUILD_OPT=1 | |
110 | ||
111 | # Set up our package file | |
112 | %{__mkdir_p} $RPM_BUILD_ROOT/%{_libdir}/pkgconfig | |
113 | %{__cat} mozldap.pc.in | sed -e "s,%%libdir%%,%{_libdir},g" \ | |
114 | -e "s,%%prefix%%,%{_prefix},g" \ | |
115 | -e "s,%%exec_prefix%%,%{_prefix},g" \ | |
116 | -e "s,%%includedir%%,%{_includedir}/mozldap,g" \ | |
117 | -e "s,%%NSPR_VERSION%%,%{nspr_version},g" \ | |
118 | -e "s,%%NSS_VERSION%%,%{nss_version},g" \ | |
119 | -e "s,%%SVRCORE_VERSION%%,%{svrcore_version},g" \ | |
120 | -e "s,%%MOZLDAP_VERSION%%,%{version},g" > \ | |
121 | $RPM_BUILD_ROOT/%{_libdir}/pkgconfig/mozldap.pc | |
122 | ||
123 | %install | |
124 | # There is no make install target so we'll do it ourselves. | |
125 | ||
126 | rm -rf $RPM_BUILD_ROOT | |
127 | %{__mkdir_p} $RPM_BUILD_ROOT/%{_includedir}/mozldap | |
128 | %{__mkdir_p} $RPM_BUILD_ROOT/%{_libdir} | |
129 | %{__mkdir_p} $RPM_BUILD_ROOT/%{_libdir}/mozldap | |
130 | ||
131 | # Copy the binary libraries we want | |
132 | for file in libssldap50.so libprldap50.so libldap50.so | |
133 | do | |
134 | %{__install} -m 755 mozilla/dist/lib/$file $RPM_BUILD_ROOT/%{_libdir} | |
135 | done | |
136 | ||
137 | # Copy the binaries we want | |
138 | for file in ldapsearch ldapmodify ldapdelete ldapcmp ldapcompare | |
139 | do | |
140 | %{__install} -m 755 mozilla/dist/bin/$file $RPM_BUILD_ROOT/%{_libdir}/mozldap | |
141 | done | |
142 | ||
143 | # Copy the include files | |
144 | for file in mozilla/dist/public/ldap/*.h | |
145 | do | |
146 | %{__install} -m 644 $file $RPM_BUILD_ROOT/%{_includedir}/mozldap | |
147 | done | |
148 | ||
149 | # Copy the developer files | |
150 | %{__mkdir_p} $RPM_BUILD_ROOT%{_datadir}/mozldap | |
151 | cp -r mozilla/directory/c-sdk/ldap/examples $RPM_BUILD_ROOT%{_datadir}/mozldap | |
152 | %{__mkdir_p} $RPM_BUILD_ROOT%{_datadir}/mozldap%{_sysconfdir} | |
153 | %{__install} -m 644 mozilla/directory/c-sdk/ldap/examples/xmplflt.conf $RPM_BUILD_ROOT%{_datadir}/mozldap%{_sysconfdir} | |
154 | %{__install} -m 644 mozilla/directory/c-sdk/ldap/libraries/libldap/ldaptemplates.conf $RPM_BUILD_ROOT%{_datadir}/mozldap%{_sysconfdir} | |
155 | %{__install} -m 644 mozilla/directory/c-sdk/ldap/libraries/libldap/ldapfilter.conf $RPM_BUILD_ROOT%{_datadir}/mozldap%{_sysconfdir} | |
156 | %{__install} -m 644 mozilla/directory/c-sdk/ldap/libraries/libldap/ldapsearchprefs.conf $RPM_BUILD_ROOT%{_datadir}/mozldap%{_sysconfdir} | |
157 | ||
158 | # Rename the libraries and create the symlinks | |
159 | cd $RPM_BUILD_ROOT/%{_libdir} | |
160 | for file in libssldap50.so libprldap50.so libldap50.so | |
161 | do | |
162 | mv $file $file.${major}.${minor} | |
163 | ln -s $file.${major}.%{minor} $file.${major} | |
164 | ln -s $file.${major} $file | |
165 | done | |
166 | ||
167 | %clean | |
168 | %{__rm} -rf $RPM_BUILD_ROOT | |
169 | ||
170 | %post | |
171 | /sbin/ldconfig >/dev/null 2>/dev/null | |
172 | ||
173 | %postun | |
174 | /sbin/ldconfig >/dev/null 2>/dev/null | |
175 | ||
176 | %files | |
177 | %defattr(644,root,root,755) | |
178 | %{_libdir}/libssldap50.so | |
179 | %{_libdir}/libprldap50.so | |
180 | %{_libdir}/libldap50.so | |
181 | %{_libdir}/libssldap50.so.%{major} | |
182 | %{_libdir}/libprldap50.so.%{major} | |
183 | %{_libdir}/libldap50.so.%{major} | |
184 | %{_libdir}/libssldap50.so.%{major}.%{minor} | |
185 | %{_libdir}/libprldap50.so.%{major}.%{minor} | |
186 | %{_libdir}/libldap50.so.%{major}.%{minor} | |
187 | ||
188 | %files tools | |
189 | %defattr(644,root,root,755) | |
190 | %{_libdir}/mozldap/ldapsearch | |
191 | %{_libdir}/mozldap/ldapmodify | |
192 | %{_libdir}/mozldap/ldapdelete | |
193 | %{_libdir}/mozldap/ldapcmp | |
194 | %{_libdir}/mozldap/ldapcompare | |
195 | ||
196 | %files devel | |
197 | %defattr(644,root,root,755) | |
198 | %{_libdir}/pkgconfig/mozldap.pc | |
199 | %{_includedir}/mozldap | |
200 | %{_datadir}/mozldap |