[packages/lasso] new, version 2.4.0
glen
glen at pld-linux.org
Tue Apr 29 17:43:30 CEST 2014
commit 5bc7eedd161053e6ed1a7ec0f17c1236ed1de18a
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Tue Apr 29 18:42:49 2014 +0300
new, version 2.4.0
based on fedora package
2a1dd4d16d0da87ee4588fc40ee696b9e45197ad
...-generators-for-parsing-of-integer-values.patch | 38 ++++
0001-Fix-java-version-detection.patch | 26 +++
...ix-liberal-use-of-casting-for-the-SNIPPET.patch | 108 +++++++++++
lasso.spec | 216 +++++++++++++++++++++
4 files changed, 388 insertions(+)
---
diff --git a/lasso.spec b/lasso.spec
new file mode 100644
index 0000000..53cd3c0
--- /dev/null
+++ b/lasso.spec
@@ -0,0 +1,216 @@
+#
+# TODO
+# - fix tests (some linkage errors)
+
+# Conditional build:
+%bcond_with wsd # wsd
+%bcond_with tests # build tests
+%bcond_without java # Java bindings
+%bcond_without php # PHP bindings
+%bcond_without perl # Perl bindings
+%bcond_without python # Python 2.x bindings
+
+Summary: Liberty Alliance Single Sign On
+Name: lasso
+Version: 2.4.0
+Release: 1
+License: GPL v2+
+Group: Libraries
+Source0: http://dev.entrouvert.org/lasso/%{name}-%{version}.tar.gz
+# Source0-md5: 3d04aaff37c816aa16f2d1bcc2639f27
+Patch1: 0001-Fix-java-version-detection.patch
+Patch2: 0001-Fix-generators-for-parsing-of-integer-values.patch
+Patch3: 0002-xml-xml.c-fix-liberal-use-of-casting-for-the-SNIPPET.patch
+URL: http://lasso.entrouvert.org/
+%{?with_wsf:BuildRequires: cyrus-sasl-devel}
+BuildRequires: glib2-devel
+BuildRequires: gtk-doc
+BuildRequires: libtool
+BuildRequires: libxml2-devel
+BuildRequires: openssl-devel
+BuildRequires: rpmbuild(macros) >= 1.315
+BuildRequires: swig
+BuildRequires: xmlsec1-devel
+BuildRequires: xmlsec1-openssl-devel
+%if %{with php}
+BuildRequires: expat-devel
+BuildRequires: php-devel
+BuildRequires: python
+%endif
+%if %{with perl}
+BuildRequires: perl(ExtUtils::MakeMaker)
+BuildRequires: perl(Test::More)
+%endif
+%if %{with java}
+BuildRequires: jdk
+BuildRequires: jpackage-utils
+%endif
+%if %{with python}
+BuildRequires: python-devel
+BuildRequires: python-lxml
+%endif
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Lasso is a library that implements the Liberty Alliance Single Sign On
+standards, including the SAML and SAML2 specifications. It allows to
+handle the whole life-cycle of SAML based Federations, and provides
+bindings for multiple languages.
+
+%package devel
+Summary: Lasso development headers and documentation
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+This package contains the header files, static libraries and
+development documentation for Lasso.
+
+%package -n perl-%{name}
+Summary: Liberty Alliance Single Sign On (lasso) Perl bindings
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description -n perl-%{name}
+Perl language bindings for the lasso (Liberty Alliance Single Sign On)
+library.
+
+%package -n java-%{name}
+Summary: Liberty Alliance Single Sign On (lasso) Java bindings
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+Requires: jpackage-utils
+Requires: jre
+
+%description -n java-%{name}
+Java language bindings for the lasso (Liberty Alliance Single Sign On)
+library.
+
+%package -n php-%{name}
+Summary: Liberty Alliance Single Sign On (lasso) PHP bindings
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description -n php-%{name}
+PHP language bindings for the lasso (Liberty Alliance Single Sign On)
+library.
+
+%package -n python-%{name}
+Summary: Liberty Alliance Single Sign On (lasso) Python bindings
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description -n python-%{name}
+Python language bindings for the lasso (Liberty Alliance Single Sign
+On) library.
+
+%prep
+%setup -q
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+
+%{__sed} -i -e '
+ s/OPTIMIZE="-g"/CC="%{__cc}" OPTIMIZE="%{rpmcflags}" INSTALLDIRS=vendor/
+' bindings/perl/Makefile.am
+
+%build
+%{__libtoolize}
+%{__gtkdocize}
+%{__aclocal}
+%{__autoconf}
+%{__automake}
+%configure \
+ --disable-static \
+ --disable-silent-rules \
+ %{!?with_tests:--disable-tests} \
+ %{!?with_java:--disable-java} \
+ %{!?with_python:--disable-python} \
+ %{!?with_perl:--disable-perl} \
+%if %{with php}
+ --enable-php5=yes \
+ --with-php5-config-dir=%{php_sysconfdir}/conf.d \
+%else
+ --enable-php5=no \
+%endif
+%if %{with wsf}
+ --enable-wsf \
+ --with-sasl2=%{_prefix}/sasl2 \
+%endif
+
+%{__make}
+
+%if %{with tests}
+%{__make} check
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+find $RPM_BUILD_ROOT -type f -name '*.la' | xargs rm -v
+
+# Perl subpackage
+%if %{with perl}
+rm $RPM_BUILD_ROOT%{perl_archlib}/perllocal.pod
+rm $RPM_BUILD_ROOT%{perl_vendorarch}/auto/Lasso/.packlist
+rm $RPM_BUILD_ROOT%{perl_vendorarch}/auto/Lasso/Lasso.bs
+%endif
+
+%if %{with python}
+%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
+%py_comp $RPM_BUILD_ROOT%{py_sitedir}
+%py_postclean
+%endif
+
+# Remove bogus doc files
+rm -r $RPM_BUILD_ROOT%{_docdir}/%{name}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc AUTHORS COPYING NEWS README
+%attr(755,root,root) %{_libdir}/liblasso.so.*.*.*
+%ghost %{_libdir}/liblasso.so.3
+
+%files devel
+%defattr(644,root,root,755)
+%{_libdir}/liblasso.so
+%{_pkgconfigdir}/lasso.pc
+%{_includedir}/lasso
+
+%if %{with perl}
+%files -n perl-%{name}
+%defattr(644,root,root,755)
+%{perl_vendorarch}/Lasso.pm
+%dir %attr(755,root,root) %{perl_vendorarch}/auto/Lasso
+%attr(755,root,root) %{perl_vendorarch}/auto/Lasso/Lasso.so
+%endif
+
+%if %{with java}
+%files -n java-%{name}
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_jnidir}/libjnilasso.so
+%{_javadir}/lasso.jar
+%endif
+
+%if %{with php}
+%files -n php-%{name}
+%defattr(644,root,root,755)
+%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/lasso.ini
+%attr(755,root,root) %{php_extensiondir}/lasso.so
+%{php_data_dir}/lasso.php
+%endif
+
+%if %{with python}
+%files -n python-%{name}
+%defattr(644,root,root,755)
+%{py_sitedir}/lasso.py[co]
+%attr(755,root,root) %{py_sitedir}/_lasso.so
+%endif
diff --git a/0001-Fix-generators-for-parsing-of-integer-values.patch b/0001-Fix-generators-for-parsing-of-integer-values.patch
new file mode 100644
index 0000000..b346032
--- /dev/null
+++ b/0001-Fix-generators-for-parsing-of-integer-values.patch
@@ -0,0 +1,38 @@
+From 0caa4e7b254b26d418048191aa588c6696a55a4d Mon Sep 17 00:00:00 2001
+From: Simo Sorce <simo at redhat.com>
+Date: Thu, 17 Apr 2014 18:10:31 -0400
+Subject: [PATCH 1/2] Fix generators for parsing of integer values
+
+All number types including enums are parse as if they were integers,
+this breaks in many ways, long and int are not the same size in all
+architectures as well as enum may vary in size depening on compiler,
+architecture and optimizations.
+
+Always pass an actual long to PyArg_ParseTuple() and rely on the a
+cast from long to the destination variable type in the following
+assignment.
+
+Signed-off-by: Simo Sorce <simo at redhat.com>
+---
+ bindings/python/lang.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/bindings/python/lang.py b/bindings/python/lang.py
+index f5c9d36ec6bd4550a8edd4ba93e5f4862bd40139..c695518e5a553738f11d614c9ce98953338408b7 100644
+--- a/bindings/python/lang.py
++++ b/bindings/python/lang.py
+@@ -770,9 +770,9 @@ register_constants(PyObject *d)
+ parse_arg = '&value'
+ print >> fd, ' %s value;' % type
+ elif is_int(m, self.binding_data):
+- parse_format = 'i'
++ parse_format = 'l'
+ parse_arg = '&value'
+- print >> fd, ' %s value;' % type
++ print >> fd, ' long value;'
+ elif is_glist(m) or is_hashtable(m) or is_xml_node(m) or is_boolean(m):
+ parse_format = 'O'
+ print >> fd, ' PyObject *cvt_value;'
+--
+1.9.0
+
diff --git a/0001-Fix-java-version-detection.patch b/0001-Fix-java-version-detection.patch
new file mode 100644
index 0000000..4c2e544
--- /dev/null
+++ b/0001-Fix-java-version-detection.patch
@@ -0,0 +1,26 @@
+From 8e2b247819b343c12aa29ad8d342f839632ace3c Mon Sep 17 00:00:00 2001
+From: Simo Sorce <simo at redhat.com>
+Date: Mon, 14 Apr 2014 14:19:20 -0400
+Subject: [PATCH] Fix java version detection
+
+Signed-off-by: Simo Sorce <simo at redhat.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0f32ad3164fb20f179ec1cca0af3f6ab485b8ffd..5668e6f325f8ad2caee1e960ed92f13fffca258f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -220,7 +220,7 @@ if test "x$JAVAC" = "xjavac"; then
+ dnl If we have a java compiler
+ dnl need to change quotes to allow square brackets
+ changequote(<<, >>)dnl
+- JAVA_VERSION=`$JAVA -version 2>&1 | $SED -ne 's/java version "\([^"]*\)".*/\1/p' 2>/dev/null`
++ JAVA_VERSION=`$JAVA -version 2>&1 | $SED -ne 's/\(openjdk\|java\) \(full\)*version "\([^"]*\)".*/\3/p' 2>/dev/null`
+ changequote([, ])dnl
+ dnl If no java version found, perphas it is a kaffee environment...
+ if test "x$JAVA_VERSION" = x; then
+--
+1.8.5.3
+
diff --git a/0002-xml-xml.c-fix-liberal-use-of-casting-for-the-SNIPPET.patch b/0002-xml-xml.c-fix-liberal-use-of-casting-for-the-SNIPPET.patch
new file mode 100644
index 0000000..e7b356c
--- /dev/null
+++ b/0002-xml-xml.c-fix-liberal-use-of-casting-for-the-SNIPPET.patch
@@ -0,0 +1,108 @@
+From 53c4298876331c1312a9a0f4dbe6eb28b2dbea59 Mon Sep 17 00:00:00 2001
+From: Benjamin Dauvergne <bdauvergne at entrouvert.com>
+Date: Thu, 24 Apr 2014 01:30:49 +0200
+Subject: [PATCH 2/2] xml/xml.c: fix liberal use of casting for the
+ SNIPPET_INTEGER and SNIPPET_BOOLEAN case
+
+Some behaviour are also made more explicit like the optional if equals
+to -1 case for integer fields, and the optional if FALSE for boolean
+fields.
+---
+ lasso/xml/xml.c | 55 ++++++++++++++++++++++++++++++++++---------------------
+ 1 file changed, 34 insertions(+), 21 deletions(-)
+
+diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c
+index ba207f552cf5c6a587c1866adecab9f2ac9a339a..4485d47669deb5b15c3f3cbcfec98942bd2edbf6 100644
+--- a/lasso/xml/xml.c
++++ b/lasso/xml/xml.c
+@@ -2717,7 +2717,6 @@ lasso_node_build_xmlNode_from_snippets(LassoNode *node, LassoNodeClass *class, x
+ struct XmlSnippet *snippets, gboolean lasso_dump)
+ {
+ struct XmlSnippet *snippet;
+- SnippetType type;
+ GType g_type;
+ xmlNode *t;
+ GList *elem;
+@@ -2727,36 +2726,49 @@ lasso_node_build_xmlNode_from_snippets(LassoNode *node, LassoNodeClass *class, x
+
+ for (snippet = snippets; snippet && snippet->name; snippet++) {
+ void *value;
++ int int_value;
++ gboolean bool_value;
+ char *str;
++ gboolean optional = snippet->type & SNIPPET_OPTIONAL;
++ gboolean optional_neg = snippet->type & SNIPPET_OPTIONAL_NEG;
+
+ if (! snippet->offset && ! (snippet->type & SNIPPET_PRIVATE)) {
+ continue;
+ }
+- type = snippet->type & 0xff;
+- value = SNIPPET_STRUCT_MEMBER(void *, node, g_type, snippet);
+- str = value;
+- if (lasso_dump == FALSE && snippet->type & SNIPPET_LASSO_DUMP)
++ if (lasso_dump == FALSE && snippet->type & SNIPPET_LASSO_DUMP) {
+ continue;
+-
+- if (type == SNIPPET_ATTRIBUTE && snippet->type & SNIPPET_ANY) {
++ }
++ if ((snippet->type & 0xff) == SNIPPET_ATTRIBUTE && (snippet->type & SNIPPET_ANY)) {
+ snippet_any_attribute = snippet;
+ continue;
+ }
+- if (value == NULL && (!(snippet->type & SNIPPET_BOOLEAN ||
+- snippet->type & SNIPPET_INTEGER) ||
+- snippet->type & SNIPPET_OPTIONAL))
+- continue;
+
+- if (snippet->type & SNIPPET_OPTIONAL_NEG && GPOINTER_TO_INT(value) == -1)
+- continue;
++ // convert input type to string if needed
++ if (snippet->type & SNIPPET_INTEGER) {
++ int_value = SNIPPET_STRUCT_MEMBER(int, node, g_type, snippet);
++ if (int_value == 0 && optional) {
++ continue;
++ }
++ if (int_value == -1 && optional_neg) {
++ continue;
++ }
++ str = g_strdup_printf("%i", int_value);
++ } else if (snippet->type & SNIPPET_BOOLEAN) {
++ bool_value = SNIPPET_STRUCT_MEMBER(gboolean, node, g_type, snippet);
++ if (bool_value == FALSE && optional) {
++ continue;
++ }
++ str = bool_value ? "true" : "false";
++ } else {
++ value = SNIPPET_STRUCT_MEMBER(void *, node, g_type, snippet);
++ if (value == NULL) {
++ continue;
++ }
++ str = value;
++ }
+
+- /* XXX: not sure it is 64-bits clean */
+- if (snippet->type & SNIPPET_BOOLEAN)
+- str = GPOINTER_TO_INT(value) ? "true" : "false";
+- if (snippet->type & SNIPPET_INTEGER)
+- str = g_strdup_printf("%d", GPOINTER_TO_INT(value));
+-
+- switch (type) {
++ // output type
++ switch (snippet->type & 0xff) {
+ case SNIPPET_ATTRIBUTE:
+ if (snippet->ns_name) {
+ xmlNsPtr ns;
+@@ -2840,8 +2852,9 @@ lasso_node_build_xmlNode_from_snippets(LassoNode *node, LassoNodeClass *class, x
+ case SNIPPET_UNUSED1:
+ g_assert_not_reached();
+ }
+- if (snippet->type & SNIPPET_INTEGER)
++ if (snippet->type & SNIPPET_INTEGER) {
+ lasso_release(str);
++ }
+ }
+
+ if (snippet_any_attribute) {
+--
+1.9.0
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/lasso.git/commitdiff/5bc7eedd161053e6ed1a7ec0f17c1236ed1de18a
More information about the pld-cvs-commit
mailing list