[packages/python-ldaptor] - new, adapterized import from fedora

baggins baggins at pld-linux.org
Tue Jan 7 19:49:35 CET 2014


commit 23c5a3f75f91486d28137d046a317034aead7a77
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Tue Jan 7 19:49:05 2014 +0100

    - new, adapterized import from fedora

 global.cfg                        |   6 ++
 python-ldaptor-doc-paths.patch    |  52 +++++++++++
 python-ldaptor-remove-webui.patch | 190 ++++++++++++++++++++++++++++++++++++++
 python-ldaptor.spec               | 124 +++++++++++++++++++++++++
 4 files changed, 372 insertions(+)
---
diff --git a/python-ldaptor.spec b/python-ldaptor.spec
new file mode 100644
index 0000000..44a6e4c
--- /dev/null
+++ b/python-ldaptor.spec
@@ -0,0 +1,124 @@
+%global		githash		29a06fa
+
+Summary:	Python LDAP client library
+Name:		python-ldaptor
+Version:	0.0.44
+Release:	0.git%{githash}.0.1
+License:	LGPLv2
+Group:		Libraries/Python
+Source0:	https://codeload.github.com/antong/ldaptor/tar.gz/%{githash}?/python-ldaptor-%{version}.%{githash}.tar.gz
+# Source0-md5:	eace8cf1dc3f7061051b019444d57ca6
+Source1:	global.cfg
+Patch0:		%{name}-remove-webui.patch
+Patch1:		%{name}-doc-paths.patch
+URL:		https://github.com/antong/ldaptor
+BuildRequires:	python-devel
+BuildRequires:	dia
+BuildRequires:	docbook-slides
+BuildRequires:	docbook-style-xsl
+BuildRequires:	epydoc
+BuildRequires:	libxslt
+BuildRequires:	python-docutils
+BuildRequires:	source-highlight
+Requires:	python-TwistedCore
+Requires:	python-TwistedNames
+Requires:	python-pyparsing
+Requires:	python-twisted-mail
+Requires:	python-zope-interface
+BuildArch:	noarch
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%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
+Group:		Libraries/Python
+Requires:	%{name} = %{version}-%{release}
+
+%description doc
+The package contains documentation for python-ldaptor package.
+
+%package tools
+Summary:	Ldaptor command line utilities
+Group:		Libraries/Python
+Requires:	%{name} = %{version}-%{release}
+
+%description tools
+The package contains command line utilities build upon python-ldaptor
+library.
+
+
+%prep
+%setup -q -n ldaptor-%{githash}
+# remove deprecated web interface
+rm -rf ldaptor/apps
+rm -rf ldaptor/weave.*
+rm -rf ldaptor/test/web/
+rm -f ldaptor/test/test_webui.*
+%patch0 -p1
+%patch1 -p1
+
+%build
+%{__make} -C doc
+
+epydoc -o doc/api --name Ldaptor ldaptor --exclude 'ldaptor\.test\.' --simple-term
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__python} setup.py install \
+	--root $RPM_BUILD_ROOT
+
+# library system-wide configuration
+install -d $RPM_BUILD_ROOT%{_sysconfdir}/ldaptor
+install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/ldaptor/
+
+# shared data
+install -d $RPM_BUILD_ROOT%{_datadir}/%{name}
+install ldaptor.schema $RPM_BUILD_ROOT%{_datadir}/%{name}/
+
+# fix permissions on executable files in the library
+chmod a+x $RPM_BUILD_ROOT%{py_sitescriptdir}/ldaptor/ldapfilter.py
+
+# install documentation
+install -d $RPM_BUILD_ROOT%{_docdir}
+install -d $RPM_BUILD_ROOT%{_pkgdocdir}
+for docdir in addressbook-slides api examples ldap-intro; do
+	cp -r doc/$docdir $RPM_BUILD_ROOT%{_pkgdocdir}/
+done
+
+# make *.py files in documentation not executable, rename to avoid byte-compilation
+mv $RPM_BUILD_ROOT%{_pkgdocdir}/examples/ldif2ldif{,.py}
+for pyfile in $(find $RPM_BUILD_ROOT%{_pkgdocdir}/examples -name "*.py"); do
+	chmod a-x $pyfile
+	mv $pyfile $pyfile.example
+done
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc COPYING TODO README.md
+%exclude %{_pkgdocdir}/*/
+%dir %{_sysconfdir}/ldaptor
+%config(noreplace) %{_sysconfdir}/ldaptor/global.cfg
+%{_datadir}/%{name}/
+%{py_sitescriptdir}/ldaptor-0.0.0-py2.7.egg-info
+%{py_sitescriptdir}/ldaptor
+
+%files doc
+%defattr(644,root,root,755)
+%doc %{_pkgdocdir}/addressbook-slides/
+%doc %{_pkgdocdir}/api/
+%doc %{_pkgdocdir}/examples/
+%doc %{_pkgdocdir}/ldap-intro/
+
+%files tools
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/ldaptor-*
diff --git a/global.cfg b/global.cfg
new file mode 100644
index 0000000..90dee1c
--- /dev/null
+++ b/global.cfg
@@ -0,0 +1,6 @@
+#
+# This is the global configuration file for the python-ldaptor library
+# User specific options can be placed in ~/.ldaptor/global.cfg
+#
+# example: /usr/share/doc/python-ldaptor-*/examples/global.cfg
+#
diff --git a/python-ldaptor-doc-paths.patch b/python-ldaptor-doc-paths.patch
new file mode 100644
index 0000000..38c8e98
--- /dev/null
+++ b/python-ldaptor-doc-paths.patch
@@ -0,0 +1,52 @@
+Update paths in documentation source files for compilation on newest Fedora.
+
+Author: Jan Vcelak <jvcelak at redhat.com>
+
+diff --git a/doc/Makefile b/doc/Makefile
+index aba2c84..3896f44 100644
+--- a/doc/Makefile
++++ b/doc/Makefile
+@@ -38,7 +38,7 @@ rsync: $(GENERATED)
+ $(DOCBOOK:%.xml=%/index.html): %/index.html: %.xml
+ 	install -d -m0755 '$(@D)'
+ 	xsltproc  --nonet \
+-		/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/xhtml/docbook.xsl \
++		/usr/share/sgml/docbook/xsl-stylesheets/xhtml/docbook.xsl \
+ 		$< \
+ 		>$@.tmp
+ 	mv $@.tmp $@
+@@ -110,8 +110,8 @@ $(SLIDES:%.xml=%/index.html): %/index.html: %.xml \
+ 	addressbook-slides/07_easy/searchform-xhtml.html \
+ 	addressbook-slides/07_easy/addressbook-tac.html
+ 	install -d -m0755 '$(@D)'
+-	cp -ar /usr/share/sgml/docbook/custom/slides/3.2.0/graphics '$(@D)'
+-	cp -ar /usr/share/sgml/docbook/custom/slides/3.2.0/browser '$(@D)'
++	cp -ar /usr/share/xml/docbook/slides/3.4.0/graphics '$(@D)'
++	cp -ar /usr/share/xml/docbook/slides/3.4.0/browser '$(@D)'
+ 	patch '$(@D)/browser/overlay.js' <overlay.js.patch
+ 	cp $(DIAPNG) '$(@D)'
+ 	cp slide-style.css '$(@D)'
+diff --git a/doc/ldap-intro.xml b/doc/ldap-intro.xml
+index 421ffd7..32758bb 100644
+--- a/doc/ldap-intro.xml
++++ b/doc/ldap-intro.xml
+@@ -1,5 +1,5 @@
+ <?xml version='1.0'?>
+-<!DOCTYPE book PUBLIC "-//Norman Walsh//DTD DocBk XML V4.2//EN" "/usr/share/sgml/docbook/dtd/xml/4.2/docbookx.dtd" [
++<!DOCTYPE book PUBLIC "-//Norman Walsh//DTD DocBk XML V4.2//EN" "/usr/share/sgml/docbook/xml-dtd-4.2/docbookx.dtd" [
+ 
+ <!ENTITY ldapentry_vs_oo SYSTEM "ldapentry-vs-oo.xml">
+ <!ENTITY search_inputs SYSTEM "search-inputs.xml">
+diff --git a/doc/slides-driver.xsl b/doc/slides-driver.xsl
+index e9fcbf3..2fc965d 100644
+--- a/doc/slides-driver.xsl
++++ b/doc/slides-driver.xsl
+@@ -1,7 +1,7 @@
+ <?xml version="1.0"?>
+ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+ 
+-  <xsl:import href="/usr/share/xml/docbook/custom/slides/3.3.1/xsl/xhtml/default.xsl"/>
++  <xsl:import href="/usr/share/xml/docbook/slides/3.4.0/xsl/xhtml/default.xsl"/>
+   <!-- xsl:import href="slides/xsl/default.xsl"/ -->
+ 
+   <xsl:param name="keyboard.nav">1</xsl:param>
diff --git a/python-ldaptor-remove-webui.patch b/python-ldaptor-remove-webui.patch
new file mode 100644
index 0000000..bcee499
--- /dev/null
+++ b/python-ldaptor-remove-webui.patch
@@ -0,0 +1,190 @@
+Remove webui from setup scripts. The webui is no longer maintained and depends
+on deprecated functions of python-twister-web.
+
+Author: Jan Vcelak <jvcelak at redhat.com>
+
+diff --git a/setup.py b/setup.py
+index cb3246c..d54bad4 100755
+--- a/setup.py
++++ b/setup.py
+@@ -2,125 +2,9 @@
+ 
+ import os, errno
+ from distutils.core import setup
+-from distutils import sysconfig, cmd
+-from distutils.command.build import build as _build
+-from distutils.command.clean import clean as _clean
+-from distutils.command.install import install as _install
+-from distutils.util import change_root
+-from distutils.dir_util import remove_tree, copy_tree, mkpath
+-
+-# quick hack to support generating locale files
+-class build(_build):
+-    def __init__(self, *a, **kw):
+-        self.sub_commands = self.sub_commands + [
+-            ('build_locale', None),
+-            ]
+-        _build.__init__(self, *a, **kw)
+-
+-class build_locale(cmd.Command):
+-    user_options = [
+-        ('build-dir=', 'd', "directory to build to"),
+-        ('po-dir=', 'd', "directory holding the domain dirs and in them PO-files"),
+-        ]
+-
+-    def initialize_options(self):
+-        self.build_dir = 'locale'
+-        self.build_base = None
+-        self.po_dir = 'po'
+-
+-    def finalize_options (self):
+-        self.set_undefined_options('build',
+-                                   ('build_base', 'build_base'))
+-        self.build_dir = change_root(self.build_base, self.build_dir)
+-
+-    def run(self):
+-        for domain in os.listdir(self.po_dir):
+-            try:
+-                l = os.listdir(os.path.join(self.po_dir, domain))
+-            except OSError, e:
+-                if e.errno == errno.ENOTDIR:
+-                    continue
+-                else:
+-                    raise
+-
+-            for po in l:
+-                if not po.endswith('.po'):
+-                    continue
+-                locale = po[:-len('.po')]
+-                path = os.path.join(self.build_dir,
+-                                    locale,
+-                                    'LC_MESSAGES')
+-                mkpath(path)
+-                self.spawn(['msgfmt', '-o',
+-                            os.path.join(path, '%s.mo' % domain),
+-                            os.path.join(self.po_dir,
+-                                         domain,
+-                                         po)])
+-class clean(_clean):
+-    def run(self):
+-        self.run_command('clean_locale')
+-        _clean.run(self)
+-
+-class clean_locale(cmd.Command):
+-    user_options = [
+-        ('build-dir=', 'd', "directory to build to"),
+-        ]
+-
+-    def initialize_options(self):
+-        self.build_dir = None
+-
+-    def finalize_options (self):
+-        self.set_undefined_options('build_locale',
+-                                   ('build_dir', 'build_dir'))
+-
+-    def run(self):
+-        if os.path.exists(self.build_dir):
+-            remove_tree(self.build_dir, dry_run=self.dry_run)
+-
+-class install(_install):
+-    def __init__(self, *a, **kw):
+-        self.sub_commands = self.sub_commands + [
+-            ('install_locale', None),
+-            ]
+-        _install.__init__(self, *a, **kw)
+-
+-class install_locale(cmd.Command):
+-    user_options = [
+-        ('install-dir=', 'd', "directory to install locales to"),
+-        ('build-dir=','b', "build directory (where to install from)"),
+-        ('skip-build', None, "skip the build steps"),
+-        ]
+-
+-    boolean_options = ['skip-build']
+-
+-    def initialize_options(self):
+-        self.build_dir = None
+-        self.install_dir = None
+-        self.root = None
+-        self.prefix = None
+-        self.skip_build = None
+-
+-    def finalize_options (self):
+-        self.set_undefined_options('build_locale',
+-                                   ('build_dir', 'build_dir'))
+-        self.set_undefined_options('install',
+-                                   ('skip_build', 'skip_build'))
+-        if self.install_dir is None:
+-            self.set_undefined_options('install',
+-                                       ('root', 'root'))
+-            self.set_undefined_options('install',
+-                                       ('prefix', 'prefix'))
+-            prefix = self.prefix
+-            if self.root is not None:
+-                prefix = change_root(self.root, prefix)
+-            self.install_dir = os.path.join(prefix, 'share', 'locale')
+-
+-    def run(self):
+-        if not self.skip_build:
+-            self.run_command('build_locale')
+-        copy_tree(src=self.build_dir,
+-                  dst=self.install_dir,
+-                  dry_run=self.dry_run)
++from distutils.command.build import build
++from distutils.command.clean import clean
++from distutils.command.install import install
+ 
+ if __name__=='__main__':
+     setup(name="ldaptor",
+@@ -151,11 +35,8 @@ from the command line.
+ 	  license="GNU LGPL",
+ 
+           cmdclass={'build': build,
+-                    'build_locale': build_locale,
+                     'clean': clean,
+-                    'clean_locale': clean_locale,
+                     'install': install,
+-                    'install_locale': install_locale,
+                     },
+ 
+ 	  packages=[
+@@ -164,12 +45,9 @@ from the command line.
+         "ldaptor.protocols.ldap",
+         "ldaptor.protocols.ldap.autofill",
+ 	"ldaptor.samba",
+-	"ldaptor.apps",
+-	"ldaptor.apps.webui",
+ 	"ldaptor.test",
+ 	],
+ 	  scripts=[
+-	"bin/ldaptor-webui",
+ 	"bin/ldaptor-ldap2dhcpconf",
+ 	"bin/ldaptor-ldap2maradns",
+ 	"bin/ldaptor-ldap2dnszones",
+@@ -184,26 +62,4 @@ from the command line.
+ 	"bin/ldaptor-fetchschema",
+         "bin/ldaptor-ldifdiff",
+         "bin/ldaptor-ldifpatch",
+-	],
+-          data_files=[
+-        (os.path.join(sysconfig.get_python_lib(), 'ldaptor/apps/webui'),
+-         [
+-        'ldaptor/apps/webui/add-really.xhtml',
+-        'ldaptor/apps/webui/add.xhtml',
+-        'ldaptor/apps/webui/basedn.xhtml',
+-        'ldaptor/apps/webui/change_password.xhtml',
+-        'ldaptor/apps/webui/change_service_passwords.xhtml',
+-        'ldaptor/apps/webui/delete-nodn.xhtml',
+-        'ldaptor/apps/webui/delete.xhtml',
+-        'ldaptor/apps/webui/edit-really.xhtml',
+-        'ldaptor/apps/webui/edit.xhtml',
+-        'ldaptor/apps/webui/login.xhtml',
+-        'ldaptor/apps/webui/mass_change_password-really.xhtml',
+-        'ldaptor/apps/webui/mass_change_password.xhtml',
+-        'ldaptor/apps/webui/move.xhtml',
+-        'ldaptor/apps/webui/search.xhtml',
+-
+-        'ldaptor/apps/webui/ldaptor.css',
+-        'ldaptor/apps/webui/skin-default.html',
+-        ]),
+         ])
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-ldaptor.git/commitdiff/23c5a3f75f91486d28137d046a317034aead7a77



More information about the pld-cvs-commit mailing list