]> git.pld-linux.org Git - packages/python-ldaptor.git/blob - python-ldaptor.spec
automatic change: use py_build/py_install macros
[packages/python-ldaptor.git] / python-ldaptor.spec
1 #
2 # Conditional build:
3 %bcond_without  doc             # build the documentation
4 #
5 %define         githash         29a06fa
6 Summary:        Python LDAP client library
7 Name:           python-ldaptor
8 Version:        0.0.44
9 Release:        0.git%{githash}.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 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
23 URL:            https://github.com/antong/ldaptor
24 BuildRequires:  python-distribute
25 BuildRequires:  rpm-pythonprov
26 BuildRequires:  rpmbuild(macros) >= 1.219
27 %if %{with doc}
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
35 %endif
36 Requires:       Zope-Interface
37 Requires:       python-Crypto
38 Requires:       python-TwistedCore
39 Requires:       python-TwistedCore-ssl
40 Requires:       python-TwistedMail
41 Requires:       python-TwistedNames
42 Requires:       python-modules
43 Requires:       python-pyOpenSSL
44 Requires:       python-pyparsing
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
72 %prep
73 %setup -q -n ldaptor-%{githash}
74 %patch0 -p1
75 %patch1 -p1
76 %patch2 -p1
77 %patch3 -p1
78 %patch4 -p1
79 %patch5 -p1
80 %patch6 -p1
81 %patch7 -p1
82
83 # remove deprecated web interface
84 %{__rm} -r ldaptor/{apps,weave.*,test/{web,test_webui.*}}
85
86 %{__sed} -i -e 's|/usr/share/xml|/usr/share/sgml|g' doc/Makefile doc/slides-driver.xsl
87
88 %build
89 %py_build
90
91 %if %{with doc}
92 %{__make} -C doc
93 epydoc -o doc/api --name Ldaptor ldaptor --exclude 'ldaptor\.test\.' --simple-term
94 %endif
95
96 %install
97 rm -rf $RPM_BUILD_ROOT
98 install -d $RPM_BUILD_ROOT%{_sysconfdir}/ldaptor
99
100 %py_install \
101         --root $RPM_BUILD_ROOT
102
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
106
107 %clean
108 rm -rf $RPM_BUILD_ROOT
109
110 %files
111 %defattr(644,root,root,755)
112 %doc TODO README.md
113 %dir %{_sysconfdir}/ldaptor
114 %config(noreplace) %{_sysconfdir}/ldaptor/global.cfg
115 %{_sysconfdir}/ldaptor/ldaptor.schema
116 %{py_sitescriptdir}/ldaptor-0.0.0-py2.7.egg-info
117 %{py_sitescriptdir}/ldaptor
118
119 %if %{with doc}
120 %files doc
121 %defattr(644,root,root,755)
122 %doc doc/addressbook-slides
123 %doc doc/api
124 %doc doc/examples
125 %doc doc/ldap-intro
126 %endif
127
128 %files tools
129 %defattr(644,root,root,755)
130 %attr(755,root,root) %{_bindir}/ldaptor-*
This page took 0.059493 seconds and 3 git commands to generate.