]>
Commit | Line | Data |
---|---|---|
bf356939 JR |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with doc # build the documentation | |
4 | # | |
d0b2ae9e | 5 | %define githash 29a06fa |
23c5a3f7 JR |
6 | Summary: Python LDAP client library |
7 | Name: python-ldaptor | |
8 | Version: 0.0.44 | |
9 | Release: 0.git%{githash}.0.1 | |
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 | |
17 | URL: https://github.com/antong/ldaptor | |
bf356939 JR |
18 | BuildRequires: python-distribute |
19 | BuildRequires: rpm-pythonprov | |
20 | BuildRequires: rpmbuild(macros) >= 1.219 | |
21 | %if %{with doc} | |
23c5a3f7 JR |
22 | BuildRequires: dia |
23 | BuildRequires: docbook-slides | |
24 | BuildRequires: docbook-style-xsl | |
25 | BuildRequires: epydoc | |
26 | BuildRequires: libxslt | |
27 | BuildRequires: python-docutils | |
28 | BuildRequires: source-highlight | |
bf356939 JR |
29 | %endif |
30 | Requires: python-modules | |
23c5a3f7 JR |
31 | Requires: python-TwistedCore |
32 | Requires: python-TwistedNames | |
33 | Requires: python-pyparsing | |
34 | Requires: python-twisted-mail | |
35 | Requires: python-zope-interface | |
36 | BuildArch: noarch | |
37 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
38 | ||
39 | %description | |
40 | Ldaptor is LDAP library written in pure Python. The library implements | |
41 | LDAP client logic, separately-accessible LDAP and BER protocol message | |
42 | generation and parsing, ASCII format LDAP filter generation and | |
43 | parsing, LDIF format data generation, and Samba password changing | |
44 | logic. | |
45 | ||
46 | %package doc | |
47 | Summary: Documentation for python-ldaptor package | |
48 | Group: Libraries/Python | |
49 | Requires: %{name} = %{version}-%{release} | |
50 | ||
51 | %description doc | |
52 | The package contains documentation for python-ldaptor package. | |
53 | ||
54 | %package tools | |
55 | Summary: Ldaptor command line utilities | |
56 | Group: Libraries/Python | |
57 | Requires: %{name} = %{version}-%{release} | |
58 | ||
59 | %description tools | |
60 | The package contains command line utilities build upon python-ldaptor | |
61 | library. | |
62 | ||
63 | ||
64 | %prep | |
65 | %setup -q -n ldaptor-%{githash} | |
66 | # remove deprecated web interface | |
67 | rm -rf ldaptor/apps | |
68 | rm -rf ldaptor/weave.* | |
69 | rm -rf ldaptor/test/web/ | |
70 | rm -f ldaptor/test/test_webui.* | |
71 | %patch0 -p1 | |
72 | %patch1 -p1 | |
73 | ||
74 | %build | |
bf356939 | 75 | %{__python} setup.py build |
23c5a3f7 | 76 | |
bf356939 JR |
77 | %if %{with doc} |
78 | %{__make} -C doc | |
23c5a3f7 | 79 | epydoc -o doc/api --name Ldaptor ldaptor --exclude 'ldaptor\.test\.' --simple-term |
bf356939 | 80 | %endif |
23c5a3f7 JR |
81 | |
82 | %install | |
83 | rm -rf $RPM_BUILD_ROOT | |
bf356939 | 84 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/ldaptor |
23c5a3f7 JR |
85 | |
86 | %{__python} setup.py install \ | |
87 | --root $RPM_BUILD_ROOT | |
88 | ||
bf356939 JR |
89 | # library system-wide configuration and schema |
90 | install -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/ldaptor | |
91 | install -p ldaptor.schema $RPM_BUILD_ROOT%{_sysconfdir}/ldaptor | |
23c5a3f7 JR |
92 | |
93 | %clean | |
94 | rm -rf $RPM_BUILD_ROOT | |
95 | ||
96 | %files | |
97 | %defattr(644,root,root,755) | |
bf356939 | 98 | %doc TODO README.md |
23c5a3f7 JR |
99 | %dir %{_sysconfdir}/ldaptor |
100 | %config(noreplace) %{_sysconfdir}/ldaptor/global.cfg | |
bf356939 | 101 | %{_sysconfdir}/ldaptor/ldaptor.schema |
23c5a3f7 JR |
102 | %{py_sitescriptdir}/ldaptor-0.0.0-py2.7.egg-info |
103 | %{py_sitescriptdir}/ldaptor | |
104 | ||
bf356939 | 105 | %if %{with doc} |
23c5a3f7 JR |
106 | %files doc |
107 | %defattr(644,root,root,755) | |
bf356939 JR |
108 | %doc doc/addressbook-slides/ |
109 | %doc doc/api/ | |
110 | %doc doc/examples/ | |
111 | %doc doc/ldap-intro/ | |
112 | %endif | |
23c5a3f7 JR |
113 | |
114 | %files tools | |
115 | %defattr(644,root,root,755) | |
116 | %attr(755,root,root) %{_bindir}/ldaptor-* |