]>
Commit | Line | Data |
---|---|---|
e6641613 ER |
1 | # |
2 | # Conditional build: | |
03be1595 JB |
3 | %bcond_without python2 # CPython 2.x module |
4 | %bcond_without python3 # CPython 3.x module | |
5 | %bcond_with tests # unit tests (require LDAP server) | |
e6641613 | 6 | |
03be1595 JB |
7 | Summary: LDAP client API for Python 2 |
8 | Summary(pl.UTF-8): API klienckie LDAP dla Pythona 2 | |
9 | Name: python-ldap | |
94161998 | 10 | Version: 3.3.1 |
c5f8481b | 11 | Release: 6 |
230a14c8 | 12 | Epoch: 1 |
43419cb9 | 13 | License: Python-like |
9716bb47 | 14 | Group: Libraries/Python |
03be1595 JB |
15 | #Source0Download: https://pypi.org/simple/python-ldap/ |
16 | Source0: https://files.pythonhosted.org/packages/source/p/python-ldap/%{name}-%{version}.tar.gz | |
94161998 | 17 | # Source0-md5: 7608579722c491e42f5f63b3f88a95fb |
4c8655fe | 18 | URL: http://python-ldap.sourceforge.net/ |
94161998 | 19 | BuildRequires: cyrus-sasl-devel >= 2.1.0 |
fac291d8 | 20 | BuildRequires: openldap-devel >= 2.4.6 |
94161998 | 21 | BuildRequires: openssl-devel |
03be1595 JB |
22 | %if %{with tests} |
23 | BuildRequires: openldap >= 2.4.6 | |
24 | BuildRequires: openldap-servers >= 2.4.6 | |
25 | %endif | |
26 | %if %{with python2} | |
27 | BuildRequires: python-devel >= 1:2.7 | |
28 | BuildRequires: python-modules >= 1:2.7 | |
5ee21101 | 29 | BuildRequires: python-setuptools |
03be1595 JB |
30 | %if %{with tests} |
31 | BuildRequires: python-pyasn1 >= 0.3.7 | |
32 | BuildRequires: python-pyasn1_modules >= 0.1.5 | |
33 | %endif | |
34 | %endif | |
35 | %if %{with python2} | |
36 | BuildRequires: python3-devel >= 1:3.4 | |
37 | BuildRequires: python3-modules >= 1:3.4 | |
5ee21101 | 38 | BuildRequires: python3-setuptools |
03be1595 JB |
39 | %if %{with tests} |
40 | BuildRequires: python3-pyasn1 >= 0.3.7 | |
41 | BuildRequires: python3-pyasn1_modules >= 0.1.5 | |
42 | %endif | |
43 | %endif | |
fac291d8 | 44 | BuildRequires: rpm-pythonprov |
03be1595 JB |
45 | BuildRequires: rpmbuild(macros) >= 1.710 |
46 | Requires: python-modules >= 1:2.7 | |
4c8655fe | 47 | Provides: ldapmodule |
4c8655fe JK |
48 | Obsoletes: ldapmodule |
49 | Obsoletes: python-ldapmodule | |
fac291d8 | 50 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
4c8655fe JK |
51 | |
52 | %description | |
43419cb9 JB |
53 | python-ldap provides an object-oriented API to access LDAP directory |
54 | servers from Python programs. Mainly it wraps the OpenLDAP client libs | |
55 | for that purpose. | |
56 | ||
57 | Additionally the package contains modules for other LDAP-related stuff | |
58 | (e.g. processing LDIF, LDAPURLs, LDAPv3 sub-schema, etc.). | |
4c8655fe | 59 | |
e18fb2ee | 60 | %description -l pl.UTF-8 |
43419cb9 JB |
61 | Moduł python-ldap dostarcza zorientowane obiektowo API pozwalające na |
62 | dostęp do usług katalogowych LDAP z poziomu programów w Pythonie. | |
63 | Głównie obudowuje w tym celu biblioteki klienckie OpenLDAP. | |
64 | ||
65 | Dodatkowo pakiet zawiera moduły do innych zadań związanych z LDAP (jak | |
66 | przetwarzanie LDIF, LDAPURL, podschematy LDAPv3 itp.). | |
4c8655fe | 67 | |
03be1595 JB |
68 | %package -n python3-ldap |
69 | Summary: LDAP client API for Python 3 | |
70 | Summary(pl.UTF-8): API klienckie LDAP dla Pythona 3 | |
71 | Group: Libraries/Python | |
72 | Requires: python3-modules >= 1:3.4 | |
73 | ||
74 | %description -n python3-ldap | |
75 | python-ldap provides an object-oriented API to access LDAP directory | |
76 | servers from Python programs. Mainly it wraps the OpenLDAP client libs | |
77 | for that purpose. | |
78 | ||
79 | Additionally the package contains modules for other LDAP-related stuff | |
80 | (e.g. processing LDIF, LDAPURLs, LDAPv3 sub-schema, etc.). | |
81 | ||
82 | %description -n python3-ldap -l pl.UTF-8 | |
83 | Moduł python-ldap dostarcza zorientowane obiektowo API pozwalające na | |
84 | dostęp do usług katalogowych LDAP z poziomu programów w Pythonie. | |
85 | Głównie obudowuje w tym celu biblioteki klienckie OpenLDAP. | |
86 | ||
87 | Dodatkowo pakiet zawiera moduły do innych zadań związanych z LDAP (jak | |
88 | przetwarzanie LDIF, LDAPURL, podschematy LDAPv3 itp.). | |
89 | ||
c7fa9053 | 90 | %prep |
4c8655fe | 91 | %setup -q |
4c8655fe JK |
92 | |
93 | %build | |
03be1595 JB |
94 | %if %{with python2} |
95 | %py_build %{?with_tests:test} | |
e6641613 | 96 | |
04ae41e8 | 97 | %if %{with tests} |
bc02c391 | 98 | LDAPNOINIT=1 \ |
d68677dd | 99 | PYTHONPATH=$(echo build-2/lib.linux-*/) \ |
bc02c391 | 100 | %{__python} -c "import ldap; print ldap.__version__; ldapo = ldap.initialize('ldap://localhost')" |
04ae41e8 | 101 | %endif |
03be1595 JB |
102 | %endif |
103 | ||
104 | %if %{with python3} | |
105 | %py3_build %{?with_tests:test} | |
106 | ||
107 | %if %{with tests} | |
108 | LDAPNOINIT=1 \ | |
109 | PYTHONPATH=$(echo build-3/lib.linux-*/) \ | |
110 | %{__python3} -c "import ldap; print ldap.__version__; ldapo = ldap.initialize('ldap://localhost')" | |
111 | %endif | |
112 | %endif | |
4c8655fe JK |
113 | |
114 | %install | |
115 | rm -rf $RPM_BUILD_ROOT | |
03be1595 JB |
116 | |
117 | %if %{with python2} | |
3f480fed | 118 | %py_install |
4c8655fe | 119 | |
03be1595 | 120 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/slapdtest |
e6641613 | 121 | %py_postclean |
03be1595 JB |
122 | %endif |
123 | ||
124 | %if %{with python3} | |
125 | %py3_install | |
126 | ||
127 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/slapdtest | |
128 | %endif | |
4c8655fe | 129 | |
4c8655fe JK |
130 | %clean |
131 | rm -rf $RPM_BUILD_ROOT | |
132 | ||
03be1595 | 133 | %if %{with python2} |
4c8655fe JK |
134 | %files |
135 | %defattr(644,root,root,755) | |
43419cb9 JB |
136 | %doc CHANGES LICENCE README TODO |
137 | %attr(755,root,root) %{py_sitedir}/_ldap.so | |
43419cb9 JB |
138 | %{py_sitedir}/ldapurl.py[co] |
139 | %{py_sitedir}/ldif.py[co] | |
96ac6477 | 140 | %{py_sitedir}/ldap |
43419cb9 | 141 | %{py_sitedir}/python_ldap-%{version}-py*.egg-info |
03be1595 JB |
142 | %endif |
143 | ||
144 | %if %{with python3} | |
145 | %files -n python3-ldap | |
146 | %defattr(644,root,root,755) | |
147 | %doc CHANGES LICENCE README TODO | |
148 | %attr(755,root,root) %{py3_sitedir}/_ldap.cpython-*.so | |
149 | %{py3_sitedir}/ldap | |
150 | %{py3_sitedir}/ldapurl.py | |
151 | %{py3_sitedir}/ldif.py | |
152 | %{py3_sitedir}/__pycache__/ldapurl.cpython-*.py[co] | |
153 | %{py3_sitedir}/__pycache__/ldif.cpython-*.py[co] | |
154 | %{py3_sitedir}/python_ldap-%{version}-py*.egg-info | |
155 | %endif |