]> git.pld-linux.org Git - packages/python-ldap.git/blob - python-ldap.spec
7a002ad74c599599efbde2483f173fdc0edf5b6a
[packages/python-ldap.git] / python-ldap.spec
1 #
2 # Conditional build:
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)
6
7 Summary:        LDAP client API for Python 2
8 Summary(pl.UTF-8):      API klienckie LDAP dla Pythona 2
9 Name:           python-ldap
10 Version:        3.3.1
11 Release:        5
12 Epoch:          1
13 License:        Python-like
14 Group:          Libraries/Python
15 #Source0Download: https://pypi.org/simple/python-ldap/
16 Source0:        https://files.pythonhosted.org/packages/source/p/python-ldap/%{name}-%{version}.tar.gz
17 # Source0-md5:  7608579722c491e42f5f63b3f88a95fb
18 URL:            http://python-ldap.sourceforge.net/
19 BuildRequires:  cyrus-sasl-devel >= 2.1.0
20 BuildRequires:  openldap-devel >= 2.4.6
21 BuildRequires:  openssl-devel
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
29 BuildRequires:  python-setuptools
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
38 BuildRequires:  python3-setuptools
39 %if %{with tests}
40 BuildRequires:  python3-pyasn1 >= 0.3.7
41 BuildRequires:  python3-pyasn1_modules >= 0.1.5
42 %endif
43 %endif
44 BuildRequires:  rpm-pythonprov
45 BuildRequires:  rpmbuild(macros) >= 1.710
46 Requires:       python-modules >= 1:2.7
47 Provides:       ldapmodule
48 Obsoletes:      ldapmodule
49 Obsoletes:      python-ldapmodule
50 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
51
52 %description
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.).
59
60 %description -l pl.UTF-8
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.).
67
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
90 %prep
91 %setup -q
92
93 %build
94 %if %{with python2}
95 %py_build %{?with_tests:test}
96
97 %if %{with tests}
98 LDAPNOINIT=1 \
99 PYTHONPATH=$(echo build-2/lib.linux-*/) \
100 %{__python} -c "import ldap; print ldap.__version__; ldapo = ldap.initialize('ldap://localhost')"
101 %endif
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
113
114 %install
115 rm -rf $RPM_BUILD_ROOT
116
117 %if %{with python2}
118 %py_install
119
120 %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/slapdtest
121 %py_postclean
122 %endif
123
124 %if %{with python3}
125 %py3_install
126
127 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/slapdtest
128 %endif
129
130 %clean
131 rm -rf $RPM_BUILD_ROOT
132
133 %if %{with python2}
134 %files
135 %defattr(644,root,root,755)
136 %doc CHANGES LICENCE README TODO
137 %attr(755,root,root) %{py_sitedir}/_ldap.so
138 %{py_sitedir}/ldapurl.py[co]
139 %{py_sitedir}/ldif.py[co]
140 %{py_sitedir}/ldap
141 %{py_sitedir}/python_ldap-%{version}-py*.egg-info
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
This page took 0.109592 seconds and 2 git commands to generate.