summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorFrederic Peters <fpeters@entrouvert.com>2004-07-22 17:00:23 +0000
committerFrederic Peters <fpeters@entrouvert.com>2004-07-22 17:00:23 +0000
commit71e99e47e30fd86b4f52e0ad61096a471f245942 (patch)
tree301f552a078c6448527ccf67436d908641bd9da7 /python
parentbc8081c0cd2378aefe1bdf69ab2a158ce9b35f5c (diff)
downloadlasso-71e99e47e30fd86b4f52e0ad61096a471f245942.tar.gz
lasso-71e99e47e30fd86b4f52e0ad61096a471f245942.tar.xz
lasso-71e99e47e30fd86b4f52e0ad61096a471f245942.zip
usage of pkg-config to get library information in configure; automake for the
python module;
Diffstat (limited to 'python')
-rw-r--r--python/Makefile.am31
-rw-r--r--python/doc/Makefile.am6
-rw-r--r--python/doc/tutorial/Makefile.am7
-rw-r--r--python/environs/Makefile.am16
-rw-r--r--python/examples/Makefile.am9
-rw-r--r--python/protocols/Makefile.am35
-rw-r--r--python/protocols/elements/Makefile.am15
-rwxr-xr-xpython/setup.py247
-rw-r--r--python/tests/Makefile.am1
-rw-r--r--python/xml/Makefile.am43
10 files changed, 163 insertions, 247 deletions
diff --git a/python/Makefile.am b/python/Makefile.am
new file mode 100644
index 00000000..7966cf03
--- /dev/null
+++ b/python/Makefile.am
@@ -0,0 +1,31 @@
+SUBDIRS = doc environs examples protocols tests xml
+
+INCLUDES = \
+ -DPACKAGE=\"@PACKAGE@\" \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/lasso \
+ $(LASSO_DEFINES) \
+ $(LASSO_CFLAGS) \
+ $(PY_CFLAGS)
+
+pythondir = $(PY_DYNLOAD)
+python_LTLIBRARIES = lassomod.la
+
+pythonspdir = $(PY_SITE_PACKAGES)
+pythonsp_DATA = lasso.py lasso_strings.py
+
+mylibs = $(top_builddir)/lasso/liblasso.la
+
+lassomod_la_LDFLAGS = -module -avoid-version -L$(top_builddir)/lasso/.libs
+lassomod_la_SOURCES = lassomod.c py_lasso.c utils.c wrap_objs.c
+lassomod_la_LIBADD = $(mylibs) \
+ ./protocols/elements/libelements.a \
+ ./protocols/libprotocols.a \
+ ./xml/libxml.a \
+ ./environs/libenvirons.a
+
+
+EXTRA_DIST = lassomod.h py_lasso.h utils.h wrap_objs.h \
+ generator_lasso_strings.py lasso.py lasso_strings.py setup.py
+
+
diff --git a/python/doc/Makefile.am b/python/doc/Makefile.am
new file mode 100644
index 00000000..d259852d
--- /dev/null
+++ b/python/doc/Makefile.am
@@ -0,0 +1,6 @@
+SUBDIRS = tutorial
+
+EXTRA_DIST = doxygen.conf pythfilter.py
+
+all:
+
diff --git a/python/doc/tutorial/Makefile.am b/python/doc/tutorial/Makefile.am
new file mode 100644
index 00000000..f484bc67
--- /dev/null
+++ b/python/doc/tutorial/Makefile.am
@@ -0,0 +1,7 @@
+EXTRA_DIST = sp-init.py \
+ sp-login-process-authn-response.py \
+ sp-login-send-authn-request.py \
+ sp-logout-process-idp-initiated-redirect-request.py \
+ sp-logout-process-idp-initiated-soap-request.py \
+ sp-logout-process-response.py \
+ sp-logout-send-request.py
diff --git a/python/environs/Makefile.am b/python/environs/Makefile.am
new file mode 100644
index 00000000..7b73a494
--- /dev/null
+++ b/python/environs/Makefile.am
@@ -0,0 +1,16 @@
+noinst_LIBRARIES = libenvirons.a
+
+INCLUDES = \
+ -DPACKAGE=\"@PACKAGE@\" \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/lasso \
+ $(LASSO_DEFINES) \
+ $(LASSO_CFLAGS) \
+ $(PY_CFLAGS) \
+ $(NULL)
+
+
+libenvirons_a_SOURCES = py_federation_termination.c py_login.c py_logout.c py_profile_context.c py_register_name_identifier.c py_server.c py_user.c
+
+EXTRA_DIST = py_federation_termination.h py_login.h py_logout.h py_profile_context.h py_register_name_identifier.h py_server.h py_user.h
+
diff --git a/python/examples/Makefile.am b/python/examples/Makefile.am
new file mode 100644
index 00000000..1d1d499f
--- /dev/null
+++ b/python/examples/Makefile.am
@@ -0,0 +1,9 @@
+EXTRA_DIST = \
+ defederation.py \
+ login.py \
+ logout-from-idp.py \
+ logout.py \
+ mapping.py \
+ registration.py \
+ test.py \
+ user.py
diff --git a/python/protocols/Makefile.am b/python/protocols/Makefile.am
new file mode 100644
index 00000000..3401e473
--- /dev/null
+++ b/python/protocols/Makefile.am
@@ -0,0 +1,35 @@
+SUBDIRS = elements
+
+INCLUDES = \
+ -DPACKAGE=\"@PACKAGE@\" \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/lasso \
+ $(LASSO_DEFINES) \
+ $(LASSO_CFLAGS) \
+ $(PY_CFLAGS) \
+ $(NULL)
+
+noinst_LIBRARIES = libprotocols.a
+
+libprotocols_a_SOURCES = \
+ py_authn_request.c \
+ py_authn_response.c \
+ py_federation_termination_notification.c \
+ py_logout_request.c \
+ py_logout_response.c \
+ py_name_identifier_mapping_request.c \
+ py_name_identifier_mapping_response.c \
+ py_register_name_identifier_request.c \
+ py_register_name_identifier_response.c
+
+EXTRA_DIST = \
+ py_authn_request.h \
+ py_authn_response.h \
+ py_federation_termination_notification.h \
+ py_logout_request.h \
+ py_logout_response.h \
+ py_name_identifier_mapping_request.h \
+ py_name_identifier_mapping_response.h \
+ py_register_name_identifier_request.h \
+ py_register_name_identifier_response.h
+
diff --git a/python/protocols/elements/Makefile.am b/python/protocols/elements/Makefile.am
new file mode 100644
index 00000000..047fede8
--- /dev/null
+++ b/python/protocols/elements/Makefile.am
@@ -0,0 +1,15 @@
+noinst_LIBRARIES = libelements.a
+
+INCLUDES = \
+ -DPACKAGE=\"@PACKAGE@\" \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/lasso \
+ $(LASSO_DEFINES) \
+ $(LASSO_CFLAGS) \
+ $(PY_CFLAGS) \
+ $(NULL)
+
+noinst_LIBRARIES = libelements.a
+libelements_a_SOURCES = py_assertion.c py_authentication_statement.c
+
+EXTRA_DIST = py_assertion.h py_authentication_statement.h
diff --git a/python/setup.py b/python/setup.py
deleted file mode 100755
index c4113974..00000000
--- a/python/setup.py
+++ /dev/null
@@ -1,247 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# $Id$
-#
-# PyLasso - Python bindings for Lasso library
-#
-# Copyright (C) 2004 Entr'ouvert
-# http://lasso.entrouvert.org
-#
-# Author: Valéry Febvre <vfebvre@easter-eggs.com>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-__doc__ = """Python bindings for Lasso Library
-
-PyLasso is a set of Python bindings for Lasso Library.
-"""
-
-classifiers = """\
-Development Status :: 2 - Pre-Alpha
-Intended Audience :: Developers
-License :: OSI Approved :: GNU General Public License (GPL)
-Operating System :: POSIX
-Programming Language :: C
-Programming Language :: Python
-Topic :: Software Development :: Libraries :: Python Modules
-"""
-
-from distutils.core import setup, Extension
-import sys, commands
-
-# check python version
-if not hasattr(sys, 'version_info') or sys.version_info < (2,2):
- raise SystemExit, "PyLasso requires Python version 2.2 or above."
-
-# sanity check for any arguments
-if len(sys.argv) == 1:
- msg = 'Choose an action :\n' \
- ' 1. Build module\n' \
- ' 2. Build documentation\n' \
- ' 3. Install\n' \
- ' 4. Clean\n' \
- ' 5. Exit\n' \
- 'Your choice : '
- reply = raw_input(msg)
- choice = None
- if reply:
- choice = reply[0]
- if choice == '1':
- sys.argv.append('build')
- elif choice == '2':
- print commands.getoutput('doxygen doc/doxygen.conf')
- sys.exit(0)
- elif choice == '3':
- sys.argv.append('install')
- elif choice == '4':
- sys.argv.append('clean')
- sys.argv.append('-a')
- elif choice == '5':
- sys.exit(0)
-
-# the crypto engine name : openssl, gnutls or nss
-xmlsec1_crypto = "openssl"
-if 'build' in sys.argv:
- msg = '\nChoose a crypto engine :\n' \
- ' 1. OpenSSL\n' \
- ' 2. GnuTLS\n' \
- ' 3. NSS\n' \
- 'Your choice : '
- reply = raw_input(msg)
- choice = None
- if reply:
- choice = reply[0]
- if choice == '1':
- xmlsec1_crypto = "openssl"
- elif choice == '2':
- xmlsec1_crypto = "gnutls"
- elif choice == '3':
- xmlsec1_crypto = "nss"
-
-define_macros = []
-include_dirs = []
-library_dirs = []
-libraries = []
-
-def extract_cflags(cflags):
- global define_macros, include_dirs
- list = cflags.split(' ')
- for flag in list:
- if flag == '':
- continue
- flag = flag.replace("\\\"", "")
- if flag[:2] == "-I":
- if flag[2:] not in include_dirs:
- include_dirs.append(flag[2:])
- elif flag[:2] == "-D":
- t = tuple(flag[2:].split('='))
- if t not in define_macros:
- define_macros.append(t)
- else:
- print "Warning : cflag %s skipped" % flag
-
-def extract_libs(libs):
- global library_dirs, libraries
- list = libs.split(' ')
- for flag in list:
- if flag == '':
- continue
- if flag[:2] == "-l":
- if flag[2:] not in libraries:
- libraries.append(flag[2:])
- elif flag[:2] == "-L":
- if flag[2:] not in library_dirs:
- library_dirs.append(flag[2:])
- else:
- print "Warning : linker flag %s skipped" % flag
-
-# GObject
-gobject_cflags = commands.getoutput('pkg-config gobject-2.0 --cflags')
-if gobject_cflags[:2] not in ["-I", "-D"]:
- print "Error : cannot get GObject pre-processor and compiler flags"
-
-gobject_libs = commands.getoutput('pkg-config gobject-2.0 --libs')
-if gobject_libs[:2] not in ["-l", "-L"]:
- print "Error : cannot get GObject linker flags"
-
-# LibXML2
-libxml2_cflags = commands.getoutput('pkg-config libxml-2.0 --cflags')
-if libxml2_cflags[:2] not in ["-I", "-D"]:
- libxml2_cflags = commands.getoutput('xml2-config --cflags')
-if libxml2_cflags[:2] not in ["-I", "-D"]:
- print "Error : cannot get LibXML2 pre-processor and compiler flags"
-
-libxml2_libs = commands.getoutput('pkg-config libxml-2.0 --libs')
-if libxml2_libs[:2] not in ["-l", "-L"]:
- libxml2_libs = commands.getoutput('xml2-config --libs')
-if libxml2_libs[:2] not in ["-l", "-L"]:
- print "Error : cannot get LibXML2 linker flags"
-
-# XMLSec1
-cmd = 'pkg-config xmlsec1-%s --cflags' % xmlsec1_crypto
-xmlsec1_cflags = commands.getoutput(cmd)
-if xmlsec1_cflags[:2] not in ["-I", "-D"]:
- cmd = 'xmlsec1-config --cflags --crypto=%s' % xmlsec1_crypto
- xmlsec1_cflags = commands.getoutput(cmd)
-if xmlsec1_cflags[:2] not in ["-I", "-D"]:
- print "Error : cannot get XMLSec1 pre-processor and compiler flags"
-
-cmd = 'pkg-config xmlsec1-%s --libs' % xmlsec1_crypto
-xmlsec1_libs = commands.getoutput(cmd)
-if xmlsec1_libs[:2] not in ["-l", "-L"]:
- cmd = 'xmlsec1-config --libs --crypto=%s' % xmlsec1_crypto
- xmlsec1_libs = commands.getoutput(cmd)
-if xmlsec1_libs[:2] not in ["-l", "-L"]:
- print "Error : cannot get XMLSec1 linker flags"
-
-#print gobject_cflags
-#print gobject_libs
-#print libxml2_cflags
-#print libxml2_libs
-#print xmlsec1_cflags
-#print xmlsec1_libs
-
-extract_cflags(gobject_cflags)
-extract_libs(gobject_libs)
-
-extract_cflags(libxml2_cflags)
-extract_libs(libxml2_libs)
-
-extract_cflags(xmlsec1_cflags)
-extract_libs(xmlsec1_libs)
-
-# FIXME : cflags & libs for lasso
-include_dirs.append('..')
-library_dirs.append('../lasso/.libs')
-#include_dirs.append('/usr/local/include')
-#library_dirs.append('/usr/local/lib')
-libraries.append('lasso')
-
-em = Extension("lassomod",
- sources = ["py_lasso.c",
- "xml/py_xml.c",
- "xml/py_lib_authentication_statement.c",
- "xml/py_lib_authn_request.c",
- "xml/py_lib_federation_termination_notification.c",
- "xml/py_lib_logout_request.c",
- "xml/py_lib_logout_response.c",
- "xml/py_lib_name_identifier_mapping_request.c",
- "xml/py_lib_name_identifier_mapping_response.c",
- "xml/py_lib_register_name_identifier_request.c",
- "xml/py_saml_assertion.c",
- "xml/py_saml_authentication_statement.c",
- "xml/py_saml_name_identifier.c",
- "xml/py_samlp_response.c",
- "protocols/py_authn_request.c",
- "protocols/py_authn_response.c",
- "protocols/py_federation_termination_notification.c",
- "protocols/py_logout_request.c",
- "protocols/py_logout_response.c",
- "protocols/py_name_identifier_mapping_request.c",
- "protocols/py_name_identifier_mapping_response.c",
- "protocols/py_register_name_identifier_request.c",
- "protocols/py_register_name_identifier_response.c",
- "protocols/elements/py_assertion.c",
- "protocols/elements/py_authentication_statement.c",
- "environs/py_federation_termination.c",
- "environs/py_login.c",
- "environs/py_logout.c",
- "environs/py_profile_context.c",
- "environs/py_register_name_identifier.c",
- "environs/py_server.c",
- "environs/py_user.c",
- "lassomod.c",
- "utils.c", "wrap_objs.c"],
- define_macros = define_macros,
- include_dirs = include_dirs,
- library_dirs = library_dirs,
- libraries = libraries
- )
-
-doclines = __doc__.split("\n")
-
-setup(name = "pylasso",
- version = "0.0.1",
- description = doclines[0],
- long_description = "\n" . join(doclines[2:]),
- author = "Valery Febvre",
- author_email = "vfebvre@easter-eggs.com",
- license = "GNU GPL",
- platforms = ["any"],
- url = "http://lasso.entrouvert.org",
- ext_modules = [em],
- py_modules = ["lasso", "lasso_strings"]
-)
diff --git a/python/tests/Makefile.am b/python/tests/Makefile.am
new file mode 100644
index 00000000..0fa3d172
--- /dev/null
+++ b/python/tests/Makefile.am
@@ -0,0 +1 @@
+EXTRA_DIST = login_tests.py tests.py
diff --git a/python/xml/Makefile.am b/python/xml/Makefile.am
new file mode 100644
index 00000000..9a3fffed
--- /dev/null
+++ b/python/xml/Makefile.am
@@ -0,0 +1,43 @@
+noinst_LIBRARIES = libxml.a
+
+INCLUDES = \
+ -DPACKAGE=\"@PACKAGE@\" \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/lasso \
+ $(LASSO_DEFINES) \
+ $(LASSO_CFLAGS) \
+ $(PY_CFLAGS) \
+ $(NULL)
+
+noinst_LIBRARIES = libxml.a
+
+libxml_a_SOURCES = \
+ py_lib_authentication_statement.c \
+ py_lib_authn_request.c \
+ py_lib_federation_termination_notification.c \
+ py_lib_logout_request.c \
+ py_lib_logout_response.c \
+ py_lib_name_identifier_mapping_request.c \
+ py_lib_name_identifier_mapping_response.c \
+ py_lib_register_name_identifier_request.c \
+ py_saml_assertion.c \
+ py_saml_authentication_statement.c \
+ py_saml_name_identifier.c \
+ py_samlp_response.c \
+ py_xml.c
+
+EXTRA_DIST = \
+ py_lib_authentication_statement.h \
+ py_lib_authn_request.h \
+ py_lib_federation_termination_notification.h \
+ py_lib_logout_request.h \
+ py_lib_logout_response.h \
+ py_lib_name_identifier_mapping_request.h \
+ py_lib_name_identifier_mapping_response.h \
+ py_lib_register_name_identifier_request.h \
+ py_saml_assertion.h \
+ py_saml_authentication_statement.h \
+ py_saml_name_identifier.h \
+ py_samlp_response.h \
+ py_xml.h
+