]> git.pld-linux.org Git - packages/python-ldap.git/blob - python-ldap.spec
- updated to 3.1.0
[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.1.0
11 Release:        1
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:  35d9a3ba265137646b2a9fd3d56d675d
18 URL:            http://python-ldap.sourceforge.net/
19 BuildRequires:  cyrus-sasl >= 2.1.0
20 BuildRequires:  openldap-devel >= 2.4.6
21 %if %{with tests}
22 BuildRequires:  openldap >= 2.4.6
23 BuildRequires:  openldap-servers >= 2.4.6
24 %endif
25 %if %{with python2}
26 BuildRequires:  python-devel >= 1:2.7
27 BuildRequires:  python-modules >= 1:2.7
28 %if %{with tests}
29 BuildRequires:  python-pyasn1 >= 0.3.7
30 BuildRequires:  python-pyasn1_modules >= 0.1.5
31 %endif
32 %endif
33 %if %{with python2}
34 BuildRequires:  python3-devel >= 1:3.4
35 BuildRequires:  python3-modules >= 1:3.4
36 %if %{with tests}
37 BuildRequires:  python3-pyasn1 >= 0.3.7
38 BuildRequires:  python3-pyasn1_modules >= 0.1.5
39 %endif
40 %endif
41 BuildRequires:  rpm-pythonprov
42 BuildRequires:  rpmbuild(macros) >= 1.710
43 Requires:       python-modules >= 1:2.7
44 Provides:       ldapmodule
45 Obsoletes:      ldapmodule
46 Obsoletes:      python-ldapmodule
47 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48
49 %description
50 python-ldap provides an object-oriented API to access LDAP directory
51 servers from Python programs. Mainly it wraps the OpenLDAP client libs
52 for that purpose.
53
54 Additionally the package contains modules for other LDAP-related stuff
55 (e.g. processing LDIF, LDAPURLs, LDAPv3 sub-schema, etc.).
56
57 %description -l pl.UTF-8
58 Moduł python-ldap dostarcza zorientowane obiektowo API pozwalające na
59 dostęp do usług katalogowych LDAP z poziomu programów w Pythonie.
60 Głównie obudowuje w tym celu biblioteki klienckie OpenLDAP.
61
62 Dodatkowo pakiet zawiera moduły do innych zadań związanych z LDAP (jak
63 przetwarzanie LDIF, LDAPURL, podschematy LDAPv3 itp.).
64
65 %package -n python3-ldap
66 Summary:        LDAP client API for Python 3
67 Summary(pl.UTF-8):      API klienckie LDAP dla Pythona 3
68 Group:          Libraries/Python
69 Requires:       python3-modules >= 1:3.4
70
71 %description -n python3-ldap
72 python-ldap provides an object-oriented API to access LDAP directory
73 servers from Python programs. Mainly it wraps the OpenLDAP client libs
74 for that purpose.
75
76 Additionally the package contains modules for other LDAP-related stuff
77 (e.g. processing LDIF, LDAPURLs, LDAPv3 sub-schema, etc.).
78
79 %description -n python3-ldap -l pl.UTF-8
80 Moduł python-ldap dostarcza zorientowane obiektowo API pozwalające na
81 dostęp do usług katalogowych LDAP z poziomu programów w Pythonie.
82 Głównie obudowuje w tym celu biblioteki klienckie OpenLDAP.
83
84 Dodatkowo pakiet zawiera moduły do innych zadań związanych z LDAP (jak
85 przetwarzanie LDIF, LDAPURL, podschematy LDAPv3 itp.).
86
87 %prep
88 %setup -q
89
90 %build
91 %if %{with python2}
92 %py_build %{?with_tests:test}
93
94 %if %{with tests}
95 LDAPNOINIT=1 \
96 PYTHONPATH=$(echo build-2/lib.linux-*/) \
97 %{__python} -c "import ldap; print ldap.__version__; ldapo = ldap.initialize('ldap://localhost')"
98 %endif
99 %endif
100
101 %if %{with python3}
102 %py3_build %{?with_tests:test}
103
104 %if %{with tests}
105 LDAPNOINIT=1 \
106 PYTHONPATH=$(echo build-3/lib.linux-*/) \
107 %{__python3} -c "import ldap; print ldap.__version__; ldapo = ldap.initialize('ldap://localhost')"
108 %endif
109 %endif
110
111 %install
112 rm -rf $RPM_BUILD_ROOT
113
114 %if %{with python2}
115 %py_install
116
117 %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/slapdtest
118 %py_postclean
119 %endif
120
121 %if %{with python3}
122 %py3_install
123
124 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/slapdtest
125 %endif
126
127 %clean
128 rm -rf $RPM_BUILD_ROOT
129
130 %if %{with python2}
131 %files
132 %defattr(644,root,root,755)
133 %doc CHANGES LICENCE README TODO
134 %attr(755,root,root) %{py_sitedir}/_ldap.so
135 %{py_sitedir}/ldapurl.py[co]
136 %{py_sitedir}/ldif.py[co]
137 %{py_sitedir}/ldap
138 %{py_sitedir}/python_ldap-%{version}-py*.egg-info
139 %endif
140
141 %if %{with python3}
142 %files -n python3-ldap
143 %defattr(644,root,root,755)
144 %doc CHANGES LICENCE README TODO
145 %attr(755,root,root) %{py3_sitedir}/_ldap.cpython-*.so
146 %{py3_sitedir}/ldap
147 %{py3_sitedir}/ldapurl.py
148 %{py3_sitedir}/ldif.py
149 %{py3_sitedir}/__pycache__/ldapurl.cpython-*.py[co]
150 %{py3_sitedir}/__pycache__/ldif.cpython-*.py[co]
151 %{py3_sitedir}/python_ldap-%{version}-py*.egg-info
152 %endif
This page took 0.546379 seconds and 3 git commands to generate.