%global checkout_date 20140909 %global checkout_hash c30f30d9 %global hash c30f30d9f8e3fe0d07f13a2076323addccb9ff6a %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} %global required_modules pyparsing python-twisted-core python-twisted-names python-twisted-mail python-zope-interface Name: python-ldaptor Version: 0.0.44 # cruft from the past, it does not respect the guidelines !!! Release: 6.%{checkout_date}git%{checkout_hash}%{?dist} Summary: Python LDAP client library License: LGPLv2 URL: https://github.com/twised/ldaptor # Upstream does not provide release tarballs, the source code can be obtained # from upstream GitHub repository: # wget https://github.com/twisted/ldaptor/tarball/%%{checkout_hash}.tar.gz -o twisted-%{name}-%{checkout_hash}.tar.gz Source0: twisted-ldaptor-%{checkout_hash}.tar.gz Source1: global.cfg BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-setuptools Requires: %{required_modules} %description Ldaptor is LDAP library written in pure Python. The library implements LDAP client logic, separately-accessible LDAP and BER protocol message generation and parsing, ASCII format LDAP filter generation and parsing, LDIF format data generation, and Samba password changing logic. %package doc Summary: Documentation for python-ldaptor package BuildRequires: dia libxslt docbook-style-xsl docbook-slides source-highlight epydoc python-docutils BuildRequires: %{required_modules} %description doc The package contains documentation for python-ldaptor package. %package tools Summary: Ldaptor command line utilities Requires: %{name} = %{version}-%{release} %description tools The package contains command line utilities build upon python-ldaptor library. %prep %setup -q -n ldaptor-%{hash} sed -i 's/cairo-alpha-//' doc/Makefile # remove deprecated web interface rm -rf ldaptor/apps rm -rf ldaptor/weave.* rm -rf ldaptor/test/web/ rm -f ldaptor/test/test_webui.* %build make -C doc epydoc -o doc/api --name Ldaptor ldaptor --exclude 'ldaptor\.test\.' --simple-term %install %{__python2} setup.py install --root %{buildroot} # library system-wide configuration mkdir -p %{buildroot}%{_sysconfdir} install -d -m 0755 %{buildroot}%{_sysconfdir}/ldaptor install -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/ldaptor/ # shared data mkdir -p %{buildroot}%{_datadir} install -d -m 0755 %{buildroot}%{_datadir}/%{name} install -m 0644 ldaptor.schema %{buildroot}%{_datadir}/%{name}/ # fix permissions on executable files in the library chmod a+x %{buildroot}%{python2_sitelib}/ldaptor/ldapfilter.py # install documentation mkdir -p %{buildroot}%{_docdir} install -d -m 0755 %{buildroot}%{_pkgdocdir} for docdir in addressbook-slides api examples ldap-intro; do cp -r doc/$docdir %{buildroot}%{_pkgdocdir}/ done # make *.py files in documentation not executable, rename to avoid byte-compilation mv %{buildroot}%{_pkgdocdir}/examples/ldif2ldif{,.py} for pyfile in $(find %{buildroot}%{_pkgdocdir}/examples -name "*.py"); do chmod a-x $pyfile mv $pyfile $pyfile.example done %files %doc LICENSE TODO README.md %exclude %{_pkgdocdir}/*/ %dir %{_sysconfdir}/ldaptor %config(noreplace) %{_sysconfdir}/ldaptor/global.cfg %{_datadir}/%{name}/ %{python2_sitelib}/ldaptor-0.0.*-py?.?.egg-info %{python2_sitelib}/ldaptor %files doc %doc %{_pkgdocdir}/addressbook-slides/ %doc %{_pkgdocdir}/api/ %doc %{_pkgdocdir}/examples/ %doc %{_pkgdocdir}/ldap-intro/ %files tools %{_bindir}/ldaptor-* %changelog * Fri Sep 12 2014 Haïkel Guémar - 0.0.44-6.20140909gitc30f30d9 - Use twisted fork + various bug fixes * Mon Sep 02 2013 Jan Vcelak 0.0.44-4.20120515git29a06fa - use unversioned documentation directory, resolves #994059 * Sun Aug 04 2013 Fedora Release Engineering - 0.0.44-3.20120515git29a06fa - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Thu Feb 14 2013 Fedora Release Engineering - 0.0.44-2.20120515git29a06fa - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild * Mon Aug 06 2012 Jan Vcelak 0.0.44-1.20120515git29a06fa - initial package