1 |
ratnik |
1.1 |
### RPM external python-ldap 2.3.5
|
2 |
diego |
1.6 |
## INITENV +PATH PYTHONPATH %i/lib/python`echo $PYTHON_VERSION | cut -f1,2 -d.`/site-packages
|
3 |
|
|
|
4 |
ratnik |
1.1 |
Source: http://voxel.dl.sourceforge.net/sourceforge/python-ldap/python-ldap-%{realversion}.tar.gz
|
5 |
elmer |
1.4 |
Patch0: python-ldap-2.3.5-gcc44
|
6 |
diego |
1.6 |
Requires: python openssl openldap
|
7 |
ratnik |
1.1 |
|
8 |
|
|
%prep
|
9 |
|
|
%setup -q -n %n-%{realversion}
|
10 |
elmer |
1.4 |
%patch0 -p1
|
11 |
|
|
|
12 |
ratnik |
1.1 |
%build
|
13 |
ratnik |
1.2 |
mkdir -p sasl2lib
|
14 |
|
|
ln -s /usr/lib/libsasl2.so.2.0.19 sasl2lib/libsasl2.so
|
15 |
|
|
|
16 |
|
|
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
|
17 |
ratnik |
1.1 |
python setup.py build
|
18 |
|
|
%install
|
19 |
|
|
python setup.py install --prefix=%i
|
20 |
|
|
|
21 |
|
|
# SCRAM ToolBox toolfile
|
22 |
|
|
mkdir -p %i/etc/scram.d
|
23 |
|
|
cat << \EOF_TOOLFILE >%i/etc/scram.d/%n
|
24 |
|
|
<doc type=BuildSystem::ToolDoc version=1.0>
|
25 |
|
|
<Tool name=%n version=%v>
|
26 |
|
|
<info url="http://python-ldap.sourceforge.net/"></info>
|
27 |
|
|
<Client>
|
28 |
|
|
<Environment name=PYTHON_LDAP_BASE default="%i"></Environment>
|
29 |
lat |
1.5 |
<Environment name=PYTHON_LDAP_PYPATH default="$PYTHON_LDAP_BASE/lib/python@PYTHONV@/site-packages"></Environment>
|
30 |
ratnik |
1.1 |
</Client>
|
31 |
ratnik |
1.3 |
<use name=openssl>
|
32 |
|
|
<use name=openldap>
|
33 |
ratnik |
1.1 |
<use name=python>
|
34 |
|
|
<Runtime name=PYTHONPATH value="$PYTHON_LDAP_PYPATH" type=path>
|
35 |
|
|
</Tool>
|
36 |
|
|
EOF_TOOLFILE
|
37 |
|
|
|
38 |
lat |
1.5 |
export PYTHONV=$(echo $PYTHON_VERSION | cut -f1,2 -d.)
|
39 |
|
|
perl -p -i -e 's|\@([^@]*)\@|$ENV{$1}|g' %i/etc/scram.d/*
|
40 |
|
|
|
41 |
diego |
1.6 |
# Dependencies environment
|
42 |
|
|
rm -rf %i/etc/profile.d
|
43 |
|
|
mkdir -p %i/etc/profile.d
|
44 |
|
|
for x in %pkgreqs; do
|
45 |
|
|
case $x in /* ) continue ;; esac
|
46 |
|
|
p=%{instroot}/%{cmsplatf}/$(echo $x | sed 's/\([^+]*\)+\(.*\)+\([A-Z0-9].*\)/\1 \2 \3/' | tr ' ' '/')
|
47 |
|
|
echo ". $p/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh
|
48 |
|
|
echo "source $p/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh
|
49 |
|
|
done
|
50 |
|
|
|
51 |
|
|
|
52 |
ratnik |
1.1 |
%post
|
53 |
|
|
%{relocateConfig}etc/scram.d/%n
|
54 |
diego |
1.6 |
# The relocation below is also needed for dependencies
|
55 |
|
|
%{relocateConfig}etc/profile.d/dependencies-setup.sh
|
56 |
|
|
%{relocateConfig}etc/profile.d/dependencies-setup.csh
|
57 |
|
|
|