lasso/lasso.spec
Simo Sorce 1e5980de7c Enable perl bindings and fix minor build issues
Keep following upstream patches until 2.4.0 release.
The latest patches fixed perl binding, rpmlint issues with FSF license
address, and other minor build glitches.

Unfortunately make check still fails for perl so we keep perl bindings still
disabled for now.
2013-12-09 11:50:30 -05:00

236 lines
6.3 KiB
RPMSpec

%global with_java 1
%global with_php 1
%global with_perl 0
%global with_python 1
%global with_wsf 0
%if %{with_php}
%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}}
%endif
Summary: Liberty Alliance Single Sign On
Name: lasso
Version: 2.3.6
Release: 0.20131125.4%{?dist}
License: GPLv2+
Group: System Environment/Libraries
Source: http://dev.entrouvert.org/lasso/lasso-%{version}.tar.gz
%if %{with_wsf}
BuildRequires: cyrus-sasl-devel
%endif
BuildRequires: gtk-doc, libtool-ltdl-devel
BuildRequires: glib2-devel, swig
BuildRequires: libxml2-devel, xmlsec1-devel, openssl-devel, xmlsec1-openssl-devel
Url: http://lasso.entrouvert.org/
Patch00: jumbo-2.3.6-to-master.patch
Patch01: add-automake-14-support.patch
Patch02: 0001-Fix-license-boilerplates.patch
Patch03: 0001-build-replace-python-libdir-by-our-own.patch
Patch04: 0002-doc-remove-reference-to-init.xml-that-is-not-created.patch
Patch05: 0003-perl-make-it-compatible-with-recent-libxml2.patch
Patch06: 0004-doc-remove-broken-gtk-doc-tests-for-now.patch
%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}%{?_isa} = %{version}-%{release}
%description devel
This package contains the header files, static libraries and development
documentation for Lasso.
%if %{with_perl}
%package perl
Summary: Liberty Alliance Single Sign On (lasso) Perl bindings
Group: Development/Libraries
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: perl(Test::More)
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Requires: %{name}%{?_isa} = %{version}-%{release}
%description perl
Perl language bindings for the lasso (Liberty Alliance Single Sign On) library.
%endif
%if %{with_java}
%package java
Summary: Liberty Alliance Single Sign On (lasso) Java bindings
Group: Development/Libraries
BuildRequires: java-devel, jpackage-utils
Requires: jre-gcj, jpackage-utils
Requires: %{name}%{?_isa} = %{version}-%{release}
%description java
Java language bindings for the lasso (Liberty Alliance Single Sign On) library.
%endif
%if %{with_php}
%package php
Summary: Liberty Alliance Single Sign On (lasso) PHP bindings
Group: Development/Libraries
BuildRequires: php-devel, expat-devel
BuildRequires: python2
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires(post): %{__pecl}
Requires(postun): %{__pecl}
Requires: php(zend-abi) = %{php_zend_api}
Requires: php(api) = %{php_core_api}
%description php
PHP language bindings for the lasso (Liberty Alliance Single Sign On) library.
%endif
%if %{with_python}
%package python
Summary: Liberty Alliance Single Sign On (lasso) Python bindings
Group: Development/Libraries
BuildRequires: python2-devel
BuildRequires: python-lxml
Requires: python
Requires: %{name}%{?_isa} = %{version}-%{release}
%description python
Python language bindings for the lasso (Liberty Alliance Single Sign On)
library.
%endif
%prep
%setup -q -n %{name}-%{version}
%patch00 -p1
%patch01 -p1
%patch02 -p1
%patch03 -p1
%patch04 -p1
%patch05 -p1
%patch06 -p1
# Temporary build fix, remove once 2.4.0 is released.
echo "2.3.6-b30e246" > .tarball-version
chmod +x tools/git-version-gen
%build
./autogen.sh
%configure --prefix=%{_prefix} \
%if !%{with_java}
--disable-java \
%endif
%if !%{with_python}
--disable-python \
%endif
%if !%{with_perl}
--disable-perl \
%endif
%if %{with_php}
--enable-php5=yes \
--with-php5-config-dir=%{_sysconfdir}/php.d \
%else
--enable-php5=no \
%endif
%if %{with_wsf}
--enable-wsf \
--with-sasl2=%{_prefix}/sasl2 \
%endif
# --with-html-dir=%{_datadir}/gtk-doc/html
make %{?_smp_mflags} CFLAGS="%{optflags}"
%check
make check
%install
#install -m 755 -d %{buildroot}%{_datadir}/gtk-doc/html
make install exec_prefix=%{_prefix} DESTDIR=%{buildroot}
find %{buildroot} -type f -name '*.la' -exec rm -f {} \;
find %{buildroot} -type f -name '*.a' -exec rm -f {} \;
# Perl subpackage
%if %{with_perl}
find %{buildroot} \( -name perllocal.pod -o -name .packlist \) -exec rm -v {} \;
find %{buildroot}/usr/lib*/perl5 -type f -print |
sed "s@^%{buildroot}@@g" > %{name}-perl-filelist
if [ "$(cat %{name}-perl-filelist)X" = "X" ] ; then
echo "ERROR: EMPTY FILE LIST"
exit -1
fi
%endif
# PHP subpackage
%if %{with_php}
install -m 755 -d %{buildroot}%{_datadir}/php/%{name}
mv %{buildroot}%{_datadir}/php/lasso.php %{buildroot}%{_datadir}/php/%{name}
%endif
# Remove bogus doc files
rm -fr %{buildroot}%{_defaultdocdir}/%{name}
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root)
%{_libdir}/liblasso.so.*
%doc AUTHORS COPYING NEWS README
%files devel
%defattr(-,root,root)
%{_libdir}/liblasso.so
%{_libdir}/pkgconfig/lasso.pc
%{_includedir}/%{name}
%if %{with_perl}
%files perl -f %{name}-perl-filelist
%defattr(-,root,root)
%endif
%if %{with_java}
%files java
%defattr(-,root,root)
%{_libdir}/java/libjnilasso.so
%{_javadir}/lasso.jar
%endif
%if %{with_php}
%files php
%defattr(-,root,root)
%attr(755,root,root) %{_libdir}/php/modules/lasso.so
%config(noreplace) %attr(644,root,root) %{_sysconfdir}/php.d/%{name}.ini
%attr(755,root,root) %dir %{_datadir}/php/%{name}
%attr(644,root,root) %{_datadir}/php/%{name}/lasso.php
%endif
%if %{with_python}
%files python
%defattr(-,root,root)
%{python_sitearch}/lasso.py*
%{python_sitearch}/_lasso.so
%endif
%changelog
* Mon Dec 9 2013 Simo Sorce <simo@redhat.com> 2.3.6-0.20131125.5
- Add patches to fix rpmlint license issues
- Add upstream patches to fix some build issues
- Enale perl bindings
* Thu Dec 5 2013 Simo Sorce <simo@redhat.com> 2.3.6-0.20131125.4
- Add patch to support automake-1.14 for rawhide
* Mon Nov 25 2013 Simo Sorce <simo@redhat.com> 2.3.6-0.20131125.3
- Initial packaging
- Based on the spec file by Jean-Marc Liger <jmliger@siris.sorbonne.fr>
- Code is updated to latest master via a jumbo patch while waiting for
official upstream release.
- Jumbo patch includes also additional patches sent to upstream list)
to build on Fedora 20
- Perl bindings are disabled as they fail to build
- Disable doc building as it doesn't ork correctly for now