]> git.pld-linux.org Git - packages/mozldap.git/blob - mozldap.spec
- buildrequires should be only in main package
[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 Requires:       mozldap = %{version}-%{release}
38 Provides:       mozldap-tools
39
40 %description tools
41 The mozldap-tools package provides the ldapsearch, ldapmodify, and
42 ldapdelete tools that use the Mozilla LDAP C SDK libraries.
43
44 %package devel
45 Summary:        Development libraries and examples for Mozilla LDAP C SDK
46 Group:          Development/Libraries
47 Requires:       mozldap = %{version}-%{release}
48 Provides:       mozldap-devel
49
50 %description devel
51 Header and Library files for doing development with the Mozilla LDAP C
52 SDK
53
54 %prep
55 %setup -q
56
57 %build
58 %ifarch x86_64 ppc64 ia64 s390x
59 arg64="--enable-64bit"
60 %endif
61
62 %configure $arg64 \
63                 --with-nss              \
64                 --with-system-svrcore   \
65                 --enable-optimize       \
66                 --disable-debug
67
68 # Enable compiler optimizations and disable debugging code
69 BUILD_OPT=1
70 export BUILD_OPT
71
72 # Generate symbolic info for debuggers
73 XCFLAGS=%{rpmcflags}
74 export XCFLAGS
75
76 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1
77 PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1
78
79 export PKG_CONFIG_ALLOW_SYSTEM_LIBS
80 export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS
81
82 %ifarch x86_64 ppc64 ia64 s390x
83 USE_64=1
84 export USE_64
85 %endif
86
87 cd mozilla/directory/c-sdk
88 %{__make} BUILDCLU=1 HAVE_SVRCORE=1 BUILD_OPT=1
89 %install
90 rm -rf $RPM_BUILD_ROOT
91 install -d $RPM_BUILD_ROOT%{_includedir}/mozldap
92 install -d $RPM_BUILD_ROOT%{_libdir}
93 install -d $RPM_BUILD_ROOT%{_libdir}/mozldap
94
95 # Copy the binary libraries we want
96 for file in libssldap50.so libprldap50.so libldap50.so; do
97         install mozilla/dist/lib/$file $RPM_BUILD_ROOT%{_libdir}
98 done
99
100 # Copy the binaries we want
101 for file in ldapsearch ldapmodify ldapdelete ldapcmp ldapcompare; do
102         install mozilla/dist/bin/$file $RPM_BUILD_ROOT%{_libdir}/mozldap
103 done
104
105 # Copy the include files
106 for file in mozilla/dist/public/ldap/*.h; do
107         install -m 644 $file $RPM_BUILD_ROOT%{_includedir}/mozldap
108 done
109
110 # Copy the developer files
111 install -d $RPM_BUILD_ROOT%{_datadir}/mozldap
112 cp -r mozilla/directory/c-sdk/ldap/examples $RPM_BUILD_ROOT%{_datadir}/mozldap
113 install -d $RPM_BUILD_ROOT%{_datadir}/mozldap%{_sysconfdir}
114 install mozilla/directory/c-sdk/ldap/examples/xmplflt.conf $RPM_BUILD_ROOT%{_datadir}/mozldap%{_sysconfdir}
115 install mozilla/directory/c-sdk/ldap/libraries/libldap/ldaptemplates.conf $RPM_BUILD_ROOT%{_datadir}/mozldap%{_sysconfdir}
116 install mozilla/directory/c-sdk/ldap/libraries/libldap/ldapfilter.conf $RPM_BUILD_ROOT%{_datadir}/mozldap%{_sysconfdir}
117 install mozilla/directory/c-sdk/ldap/libraries/libldap/ldapsearchprefs.conf $RPM_BUILD_ROOT%{_datadir}/mozldap%{_sysconfdir}
118
119 # Rename the libraries and create the symlinks
120 cd $RPM_BUILD_ROOT%{_libdir}
121 for file in libssldap50.so libprldap50.so libldap50.so; do
122         mv $file $file.%{major}.${minor}
123         ln -s $file.%{major}.%{minor} $file.%{major}
124         ln -s $file.%{major} $file
125 done
126
127 # Set up our package file
128 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
129 sed mozldap.pc.in -e "
130         s,%%libdir%%,%{_libdir},g
131         s,%%prefix%%,%{_prefix},g
132         s,%%exec_prefix%%,%{_prefix},g
133         s,%%includedir%%,%{_includedir}/mozldap,g
134         s,%%NSPR_VERSION%%,%{nspr_version},g
135         s,%%NSS_VERSION%%,%{nss_version},g
136         s,%%SVRCORE_VERSION%%,%{svrcore_version},g
137         s,%%MOZLDAP_VERSION%%,%{version},g
138 " > $RPM_BUILD_ROOT%{_pkgconfigdir}/mozldap.pc
139
140
141 %clean
142 rm -rf $RPM_BUILD_ROOT
143
144 %post -p /sbin/ldconfig
145 %postun -p /sbin/ldconfig
146
147 %files
148 %defattr(644,root,root,755)
149 %{_libdir}/libssldap50.so
150 %{_libdir}/libprldap50.so
151 %{_libdir}/libldap50.so
152 %attr(755,root,root) %{_libdir}/libssldap50.so.%{major}
153 %attr(755,root,root) %{_libdir}/libprldap50.so.%{major}
154 %attr(755,root,root) %{_libdir}/libldap50.so.%{major}
155 %attr(755,root,root) %{_libdir}/libssldap50.so.%{major}.%{minor}
156 %attr(755,root,root) %{_libdir}/libprldap50.so.%{major}.%{minor}
157 %attr(755,root,root) %{_libdir}/libldap50.so.%{major}.%{minor}
158
159 %files tools
160 %defattr(644,root,root,755)
161 %{_libdir}/mozldap/ldapsearch
162 %{_libdir}/mozldap/ldapmodify
163 %{_libdir}/mozldap/ldapdelete
164 %{_libdir}/mozldap/ldapcmp
165 %{_libdir}/mozldap/ldapcompare
166
167 %files devel
168 %defattr(644,root,root,755)
169 %{_pkgconfigdir}/mozldap.pc
170 %{_includedir}/mozldap
171 %{_datadir}/mozldap
This page took 0.093626 seconds and 4 git commands to generate.