5 |
|
Patch0: python-ldap-2.3.5-gcc44 |
6 |
|
Requires: python openssl openldap |
7 |
|
|
8 |
+ |
%define isslc6 %(case %cmsplatf in (slc6*) echo true ;; (*) echo false ;; esac) |
9 |
+ |
|
10 |
+ |
%if "%isslc6" == "true" |
11 |
+ |
# On SLC6 we build missing Cyrus SASL. |
12 |
+ |
Requires: cyrus-sasl |
13 |
+ |
%endif |
14 |
+ |
|
15 |
|
%prep |
16 |
|
%setup -q -n %n-%{realversion} |
17 |
|
%patch0 -p1 |
18 |
|
|
19 |
|
%build |
13 |
– |
mkdir -p sasl2lib |
14 |
– |
ln -s /usr/lib/libsasl2.so.2.0.19 sasl2lib/libsasl2.so |
20 |
|
|
21 |
< |
perl -p -i -e 's|/usr/local/openldap-2.3/|$ENV{OPENLDAP_ROOT}/|; s|(library_dirs = .*)|$1 /usr/lib/sasl2 %{_builddir}/%n-%{realversion}/sasl2lib $ENV{OPENSSL_ROOT}/lib|;' setup.cfg |
21 |
> |
# XXX: |
22 |
> |
# Paths in library_dirs (setup.cfg) are hardcoded into RPATH dynamic section |
23 |
> |
# attribute of the binary. Shared libraries are first searched in RPATH paths |
24 |
> |
# before LD_LIBRARY_PATH paths. More information in 'distutils' Python package |
25 |
> |
# source code. |
26 |
> |
|
27 |
> |
# Modify setup.cfg with proper include/libs dirs |
28 |
> |
# ROOT_CYRUS_SASL should be included only on SLC6. |
29 |
> |
# SLC5 has the library by default |
30 |
> |
|
31 |
> |
CYRUS_SASL_ROOT=${CYRUS_SASL_ROOT:-"/usr"} |
32 |
> |
sed -i'' "s:\(library_dirs =\)\(.*\):\1 ${CYRUS_SASL_ROOT}\/lib ${OPENSSL_ROOT}\/lib ${PYTHON_ROOT}\/lib ${OPENLDAP_ROOT}\/lib:g" setup.cfg |
33 |
> |
sed -i'' "s:\(include_dirs = \)\(.*\):\1 ${CYRUS_SASL_ROOT}\/include\/sasl ${OPENSSL_ROOT}\/include ${PYTHON_ROOT}\/include ${OPENLDAP_ROOT}\/include:g" setup.cfg |
34 |
> |
|
35 |
|
python setup.py build |
36 |
|
%install |
37 |
|
python setup.py install --prefix=%i |
38 |
|
|
21 |
– |
# SCRAM ToolBox toolfile |
22 |
– |
mkdir -p %i/etc/scram.d |
23 |
– |
cat << \EOF_TOOLFILE >%i/etc/scram.d/%n.xml |
24 |
– |
<tool name="%n" version="%v"> |
25 |
– |
<info url="http://python-ldap.sourceforge.net/"/> |
26 |
– |
<client> |
27 |
– |
<environment name="PYTHON_LDAP_BASE" default="%i"/> |
28 |
– |
<environment name="PYTHON_LDAP_PYPATH" default="$PYTHON_LDAP_BASE/lib/python@PYTHONV@/site-packages"/> |
29 |
– |
</client> |
30 |
– |
<runtime name="PYTHONPATH" value="$PYTHON_LDAP_PYPATH" type="path"/> |
31 |
– |
<use name="openssl"/> |
32 |
– |
<use name="openldap"/> |
33 |
– |
<use name="python"/> |
34 |
– |
</tool> |
35 |
– |
EOF_TOOLFILE |
36 |
– |
|
37 |
– |
export PYTHONV=$(echo $PYTHON_VERSION | cut -f1,2 -d.) |
38 |
– |
perl -p -i -e 's|\@([^@]*)\@|$ENV{$1}|g' %i/etc/scram.d/* |
39 |
– |
|
39 |
|
# Dependencies environment |
40 |
|
rm -rf %i/etc/profile.d |
41 |
|
mkdir -p %i/etc/profile.d |
48 |
|
|
49 |
|
|
50 |
|
%post |
52 |
– |
%{relocateConfig}etc/scram.d/%n.xml |
53 |
– |
# The relocation below is also needed for dependencies |
51 |
|
%{relocateConfig}etc/profile.d/dependencies-setup.sh |
52 |
|
%{relocateConfig}etc/profile.d/dependencies-setup.csh |
53 |
|
|