lemonldap-ng.spec 30.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
Xavier Guimard's avatar
Xavier Guimard committed
52
Version:        2.0.2
53
Release:        %{?pre_release:0.}1%{?pre_release:.%{pre_release}}%{?dist}
54
Summary:        LemonLDAP-NG WebSSO
Xavier Bachelot's avatar
Xavier Bachelot committed
55
License:        GPLv2+
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)
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)
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)
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)
128 129 130 131
%if 0%{?fedora} >= 29
BuildRequires:  perl(Lasso)
BuildRequires:  perl(Glib)
%endif
Xavier Bachelot's avatar
Xavier Bachelot committed
132 133 134 135
BuildRequires:  perl(Log::Log4perl)
BuildRequires:  perl(LWP::Protocol::https)
BuildRequires:  perl(LWP::UserAgent)
BuildRequires:  perl(MIME::Base64)
136
BuildRequires:  perl(MIME::Entity)
Xavier Bachelot's avatar
Xavier Bachelot committed
137
BuildRequires:  perl(mod_perl2)
138 139
BuildRequires:  perl(Mouse)
BuildRequires:  perl(Net::LDAP)
Xavier Bachelot's avatar
Xavier Bachelot committed
140 141
BuildRequires:  perl(Net::LDAP::Extension::SetPassword)
BuildRequires:  perl(Net::LDAP::Util)
142 143 144
%if 0%{?fedora}
BuildRequires:  perl(Net::OpenID::Server)
%endif
145
BuildRequires:  perl(Plack)
Xavier Bachelot's avatar
Xavier Bachelot committed
146 147 148 149 150 151 152 153
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)
154 155
BuildRequires:  perl(Regexp::Assemble)
BuildRequires:  perl(Regexp::Common)
Xavier Bachelot's avatar
Xavier Bachelot committed
156 157
BuildRequires:  perl(Safe)
BuildRequires:  perl(Scalar::Util)
158 159 160
%if 0%{?fedora}
BuildRequires:  perl(Sentry::Raven)
%endif
161
BuildRequires:  perl(SOAP::Lite)
Xavier Bachelot's avatar
Xavier Bachelot committed
162 163
BuildRequires:  perl(SOAP::Transport::HTTP)
BuildRequires:  perl(strict)
164
BuildRequires:  perl(String::Random)
Xavier Bachelot's avatar
Xavier Bachelot committed
165
BuildRequires:  perl(Sys::Syslog)
166 167
BuildRequires:  perl(Test::MockObject)
BuildRequires:  perl(Test::Pod) >= 1.00
Xavier Bachelot's avatar
Xavier Bachelot committed
168
BuildRequires:  perl(Time::Local)
169
BuildRequires:  perl(Unicode::String)
Xavier Bachelot's avatar
Xavier Bachelot committed
170 171 172 173 174
BuildRequires:  perl(URI)
BuildRequires:  perl(URI::Escape)
BuildRequires:  perl(URI::URL)
BuildRequires:  perl(utf8)
BuildRequires:  perl(warnings)
175
%if 0%{?fedora}
176
BuildRequires:  perl(Web::ID)
177 178
BuildRequires:  perl(XML::LibXML)
%endif
179 180
BuildRequires:  perl(XML::LibXSLT)
BuildRequires:  perl(XML::Simple)
Xavier Bachelot's avatar
Xavier Bachelot committed
181
BuildRequires:  perl(YAML)
182
%if 0%{?fedora} || 0%{?rhel} >= 7
183
BuildRequires:  systemd
184
%endif
185

186 187 188 189 190 191
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}
192

193 194
# Setup requires filtering
%if 0%{?rhel} == 6
195
%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;
196 197 198
%filter_setup
%endif

199 200 201 202 203 204
%if 0%{?rhel} >= 7
%{?perl_default_filter}
%global __requires_exclude perl\\(lasso|perl\\(Net::OpenID|perl\\(Web::ID|perl\\(XML::LibXML|perl\\(XML::LibXSLT|perl\\(Sentry::Raven
%endif

%if 0%{?fedora}
205
%{?perl_default_filter}
206
%if 0%{?fedora} < 29
207
%global __requires_exclude perl\\(Lasso
208
%endif
209
%endif
210

211
%description
212
LemonLdap::NG is a modular Web-SSO based on Apache::Session modules. It
213 214 215 216
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.
217

218 219 220
#==============================================================================
# Conf
#==============================================================================
221
%package conf
222
Summary:        LemonLDAP-NG configuration
223 224
Requires:       perl(Apache::Session)
Requires:       perl(IO::String)
225
Requires:       perl(Lemonldap::NG::Common) = %{version}-%{release}
226
Requires:       perl(mod_perl2)
227
%if 0%{?rhel}%{?fedora}
228 229 230 231
Requires(post):  httpd
%else
Requires(post):  apache2
%endif
232

233
%description conf
234 235
This package contains the main storage configuration.

236 237 238
#==============================================================================
# Documentation
#==============================================================================
239
%package doc
240
Summary:        LemonLDAP-NG documentation
241
Requires:       lemonldap-ng-conf = %{version}-%{release}
242

243
%description doc
244
This package contains HTML documentation.
245 246

#==============================================================================
247 248
# Handler
#==============================================================================
249
%package handler
250
Summary:        LemonLDAP-NG handler
251
%if 0%{?rhel}%{?fedora}
252 253
Requires:       crontabs
%endif
254 255
Requires:       lemonldap-ng-conf = %{version}-%{release}
Requires:       perl(Lemonldap::NG::Handler) = %{version}-%{release}
256

257
%description handler
258 259 260 261 262
This package deploys the Apache Handler.

#==============================================================================
# Manager
#==============================================================================
263
%package manager
264
Summary:        LemonLDAP-NG administration interface
265 266
Requires:       lemonldap-ng-conf = %{version}-%{release}
Requires:       perl(Lemonldap::NG::Manager) = %{version}-%{release}
267

268
%description manager
269
This package deploys the administration interface and sessions explorer.
270 271 272 273

#==============================================================================
# Portal
#==============================================================================
274
%package portal
275
Summary:        LemonLDAP-NG authentication portal
276
%if 0%{?rhel}%{?fedora}
277 278
Requires:       crontabs
%endif
279 280
Requires:       lemonldap-ng-conf = %{version}-%{release}
Requires:       perl(Lemonldap::NG::Portal) = %{version}-%{release}
281

282
%description portal
283 284 285 286
This package deploys the authentication portal.

#==============================================================================
# Test
287
#==============================================================================
288
%package test
289
Summary:        LemonLDAP-NG test applications
290
Requires:       lemonldap-ng-conf = %{version}-%{release}
291

292
%description test
293 294
This package deploys small test applications.

295 296 297
#==============================================================================
# FastCGI Server
#==============================================================================
298
%package fastcgi-server
299
Summary:        LemonLDAP-NG FastCGI Server
300
Requires:       lemonldap-ng-conf = %{version}-%{release}
301
%if 0%{?rhel}%{?fedora}
302 303 304 305 306
Requires:       mod_fcgid
%else
Requires:       apache2-mod_fcgid
%endif
Requires:       perl(FCGI::ProcManager)
307

308
%description fastcgi-server
309 310
This package deploys files needed to start a FastCGI server.

Clément OUDOT's avatar
Clément OUDOT committed
311 312 313
#==============================================================================
# UWSGI Application
#==============================================================================
314
%package uwsgi-app
Clément OUDOT's avatar
Clément OUDOT committed
315
Summary:        LemonLDAP-NG UWSGI Application
316
Requires:       uwsgi-plugin-psgi
Clément OUDOT's avatar
Clément OUDOT committed
317

318
%description uwsgi-app
Clément OUDOT's avatar
Clément OUDOT committed
319 320 321
LemonLDAP::NG uWSGI server provides a replacement to LemonLDAP::NG FastCGI
server, using uWSGI instead of Plack FCGI.

322 323 324 325 326 327 328 329 330 331
#==============================================================================
# Nginx server
#==============================================================================
%package nginx
Summary:        LemonLDAP-NG Nginx support
Requires:       nginx

%description nginx
Nginx support for LemonLDAP::NG.

332 333 334 335
#==============================================================================
# CPAN modules - Common
#==============================================================================
%package -n perl-Lemonldap-NG-Common
336 337
Summary:        LemonLDAP-NG Common Modules

338
%description -n perl-Lemonldap-NG-Common
339 340
This package installs the configuration libraries used by other LemonLDAP::NG
modules.
341 342

#==============================================================================
343
# CPAN modules - Handler
344 345 346 347 348
#==============================================================================
%package -n perl-Lemonldap-NG-Handler
Summary:        LemonLDAP-NG Handler Modules

%description -n perl-Lemonldap-NG-Handler
349 350
This package installs the Apache module part (handler) used to protect web
areas.
351 352

#==============================================================================
353
# CPAN modules -  Manager
354 355 356 357 358 359 360 361
#==============================================================================
%package -n perl-Lemonldap-NG-Manager
Summary:        LemonLDAP-NG Manager Modules

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

#==============================================================================
362
# CPAN modules - Portal
363 364 365 366 367 368 369
#==============================================================================
%package -n perl-Lemonldap-NG-Portal
Summary:        LemonLDAP-NG Portal Modules

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

370
#==============================================================================
371
# Source preparation
372
#==============================================================================
373
%prep
374
%setup -q -n %{name}-%{version}%{?pre_release:~%{pre_release}}
375

376

377
#==============================================================================
378
# Building
379
#==============================================================================
380
%build
Xavier Bachelot's avatar
Xavier Bachelot committed
381 382 383
%{__make} %{?_smp_mflags} configure \
    STORAGECONFFILE=%{lm_storagefile} \
    PERLOPTIONS="INSTALLDIRS=vendor"
384
%{__make} %{?_smp_mflags}
385

386
#==============================================================================
387
# Installation
388
#============================================================================
389
%install
390
%{__make} %{?_smp_mflags} install \
391 392
    DESTDIR=%{buildroot} \
    PREFIX=%{lm_prefix} \
393 394
    BINDIR=%{lm_bindir} \
    SBINDIR=%{lm_sbindir} \
395
    FASTCGISOCKDIR=%{_rundir}/llng-fastcgi-server \
396
    DOCUMENTROOT=%{lm_sharedir} \
397
    EXAMPLESDIR=%{lm_examplesdir} \
398
    HANDLERDIR=%{lm_sharedir}/handler \
399 400 401 402 403 404
    MANAGERDIR=%{lm_sharedir}/manager \
    STORAGECONFFILE=%{lm_storagefile} \
    TOOLSDIR=%{lm_sharedir}/ressources \
    CONFDIR=%{lm_confdir} \
    CRONDIR=%{_sysconfdir}/cron.d \
    DATADIR=%{lm_vardir} \
405 406
    INITDIR=%{_sysconfdir}/init.d \
    ETCDEFAULTDIR=%{_sysconfdir}/default \
407 408
    DNSDOMAIN=%{lm_dnsdomain} \
    APACHEVERSION=%{apache_version} \
409
    APACHELOGDIR=%{_localstatedir}/log/httpd \
410
    UWSGIYAMLDIR=%{_sysconfdir}/uwsgi/apps-available \
411 412
    LLNGAPPDIR=%{lm_sharedir}/llng-server \
    PROD=yes
413

414
# Remove some unwanted files
415 416 417
find %{buildroot} -name .packlist -exec rm -f {} \;
find %{buildroot} -name perllocal.pod -exec rm -f {} \;
find %{buildroot} -name *.bak -exec rm -f {} \;
418

419 420
# Install files for FastCGI Server
mkdir -p %{buildroot}%{_unitdir}
Xavier Bachelot's avatar
Xavier Bachelot committed
421 422
install -m644 fastcgi-server/systemd/llng-fastcgi-server.service \
    %{buildroot}%{_unitdir}
423 424
sed -i \
    -e 's:__FASTCGISOCKDIR__:%{_rundir}/llng-fastcgi-server:' \
425
    -e 's:__SBINDIR__:%{lm_sbindir}:' \
Xavier Bachelot's avatar
Xavier Bachelot committed
426
    %{buildroot}%{_unitdir}/llng-fastcgi-server.service
427
rm -f %{buildroot}%{_sysconfdir}/init.d/llng-fastcgi-server
428 429

mkdir -p %{buildroot}%{_tmpfilesdir}
Xavier Bachelot's avatar
Xavier Bachelot committed
430 431
install -m644 fastcgi-server/systemd/llng-fastcgi-server.tmpfile \
    %{buildroot}%{_tmpfilesdir}/llng-fastcgi-server.conf
432 433 434 435
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
436
    %{buildroot}%{_tmpfilesdir}/llng-fastcgi-server.conf
437

Clément OUDOT's avatar
Clément OUDOT committed
438
# UWSGI Application
439
mkdir -p %{buildroot}%{_sysconfdir}/uwsgi/apps-available
Clément OUDOT's avatar
Clément OUDOT committed
440 441
mkdir -p %{buildroot}%{lm_sharedir}/llng-server

442
# Set apache user in some files (see Makefile)
Clément OUDOT's avatar
Clément OUDOT committed
443 444 445
# 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
446
sed -i 's/nobody/%{lm_apacheuser}/' %{buildroot}%{_sysconfdir}/cron.d/*
Xavier Bachelot's avatar
Xavier Bachelot committed
447
sed -i 's/nobody/%{lm_apacheuser}/' \
448
    %{buildroot}%{lm_bindir}/lmConfigEditor
Xavier Bachelot's avatar
Xavier Bachelot committed
449
sed -i 's/nobody/%{lm_apacheuser}/g' \
450
    %{buildroot}%{lm_bindir}/lemonldap-ng-cli
Xavier Bachelot's avatar
Xavier Bachelot committed
451 452
sed -i 's/nobody/%{lm_apacheuser}/g' \
    %{buildroot}%{_sysconfdir}/default/llng-fastcgi-server
453

454
# Set UNIX rights
455
mkdir -p %{buildroot}%{lm_vardir}/sessions/lock
456
mkdir -p %{buildroot}%{lm_vardir}/psessions/lock
457 458 459 460 461
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
462 463
chmod 770 %{buildroot}%{lm_vardir}/psessions
chmod 770 %{buildroot}%{lm_vardir}/psessions/lock
464
chmod 770 %{buildroot}%{lm_vardir}/notifications
465
chmod 770 %{buildroot}%{lm_vardir}/captcha
466
chmod 775 %{buildroot}%{lm_sbindir}/llng-fastcgi-server
467

468 469 470 471 472 473 474
# 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
475

476 477 478 479
# Install nginx conf files
mkdir -p %{buildroot}%{_sysconfdir}/nginx/conf.d/
mv %{buildroot}%{lm_confdir}/*nginx*.conf \
    %{buildroot}%{_sysconfdir}/nginx/conf.d/
480 481 482 483 484 485 486 487 488
# Move lua and log configuration
mv %{buildroot}%{_sysconfdir}/nginx/conf.d/nginx-lua-headers.conf \
    %{buildroot}%{_sysconfdir}/nginx/conf.d/nginx-lmlog.conf \
    %{buildroot}%{_sysconfdir}/nginx/
# Replace paths in main configuration files
sed -i 's:/etc/lemonldap-ng/nginx-lmlog.conf:/etc/nginx/nginx-lmlog.conf:' \
    %{buildroot}%{_sysconfdir}/nginx/conf.d/handler-nginx.conf
sed -i 's:/etc/lemonldap-ng/nginx-lua-headers.conf:/etc/nginx/nginx-lua-headers.conf:' \
    %{buildroot}%{_sysconfdir}/nginx/conf.d/test-nginx.conf
489

490 491 492
# Remove for_etc_hosts from %%{_sysconfdir}
mv %{buildroot}%{lm_confdir}/for_etc_hosts .

Xavier Bachelot's avatar
Xavier Bachelot committed
493 494 495 496 497 498 499 500 501 502 503
# 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

504 505 506 507
#==============================================================================
# Run test
#==============================================================================
%check
Xavier Bachelot's avatar
Xavier Bachelot committed
508 509 510 511 512 513
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}
514

515
#==============================================================================
516
# Post Installation
517
#==============================================================================
518
%post conf
Clément OUDOT's avatar
Clément OUDOT committed
519 520 521
# 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
522 523 524
    if [ -e %{lm_confdir}/storage.conf \
         -o -e %{lm_confdir}/apply.conf \
         -o -e %{lm_confdir}/apps-list.xml ] ; then
525
        # Run migration script
526
        %{lm_bindir}/lmMigrateConfFiles2ini 2>&1 > /dev/null || :
527 528 529
        # Fix ownership
        chgrp %{lm_apachegroup} %{lm_storagefile} || :
    fi
530
fi
531 532 533 534 535
# 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
536

537
#==============================================================================
538
# Pre uninstallation
539
#==============================================================================
540
%preun conf
Clément OUDOT's avatar
Clément OUDOT committed
541 542
# Upgrade from previous version
if [ $1 -eq 1 ] ; then
543 544
    # Remove old symlinks in Apache configuration
    rm -f %{apache_confdir}/z-lemonldap-ng*.conf 2>&1 > /dev/null || :
545
fi
546

547 548 549 550 551 552 553 554
%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
555

556
%files
557

558
%files conf
559
%doc changelog INSTALL README.md AUTHORS CONTRIBUTING.md
560
%doc for_etc_hosts
561
%license COPYING LICENSE
562
%dir %{lm_confdir}
563
%config(noreplace) %attr(-,root,%{lm_apachegroup}) %{lm_storagefile}
564 565 566
%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
567
%{_mandir}/man1/convertConfig*
568 569 570 571 572 573 574
%dir %{_libexecdir}/%{name}
%dir %{lm_sbindir}
%dir %{lm_bindir}
%{lm_bindir}/convertConfig
%{lm_bindir}/importMetadata
%{lm_bindir}/lmMigrateConfFiles2ini
%{lm_bindir}/rotateOidcKeys
575
%dir %{lm_examplesdir}
576
%dir %{lm_sharedir}
577
%{lm_sharedir}/ressources/
578
%dir %{lm_vardir}
579
%defattr(640,%{lm_apacheuser},%{lm_apachegroup},750)
580 581 582
%dir %{lm_vardir}/conf
%dir %{lm_vardir}/sessions
%dir %{lm_vardir}/sessions/lock
583 584
%dir %{lm_vardir}/psessions
%dir %{lm_vardir}/psessions/lock
585
%dir %{lm_vardir}/notifications
586
%config(noreplace) %{lm_vardir}/conf/lmConf-1.json
587

588
%files doc
589
%doc %{lm_sharedir}/doc
590
%doc changelog INSTALL README.md AUTHORS CONTRIBUTING.md
591
%license COPYING LICENSE
592

593
%files handler
594
%{lm_bindir}/purgeLocalCache
595
%config(noreplace) %{_sysconfdir}/cron.d/lemonldap-ng-handler
596
%{lm_sharedir}/handler
597
%{lm_examplesdir}/handler
598
%{lm_sharedir}/llng-server/llng-server.psgi
599

600
%files manager
601 602
%{lm_sharedir}/manager
%{lm_examplesdir}/manager
603 604
%{lm_bindir}/lmConfigEditor
%{lm_bindir}/lemonldap-ng-cli
605
%{_mandir}/man1/lemonldap-ng-cli*
606

607
%files portal
608 609
%{lm_sharedir}/portal
%{lm_bindir}/purgeCentralCache
610
%config(noreplace) %{_sysconfdir}/cron.d/lemonldap-ng-portal
611
%{lm_examplesdir}/portal
612 613
%defattr(750,%{lm_apacheuser},%{lm_apachegroup},-)
%dir %{lm_vardir}/captcha
614

615
%files test
616
%{lm_sharedir}/test
617
%config(noreplace) %{apache_confdir}/z-lemonldap-ng-test.conf
618

619
%files fastcgi-server
620
%{lm_sbindir}/llng-fastcgi-server
621
%config(noreplace) %{_sysconfdir}/default/llng-fastcgi-server
622
%{_unitdir}/llng-fastcgi-server.service
623
%{_tmpfilesdir}/llng-fastcgi-server.conf
624
%defattr(755,%{lm_apacheuser},%{lm_apachegroup},-)
625
%dir %{_rundir}/llng-fastcgi-server
Clément OUDOT's avatar
Clément OUDOT committed
626 627
%{lm_sharedir}/examples/llngapp.psgi

628
%files uwsgi-app
629
%config(noreplace) %{_sysconfdir}/uwsgi/apps-available/llng-server.yaml
630

631 632 633
%files nginx
%config(noreplace) %{_sysconfdir}/nginx/conf.d/handler-nginx.conf
%config(noreplace) %{_sysconfdir}/nginx/conf.d/manager-nginx.conf
634 635
%config(noreplace) %{_sysconfdir}/nginx/nginx-lmlog.conf
%config(noreplace) %{_sysconfdir}/nginx/nginx-lua-headers.conf
636 637 638
%config(noreplace) %{_sysconfdir}/nginx/conf.d/portal-nginx.conf
%config(noreplace) %{_sysconfdir}/nginx/conf.d/test-nginx.conf

639
%files -n perl-Lemonldap-NG-Common
640
%{_mandir}/man3/Lemonldap::NG::Common*.3pm.*
641 642
%dir %{perl_vendorlib}/Lemonldap
%dir %{perl_vendorlib}/Lemonldap/NG
643 644
%{perl_vendorlib}/Lemonldap/NG/Common.pm
%{perl_vendorlib}/Lemonldap/NG/Common/
645
%{perl_vendorlib}/auto/Lemonldap/NG/Common/
646 647

%files -n perl-Lemonldap-NG-Handler
648 649
%{_mandir}/man3/Lemonldap::NG::Handler*.3pm.*
%{_mandir}/man3/Plack::Middleware::Auth::LemonldapNG.3pm.*
650 651
%{perl_vendorlib}/Lemonldap/NG/Handler.pm
%{perl_vendorlib}/Lemonldap/NG/Handler/
652
%{perl_vendorlib}/auto/Lemonldap/NG/Handler/
653
%{perl_vendorlib}/Plack/Middleware/Auth/LemonldapNG.pm
654 655

%files -n perl-Lemonldap-NG-Manager
656
%{_mandir}/man3/Lemonldap::NG::Manager*.3pm.*
657 658 659 660
%{perl_vendorlib}/Lemonldap/NG/Manager.pm
%{perl_vendorlib}/Lemonldap/NG/Manager/

%files -n perl-Lemonldap-NG-Portal
661
%{_mandir}/man3/Lemonldap::NG::Portal*.3pm.*
662 663
%{perl_vendorlib}/Lemonldap/NG/Portal.pm
%{perl_vendorlib}/Lemonldap/NG/Portal/
664

665
#==============================================================================
666
# Changelog
667
#==============================================================================
668
%changelog
669 670 671
* Fri Dec 21 2018 Clement Oudot <clem.oudot@gmail.com> - 2.0.1-1
- Update to 2.0.1

Clément OUDOT's avatar
Clément OUDOT committed
672 673 674
* Sat Dec 01 2018 Clement Oudot <clem.oudot@gmail.com> - 2.0.0-3
- Fix warnings in Manager

Xavier Bachelot's avatar
Xavier Bachelot committed
675 676 677
* 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
678 679
* Fri Nov 30 2018 Clement Oudot <clem.oudot@gmail.com> - 2.0.0-1
- Update to 2.0.0
680

681 682 683
* Fri Oct 05 2018 Clement Oudot <clem.oudot@gmail.com> - 1.9.18-1
- Update to 1.9.18

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

687
* Sun Jun 17 2018 Clement Oudot <clem.oudot@gmail.com> - 1.9.17-1
688 689 690 691 692
- Update to 1.9.17

* Fri Mar 16 2018 Clement Oudot <clem.oudot@gmail.com> - 1.9.16-1
- Update to 1.9.16

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

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

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

702 703
* Fri Sep 29 2017 Clement Oudot <clem.oudot@gmail.com> - 1.9.13-1
- Update to 1.9.13
704

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

708 709
* Tue Sep 12 2017 Clement Oudot <clem.oudot@gmail.com> - 1.9.12-1
- Update to 1.9.12
710

711 712
* Fri Sep 01 2017 Clement Oudot <clem.oudot@gmail.com> - 1.9.11-1
- Update to 1.9.11
713

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

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

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

723 724
* Thu Mar 02 2017 Clement Oudot <clem.oudot@gmail.com> - 1.9.8-1
- Update to 1.9.8
725

726 727
* Mon Dec 12 2016 Clement Oudot <clem.oudot@gmail.com> - 1.9.7-1
- Update to 1.9.7
728

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

732
* Mon Oct 10 2016 Clement Oudot <clem.oudot@gmail.com> - 1.4.11-1
733
- Update to 1.4.11
734

735 736
* Wed Jul 13 2016 Clement Oudot <clem.oudot@gmail.com> - 1.9.5-1
- Update to 1.9.5
737

738 739
* Wed Jul 13 2016 Clement Oudot <clem.oudot@gmail.com> - 1.4.10-1
- Update to 1.4.10
740

741 742
* Tue Jun 14 2016 Clement Oudot <clem.oudot@gmail.com> - 1.9.4-1
- Update to 1.9.4
743

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

747 748
* Fri Jun 03 2016 Clement Oudot <clem.oudot@gmail.com> - 1.4.9-1
- Update to 1.4.9
749

750 751
* Sun May 01 2016 Clement Oudot <clem.oudot@gmail.com> - 1.9.2-1
- Update to 1.9.2
752

753 754
* Wed Apr 27 2016 Clement Oudot <clem.oudot@gmail.com> - 1.4.8-1
- Update to 1.4.8
755

756 757
* Thu Mar 31 2016 Clement Oudot <clem.oudot@gmail.com> - 1.9.1-1
- Update to 1.9.1
758

759 760
* Thu Mar 17 2016 Clement Oudot <clem.oudot@gmail.com> - 1.4.7-1
- Update to 1.4.7
761

762
* Wed Mar 02 2016 Clement Oudot <clem.oudot@gmail.com> - 1.9.0-1
763
- Update to 1.9.0
764

765 766
* Mon Sep 28 2015 Clement Oudot <clem.oudot@gmail.com> - 1.4.6-1
- Update to 1.4.6
767

768 769
* Mon May 11 2015 Clement Oudot <clem.oudot@gmail.com> - 1.4.5-1
- Update to 1.4.5
770

771
* Wed Apr 15 2015 Clement Oudot <clem.oudot@gmail.com> - 1.4.4-1
772
- Update to 1.4.4
773

774 775 776
* Thu Dec 18 2014 Clement Oudot <clem.oudot@gmail.com> - 1.4.3-1
- Update to 1.4.3
- Support for CentOS 7
777

778 779
* Fri Oct 31 2014 Clement Oudot <clem.oudot@gmail.com> - 1.4.2-1
- Update to 1.4.2
780

781 782
* Fri Jul 25 2014 Clement Oudot <clem.oudot@gmail.com> - 1.4.1-1
- Update to 1.4.1
783

784 785
* Fri Apr 18 2014 Clement Oudot <clem.oudot@gmail.com> - 1.4.0-1
- Update to 1.4.0
786

787 788
* Fri Mar 07 2014 Clement Oudot <clem.oudot@gmail.com> - 1.3.3-1
- Update to 1.3.3
789

790 791
* Thu Jan 23 2014 Clement Oudot <clem.oudot@gmail.com> - 1.3.2-1
- Update to 1.3.2
792

793 794
* Mon Nov 11 2013 Clement Oudot <clem.oudot@gmail.com> - 1.3.1-1
- Update to 1.3.1
795

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

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

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

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

808 809
* Mon Sep 17 2012 Clement Oudot <clem.oudot@gmail.com> - 1.2.2-1
- Update to 1.2.2
810

811
* Thu Jul 05 2012 Clement Oudot <clem.oudot@gmail.com> - 1.2.1-1
812
- Update to 1.2.1
813

814
* Sun Jun 17 2012 Clement Oudot <clem.oudot@gmail.com> - 1.2.0-1
815
- Update to 1.2.0
816

817 818
* Fri Oct 07 2011 Clement Oudot <clem.oudot@gmail.com> - 1.1.2-1
- Update to 1.1.2
819

820 821
* Fri Jul 29 2011 Clement Oudot <clem.oudot@gmail.com> - 1.1.1-1
- Update to 1.1.1
822

823 824
* Fri Jul 08 2011 Clement Oudot <clem.oudot@gmail.com> - 1.1.0-1
- Update to 1.1.0
825

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

829 830
* Fri Apr 15 2011 Clement Oudot <clem.oudot@gmail.com> - 1.0.5-1
- Update to 1.0.5
831

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

835 836
* Mon Mar 07 2011 Clement Oudot <clem.oudot@gmail.com> - 1.0.3-1
- Update to 1.0.3
837

838 839
* Mon Feb 28 2011 Clement Oudot <clem.oudot@gmail.com> - 1.0.2-1
- Update to 1.0.2
840

841 842
* Thu Dec 16 2010 Clement Oudot <clem.oudot@gmail.com> - 1.0.1-1
- Update to 1.0.1
843

844 845
* Fri Nov 26 2010 Clement Oudot <clem.oudot@gmail.com> - 1.0-1
- Update to 1.0
846

847 848 849
* 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)
850

851 852
* Mon Jul 12 2010 Nicolas Chauvet <nchauvet@linagora.com> - 0.9.4.1-2
- Protect lemonldap directories against word readability
853

854 855
* Mon Oct 12 2009 Nicolas Chauvet <nchauvet@linagora.com> - 0.9.4.1-1
- Update to 0.9.4.1
856

857 858 859 860
* 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.
861

862
* Mon Jul 6 2009 Clement Oudot <coudot@linagora.com> - 0.9.4-1
863 864 865
- Upgrade to release 0.9.4
- Remove cronjob patch (included in 0.9.4)
- Split scriplets into subpackages
866
- Use conditions to build for other RPM distributions like OpenSuSE (thanks to clauded1)
867

868 869 870 871
* 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
872

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

881 882 883
* 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.
884

885
* Tue Oct 7 2008 David Hannequin <david.hannequin@linagora.com> 
886
- New spec file
887

888 889
* Sun Mar 02 2008 Dag Wieers <dag@wieers.com> - 0.85-1
- Updated to release 0.85.
890

891 892
* Tue Nov 13 2007 Dag Wieers <dag@wieers.com> - 0.84-1
- Updated to release 0.84.
893

894 895
* Wed May 02 2007 Dries Verachtert <dries@ulyssis.org> - 0.81-1
- Updated to release 0.81.
896

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