lemonldap-ng/build/rpm/lemonldap-ng.spec

446 lines
16 KiB
RPMSpec
Raw Normal View History

2009-01-05 18:13:16 +01:00
#==============================================================================
# Specification file for LemonLDAP::NG
#
# Install LemonLDAP::NG modules, htdocs and scripts
# Authority: dries
# Upstream: Xavier Guimard <x,guimard$free,fr>
2009-01-05 18:13:16 +01:00
#==============================================================================
#==============================================================================
# Variables
#==============================================================================
%define perl_vendorlib %(eval "`%{__perl} -V:installvendorlib`"; echo $installvendorlib)
%define perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch)
%define real_name lemonldap-ng
%define real_version 0.9.4.1
%define cpan_common_version 0.95
%define cpan_handler_version 0.92
%define cpan_manager_version 0.91
%define cpan_portal_version 0.90
2009-01-05 18:13:16 +01:00
%define lm_prefix /usr
%define lm_sharedir /usr/share/lemonldap-ng
%define lm_examplesdir %{lm_sharedir}/examples
2009-01-05 18:13:16 +01:00
%define lm_vardir /var/lib/lemonldap-ng
%define lm_confdir /etc/lemonldap-ng
%define lm_storagefile %{lm_confdir}/storage.conf
# Apache configuration directory
2009-07-07 11:15:16 +02:00
%if 0%{?rhl}%{?rhel}%{?fedora}
%define apache_confdir /etc/httpd/conf.d
2009-07-07 11:15:16 +02:00
%else
%define apache_confdir /etc/apache2/conf.d
2009-07-07 11:15:16 +02:00
%endif
# Apache User and Group
%if 0%{?rhl}%{?rhel}%{?fedora}
2009-01-05 18:13:16 +01:00
%define lm_apacheuser apache
%define lm_apachegroup apache
%else
%define lm_apacheuser wwwrun
%define lm_apachegroup www
%endif
2009-01-05 18:13:16 +01:00
%define lm_dnsdomain example.com
%define lm_ldaphost localhost
%define lm_ldapport 389
%define lm_ldapsuffix dc=example,dc=com
#==============================================================================
# Main package
#==============================================================================
Name: %{real_name}
Version: %{real_version}
2009-06-03 15:30:02 +02:00
Release: 1%{?dist}
Summary: LemonLDAP-NG WebSSO
Group: Applications/System
License: GPL+ or Artistic
2009-01-05 18:13:16 +01:00
URL: http://lemonldap.ow2.org
Source0: http://download.forge.objectweb.org/lemonldap/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
2009-01-05 18:13:16 +01:00
BuildArch: noarch
%if 0%{?rhl}%{?rhel}%{?fedora}
BuildRequires: perl, perl(Regexp::Assemble), perl(Cache::Cache), perl(Apache::Session), perl(Net::LDAP), perl(SOAP::Lite), perl(IO::String), perl(Crypt::Rijndael), perl(XML::LibXML), perl(XML::Simple)
%else
# SuSE Linux needs rpm packages for perl scripts
BuildRequires: perl, perl-Regexp-Assemble, perl-Cache-Cache, perl-Apache-Session, perl-Apache-AuthNetLDAP, perl-XML-Simple, perl-XML-LibXML, perl-Crypt-Rijndael, perl-IO-String
%endif
2009-07-07 11:15:16 +02:00
%if 0%{?rhl}%{?rhel}%{?fedora}
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
2009-01-05 18:13:16 +01:00
Requires: perl(Apache::Session), mod_perl
2009-07-07 11:15:16 +02:00
%else
Requires: cron, apache2, apache2-mod_perl
Requires: perl >= %(eval "`%{__perl} -V:version`"; echo $version)
Requires: perl-Regexp-Assemble, perl-Cache-Cache, perl-Apache-Session, perl-Apache-AuthNetLDAP, perl-XML-Simple, perl-XML-LibXML, perl-Crypt-Rijndael, perl-IO-String
Requires: perl-ldap, perl-MIME-Base64, perl-CGI, perl-CGI-Session, perl-DBI, perl-HTML-Template, perl-SOAP-Lite, perl-IPC-ShareLite, perl-Convert-ASN1, perl-Error
%endif
Requires: lemonldap-ng-conf >= %{real_version}
Requires: lemonldap-ng-doc >= %{real_version}
Requires: lemonldap-ng-handler >= %{real_version}
Requires: lemonldap-ng-manager >= %{real_version}
Requires: lemonldap-ng-portal >= %{real_version}
Requires: lemonldap-ng-test >= %{real_version}
2009-07-07 11:15:16 +02:00
%if 0%{?rhl}%{?rhel}%{?fedora}
2009-06-03 15:30:02 +02:00
Requires: perl(Lemonldap::NG::Common) >= %{cpan_common_version}
Requires: perl(Lemonldap::NG::Handler) >= %{cpan_handler_version}
Requires: perl(Lemonldap::NG::Manager) >= %{cpan_manager_version}
Requires: perl(Lemonldap::NG::Portal) >= %{cpan_portal_version}
%else
2009-07-07 11:15:16 +02:00
Requires: perl-Lemonldap-NG-Common >= %{cpan_common_version}
Requires: perl-Lemonldap-NG-Handler >= %{cpan_handler_version}
Requires: perl-Lemonldap-NG-Manager >= %{cpan_manager_version}
2009-07-08 09:19:18 +02:00
Requires: perl-Lemonldap-NG-Portal >= %{cpan_portal_version}
%endif
%description
LemonLDAP::NG is a modular Web-SSO based on Apache::Session modules. It simplifies the build of a protected area with a few changes in the application. It manages both authentication and authorization and provides headers for accounting. So you can have a full AAA protection for your web space as described below.
#==============================================================================
# Conf
#==============================================================================
%package -n lemonldap-ng-conf
Summary: LemonLDAP-NG configuration
Group: Applications/System
%description -n lemonldap-ng-conf
This package contains the main storage configuration.
2009-01-05 18:13:16 +01:00
#==============================================================================
# Documentation
#==============================================================================
%package -n lemonldap-ng-doc
Summary: LemonLDAP-NG documentation
Group: Applications/System
%description -n lemonldap-ng-doc
This package contains html documentation.
#==============================================================================
# Handler
#==============================================================================
%package -n lemonldap-ng-handler
Summary: LemonLDAP-NG Handler
Group: Applications/System
%description -n lemonldap-ng-handler
This package deploys the Apache Handler.
#==============================================================================
# Manager
#==============================================================================
%package -n lemonldap-ng-manager
Summary: LemonLDAP-NG administration interface
Group: Applications/System
%description -n lemonldap-ng-manager
This package deploys the adminsitration interface and sessions explorer.
#==============================================================================
# Portal
#==============================================================================
%package -n lemonldap-ng-portal
Summary: LemonLDAP-NG authentication portal
Group: Applications/System
%description -n lemonldap-ng-portal
This package deploys the authentication portal.
#==============================================================================
# Test
2009-01-05 18:13:16 +01:00
#==============================================================================
%package -n lemonldap-ng-test
Summary: LemonLDAP-NG test applications
Group: Applications/System
%description -n lemonldap-ng-test
This package deploys small test applications.
#==============================================================================
# CPAN modules - Common
#==============================================================================
%package -n perl-Lemonldap-NG-Common
2009-01-05 18:13:16 +01:00
Summary: LemonLDAP-NG Common Modules
2009-06-03 15:30:02 +02:00
Version: %{cpan_common_version}
2009-01-05 18:13:16 +01:00
Group: Applications/System
%description -n perl-Lemonldap-NG-Common
2009-01-05 18:13:16 +01:00
This package installs the configuration libraries used by other LemonLDAP::NG modules.
#==============================================================================
# CPAN modules - Handler
2009-01-05 18:13:16 +01:00
#==============================================================================
%package -n perl-Lemonldap-NG-Handler
Summary: LemonLDAP-NG Handler Modules
2009-06-03 15:30:02 +02:00
Version: %{cpan_handler_version}
2009-01-05 18:13:16 +01:00
Group: Applications/System
%description -n perl-Lemonldap-NG-Handler
This package installs the Apache module part (handler) used to protect web areas.
#==============================================================================
# CPAN modules - Manager
2009-01-05 18:13:16 +01:00
#==============================================================================
%package -n perl-Lemonldap-NG-Manager
Summary: LemonLDAP-NG Manager Modules
2009-06-03 15:30:02 +02:00
Version: %{cpan_manager_version}
2009-01-05 18:13:16 +01:00
Group: Applications/System
%description -n perl-Lemonldap-NG-Manager
This package installs the administration interface (manager).
#==============================================================================
# CPAN modules - Portal
2009-01-05 18:13:16 +01:00
#==============================================================================
%package -n perl-Lemonldap-NG-Portal
Summary: LemonLDAP-NG Portal Modules
2009-06-03 15:30:02 +02:00
Version: %{cpan_portal_version}
2009-01-05 18:13:16 +01:00
Group: Applications/System
%description -n perl-Lemonldap-NG-Portal
This package installs the authentication portal.
#==============================================================================
2009-01-05 18:13:16 +01:00
# Source preparation
#==============================================================================
%prep
%setup -n %{real_name}-%{real_version} -q
2009-01-05 18:13:16 +01:00
# Remove unwanted provides/requires
# We remove Lemonldap::NG requires because the requires are set in the header
2009-01-05 18:13:16 +01:00
cat << \EOF > %{name}-prov
#!/bin/sh
%{__perl_provides} $* |\
sed -e '/perl(My::Package)/d'
EOF
%define __perl_provides %{_builddir}/%{name}-%{real_version}/%{name}-prov
2009-01-05 18:13:16 +01:00
chmod +x %{__perl_provides}
cat << \EOF > %{name}-req
#!/bin/sh
%{__perl_requires} $* |\
sed -e '/perl(lasso)/d' |\
sed -e '/perl(Log::Log4perl)/d' |\
sed -e '/perl(AuthCAS)/d'
EOF
%define __perl_requires %{_builddir}/%{name}-%{real_version}/%{name}-req
2009-01-05 18:13:16 +01:00
chmod +x %{__perl_requires}
#==============================================================================
2009-01-05 18:13:16 +01:00
# Building
#==============================================================================
%build
2009-01-05 18:13:16 +01:00
%{__make} %{?_smp_mflags} configure STORAGECONFFILE=%{lm_storagefile} PERLOPTIONS="INSTALLDIRS=vendor"
%{__make} %{?_smp_mflags}
#==============================================================================
2009-01-05 18:13:16 +01:00
# Installation
#==============================================================================
%install
%if 0%{?rhl}%{?rhel}%{?fedora}
rm -rf %{buildroot}
%endif
2009-01-05 18:13:16 +01:00
# Tests
%{__make} %{?_smp_mflags} test
# Install
%{__make} %{?_smp_mflags} install \
DESTDIR=%{buildroot} \
PREFIX=%{lm_prefix} \
BINDIR=%{lm_sharedir}/bin \
DOCUMENTROOT=%{lm_vardir} \
EXAMPLESDIR=%{lm_examplesdir} \
HANDLERDIR=%{lm_vardir}/handler \
PORTALSKINSDIR=%{lm_sharedir}/portal-skins \
MANAGERDATADIR=%{lm_sharedir}/manager-imgs \
SESSIONSEXPLORERDATADIR=%{lm_sharedir}/sessions-explorer-imgs \
STORAGECONFFILE=%{lm_storagefile} \
TOOLSDIR=%{lm_sharedir}/ressources \
CONFDIR=%{lm_confdir} \
CRONDIR=/etc/cron.d \
DATADIR=%{lm_vardir} \
DNSDOMAIN=%{lm_dnsdomain} \
LDAPHOST=%{lm_ldaphost} \
LDAPPORT=%{lm_ldapport} \
LDAPSUFFIX=%{lm_ldapsuffix}
# Remove some unwanted files
find $RPM_BUILD_ROOT -name .packlist -exec rm -f {} \;
find $RPM_BUILD_ROOT -name perllocal.pod -exec rm -f {} \;
find $RPM_BUILD_ROOT -name *.bak -exec rm -f {} \;
# Set APACHEUSER in cronjob
2009-07-07 11:15:16 +02:00
sed -i 's/root/%{lm_apacheuser}/' %{buildroot}/etc/cron.d/lemonldap-ng
# Set UNIX rights
chmod 750 %{buildroot}%{lm_vardir}/conf
chmod 640 %{buildroot}%{lm_vardir}/conf/*
chmod 640 %{buildroot}%{lm_storagefile}
chmod 770 %{buildroot}%{lm_vardir}/sessions
chmod 770 %{buildroot}%{lm_vardir}/sessions/lock
chmod 640 %{buildroot}%{lm_confdir}/apply.conf
#==============================================================================
2009-01-05 18:13:16 +01:00
# Post Installation
#==============================================================================
2009-06-03 15:30:02 +02:00
%post -n lemonldap-ng-conf
# Set file ownership
2009-01-05 18:13:16 +01:00
chown -R %{lm_apacheuser}:%{lm_apachegroup} %{lm_vardir}/conf
chgrp %{lm_apachegroup} %{lm_storagefile}
chown -R %{lm_apacheuser}:%{lm_apachegroup} %{lm_vardir}/sessions
chgrp %{lm_apachegroup} %{lm_confdir}/apply.conf
if [ $1 -eq 1 ] ; then
# Create symlink in Apache configuration
# We use "z-lemonldap-ng" so that Apache read the file after "perl.conf"
ln -s %{lm_confdir}/apache2.conf %{apache_confdir}/z-lemonldap-ng.conf
fi
#==============================================================================
2009-01-05 18:13:16 +01:00
# Pre uninstallation
#==============================================================================
2009-06-03 15:30:02 +02:00
%preun -n lemonldap-ng-conf
if [ $1 -eq 0 ] ; then
# Remove symlink in Apache configuration
rm -f %{apache_confdir}/z-lemonldap-ng.conf
fi
2009-01-05 18:13:16 +01:00
#==============================================================================
2009-01-05 18:13:16 +01:00
# Cleaning
#==============================================================================
%clean
rm -rf %{buildroot}
#==============================================================================
2009-01-05 18:13:16 +01:00
# Files
#==============================================================================
%files
%defattr(-,root,root,-)
2009-07-07 11:15:16 +02:00
%doc changelog COPYING INSTALL README
%files -n lemonldap-ng-conf
%defattr(-,root,root,-)
%dir %{lm_vardir}
%dir %{lm_sharedir}
%dir %{lm_sharedir}/bin
%dir %{lm_examplesdir}
%dir %{perl_vendorlib}/Lemonldap
%dir %{perl_vendorlib}/Lemonldap/NG
%dir %{perl_vendorlib}/Lemonldap/NG/Manager
%dir %{perl_vendorlib}/auto/Lemonldap
%dir %{perl_vendorlib}/auto/Lemonldap/NG
%dir %{lm_confdir}
%config(noreplace) %{lm_confdir}
%config(noreplace) %{lm_vardir}/conf
%{lm_vardir}/sessions
%{lm_sharedir}/ressources
%files -n lemonldap-ng-doc
%defattr(-,root,root,-)
%doc %{lm_vardir}/doc
%files -n lemonldap-ng-handler
%defattr(-,root,root,-)
%{lm_vardir}/handler
%{lm_examplesdir}/handler
%files -n lemonldap-ng-manager
%defattr(-,root,root,-)
%{lm_vardir}/manager
%{lm_sharedir}/bin/lmConfigEditor
%{lm_sharedir}/bin/lmConfig_File2MySQL
2009-06-03 15:30:02 +02:00
%{lm_sharedir}/bin/lmConfig_File2LDIF
%{lm_sharedir}/manager-imgs
%{lm_sharedir}/sessions-explorer-imgs
%{lm_examplesdir}/manager
%files -n lemonldap-ng-portal
%defattr(-,root,root,-)
%{lm_vardir}/liberty-alliance-sp-portal
%{lm_vardir}/portal
%{lm_sharedir}/bin/purgeCentralCache
2009-06-03 15:30:02 +02:00
%{lm_sharedir}/bin/buildPortalWSDL
%config(noreplace) /etc/cron.d/lemonldap-ng
%{lm_examplesdir}/portal
%{lm_sharedir}/portal-skins
2009-01-05 18:13:16 +01:00
%files -n lemonldap-ng-test
%defattr(-,root,root,-)
%{lm_vardir}/test
2009-01-05 18:13:16 +01:00
%files -n perl-Lemonldap-NG-Common
%defattr(-,root,root,-)
2009-01-05 18:13:16 +01:00
%doc %{_mandir}/man3/Lemonldap::NG::Common*.3pm.gz
%{perl_vendorlib}/Lemonldap/NG/Common.pm
%{perl_vendorlib}/Lemonldap/NG/Common/
%files -n perl-Lemonldap-NG-Handler
%defattr(-,root,root,-)
2009-01-05 18:13:16 +01:00
%doc %{_mandir}/man3/Lemonldap::NG::Handler*.3pm.gz
%{perl_vendorlib}/Lemonldap/NG/Handler.pm
%{perl_vendorlib}/Lemonldap/NG/Handler/
%files -n perl-Lemonldap-NG-Manager
%defattr(-,root,root,-)
2009-01-05 18:13:16 +01:00
%doc %{_mandir}/man3/Lemonldap::NG::Manager*.3pm.gz
%{perl_vendorlib}/Lemonldap/NG/Manager.pm
%{perl_vendorlib}/Lemonldap/NG/Manager/
%{perl_vendorlib}/auto/Lemonldap/NG/Manager/
%files -n perl-Lemonldap-NG-Portal
%defattr(-,root,root,-)
2009-01-05 18:13:16 +01:00
%doc %{_mandir}/man3/Lemonldap::NG::Portal*.3pm.gz
%{perl_vendorlib}/Lemonldap/NG/Portal.pm
%{perl_vendorlib}/Lemonldap/NG/Portal/
%{perl_vendorlib}/auto/Lemonldap/NG/Portal/
#==============================================================================
2009-01-05 18:13:16 +01:00
# Changelog
#==============================================================================
%changelog
* Thu Oct 13 2009 Clement Oudot <clem.oudot@gmail.com> - 0.9.4.1-1
- [RPM] Use config(noreplace) to prevent config files from being erased
- [CODE] Safe jail update
- [CODE] Many little bugs in Handler/CGI.pm
- [CODE] Apache::Session::LDAP was not usable with session explorer
- [CODE] syslog facility was not taken in account in Common/CGI.pm
- [CODE] require failed in _Multi.pm
- [DOC] doc update
- [DEB] run debconf translation (Closes: #550552 / bugs.debian.org)
* Mon Jul 6 2009 Clement Oudot <coudot@linagora.com> - 0.9.4-1
2009-06-03 15:30:02 +02:00
- Upgrade to release 0.9.4
- Remove cronjob patch (included in 0.9.4)
- Split scriplets into subpackages
- Use conditions to build for other RPM distributions like OpenSuSE (thanks to clauded1)
* Mon Jan 12 2009 Clement Oudot <coudot@linagora.com> - 0.9.3.2-2
- Include cronjob patch
- Delete unwanted files (perllocal.pod, .packlist)
- Follow rpmfusion guidelines
* Thu Jan 9 2009 Clement Oudot <coudot@linagora.com> - 0.9.3.2-1
2009-01-05 18:13:16 +01:00
- Updated to release 0.9.3.2.
- Use internal version number for perl modules (compatibility with RPMforge packages)
2009-01-05 18:13:16 +01:00
- Merge with existing .spec file from RPMforge.
- Use the same directories as the Debian package.
- Create a symlink in Apache confguration.
- Create specific portal/manager/handler/conf packages independant from CPAN packages
2009-01-05 18:13:16 +01:00
* Thu Nov 20 2008 Jean-Christophe Toussaint <jean-christophe.toussaint@ac-nancy-metz.fr> - 0.9.2-1DSI
- Updated to release 0.9.2.
- Using official tar.gz from forge.
* Tue Oct 7 2008 David Hannequin <david.hannequin@linagora.com>
2009-01-05 18:13:16 +01:00
- New spec file
* Sun Mar 02 2008 Dag Wieers <dag@wieers.com> - 0.85-1
- Updated to release 0.85.
* Tue Nov 13 2007 Dag Wieers <dag@wieers.com> - 0.84-1
- Updated to release 0.84.
* Wed May 02 2007 Dries Verachtert <dries@ulyssis.org> - 0.81-1
- Updated to release 0.81.
* Sun Apr 29 2007 Dries Verachtert <dries@ulyssis.org> - 0.75-1
- Initial package.