]>
Commit | Line | Data |
---|---|---|
bf356939 JR |
1 | # |
2 | # Conditional build: | |
f16cc43f | 3 | %bcond_without doc # build the documentation |
bf356939 | 4 | # |
d0b2ae9e | 5 | %define githash 29a06fa |
23c5a3f7 JR |
6 | Summary: Python LDAP client library |
7 | Name: python-ldaptor | |
8 | Version: 0.0.44 | |
41370791 | 9 | Release: 0.git%{githash}.1 |
23c5a3f7 JR |
10 | License: LGPLv2 |
11 | Group: Libraries/Python | |
12 | Source0: https://codeload.github.com/antong/ldaptor/tar.gz/%{githash}?/python-ldaptor-%{version}.%{githash}.tar.gz | |
13 | # Source0-md5: eace8cf1dc3f7061051b019444d57ca6 | |
14 | Source1: global.cfg | |
15 | Patch0: %{name}-remove-webui.patch | |
16 | Patch1: %{name}-doc-paths.patch | |
06f90a4b JR |
17 | Patch2: deprecated-exception.patch |
18 | Patch3: module-typo.patch | |
19 | Patch4: sasl.patch | |
20 | Patch5: starttls-fix.patch | |
21 | Patch6: unicode.patch | |
22 | Patch7: abandon.patch | |
23c5a3f7 | 23 | URL: https://github.com/antong/ldaptor |
bf356939 JR |
24 | BuildRequires: python-distribute |
25 | BuildRequires: rpm-pythonprov | |
26 | BuildRequires: rpmbuild(macros) >= 1.219 | |
27 | %if %{with doc} | |
23c5a3f7 JR |
28 | BuildRequires: dia |
29 | BuildRequires: docbook-slides | |
30 | BuildRequires: docbook-style-xsl | |
31 | BuildRequires: epydoc | |
32 | BuildRequires: libxslt | |
33 | BuildRequires: python-docutils | |
34 | BuildRequires: source-highlight | |
bf356939 | 35 | %endif |
547945a3 | 36 | Requires: Zope-Interface |
f16cc43f | 37 | Requires: python-Crypto |
23c5a3f7 | 38 | Requires: python-TwistedCore |
f16cc43f | 39 | Requires: python-TwistedCore-ssl |
547945a3 | 40 | Requires: python-TwistedMail |
23c5a3f7 | 41 | Requires: python-TwistedNames |
f16cc43f JR |
42 | Requires: python-modules |
43 | Requires: python-pyOpenSSL | |
44 | Requires: python-pyparsing | |
23c5a3f7 JR |
45 | BuildArch: noarch |
46 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
47 | ||
48 | %description | |
49 | Ldaptor is LDAP library written in pure Python. The library implements | |
50 | LDAP client logic, separately-accessible LDAP and BER protocol message | |
51 | generation and parsing, ASCII format LDAP filter generation and | |
52 | parsing, LDIF format data generation, and Samba password changing | |
53 | logic. | |
54 | ||
55 | %package doc | |
56 | Summary: Documentation for python-ldaptor package | |
57 | Group: Libraries/Python | |
58 | Requires: %{name} = %{version}-%{release} | |
59 | ||
60 | %description doc | |
61 | The package contains documentation for python-ldaptor package. | |
62 | ||
63 | %package tools | |
64 | Summary: Ldaptor command line utilities | |
65 | Group: Libraries/Python | |
66 | Requires: %{name} = %{version}-%{release} | |
67 | ||
68 | %description tools | |
69 | The package contains command line utilities build upon python-ldaptor | |
70 | library. | |
71 | ||
23c5a3f7 JR |
72 | %prep |
73 | %setup -q -n ldaptor-%{githash} | |
23c5a3f7 JR |
74 | %patch0 -p1 |
75 | %patch1 -p1 | |
06f90a4b JR |
76 | %patch2 -p1 |
77 | %patch3 -p1 | |
78 | %patch4 -p1 | |
79 | %patch5 -p1 | |
80 | %patch6 -p1 | |
81 | %patch7 -p1 | |
23c5a3f7 | 82 | |
41370791 JR |
83 | # remove deprecated web interface |
84 | %{__rm} -r ldaptor/{apps,weave.*,test/{web,test_webui.*}} | |
85 | ||
f16cc43f JR |
86 | %{__sed} -i -e 's|/usr/share/xml|/usr/share/sgml|g' doc/Makefile doc/slides-driver.xsl |
87 | ||
23c5a3f7 | 88 | %build |
16532a5d | 89 | %py_build |
23c5a3f7 | 90 | |
bf356939 JR |
91 | %if %{with doc} |
92 | %{__make} -C doc | |
23c5a3f7 | 93 | epydoc -o doc/api --name Ldaptor ldaptor --exclude 'ldaptor\.test\.' --simple-term |
bf356939 | 94 | %endif |
23c5a3f7 JR |
95 | |
96 | %install | |
97 | rm -rf $RPM_BUILD_ROOT | |
bf356939 | 98 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/ldaptor |
23c5a3f7 | 99 | |
16532a5d | 100 | %py_install \ |
23c5a3f7 JR |
101 | --root $RPM_BUILD_ROOT |
102 | ||
bf356939 JR |
103 | # library system-wide configuration and schema |
104 | install -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/ldaptor | |
105 | install -p ldaptor.schema $RPM_BUILD_ROOT%{_sysconfdir}/ldaptor | |
23c5a3f7 JR |
106 | |
107 | %clean | |
108 | rm -rf $RPM_BUILD_ROOT | |
109 | ||
110 | %files | |
111 | %defattr(644,root,root,755) | |
bf356939 | 112 | %doc TODO README.md |
23c5a3f7 JR |
113 | %dir %{_sysconfdir}/ldaptor |
114 | %config(noreplace) %{_sysconfdir}/ldaptor/global.cfg | |
bf356939 | 115 | %{_sysconfdir}/ldaptor/ldaptor.schema |
23c5a3f7 JR |
116 | %{py_sitescriptdir}/ldaptor-0.0.0-py2.7.egg-info |
117 | %{py_sitescriptdir}/ldaptor | |
118 | ||
bf356939 | 119 | %if %{with doc} |
23c5a3f7 JR |
120 | %files doc |
121 | %defattr(644,root,root,755) | |
41370791 JR |
122 | %doc doc/addressbook-slides |
123 | %doc doc/api | |
124 | %doc doc/examples | |
125 | %doc doc/ldap-intro | |
bf356939 | 126 | %endif |
23c5a3f7 JR |
127 | |
128 | %files tools | |
129 | %defattr(644,root,root,755) | |
130 | %attr(755,root,root) %{_bindir}/ldaptor-* |