lemonldap-ng.spec 29.1 KB
Newer Older
1 2 3 4
#==============================================================================
# Specification file for LemonLDAP::NG
#
# Install LemonLDAP::NG modules, htdocs and scripts
5 6
# Authority: dries
# Upstream: Xavier Guimard <x,guimard$free,fr>
7 8 9 10 11
#==============================================================================

#==============================================================================
# Variables
#==============================================================================
12
%global lm_prefix %{_prefix}
13 14 15 16 17
%global lm_sharedir %{_datadir}/lemonldap-ng
%global lm_examplesdir %{lm_sharedir}/examples
%global lm_vardir %{_localstatedir}/lib/lemonldap-ng
%global lm_confdir %{_sysconfdir}/lemonldap-ng
%global lm_storagefile %{lm_confdir}/lemonldap-ng.ini
18 19
%global lm_bindir %{_libexecdir}/%{name}/bin
%global lm_sbindir %{_libexecdir}/%{name}/sbin
20

21
# Apache configuration directory
22
%if 0%{?rhel}%{?fedora}
23
%global apache_confdir %{_sysconfdir}/httpd/conf.d
24
%else
25
%global apache_confdir %{_sysconfdir}/apache2/conf.d
26
%endif
27 28

# Apache User and Group
29
%if 0%{?rhel}%{?fedora}
30 31
%global lm_apacheuser apache
%global lm_apachegroup apache
32
%else
33 34
%global lm_apacheuser wwwrun
%global lm_apachegroup www
35
%endif
36

37
# Apache version
38
%if 0%{?fedora} || 0%{?rhel} >= 7
39
%global apache_version 2.4
40
%else
41
%global apache_version 2
42 43
%endif

44
%global lm_dnsdomain example.com
45

46 47
#global pre_release beta1

48 49 50
#==============================================================================
# Main package
#==============================================================================
Xavier Bachelot's avatar
Xavier Bachelot committed
51
Name:           lemonldap-ng
52
Version:        2.0.0
Xavier Bachelot's avatar
Xavier Bachelot committed
53
Release:        %{?pre_release:0.}2%{?pre_release:.%{pre_release}}%{?dist}
54
Summary:        LemonLDAP-NG WebSSO
Xavier Bachelot's avatar
Xavier Bachelot committed
55
License:        GPLv2+
Clément OUDOT's avatar
Clément OUDOT committed
56
URL:            http://lemonldap-ng.org
57
Source0:        https://release.ow2.org/lemonldap/%{name}-%{version}%{?pre_release:~%{pre_release}}.tar.gz
58
BuildArch:      noarch
59

60
BuildRequires:  perl-generators
61
BuildRequires:  perl-interpreter
Xavier Bachelot's avatar
Xavier Bachelot committed
62 63 64 65 66 67 68 69 70
BuildRequires:  perl(Apache2::Connection)
BuildRequires:  perl(Apache2::Const)
BuildRequires:  perl(Apache2::Filter)
BuildRequires:  perl(Apache2::Log)
BuildRequires:  perl(Apache2::RequestIO)
BuildRequires:  perl(Apache2::RequestRec)
BuildRequires:  perl(Apache2::RequestUtil)
BuildRequires:  perl(Apache2::ServerRec)
BuildRequires:  perl(Apache2::ServerUtil)
Clément OUDOT's avatar
Clément OUDOT committed
71
BuildRequires:  perl(Apache::Session)
Xavier Bachelot's avatar
Xavier Bachelot committed
72 73 74
BuildRequires:  perl(Apache::Session::Generate::MD5)
BuildRequires:  perl(APR::Table)
BuildRequires:  perl(AuthCAS)
75
BuildRequires:  perl(Authen::Captcha)
Xavier Bachelot's avatar
Xavier Bachelot committed
76 77 78 79 80
BuildRequires:  perl(Authen::PAM)
BuildRequires:  perl(Authen::Radius)
BuildRequires:  perl(AutoLoader)
BuildRequires:  perl(base)
BuildRequires:  perl(bytes)
81
BuildRequires:  perl(Cache::Cache)
Xavier Bachelot's avatar
Xavier Bachelot committed
82 83 84
BuildRequires:  perl(Cache::FileCache)
BuildRequires:  perl(Cache::Memcached)
BuildRequires:  perl(CGI)
85 86
BuildRequires:  perl(Class::Inspector)
BuildRequires:  perl(Clone)
Clément OUDOT's avatar
Clément OUDOT committed
87
BuildRequires:  perl(Config::IniFiles)
Xavier Bachelot's avatar
Xavier Bachelot committed
88
BuildRequires:  perl(constant)
89
BuildRequires:  perl(Convert::Base32)
90
BuildRequires:  perl(Convert::PEM)
Xavier Guimard's avatar
Xavier Guimard committed
91
BuildRequires:  perl(Crypt::OpenSSL::Bignum)
Clément OUDOT's avatar
Clément OUDOT committed
92 93
BuildRequires:  perl(Crypt::OpenSSL::RSA)
BuildRequires:  perl(Crypt::OpenSSL::X509)
94
BuildRequires:  perl(Crypt::Rijndael)
Xavier Bachelot's avatar
Xavier Bachelot committed
95 96 97 98
BuildRequires:  perl(Data::Dumper)
BuildRequires:  perl(DBI)
BuildRequires:  perl(Digest::HMAC_SHA1)
BuildRequires:  perl(Digest::MD5)
99
BuildRequires:  perl(Digest::SHA)
100
BuildRequires:  perl(Email::Date::Format)
101
# Not available for EL6
Xavier Bachelot's avatar
Xavier Bachelot committed
102 103 104 105 106 107 108
%if ! 0%{?el6}
BuildRequires:  perl(Email::Sender)
BuildRequires:  perl(Email::Sender::Simple)
BuildRequires:  perl(Email::Sender::Transport::SMTP)
%endif
BuildRequires:  perl(Encode)
BuildRequires:  perl(English)
109
BuildRequires:  perl(Env)
Xavier Bachelot's avatar
Xavier Bachelot committed
110
BuildRequires:  perl(Exporter)
111
BuildRequires:  perl(ExtUtils::MakeMaker)
Xavier Bachelot's avatar
Xavier Bachelot committed
112 113 114 115 116 117 118 119 120
BuildRequires:  perl(FCGI::Client)
BuildRequires:  perl(FCGI::ProcManager)
BuildRequires:  perl(feature)
BuildRequires:  perl(fields)
BuildRequires:  perl(File::Temp)
BuildRequires:  perl(GD::SecurityImage)
BuildRequires:  perl(Getopt::Long)
BuildRequires:  perl(Getopt::Std)
BuildRequires:  perl(GSSAPI)
121
BuildRequires:  perl(HTML::Template)
Xavier Bachelot's avatar
Xavier Bachelot committed
122 123 124 125
BuildRequires:  perl(HTTP::Headers)
BuildRequires:  perl(HTTP::Request)
BuildRequires:  perl(IO::Select)
BuildRequires:  perl(IO::Socket::INET)
126 127
BuildRequires:  perl(IO::String)
BuildRequires:  perl(JSON)
Xavier Bachelot's avatar
Xavier Bachelot committed
128 129 130 131
BuildRequires:  perl(Log::Log4perl)
BuildRequires:  perl(LWP::Protocol::https)
BuildRequires:  perl(LWP::UserAgent)
BuildRequires:  perl(MIME::Base64)
132
BuildRequires:  perl(MIME::Entity)
Xavier Bachelot's avatar
Xavier Bachelot committed
133
BuildRequires:  perl(mod_perl2)
134 135
BuildRequires:  perl(Mouse)
BuildRequires:  perl(Net::LDAP)
Xavier Bachelot's avatar
Xavier Bachelot committed
136 137
BuildRequires:  perl(Net::LDAP::Extension::SetPassword)
BuildRequires:  perl(Net::LDAP::Util)
138
BuildRequires:  perl(Plack)
Xavier Bachelot's avatar
Xavier Bachelot committed
139 140 141 142 143 144 145 146
BuildRequires:  perl(Plack::Handler::CGI)
BuildRequires:  perl(Plack::Handler::FCGI)
BuildRequires:  perl(Plack::Middleware)
BuildRequires:  perl(Plack::Request)
BuildRequires:  perl(Plack::Runner)
BuildRequires:  perl(Plack::Util)
BuildRequires:  perl(Plack::Util::Accessor)
BuildRequires:  perl(POSIX)
147 148
BuildRequires:  perl(Regexp::Assemble)
BuildRequires:  perl(Regexp::Common)
Xavier Bachelot's avatar
Xavier Bachelot committed
149 150
BuildRequires:  perl(Safe)
BuildRequires:  perl(Scalar::Util)
151 152
# https://bugzilla.redhat.com/show_bug.cgi?id=1644266
#BuildRequires:  perl(Sentry::Raven)
153
BuildRequires:  perl(SOAP::Lite)
Xavier Bachelot's avatar
Xavier Bachelot committed
154 155
BuildRequires:  perl(SOAP::Transport::HTTP)
BuildRequires:  perl(strict)
156
BuildRequires:  perl(String::Random)
Xavier Bachelot's avatar
Xavier Bachelot committed
157
BuildRequires:  perl(Sys::Syslog)
158 159
BuildRequires:  perl(Test::MockObject)
BuildRequires:  perl(Test::Pod) >= 1.00
Xavier Bachelot's avatar
Xavier Bachelot committed
160
BuildRequires:  perl(Time::Local)
161
BuildRequires:  perl(Unicode::String)
Xavier Bachelot's avatar
Xavier Bachelot committed
162 163 164 165 166
BuildRequires:  perl(URI)
BuildRequires:  perl(URI::Escape)
BuildRequires:  perl(URI::URL)
BuildRequires:  perl(utf8)
BuildRequires:  perl(warnings)
167 168
BuildRequires:  perl(XML::LibXSLT)
BuildRequires:  perl(XML::Simple)
Xavier Bachelot's avatar
Xavier Bachelot committed
169
BuildRequires:  perl(YAML)
Xavier Bachelot's avatar
Xavier Bachelot committed
170
%if 0%{?fedora} || 0%{?rhel} >= 7
171
BuildRequires:  systemd
Xavier Bachelot's avatar
Xavier Bachelot committed
172
%endif
173

174 175 176 177 178 179
Requires: lemonldap-ng-conf = %{version}-%{release}
Requires: lemonldap-ng-doc = %{version}-%{release}
Requires: lemonldap-ng-handler = %{version}-%{release}
Requires: lemonldap-ng-manager = %{version}-%{release}
Requires: lemonldap-ng-portal = %{version}-%{release}
Requires: lemonldap-ng-test = %{version}-%{release}
180

181 182
# Setup requires filtering
%if 0%{?rhel} == 6
183
%filter_from_requires /perl(lasso/d; /perl(Net::OpenID/d; /perl(Web::ID/d; /perl(XML::LibXML/d; /perl(XML::LibXSLT/d; /perl(Sentry::Raven/d;
Xavier Bachelot's avatar
Xavier Bachelot committed
184
%filter_from_provides /perl(Lemonldap::NG::Handler::Main/d; /perl(Lemonldap::NG::Manager::Attributes/d; /perlLemonldap::NG::Portal::Main/d;
185 186 187 188 189
%filter_setup
%endif

%if 0%{?fedora} || 0%{?rhel} >= 7
%{?perl_default_filter}
190
%global __requires_exclude perl\\(lasso|perl\\(Net::OpenID|perl\\(Web::ID|perl\\(XML::LibXML|perl\\(XML::LibXSLT|perl\\(Sentry::Raven
Xavier Bachelot's avatar
Xavier Bachelot committed
191
%global __provides_exclude perl\\(Lemonldap::NG::Handler::Main|perl\\(Lemonldap::NG::Manager::Attributes|perl\\(Lemonldap::NG::Portal::Main
192 193
%endif

194
%description
195
LemonLdap::NG is a modular Web-SSO based on Apache::Session modules. It
Clément OUDOT's avatar
Clément OUDOT committed
196 197 198 199
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.
200

201 202 203
#==============================================================================
# Conf
#==============================================================================
204
%package conf
205
Summary:        LemonLDAP-NG configuration
206 207
Requires:       perl(Apache::Session)
Requires:       perl(IO::String)
208
Requires:       perl(Lemonldap::NG::Common) = %{version}-%{release}
209
Requires:       perl(mod_perl2)
210
%if 0%{?rhel}%{?fedora}
211 212 213 214
Requires(post):  httpd
%else
Requires(post):  apache2
%endif
215

216
%description conf
217 218
This package contains the main storage configuration.

219 220 221
#==============================================================================
# Documentation
#==============================================================================
222
%package doc
223
Summary:        LemonLDAP-NG documentation
224
Requires:       lemonldap-ng-conf = %{version}-%{release}
225

226
%description doc
227
This package contains HTML documentation.
228 229

#==============================================================================
230 231
# Handler
#==============================================================================
232
%package handler
233
Summary:        LemonLDAP-NG handler
234
%if 0%{?rhel}%{?fedora}
235 236
Requires:       crontabs
%endif
237 238
Requires:       lemonldap-ng-conf = %{version}-%{release}
Requires:       perl(Lemonldap::NG::Handler) = %{version}-%{release}
239

240
%description handler
241 242 243 244 245
This package deploys the Apache Handler.

#==============================================================================
# Manager
#==============================================================================
246
%package manager
247
Summary:        LemonLDAP-NG administration interface
248 249
Requires:       lemonldap-ng-conf = %{version}-%{release}
Requires:       perl(Lemonldap::NG::Manager) = %{version}-%{release}
250

251
%description manager
252
This package deploys the administration interface and sessions explorer.
253 254 255 256

#==============================================================================
# Portal
#==============================================================================
257
%package portal
258
Summary:        LemonLDAP-NG authentication portal
259
%if 0%{?rhel}%{?fedora}
260 261
Requires:       crontabs
%endif
262 263
Requires:       lemonldap-ng-conf = %{version}-%{release}
Requires:       perl(Lemonldap::NG::Portal) = %{version}-%{release}
264

265
%description portal
266 267 268 269
This package deploys the authentication portal.

#==============================================================================
# Test
270
#==============================================================================
271
%package test
272
Summary:        LemonLDAP-NG test applications
273
Requires:       lemonldap-ng-conf = %{version}-%{release}
274

275
%description test
276 277
This package deploys small test applications.

278 279 280
#==============================================================================
# FastCGI Server
#==============================================================================
281
%package fastcgi-server
282
Summary:        LemonLDAP-NG FastCGI Server
283
Requires:       lemonldap-ng-conf = %{version}-%{release}
284
%if 0%{?rhel}%{?fedora}
285 286 287 288 289
Requires:       mod_fcgid
%else
Requires:       apache2-mod_fcgid
%endif
Requires:       perl(FCGI::ProcManager)
290

291
%description fastcgi-server
292 293
This package deploys files needed to start a FastCGI server.

Clément OUDOT's avatar
Clément OUDOT committed
294 295 296
#==============================================================================
# UWSGI Application
#==============================================================================
297
%package uwsgi-app
Clément OUDOT's avatar
Clément OUDOT committed
298
Summary:        LemonLDAP-NG UWSGI Application
Xavier Bachelot's avatar
Xavier Bachelot committed
299
Requires:       uwsgi-plugin-psgi
Clément OUDOT's avatar
Clément OUDOT committed
300

301
%description uwsgi-app
Clément OUDOT's avatar
Clément OUDOT committed
302 303 304
LemonLDAP::NG uWSGI server provides a replacement to LemonLDAP::NG FastCGI
server, using uWSGI instead of Plack FCGI.

305 306 307 308 309 310 311 312 313 314
#==============================================================================
# Nginx server
#==============================================================================
%package nginx
Summary:        LemonLDAP-NG Nginx support
Requires:       nginx

%description nginx
Nginx support for LemonLDAP::NG.

315 316 317 318
#==============================================================================
# CPAN modules - Common
#==============================================================================
%package -n perl-Lemonldap-NG-Common
319 320
Summary:        LemonLDAP-NG Common Modules

321
%description -n perl-Lemonldap-NG-Common
322 323
This package installs the configuration libraries used by other LemonLDAP::NG
modules.
324 325

#==============================================================================
326
# CPAN modules - Handler
327 328 329 330 331
#==============================================================================
%package -n perl-Lemonldap-NG-Handler
Summary:        LemonLDAP-NG Handler Modules

%description -n perl-Lemonldap-NG-Handler
332 333
This package installs the Apache module part (handler) used to protect web
areas.
334 335

#==============================================================================
336
# CPAN modules -  Manager
337 338 339 340 341 342 343 344
#==============================================================================
%package -n perl-Lemonldap-NG-Manager
Summary:        LemonLDAP-NG Manager Modules

%description -n perl-Lemonldap-NG-Manager
This package installs the administration interface (manager).

#==============================================================================
345
# CPAN modules - Portal
346 347 348 349 350 351 352
#==============================================================================
%package -n perl-Lemonldap-NG-Portal
Summary:        LemonLDAP-NG Portal Modules

%description -n perl-Lemonldap-NG-Portal
This package installs the authentication portal.

353
#==============================================================================
354
# Source preparation
355
#==============================================================================
356
%prep
357
%setup -q -n %{name}-%{version}%{?pre_release:~%{pre_release}}
358

359

360
#==============================================================================
361
# Building
362
#==============================================================================
363
%build
Xavier Bachelot's avatar
Xavier Bachelot committed
364 365 366
%{__make} %{?_smp_mflags} configure \
    STORAGECONFFILE=%{lm_storagefile} \
    PERLOPTIONS="INSTALLDIRS=vendor"
367
%{__make} %{?_smp_mflags}
368

369
#==============================================================================
370
# Installation
371
#============================================================================
372
%install
373
%{__make} %{?_smp_mflags} install \
Xavier Bachelot's avatar
Xavier Bachelot committed
374 375
    DESTDIR=%{buildroot} \
    PREFIX=%{lm_prefix} \
376 377
    BINDIR=%{lm_bindir} \
    SBINDIR=%{lm_sbindir} \
378
    FASTCGISOCKDIR=%{_rundir}/llng-fastcgi-server \
379
    DOCUMENTROOT=%{lm_sharedir} \
Xavier Bachelot's avatar
Xavier Bachelot committed
380
    EXAMPLESDIR=%{lm_examplesdir} \
381
    HANDLERDIR=%{lm_sharedir}/handler \
Xavier Bachelot's avatar
Xavier Bachelot committed
382 383 384 385 386 387
    MANAGERDIR=%{lm_sharedir}/manager \
    STORAGECONFFILE=%{lm_storagefile} \
    TOOLSDIR=%{lm_sharedir}/ressources \
    CONFDIR=%{lm_confdir} \
    CRONDIR=%{_sysconfdir}/cron.d \
    DATADIR=%{lm_vardir} \
388 389
    INITDIR=%{_sysconfdir}/init.d \
    ETCDEFAULTDIR=%{_sysconfdir}/default \
Xavier Bachelot's avatar
Xavier Bachelot committed
390 391
    DNSDOMAIN=%{lm_dnsdomain} \
    APACHEVERSION=%{apache_version} \
392
    UWSGIYAMLDIR=%{_sysconfdir}/uwsgi/apps-available \
Xavier Bachelot's avatar
Xavier Bachelot committed
393 394
    LLNGAPPDIR=%{lm_sharedir}/llng-server \
    PROD=yes
395

396
# Remove some unwanted files
397 398 399
find %{buildroot} -name .packlist -exec rm -f {} \;
find %{buildroot} -name perllocal.pod -exec rm -f {} \;
find %{buildroot} -name *.bak -exec rm -f {} \;
400

401 402
# Install files for FastCGI Server
mkdir -p %{buildroot}%{_unitdir}
Xavier Bachelot's avatar
Xavier Bachelot committed
403 404
install -m644 fastcgi-server/systemd/llng-fastcgi-server.service \
    %{buildroot}%{_unitdir}
405 406
sed -i \
    -e 's:__FASTCGISOCKDIR__:%{_rundir}/llng-fastcgi-server:' \
407
    -e 's:__SBINDIR__:%{lm_sbindir}:' \
Xavier Bachelot's avatar
Xavier Bachelot committed
408
    %{buildroot}%{_unitdir}/llng-fastcgi-server.service
409
rm -f %{buildroot}%{_sysconfdir}/init.d/llng-fastcgi-server
410 411

mkdir -p %{buildroot}%{_tmpfilesdir}
Xavier Bachelot's avatar
Xavier Bachelot committed
412 413
install -m644 fastcgi-server/systemd/llng-fastcgi-server.tmpfile \
    %{buildroot}%{_tmpfilesdir}/llng-fastcgi-server.conf
414 415 416 417
sed -i \
    -e 's:__FASTCGISOCKDIR__:%{_rundir}/llng-fastcgi-server:' \
    -e 's:__USER__:%{lm_apacheuser}:' \
    -e 's:__GROUP__:%{lm_apachegroup}:' \
Xavier Bachelot's avatar
Xavier Bachelot committed
418
    %{buildroot}%{_tmpfilesdir}/llng-fastcgi-server.conf
419

Clément OUDOT's avatar
Clément OUDOT committed
420
# UWSGI Application
421
mkdir -p %{buildroot}%{_sysconfdir}/uwsgi/apps-available
Clément OUDOT's avatar
Clément OUDOT committed
422 423
mkdir -p %{buildroot}%{lm_sharedir}/llng-server

Clément OUDOT's avatar
Clément OUDOT committed
424
# Set apache user in some files (see Makefile)
Clément OUDOT's avatar
Clément OUDOT committed
425 426 427
# Note: we do not use the APACHEUSER and APACHEGROUP in make install
# because it launches a 'chown', which is not permitted if RPM is not
# built as root
Clément OUDOT's avatar
Clément OUDOT committed
428
sed -i 's/nobody/%{lm_apacheuser}/' %{buildroot}%{_sysconfdir}/cron.d/*
Xavier Bachelot's avatar
Xavier Bachelot committed
429
sed -i 's/nobody/%{lm_apacheuser}/' \
430
    %{buildroot}%{lm_bindir}/lmConfigEditor
Xavier Bachelot's avatar
Xavier Bachelot committed
431
sed -i 's/nobody/%{lm_apacheuser}/g' \
432
    %{buildroot}%{lm_bindir}/lemonldap-ng-cli
Xavier Bachelot's avatar
Xavier Bachelot committed
433 434
sed -i 's/nobody/%{lm_apacheuser}/g' \
    %{buildroot}%{_sysconfdir}/default/llng-fastcgi-server
435

436
# Set UNIX rights
Clément OUDOT's avatar
Clément OUDOT committed
437
mkdir -p %{buildroot}%{lm_vardir}/sessions/lock
438
mkdir -p %{buildroot}%{lm_vardir}/psessions/lock
439 440 441 442 443
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
444 445
chmod 770 %{buildroot}%{lm_vardir}/psessions
chmod 770 %{buildroot}%{lm_vardir}/psessions/lock
446
chmod 770 %{buildroot}%{lm_vardir}/notifications
447
chmod 770 %{buildroot}%{lm_vardir}/captcha
448
chmod 775 %{buildroot}%{lm_sbindir}/llng-fastcgi-server
Clément OUDOT's avatar
Clément OUDOT committed
449

450 451 452 453 454 455 456
# Install httpd conf files
# We use "z-lemonldap-ng-*" so that httpd read the files after "perl.conf"
mkdir -p %{buildroot}%{apache_confdir}
for i in handler manager portal test; do {
    mv %{buildroot}%{lm_confdir}/$i-apache%{apache_version}.conf \
        %{buildroot}%{apache_confdir}/z-lemonldap-ng-$i.conf
}; done
457

458 459 460 461 462
# Install nginx conf files
mkdir -p %{buildroot}%{_sysconfdir}/nginx/conf.d/
mv %{buildroot}%{lm_confdir}/*nginx*.conf \
    %{buildroot}%{_sysconfdir}/nginx/conf.d/

463 464 465
# Remove for_etc_hosts from %%{_sysconfdir}
mv %{buildroot}%{lm_confdir}/for_etc_hosts .

Xavier Bachelot's avatar
Xavier Bachelot committed
466 467 468 469 470 471 472 473 474 475 476
# Fix shebang and perms
sed -i -e 's,#!/usr/bin/env plackup,#!/usr/bin/plackup,' \
    %{buildroot}/usr/share/lemonldap-ng/manager/htdocs/manager.psgi
chmod 755 %{buildroot}/usr/share/lemonldap-ng/manager/htdocs/manager.psgi
sed -i -e 's,#!/usr/bin/env plackup,#!/usr/bin/plackup,' \
    %{buildroot}/usr/share/lemonldap-ng/examples/manager/manager.psgi
chmod 755 %{buildroot}/usr/share/lemonldap-ng/examples/manager/manager.psgi
sed -i -e '1i#!/usr/bin/plackup' \
    %{buildroot}/usr/share/lemonldap-ng/examples/llngapp.psgi
chmod 644 %{buildroot}/usr/share/lemonldap-ng/test/cas.php

477 478 479 480
#==============================================================================
# Run test
#==============================================================================
%check
Xavier Bachelot's avatar
Xavier Bachelot committed
481 482 483 484 485 486
sed -i 's:^dirName.*:dirName = %{buildroot}%{lm_vardir}/conf:' \
    %{buildroot}%{lm_storagefile}
%{__make} %{?_smp_mflags} test \
    LLNG_DEFAULTCONFFILE=%{buildroot}%{lm_storagefile}
sed -i 's:^dirName.*:dirName = %{lm_vardir}/conf:' \
    %{buildroot}%{lm_storagefile}
487

488
#==============================================================================
489
# Post Installation
490
#==============================================================================
491
%post conf
Clément OUDOT's avatar
Clément OUDOT committed
492 493 494
# Upgrade from previous version
# See http://lemonldap-ng.org/documentation/1.0/upgrade
if [ $1 -gt 1 ] ; then
Xavier Bachelot's avatar
Xavier Bachelot committed
495 496 497
    if [ -e %{lm_confdir}/storage.conf \
         -o -e %{lm_confdir}/apply.conf \
         -o -e %{lm_confdir}/apps-list.xml ] ; then
Xavier Bachelot's avatar
Xavier Bachelot committed
498
        # Run migration script
499
        %{lm_bindir}/lmMigrateConfFiles2ini 2>&1 > /dev/null || :
Xavier Bachelot's avatar
Xavier Bachelot committed
500 501 502
        # Fix ownership
        chgrp %{lm_apachegroup} %{lm_storagefile} || :
    fi
503
fi
504 505 506 507 508
# Set editor alternatives if it does not exist
update-alternatives --display editor > /dev/null 2>&1
if [ $? -ne 0 ] ; then
        update-alternatives --install /usr/bin/editor editor /usr/bin/vim 1
fi
509

510
#==============================================================================
511
# Pre uninstallation
512
#==============================================================================
513
%preun conf
Clément OUDOT's avatar
Clément OUDOT committed
514 515
# Upgrade from previous version
if [ $1 -eq 1 ] ; then
516 517
    # Remove old symlinks in Apache configuration
    rm -f %{apache_confdir}/z-lemonldap-ng*.conf 2>&1 > /dev/null || :
518
fi
519

520 521 522 523 524 525 526 527
%post fastcgi-server
%systemd_post llng-fastcgi-server.service

%preun fastcgi-server
%systemd_preun llng-fastcgi-server.service

%postun fastcgi-server
%systemd_postun_with_restart llng-fastcgi-server.service
Clément OUDOT's avatar
Clément OUDOT committed
528

529
%files
530

531
%files conf
532
%doc changelog INSTALL README.md AUTHORS CONTRIBUTING.md
533
%doc for_etc_hosts
534
%license COPYING GPL
Clément OUDOT's avatar
Clément OUDOT committed
535
%dir %{lm_confdir}
536
%config(noreplace) %attr(-,root,%{lm_apachegroup}) %{lm_storagefile}
537 538 539
%config(noreplace) %{apache_confdir}/z-lemonldap-ng-handler.conf
%config(noreplace) %{apache_confdir}/z-lemonldap-ng-manager.conf
%config(noreplace) %{apache_confdir}/z-lemonldap-ng-portal.conf
540
%{_mandir}/man1/convertConfig*
541 542 543 544 545 546 547
%dir %{_libexecdir}/%{name}
%dir %{lm_sbindir}
%dir %{lm_bindir}
%{lm_bindir}/convertConfig
%{lm_bindir}/importMetadata
%{lm_bindir}/lmMigrateConfFiles2ini
%{lm_bindir}/rotateOidcKeys
548
%dir %{lm_examplesdir}
549
%dir %{lm_sharedir}
Clément OUDOT's avatar
Clément OUDOT committed
550 551
%dir %{lm_sharedir}/ressources
%{lm_sharedir}/ressources/*
552
%dir %{lm_vardir}
Clément OUDOT's avatar
Clément OUDOT committed
553 554 555 556
%defattr(750,%{lm_apacheuser},%{lm_apachegroup},-)
%dir %{lm_vardir}/conf
%dir %{lm_vardir}/sessions
%dir %{lm_vardir}/sessions/lock
557 558
%dir %{lm_vardir}/psessions
%dir %{lm_vardir}/psessions/lock
559
%dir %{lm_vardir}/notifications
Clément OUDOT's avatar
Clément OUDOT committed
560
%defattr(640,%{lm_apacheuser},%{lm_apachegroup},-)
Clément OUDOT's avatar
Clément OUDOT committed
561
%config(noreplace) %{lm_vardir}/conf/lmConf-1.json
562

563
%files doc
564
%doc %{lm_sharedir}/doc
565 566
%doc changelog INSTALL README.md AUTHORS CONTRIBUTING.md
%license COPYING GPL
567

568
%files handler
569
%{lm_bindir}/purgeLocalCache
570
%config(noreplace) %{_sysconfdir}/cron.d/lemonldap-ng-handler
571
%{lm_sharedir}/handler
572
%{lm_examplesdir}/handler
573
%{lm_sharedir}/llng-server/llng-server.psgi
574

575
%files manager
Clément OUDOT's avatar
Clément OUDOT committed
576 577
%{lm_sharedir}/manager
%{lm_examplesdir}/manager
578 579
%{lm_bindir}/lmConfigEditor
%{lm_bindir}/lemonldap-ng-cli
580
%{_mandir}/man1/lemonldap-ng-cli*
581

582
%files portal
583 584
%{lm_sharedir}/portal
%{lm_bindir}/purgeCentralCache
585
%config(noreplace) %{_sysconfdir}/cron.d/lemonldap-ng-portal
586
%{lm_examplesdir}/portal
587 588
%defattr(750,%{lm_apacheuser},%{lm_apachegroup},-)
%dir %{lm_vardir}/captcha
589

590
%files test
591
%{lm_sharedir}/test
592
%config(noreplace) %{apache_confdir}/z-lemonldap-ng-test.conf
593

594
%files fastcgi-server
595
%{lm_sbindir}/llng-fastcgi-server
596
%config(noreplace) %{_sysconfdir}/default/llng-fastcgi-server
597
%{_unitdir}/llng-fastcgi-server.service
598
%{_tmpfilesdir}/llng-fastcgi-server.conf
599
%defattr(755,%{lm_apacheuser},%{lm_apachegroup},-)
600
%dir %{_rundir}/llng-fastcgi-server
Clément OUDOT's avatar
Clément OUDOT committed
601 602
%{lm_sharedir}/examples/llngapp.psgi

603
%files uwsgi-app
604
%config(noreplace) %{_sysconfdir}/uwsgi/apps-available/llng-server.yaml
605

606 607 608 609 610 611 612 613
%files nginx
%config(noreplace) %{_sysconfdir}/nginx/conf.d/handler-nginx.conf
%config(noreplace) %{_sysconfdir}/nginx/conf.d/manager-nginx.conf
%config(noreplace) %{_sysconfdir}/nginx/conf.d/nginx-lmlog.conf
%config(noreplace) %{_sysconfdir}/nginx/conf.d/nginx-lua-headers.conf
%config(noreplace) %{_sysconfdir}/nginx/conf.d/portal-nginx.conf
%config(noreplace) %{_sysconfdir}/nginx/conf.d/test-nginx.conf

614
%files -n perl-Lemonldap-NG-Common
615
%{_mandir}/man3/Lemonldap::NG::Common*.3pm.*
616 617
%{perl_vendorlib}/Lemonldap/NG/Common.pm
%{perl_vendorlib}/Lemonldap/NG/Common/
Clément OUDOT's avatar
Clément OUDOT committed
618
%{perl_vendorlib}/auto/Lemonldap/NG/Common/
619 620

%files -n perl-Lemonldap-NG-Handler
621 622
%{_mandir}/man3/Lemonldap::NG::Handler*.3pm.*
%{_mandir}/man3/Plack::Middleware::Auth::LemonldapNG.3pm.*
623 624
%{perl_vendorlib}/Lemonldap/NG/Handler.pm
%{perl_vendorlib}/Lemonldap/NG/Handler/
625
%{perl_vendorlib}/auto/Lemonldap/NG/Handler/
626
%{perl_vendorlib}/Plack/Middleware/Auth/LemonldapNG.pm
627 628

%files -n perl-Lemonldap-NG-Manager
629
%{_mandir}/man3/Lemonldap::NG::Manager*.3pm.*
630 631 632 633
%{perl_vendorlib}/Lemonldap/NG/Manager.pm
%{perl_vendorlib}/Lemonldap/NG/Manager/

%files -n perl-Lemonldap-NG-Portal
634
%{_mandir}/man3/Lemonldap::NG::Portal*.3pm.*
635 636
%{perl_vendorlib}/Lemonldap/NG/Portal.pm
%{perl_vendorlib}/Lemonldap/NG/Portal/
637

638
#==============================================================================
639
# Changelog
640
#==============================================================================
641
%changelog
Xavier Bachelot's avatar
Xavier Bachelot committed
642 643 644
* Fri Nov 30 2018 Xavier Bachelot <xavier@bachelot.org> - 2.0.0-2
- Huge spec file cleanup.

Clément OUDOT's avatar
Clément OUDOT committed
645 646
* Fri Nov 30 2018 Clement Oudot <clem.oudot@gmail.com> - 2.0.0-1
- Update to 2.0.0
647

Clément OUDOT's avatar
Clément OUDOT committed
648
* Fri Jul 20 2018 Clement Oudot <clem.oudot@gmail.com> - 2.0.0~beta1-1
Clément OUDOT's avatar
Clément OUDOT committed
649
- First beta version for 2.0.0
650

Clément OUDOT's avatar
Clément OUDOT committed
651 652
* Fri Jan 26 2018 Clement Oudot <clem.oudot@gmail.com> - 2.0.0~alpha3-1
- Third alpha version for 2.0.0
653

Clément OUDOT's avatar
Clément OUDOT committed
654 655
* Tue Jan 23 2018 Clement Oudot <clem.oudot@gmail.com> - 1.9.15-1
- Update to 1.9.15
656

Clément OUDOT's avatar
Clément OUDOT committed
657 658
* Fri Nov 24 2017 Clement Oudot <clem.oudot@gmail.com> - 1.9.14-1
- Update to 1.9.14
659

660 661
* Fri Sep 29 2017 Clement Oudot <clem.oudot@gmail.com> - 1.9.13-1
- Update to 1.9.13
662

Clément OUDOT's avatar
Clément OUDOT committed
663 664
* Thu Sep 14 2017 Clement Oudot <clem.oudot@gmail.com> - 2.0.0~alpha2-1
- Second alpha version for 2.0.0
665

666 667
* Tue Sep 12 2017 Clement Oudot <clem.oudot@gmail.com> - 1.9.12-1
- Update to 1.9.12
668

Clément OUDOT's avatar
Clément OUDOT committed
669 670
* Fri Sep 01 2017 Clement Oudot <clem.oudot@gmail.com> - 1.9.11-1
- Update to 1.9.11
671

672 673
* Mon Jul 10 2017 Clement Oudot <clem.oudot@gmail.com> - 2.0.0~alpha1-1
- First alpha version for 2.0.0
674

Clément OUDOT's avatar
Clément OUDOT committed
675 676
* Fri May 19 2017 Clement Oudot <clem.oudot@gmail.com> - 1.9.10-1
- Update to 1.9.10
677

Clément OUDOT's avatar
Clément OUDOT committed
678 679
* Thu Mar 16 2017 Clement Oudot <clem.oudot@gmail.com> - 1.9.9-1
- Update to 1.9.9
680

681 682
* Thu Mar 02 2017 Clement Oudot <clem.oudot@gmail.com> - 1.9.8-1
- Update to 1.9.8
683

684 685
* Mon Dec 12 2016 Clement Oudot <clem.oudot@gmail.com> - 1.9.7-1
- Update to 1.9.7
686

Clément OUDOT's avatar
Clément OUDOT committed
687 688
* Fri Oct 14 2016 Clement Oudot <clem.oudot@gmail.com> - 1.9.6-1
- Update to 1.9.6
689

690
* Mon Oct 10 2016 Clement Oudot <clem.oudot@gmail.com> - 1.4.11-1
691
- Update to 1.4.11
692

693 694
* Wed Jul 13 2016 Clement Oudot <clem.oudot@gmail.com> - 1.9.5-1
- Update to 1.9.5
695

696 697
* Wed Jul 13 2016 Clement Oudot <clem.oudot@gmail.com> - 1.4.10-1
- Update to 1.4.10
698

Clément OUDOT's avatar
Clément OUDOT committed
699 700
* Tue Jun 14 2016 Clement Oudot <clem.oudot@gmail.com> - 1.9.4-1
- Update to 1.9.4
701

Clément OUDOT's avatar
Clément OUDOT committed
702 703
* Tue Jun 07 2016 Clement Oudot <clem.oudot@gmail.com> - 1.9.3-1
- Update to 1.9.3
704

705 706
* Fri Jun 03 2016 Clement Oudot <clem.oudot@gmail.com> - 1.4.9-1
- Update to 1.4.9
707

708 709
* Sun May 01 2016 Clement Oudot <clem.oudot@gmail.com> - 1.9.2-1
- Update to 1.9.2
710

711 712
* Wed Apr 27 2016 Clement Oudot <clem.oudot@gmail.com> - 1.4.8-1
- Update to 1.4.8
713

714 715
* Thu Mar 31 2016 Clement Oudot <clem.oudot@gmail.com> - 1.9.1-1
- Update to 1.9.1
716

717 718
* Thu Mar 17 2016 Clement Oudot <clem.oudot@gmail.com> - 1.4.7-1
- Update to 1.4.7
719

720
* Wed Mar 02 2016 Clement Oudot <clem.oudot@gmail.com> - 1.9.0-1
Clément OUDOT's avatar
Clément OUDOT committed
721
- Update to 1.9.0
722

723 724
* Mon Sep 28 2015 Clement Oudot <clem.oudot@gmail.com> - 1.4.6-1
- Update to 1.4.6
725

726 727
* Mon May 11 2015 Clement Oudot <clem.oudot@gmail.com> - 1.4.5-1
- Update to 1.4.5
728

729
* Wed Apr 15 2015 Clement Oudot <clem.oudot@gmail.com> - 1.4.4-1
730
- Update to 1.4.4
731

732 733 734
* Thu Dec 18 2014 Clement Oudot <clem.oudot@gmail.com> - 1.4.3-1
- Update to 1.4.3
- Support for CentOS 7
735

736 737
* Fri Oct 31 2014 Clement Oudot <clem.oudot@gmail.com> - 1.4.2-1
- Update to 1.4.2
738

739 740
* Fri Jul 25 2014 Clement Oudot <clem.oudot@gmail.com> - 1.4.1-1
- Update to 1.4.1
741

Clément OUDOT's avatar
Clément OUDOT committed
742 743
* Fri Apr 18 2014 Clement Oudot <clem.oudot@gmail.com> - 1.4.0-1
- Update to 1.4.0
744

Clément OUDOT's avatar
Clément OUDOT committed
745 746
* Fri Mar 07 2014 Clement Oudot <clem.oudot@gmail.com> - 1.3.3-1
- Update to 1.3.3
747

Clément OUDOT's avatar
Clément OUDOT committed
748 749
* Thu Jan 23 2014 Clement Oudot <clem.oudot@gmail.com> - 1.3.2-1
- Update to 1.3.2
750

Clément OUDOT's avatar
Clément OUDOT committed
751 752
* Mon Nov 11 2013 Clement Oudot <clem.oudot@gmail.com> - 1.3.1-1
- Update to 1.3.1
753

Clément OUDOT's avatar
Clément OUDOT committed
754 755
* Sat Nov 2 2013 Clement Oudot <clem.oudot@gmail.com> - 1.3.0-1
- Update to 1.3.0
756

Clément OUDOT's avatar
Clément OUDOT committed
757 758
* Mon Aug 26 2013 Clement Oudot <clem.oudot@gmail.com> - 1.2.5-1
- Update to 1.2.5
759

Clément OUDOT's avatar
Clément OUDOT committed
760 761
* Tue Apr 23 2013 Clement Oudot <clem.oudot@gmail.com> - 1.2.4-1
- Update to 1.2.4
762

Clément OUDOT's avatar
Clément OUDOT committed
763 764
* Fri Feb 08 2013 Clement Oudot <clem.oudot@gmail.com> - 1.2.3-1
- Update to 1.2.3
765

766 767
* Mon Sep 17 2012 Clement Oudot <clem.oudot@gmail.com> - 1.2.2-1
- Update to 1.2.2
768

769
* Thu Jul 05 2012 Clement Oudot <clem.oudot@gmail.com> - 1.2.1-1
770
- Update to 1.2.1
771

772
* Sun Jun 17 2012 Clement Oudot <clem.oudot@gmail.com> - 1.2.0-1
773
- Update to 1.2.0
774

775 776
* Fri Oct 07 2011 Clement Oudot <clem.oudot@gmail.com> - 1.1.2-1
- Update to 1.1.2
777

778 779
* Fri Jul 29 2011 Clement Oudot <clem.oudot@gmail.com> - 1.1.1-1
- Update to 1.1.1
780

Clément OUDOT's avatar
Clément OUDOT committed
781 782
* Fri Jul 08 2011 Clement Oudot <clem.oudot@gmail.com> - 1.1.0-1
- Update to 1.1.0
783

784
* Thu Jun 30 2011 Clement Oudot <clem.oudot@gmail.com> - 1.0.6-1
Clément OUDOT's avatar
Clément OUDOT committed
785
- Update to 1.0.6
786

787 788
* Fri Apr 15 2011 Clement Oudot <clem.oudot@gmail.com> - 1.0.5-1
- Update to 1.0.5
789

Clément OUDOT's avatar
Clément OUDOT committed
790 791
* Tue Mar 22 2011 Clement Oudot <clem.oudot@gmail.com> - 1.0.4-1
- Update to 1.0.4
792

793 794
* Mon Mar 07 2011 Clement Oudot <clem.oudot@gmail.com> - 1.0.3-1
- Update to 1.0.3
795

796 797
* Mon Feb 28 2011 Clement Oudot <clem.oudot@gmail.com> - 1.0.2-1
- Update to 1.0.2
798

799 800
* Thu Dec 16 2010 Clement Oudot <clem.oudot@gmail.com> - 1.0.1-1
- Update to 1.0.1
801

Clément OUDOT's avatar
Clément OUDOT committed
802 803
* Fri Nov 26 2010 Clement Oudot <clem.oudot@gmail.com> - 1.0-1
- Update to 1.0
804

Clément OUDOT's avatar
Clément OUDOT committed
805 806 807
* Wed Jul 21 2010 Nicolas Chauvet <kwizart@gmail.com> - 0.9.4.1-3
- Fix compatibility with perl-LDAP 0.40
- Add BR perl(Auth::CAS)
808

Clément OUDOT's avatar
Clément OUDOT committed
809 810
* Mon Jul 12 2010 Nicolas Chauvet <nchauvet@linagora.com> - 0.9.4.1-2
- Protect lemonldap directories against word readability
811

Clément OUDOT's avatar
Clément OUDOT committed
812 813
* Mon Oct 12 2009 Nicolas Chauvet <nchauvet@linagora.com> - 0.9.4.1-1
- Update to 0.9.4.1
814

Clément OUDOT's avatar
Clément OUDOT committed
815 816 817 818
* Thu Sep 24 2009 Nicolas Chauvet <nchauvet@linagora.com> - 0.9.4-2
- Add Missing BuildRequires
- Remove filter for dependencies available in EPEL.
- use %%defattr to define ownership.
819

820
* Mon Jul 6 2009 Clement Oudot <coudot@linagora.com> - 0.9.4-1
821 822 823
- Upgrade to release 0.9.4
- Remove cronjob patch (included in 0.9.4)
- Split scriplets into subpackages
824
- Use conditions to build for other RPM distributions like OpenSuSE (thanks to clauded1)
825

826 827 828 829
* 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
830

831
* Fri Jan 9 2009 Clement Oudot <coudot@linagora.com> - 0.9.3.2-1
832
- Updated to release 0.9.3.2.
833
- Use internal version number for perl modules (compatibility with RPMforge packages)
834 835
- Merge with existing .spec file from RPMforge.
- Use the same directories as the Debian package.
836
- Create a symlink in Apache confguration.
Xavier Guimard's avatar
Xavier Guimard committed
837
- Create specific portal/manager/handler/conf packages independent from CPAN packages
838

839 840 841
* 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.
842

843
* Tue Oct 7 2008 David Hannequin <david.hannequin@linagora.com> 
844
- New spec file
845

846 847
* Sun Mar 02 2008 Dag Wieers <dag@wieers.com> - 0.85-1
- Updated to release 0.85.
848

849 850
* Tue Nov 13 2007 Dag Wieers <dag@wieers.com> - 0.84-1
- Updated to release 0.84.
851

852 853
* Wed May 02 2007 Dries Verachtert <dries@ulyssis.org> - 0.81-1
- Updated to release 0.81.
854

855 856
* Sun Apr 29 2007 Dries Verachtert <dries@ulyssis.org> - 0.75-1
- Initial package.