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