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