View | Details | Raw Unified | Return to bug 19735
Collapse All | Expand All

(-)a/C4/Installer.pm (-1 lines)
Lines 22-28 use Modern::Perl; Link Here
22
use Encode qw( encode is_utf8 );
22
use Encode qw( encode is_utf8 );
23
use DBIx::RunSQL;
23
use DBIx::RunSQL;
24
use C4::Context;
24
use C4::Context;
25
use C4::Installer::PerlModules;
26
use DBI;
25
use DBI;
27
use Koha;
26
use Koha;
28
27
(-)a/C4/Installer/PerlDependencies.pm (-940 lines)
Lines 1-940 Link Here
1
package C4::Installer::PerlDependencies;
2
3
use warnings;
4
use strict;
5
6
our $PERL_DEPS = {
7
    'Try::Tiny' => {
8
        'usage'    => 'Core',
9
        'required' => '1',
10
        'min_ver'  => '0.22'
11
    },
12
    'Plack::Middleware::ReverseProxy' => {
13
        'usage'    => 'Plack',
14
        'required' => '1',
15
        'min_ver'  => '0.14'
16
    },
17
    'XML::LibXSLT' => {
18
        'usage'    => 'Core',
19
        'required' => '1',
20
        'min_ver'  => '1.59'
21
    },
22
    'Text::CSV::Encoded' => {
23
        'usage'    => 'Core',
24
        'required' => '1',
25
        'min_ver'  => '0.09'
26
    },
27
    'Storable' => {
28
        'usage'    => 'Core',
29
        'required' => '1',
30
        'min_ver'  => '2.20'
31
    },
32
    'PDF::API2' => {
33
        'usage'    => 'Core',
34
        'required' => '1',
35
        'min_ver'  => '2'
36
    },
37
    'Text::CSV_XS' => {
38
        'usage'    => 'Core',
39
        'required' => '1',
40
        'min_ver'  => '0.32'
41
    },
42
    'Schedule::At' => {
43
        'usage'    => 'Core',
44
        'required' => '1',
45
        'min_ver'  => '1.06'
46
    },
47
    'MIME::Lite' => {
48
        'usage'    => 'Core',
49
        'required' => '1',
50
        'min_ver'  => '3'
51
    },
52
    'GD' => {
53
        'usage'    => 'Patron Images Feature',
54
        'required' => '0',
55
        'min_ver'  => '2.39'
56
    },
57
    'List::MoreUtils' => {
58
        'usage'    => 'Core',
59
        'required' => '1',
60
        'min_ver'  => '0.21'
61
    },
62
    'DBI' => {
63
        'usage'    => 'Core',
64
        'required' => '1',
65
        'min_ver'  => '1.53'
66
    },
67
    'DBIx::Class::Schema::Loader' => {
68
        'usage'    => 'Core',
69
        'required' => '1',
70
        'min_ver'  => '0.07039'
71
    },
72
    'Net::Z3950::ZOOM' => {
73
        'usage'    => 'Core',
74
        'required' => '1',
75
        'min_ver'  => '1.16'
76
    },
77
    'Biblio::EndnoteStyle' => {
78
        'usage'    => 'Core',
79
        'required' => '1',
80
        'min_ver'  => '0.05'
81
    },
82
    'Date::Calc' => {
83
        'usage'    => 'Core',
84
        'required' => '1',
85
        'min_ver'  => '5.4'
86
    },
87
    'Mail::Sendmail' => {
88
        'usage'    => 'Core',
89
        'required' => '1',
90
        'min_ver'  => '0.79'
91
    },
92
    'DBD::mysql' => {
93
        'usage'    => 'Core',
94
        'required' => '1',
95
        'min_ver'  => '4.004'
96
    },
97
    'XML::LibXML' => {
98
        'usage'    => 'Core',
99
        'required' => '1',
100
        'min_ver'  => '1.59'
101
    },
102
    'Email::Date' => {
103
        'usage'    => 'Core',
104
        'required' => '1',
105
        'min_ver'  => '1.103'
106
    },
107
    'Exception::Class' => {
108
        'usage'    => 'Core',
109
        'required' => '1.38',
110
        'min_ver'  => '1.38'
111
    },
112
    'HTML::Scrubber' => {
113
        'usage'    => 'Core',
114
        'required' => '1',
115
        'min_ver'  => '0.08'
116
    },
117
    'XML::Dumper' => {
118
        'usage'    => 'Core',
119
        'required' => '1',
120
        'min_ver'  => '0.81'
121
    },
122
    'URI::Escape' => {
123
        'usage'    => 'Core',
124
        'required' => '1',
125
        'min_ver'  => '3.31'
126
    },
127
    'Unicode::Normalize' => {
128
        'usage'    => 'Core',
129
        'required' => '1',
130
        'min_ver'  => '0.32'
131
    },
132
    'Text::Wrap' => {
133
        'usage'    => 'Core',
134
        'required' => '1',
135
        'min_ver'  => '2005.082401'
136
    },
137
    'Test' => {
138
        'usage'    => 'Core',
139
        'required' => '1',
140
        'min_ver'  => '1.25'
141
    },
142
    'Locale::PO' => {
143
        'usage'    => 'Core',
144
        'required' => '1',
145
        'min_ver'  => '0.17'
146
    },
147
    'LWP::Simple' => {
148
        'usage'    => 'Core',
149
        'required' => '1',
150
        'min_ver'  => '1.41'
151
    },
152
    'DBD::SQLite2' => {
153
        'usage'    => 'Offline Circulation Feature',
154
        'required' => '0',
155
        'min_ver'  => '0.33'
156
    },
157
    'SMS::Send' => {
158
        'usage'    => 'SMS Messaging Feature',
159
        'required' => '0',
160
        'min_ver'  => '0.05'
161
    },
162
    'XML::SAX::ParserFactory' => {
163
        'usage'    => 'Core',
164
        'required' => '1',
165
        'min_ver'  => '1.01'
166
    },
167
    'PDF::API2::Util' => {
168
        'usage'    => 'Core',
169
        'required' => '1',
170
        'min_ver'  => '2'
171
    },
172
    'Class::Accessor' => {
173
        'usage'    => 'Core',
174
        'required' => '1',
175
        'min_ver'  => '0.3'
176
    },
177
    'HTTP::OAI' => {
178
        'usage'    => 'Core',
179
        'required' => '1',
180
        'min_ver'  => '3.2'
181
    },
182
    'LWP::UserAgent' => {
183
        'usage'    => 'Core',
184
        'required' => '1',
185
        'min_ver'  => '2.033'
186
    },
187
    'MIME::Base64' => {
188
        'usage'    => 'Core',
189
        'required' => '1',
190
        'min_ver'  => '3.07'
191
    },
192
    'Algorithm::CheckDigits' => {
193
        'usage'    => 'Core',
194
        'required' => '1',
195
        'min_ver'  => '0.5'
196
    },
197
    'Net::LDAP' => {
198
        'usage'    => 'LDAP Interface Feature',
199
        'required' => '0',
200
        'min_ver'  => '0.33'
201
    },
202
    'PDF::Reuse' => {
203
        'usage'    => 'Core',
204
        'required' => '1',
205
        'min_ver'  => '0.36'
206
    },
207
    'Text::PDF' => {
208
        'usage'    => 'Core',
209
        'required' => '1',
210
        'min_ver'  => '0.29',
211
        # We don't use this directly, but it's not a required dependency for
212
        # PDF::Reuse however we need it via that or tests fail.
213
    },
214
    'Font::TTF' => {
215
        'usage'    => 'Core',
216
        'required' => '1',
217
        'min_ver'  => '0.45',
218
        # Also needed for our use of PDF::Reuse
219
    },
220
    'DateTime' => {
221
        'usage'    => 'Core',
222
        'required' => '1',
223
        'min_ver'  => '0.58'
224
    },
225
    'DateTime::TimeZone' => {
226
        'usage'    => 'Core',
227
        'required' => '1',
228
        'min_ver'  => '1.20'
229
    },
230
    'DateTime::Format::MySQL' => {
231
        'usage'    => 'Core',
232
        'required' => '1',
233
        'min_ver'  => '0.04'
234
    },
235
    'DateTime::Set' => {
236
        'usage'    => 'Core',
237
        'required' => '1',
238
        'min_ver'  => '0.28'
239
    },
240
    'DateTime::Event::ICal' => {
241
        'usage'    => 'Core',
242
        'required' => '1',
243
        'min_ver'  => '0.08'
244
    },
245
    'Graphics::Magick' => {
246
        'usage'    => 'Patron Card Creator Feature',
247
        'required' => '0',
248
        'min_ver'  => '1.3.05'
249
    },
250
    'MARC::Charset' => {
251
        'usage'    => 'Core',
252
        'required' => '1',
253
        'min_ver'  => '0.98'
254
    },
255
    'Cache::Memcached' => {
256
        'usage'    => 'Caching',
257
        'required' => '0',
258
        'min_ver'  => '1.30'
259
    },
260
    'Cache::Memcached::Fast' => {
261
        'usage'    => 'Caching',
262
        'required' => '0',
263
        'min_ver'  => '0.17'
264
    },
265
    'Cache::FastMmap' => {
266
        'usage'    => 'Caching',
267
        'required' => '0',
268
        'min_ver'  => '1.34'
269
    },
270
    'Cache::Memory' => {
271
        'usage'    => 'Caching',
272
        'required' => '0',
273
        'min_ver'  => '2.04'
274
    },
275
    'Net::LDAP::Filter' => {
276
        'usage'    => 'LDAP Interface Feature',
277
        'required' => '0',
278
        'min_ver'  => '0.14'
279
    },
280
    'Text::CSV' => {
281
        'usage'    => 'Core',
282
        'required' => '1',
283
        'min_ver'  => '0.01'
284
    },
285
    'PDF::Table' => {
286
        'usage'    => 'Core',
287
        'required' => '1',
288
        'min_ver'  => '0.9.3'
289
    },
290
    'CGI' => {
291
        'usage'    => 'Core',
292
        'required' => '1',
293
        'min_ver'  => '3.15'
294
    },
295
    'Class::Factory::Util' => {
296
        'usage'    => 'Core',
297
        'required' => '1',
298
        'min_ver'  => '1.6'
299
    },
300
    'List::Util' => {
301
        'usage'    => 'Core',
302
        'required' => '1',
303
        'min_ver'  => '1.18'
304
    },
305
    'Lingua::Stem::Snowball' => {
306
        'usage'    => 'Core',
307
        'required' => '1',
308
        'min_ver'  => '0.952'
309
    },
310
    'Time::localtime' => {
311
        'usage'    => 'Core',
312
        'required' => '1',
313
        'min_ver'  => '1.02'
314
    },
315
    'Digest::SHA' => {
316
        'usage'    => 'Core',
317
        'required' => '1',
318
        'min_ver'  => '5.43'
319
    },
320
    'CGI::Session::Serialize::yaml' => {
321
        'usage'    => 'Core',
322
        'required' => '1',
323
        'min_ver'  => '4.2'
324
    },
325
    'CGI::Carp' => {
326
        'usage'    => 'Core',
327
        'required' => '1',
328
        'min_ver'  => '1.29'
329
    },
330
    'Getopt::Long' => {
331
        'usage'    => 'Core',
332
        'required' => '1',
333
        'min_ver'  => '2.35'
334
    },
335
    'Term::ANSIColor' => {
336
        'usage'    => 'Core',
337
        'required' => '1',
338
        'min_ver'  => '1.1'
339
    },
340
    'Getopt::Std' => {
341
        'usage'    => 'Core',
342
        'required' => '1',
343
        'min_ver'  => '1.05'
344
    },
345
    'Data::Dumper' => {
346
        'usage'    => 'Core',
347
        'required' => '1',
348
        'min_ver'  => '2.121'
349
    },
350
    'Lingua::Stem' => {
351
        'usage'    => 'Core',
352
        'required' => '1',
353
        'min_ver'  => '0.82'
354
    },
355
    'MIME::QuotedPrint' => {
356
        'usage'    => 'Core',
357
        'required' => '1',
358
        'min_ver'  => '3.07'
359
    },
360
    'IPC::Cmd' => {
361
        'usage'    => 'Core',
362
        'required' => '1',
363
        'min_ver'  => '0.46'
364
    },
365
    'HTTP::Cookies' => {
366
        'usage'    => 'Core',
367
        'required' => '1',
368
        'min_ver'  => '1.39'
369
    },
370
    'HTTP::Request::Common' => {
371
        'usage'    => 'Core',
372
        'required' => '1',
373
        'min_ver'  => '1.26'
374
    },
375
    'PDF::Reuse::Barcode' => {
376
        'usage'    => 'Core',
377
        'required' => '1',
378
        'min_ver'  => '0.05'
379
    },
380
    'GD::Barcode::UPCE' => {
381
        'usage'    => 'Core',
382
        'required' => '1',
383
        'min_ver'  => '1.1'
384
    },
385
    'Text::Iconv' => {
386
        'usage'    => 'Core',
387
        'required' => '1',
388
        'min_ver'  => '1.7'
389
    },
390
    'File::Temp' => {
391
        'usage'    => 'Core',
392
        'required' => '1',
393
        'min_ver'  => '0.16'
394
    },
395
    'Date::Manip' => {
396
        'usage'    => 'Core',
397
        'required' => '1',
398
        'min_ver'  => '5.44'
399
    },
400
    'Locale::Language' => {
401
        'usage'    => 'Core',
402
        'required' => '1',
403
        'min_ver'  => '2.07'
404
    },
405
    'PDF::API2::Simple' => {
406
        'usage'    => 'Core',
407
        'required' => '1',
408
        'min_ver'  => '1'
409
    },
410
    'XML::RSS' => {
411
        'usage'    => 'Core',
412
        'required' => '1',
413
        'min_ver'  => '1.31'
414
    },
415
    'XML::Simple' => {
416
        'usage'    => 'Core',
417
        'required' => '1',
418
        'min_ver'  => '2.14'
419
    },
420
    'PDF::API2::Page' => {
421
        'usage'    => 'Core',
422
        'required' => '1',
423
        'min_ver'  => '2'
424
    },
425
    'CGI::Session' => {
426
        'usage'    => 'Core',
427
        'required' => '1',
428
        'min_ver'  => '4.2'
429
    },
430
    'CGI::Session::Driver::memcached' => {
431
        'usage'    => 'Memcached Feature (Experimental)',
432
        'required' => '0',
433
        'min_ver'  => '0.04',
434
    },
435
    'POSIX' => {
436
        'usage'    => 'Core',
437
        'required' => '1',
438
        'min_ver'  => '1.09'
439
    },
440
    'Digest::MD5' => {
441
        'usage'    => 'Core',
442
        'required' => '1',
443
        'min_ver'  => '2.36'
444
    },
445
    'Authen::CAS::Client' => {
446
        'usage'    => 'Core',
447
        'required' => '1',
448
        'min_ver'  => '0.05'
449
    },
450
    'Data::ICal' => {
451
        'usage'    => 'Core',
452
        'required' => '1',
453
        'min_ver'  => '0.13'
454
    },
455
    'MARC::Record' => {
456
        'usage'    => 'Core',
457
        'required' => '1',
458
        'min_ver'  => '2.0.6'
459
    },
460
    'Locale::Currency::Format' => {
461
        'usage'    => 'Core',
462
        'required' => '1',
463
        'min_ver'  => '1.28'
464
    },
465
    'Number::Format' => {
466
        'usage'    => 'Core',
467
        'required' => '1',
468
        'min_ver'  => '1.52'
469
    },
470
    'YAML::Syck' => {
471
        'usage'    => 'Core',
472
        'required' => '1',
473
        'min_ver'  => '0.71'
474
    },
475
    'Time::HiRes' => {
476
        'usage'    => 'Core',
477
        'required' => '1',
478
        'min_ver'  => '1.86'
479
    },
480
    'MARC::File::XML' => {
481
        'usage'    => 'Core',
482
        'required' => '1',
483
        'min_ver'  => '1.0.1'
484
    },
485
    'XML::SAX::Writer' => {
486
        'usage'    => 'Core',
487
        'required' => '1',
488
        'min_ver'  => '0.44'
489
    },
490
    'JSON' => {
491
        'usage'    => 'Core',
492
        'required' => '1',
493
        'min_ver'  => '2.07'
494
    },
495
    'YAML' => {
496
        'usage'    => 'Core',
497
        'required' => '1',
498
        'min_ver'  => '0.71'
499
    },
500
    'UNIVERSAL::require' => {
501
        'usage'    => 'SipServer',
502
        'required' => '0',
503
        'min_ver'  => '0.13',
504
    },
505
    'Net::Server' => {
506
        'usage'    => 'SipServer',
507
        'required' => '0',
508
        'min_ver'  => '0.97',
509
    },
510
    'Business::ISBN' => {
511
        'usage'    => 'Core',
512
        'required' => '1',
513
        'min_ver'  => '2.05',
514
    },
515
    'Business::ISSN' => {
516
        'usage'    => 'Core',
517
        'required' => '1',
518
        'min_ver'  => '0.91',
519
    },
520
    'Template' => {
521
        'usage'    => 'Core',
522
        'required' => '1',
523
        'min_ver'  => '2.22',
524
      },
525
    'Template::Plugin::Stash' => {
526
        'usage'    => 'Debugging',
527
        'required' => '0',
528
        'min_ver'  => '1.006',
529
      },
530
    'Gravatar::URL' => {
531
        'usage'    => 'Photos in OPAC reviews',
532
        'required' => '0',
533
        'min_ver'  => '1.03',
534
    },
535
    'Modern::Perl' => {
536
        'usage'    => 'Core',
537
        'required' => '1',
538
        'min_ver'  => '1.03',
539
    },
540
    'DateTime::Format::ICal' => {
541
        'usage'    => 'Core',
542
        'required' => '1',
543
        'min_ver'  => '0.09',
544
    },
545
    'Template::Plugin::HtmlToText' => {
546
        'usage'    => 'Core',
547
        'required' => '1',
548
        'min_ver'  => '0.03',
549
    },
550
    'Template::Plugin::JSON::Escape' => {
551
        'usage'    => 'Core',
552
        'required' => '1',
553
        'min_ver'  => '0.02',
554
    },
555
    'DBD::Mock' => {
556
        'usage'    => 'Core',
557
        'required' => '1',
558
        'min_ver'  => '1.39'
559
    },
560
    'Text::Bidi'   => {
561
        'usage'    => 'Label batch PDF',
562
        'required' => '1',
563
        'min_ver'  => '0.03',
564
    },
565
    'Test::DBIx::Class' => {
566
        'usage'    => 'Testing modules utilising DBIx::Class',
567
        'required' => '0',
568
        'min_ver'  => '0.42',
569
    },
570
    'Test::Deep' => {
571
        'usage'    => 'Core',
572
        'required' => '0',
573
        'min_ver'  => '0.106',
574
    },
575
    'Test::Exception' => {
576
        'usage'    => 'Core',
577
        'required' => '0',
578
        'min_ver'  => '0.35',
579
    },
580
    'Test::Harness' => {
581
        'usage'    => 'Core',
582
        'required' => '1',
583
        'min_ver'  => '2.56'
584
    },
585
    'Test::MockModule' => {
586
        'usage'    => 'Core',
587
        'required' => '1',
588
        'min_ver'  => '0.05',
589
    },
590
    'Test::MockObject' => {
591
        'usage'    => 'Core',
592
        'required' => '0',
593
        'min_ver'  => '1.09',
594
    },
595
    'Test::MockTime' => {
596
        usage      => 'Testing suite',
597
        required   => 0,
598
        min_ver    => '0.13',
599
    },
600
    'Test::More' => {
601
        'usage'    => 'Core',
602
        'required' => '1',
603
        'min_ver'  => '1.302073'
604
    },
605
    'Test::Strict' => {
606
        'usage'    => 'Core',
607
        'required' => '0',
608
        'min_ver'  => '0.14',
609
    },
610
    'Test::Warn' => {
611
        'usage'    => 'Core',
612
        'required' => '0',
613
        'min_ver'  => '0.21',
614
    },
615
    'Test::YAML::Valid' => {
616
        'usage'    => 'Core',
617
        'required' => '0',
618
        'min_ver'  => '0.04',
619
    },
620
    'Text::Unaccent' => {
621
        'usage'    => 'Core',
622
        'required' => '1',
623
        'min_ver'  => '1.08',
624
    },
625
    'Test::WWW::Mechanize' => {
626
        'usage'    => 'Testing suite',
627
        'required' => '0',
628
        'min_ver'  => '1.42',
629
    },
630
    'HTML::FormatText' => {
631
        'usage'    => 'Core',
632
        'required' => '1',
633
        'min_ver'  => '1.23',
634
    },
635
    'AnyEvent' => {
636
        'usage'    => 'Command line scripts',
637
        'required' => '0',
638
        'min_ver'  => '5.0',
639
    },
640
    'AnyEvent::HTTP' => {
641
        'usage'    => 'Command line scripts',
642
        'required' => '0',
643
        'min_ver'  => '2.13',
644
    },
645
    'Moo' => {
646
        'usage'    => 'Core',
647
        'required' => '0',
648
        'min_ver'  => '1',
649
    },
650
    'String::Random' => {
651
        'usage'    => 'OpacSelfRegistration',
652
        'required' => '1',
653
        'min_ver'  => '0.22',
654
    },
655
    'File::Temp' => {
656
        'usage'    => 'Plugins',
657
        'required' => '0',
658
        'min_ver'  => '0.22',
659
    },
660
    'File::Copy' => {
661
        'usage'    => 'Plugins',
662
        'required' => '0',
663
        'min_ver'  => '2.08',
664
    },
665
    'File::Path' => {
666
        'usage'    => 'Plugins',
667
        'required' => '0',
668
        'min_ver'  => '2.07',
669
    },
670
    'Archive::Extract' => {
671
        'usage'    => 'Plugins',
672
        'required' => '0',
673
        'min_ver'  => '0.60',
674
    },
675
    'Archive::Zip' => {
676
        'usage'    => 'Plugins',
677
        'required' => '0',
678
        'min_ver'  => '1.30',
679
    },
680
    'Module::Load::Conditional' => {
681
        'usage'    => 'Plugins',
682
        'required' => '0',
683
        'min_ver'  => '0.38',
684
    },
685
    'Module::Bundled::Files' => {
686
        'usage'    => 'Plugins',
687
        'required' => '0',
688
        'min_ver'  => '0.03',
689
    },
690
    'Module::Pluggable' => {
691
        'usage'    => 'Plugins',
692
        'required' => '0',
693
        'min_ver'  => '3.9',
694
    },
695
    'File::Slurp' => {
696
        'usage'    => 'Core',
697
        'required' => '1',
698
        'min_ver'  => '9999.13',
699
    },
700
    'Library::CallNumber::LC' => {
701
        'usage'    => 'Core',
702
        'required' => '1',
703
        'min_ver'  => '0.22',
704
    },
705
    'Crypt::Eksblowfish::Bcrypt' => {
706
        'usage'    => 'Password storage',
707
        'required' => '1',
708
        'min_ver'  => '0.008',
709
    },
710
    'HTTPD::Bench::ApacheBench' => {
711
        'usage'    => 'Load testing',
712
        'required' => '0',
713
        'min_ver'  => '0.73',
714
    },
715
    'Email::Valid' => {
716
        'usage'    => 'Core',
717
        'required' => '1',
718
        'min_ver'  => '0.190',
719
    },
720
    'OpenOffice::OODoc' => {
721
        usage      => 'Export',
722
        required   => 1,
723
        min_ver    => '2.125',
724
    },
725
    'Locale::Maketext' => {
726
        'usage'    => 'Core',
727
        'required' => '1',
728
        'min_ver'  => '1.19',
729
    },
730
    'Locale::Maketext::Lexicon' => {
731
        'usage'    => 'Core',
732
        'required' => '1',
733
        'min_ver'  => '0.91',
734
    },
735
    'LWP::Protocol::https' => {
736
        'usage'    => 'OverDrive integration',
737
        'required' => '0',
738
        'min_ver'  => '5.836',
739
    },
740
    'SOAP::Lite' => {
741
        'usage'    => 'Norwegian national library card',
742
        'required' => '0',
743
        'min_ver'  => '0.712',
744
    },
745
    'Crypt::GCrypt' => {
746
        'usage'    => 'Norwegian national library card',
747
        'required' => '0',
748
        'min_ver'  => '1.24',
749
    },
750
    'Convert::BaseN' => {
751
        'usage'    => 'Norwegian national library card',
752
        'required' => '0',
753
        'min_ver'  => '0.01',
754
    },
755
    'Digest::SHA' => {
756
        'usage'    => 'Norwegian national library card',
757
        'required' => '0',
758
        'min_ver'  => '5.61',
759
    },
760
    'PDF::FromHTML' => {
761
        'usage'    => 'Discharge generation',
762
        'required' => '0',
763
        'min_ver'  => '0.31',
764
    },
765
    'Devel::Cover' => {
766
        'usage'    => 'Test code coverage',
767
        'required' => '0',
768
        'min_ver'  => '0.89',
769
    },
770
    'Log::Log4perl' => {
771
        'usage'    => 'Core',
772
        'required' => '1',
773
        'min_ver'  => '1.29',
774
    },
775
    'XML::Writer' => {
776
        'usage'    => 'Command line scripts',
777
        'required' => '0',
778
        'min_ver'  => '0.614',
779
    },
780
    'UUID' => {
781
        'usage'    => 'Professional cataloging interface',
782
        'required' => '1',
783
        'min_ver'  => '0.05',
784
    },
785
    'Mojolicious' => {
786
        'usage'    => 'REST API',
787
        'required' => '1',
788
        'min_ver'  => '7.21',
789
    },
790
    'Mojolicious::Plugin::OpenAPI' => {
791
        'usage'    => 'REST API',
792
        'required' => '1',
793
        'min_ver'  => '1.15',
794
    },
795
    'JSON::Validator' => {
796
        'usage'    => 'REST API',
797
        'required' => '1',
798
        'min_ver'  => '0.97',
799
    },
800
    'UNIVERSAL::can' => {
801
        'usage'    => 'SIP',
802
        'required' => '1',
803
        'min_ver'  => '1.10',
804
    },
805
    'WWW::YouTube::Download' => {
806
        'usage'    => 'HTML5Media streaming from YouTube',
807
        'required' => '0',
808
        'min_ver'  => '0.56',
809
    },
810
    'Net::SFTP::Foreign' => {
811
        'usage'    => 'Edifact',
812
        'required' => '0',
813
        'min_ver'  => '1.73',
814
    },
815
    'Text::Unidecode' => {
816
        'usage'    => 'Edifact',
817
        'required' => '0',
818
        'min_ver'  => '0.04',
819
    },
820
    'Time::Fake'   => {
821
        'usage'    => 'Test code coverage',
822
        'required' => '0',
823
        'min_ver'  => '0.11',
824
    },
825
    'DBIx::RunSQL' => {
826
        'usage'    => 'Load SQL files',
827
        'required' => '1',
828
        'min_ver'  => '0.14',
829
    },
830
    'Lingua::Ispell' => {
831
        'usage'    => 'Enhanced Content - Tagging',
832
        'required' => '0',
833
        'min_ver'  => '0.07'
834
    },
835
    'WWW::CSRF' => {
836
        usage => 'Core',
837
        required => 1,
838
        min_ver => '1.00',
839
    },
840
    'Sereal::Encoder' => {
841
        'usage'    => 'Caching',
842
        'required' => '1',
843
        'min_ver'  => '3.0',
844
    },
845
    'Sereal::Decoder' => {
846
        'usage'    => 'Caching',
847
        'required' => '1',
848
        'min_ver'  => '3.0',
849
    },
850
    'HTML::Entities' => {
851
        usage => 'Core',
852
        required => 1,
853
        min_ver => '3.69', # same for Wheezy/Jessie
854
    },
855
    'Readonly' => {
856
        'usage'    => 'Make script happy',
857
        'required' => '0',
858
        'min_ver'  => '0.01'
859
    },
860
    'Readonly::XS' => {
861
        'usage'    => 'Make script happy',
862
        'required' => '0',
863
        'min_ver'  => '0.01'
864
    },
865
    'Bytes::Random::Secure' => {
866
        usage => 'Core',
867
        required => 1,
868
        min_ver => '0.28',
869
    },
870
    'WebService::ILS' => {
871
        'usage'    => 'Interface third party systems',
872
        'required' => '0',
873
        'min_ver'  => '0.17',
874
    },
875
    'Search::Elasticsearch' => {
876
        'usage'    => 'Elasticsearch integration',
877
        'required' => '1',
878
        'min_ver'  => '5.01',
879
        # also required for Zebra installs: about page: bug 20061
880
    },
881
    'Parallel::ForkManager' => {
882
        usage      => 'Testing suite',
883
        required   => 0,
884
        min_ver    => '0.75',
885
    },
886
    'Sys::CPU' => {
887
        usage      => 'Testing suite',
888
        required   => 0,
889
        min_ver    => '0.52',
890
    },
891
};
892
893
1;
894
895
__END__
896
897
=head1 NAME
898
899
C4::Installer::PerlDependencies
900
901
=head1 ABSTRACT
902
903
A module for cataloging Koha Perl dependencies.
904
905
=head1 SYNOPSIS
906
907
This module's sole purpose for existence is to provide a single location to catalog all Koha Perl dependencies. New dependencies should be added to the
908
end of the outer hash and follow the key/value pattern used in the other dependencies.
909
910
=head2 Debian
911
912
If you change the list of dependencies, and you use Debian, please also
913
run the debian/update-control script and commit the modified version of
914
debian/control into git as well. If you're not running Debian, don't
915
worry about it.
916
917
=head1 AUTHOR
918
919
Chris Nighswonger <cnighswonger AT foundations DOT edu>
920
921
=head1 COPYRIGHT
922
923
Copyright 2010 Foundations Bible College.
924
925
=head1 LICENSE
926
927
This file is part of Koha.
928
929
Koha is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software
930
Foundation; either version 2 of the License, or (at your option) any later version.
931
932
You should have received a copy of the GNU General Public License along with Koha; if not, write to the Free Software Foundation, Inc., 51 Franklin Street,
933
Fifth Floor, Boston, MA 02110-1301 USA.
934
935
=head1 DISCLAIMER OF WARRANTY
936
937
Koha is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
938
A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
939
940
=cut
(-)a/C4/Installer/PerlModules.pm (-123 / +56 lines)
Lines 4-14 use warnings; Link Here
4
use strict;
4
use strict;
5
5
6
use File::Spec;
6
use File::Spec;
7
7
use File::Basename;
8
use C4::Installer::PerlDependencies;
8
use Module::CPANfile;
9
10
11
our $PERL_DEPS = $C4::Installer::PerlDependencies::PERL_DEPS;
12
9
13
sub new {
10
sub new {
14
    my $invocant = shift;
11
    my $invocant = shift;
Lines 17-60 sub new { Link Here
17
        upgrade_pm  => [],
14
        upgrade_pm  => [],
18
        current_pm  => [],
15
        current_pm  => [],
19
    };
16
    };
17
20
    my $type = ref($invocant) || $invocant;
18
    my $type = ref($invocant) || $invocant;
21
    bless ($self, $type);
19
    bless ($self, $type);
22
    return $self;
20
    return $self;
23
}
21
}
24
22
25
sub prereq_pm {
23
sub prereqs {
26
    my $self = shift;
24
    my $self = shift;
27
    my $prereq_pm = {};
25
28
    for (keys %$PERL_DEPS) {
26
    unless (defined $self->{prereqs}) {
29
        $prereq_pm->{$_} = $PERL_DEPS->{$_}->{'min_ver'};
27
        my $filename = $INC{'C4/Installer/PerlModules.pm'};
28
        my $path = dirname(dirname(dirname($filename)));
29
        $self->{prereqs} = Module::CPANfile->load("$path/cpanfile")->prereqs;
30
    }
30
    }
31
    return $prereq_pm;
31
32
    return $self->{prereqs};
32
}
33
}
33
34
34
sub required {
35
sub prereq_pm {
35
    my $self = shift;
36
    my $self = shift;
36
    my %params = @_;
37
37
    if ($params{'module'}) {
38
    my $prereq_pm = {};
38
        return -1 unless grep {m/$params{'module'}/} keys(%$PERL_DEPS);
39
    my $reqs = $self->prereqs->merged_requirements;
39
        return $PERL_DEPS->{$params{'module'}}->{'required'};
40
    foreach my $module ($reqs->required_modules) {
40
    }
41
        $prereq_pm->{$module} = $reqs->requirements_for_module($module);
41
    elsif ($params{'required'}) {
42
        my $required_pm = [];
43
        for (keys %$PERL_DEPS) {
44
            push (@$required_pm, $_) if $PERL_DEPS->{$_}->{'required'} == 1;
45
        }
46
        return $required_pm;
47
    }
48
    elsif ($params{'optional'}) {
49
        my $optional_pm = [];
50
        for (keys %$PERL_DEPS) {
51
            push (@$optional_pm, $_) if $PERL_DEPS->{$_}->{'required'} == 0;
52
        }
53
        return $optional_pm;
54
    }
55
    else {
56
        return -1; # unrecognized parameter passed in
57
    }
42
    }
43
44
    return $prereq_pm;
58
}
45
}
59
46
60
sub versions_info {
47
sub versions_info {
Lines 65-121 sub versions_info { Link Here
65
    $self->{'upgrade_pm'} = [];
52
    $self->{'upgrade_pm'} = [];
66
    $self->{'current_pm'} = [];
53
    $self->{'current_pm'} = [];
67
54
68
    for my $module ( sort keys %$PERL_DEPS ) {
55
    foreach my $phase ($self->prereqs->phases) {
69
        my $module_infos = $self->version_info($module);
56
        foreach my $type ($self->prereqs->types_in($phase)) {
70
        my $status       = $module_infos->{status};
57
            my $reqs = $self->prereqs->requirements_for($phase, $type);
71
        push @{ $self->{"${status}_pm"} }, { $module => $module_infos };
58
            foreach my $module ($reqs->required_modules) {
59
                no warnings;  # perl throws warns for invalid $VERSION numbers which some modules use
60
61
                my $module_infos = {
62
                    cur_ver  => 0,
63
                    min_ver  => $reqs->requirements_for_module($module),
64
                    required => $type eq 'requires',
65
                };
66
67
                my $attr;
68
69
                eval "require $module";
70
                if ($@) {
71
                    $attr = 'missing_pm';
72
                } else {
73
                    my $pkg_version = $module->can("VERSION") ? $module->VERSION : 0;
74
                    $module_infos->{cur_ver} = $pkg_version;
75
                    if ($reqs->accepts_module($module => $pkg_version)) {
76
                        $attr = 'current_pm';
77
                    } else {
78
                        $attr = 'upgrade_pm';
79
                    }
80
                }
81
82
                push @{ $self->{$attr} }, { $module => $module_infos };
83
            }
84
        }
72
    }
85
    }
73
}
86
}
74
87
75
sub version_info {
76
    no warnings
77
      ;  # perl throws warns for invalid $VERSION numbers which some modules use
78
    my ( $self, $module ) = @_;
79
    return -1 unless grep { /^$module$/ } keys(%$PERL_DEPS);
80
81
    eval "require $module";
82
    my $pkg_version = $module->can("VERSION") ? $module->VERSION : 0;
83
    my $min_version = $PERL_DEPS->{$module}->{'min_ver'} // 0;
84
85
    my ( $cur_ver, $upgrade, $status );
86
    if ($@) {
87
        ( $cur_ver, $upgrade, $status ) = ( 0, 0, 'missing' );
88
    }
89
    elsif ( version->parse("$pkg_version") < version->parse("$min_version") ) {
90
        ( $cur_ver, $upgrade, $status ) = ( $module->VERSION, 1, 'upgrade' );
91
    }
92
    else {
93
        ( $cur_ver, $upgrade, $status ) = ( $module->VERSION, 0, 'current' );
94
    }
95
96
    return {
97
        cur_ver  => $cur_ver,
98
        min_ver  => $PERL_DEPS->{$module}->{min_ver},
99
        required => $PERL_DEPS->{$module}->{required},
100
        usage    => $PERL_DEPS->{$module}->{usage},
101
        upgrade  => $upgrade,
102
        status   => $status,
103
    };
104
}
105
106
107
sub get_attr {
88
sub get_attr {
108
    return $_[0]->{$_[1]};
89
    return $_[0]->{$_[1]};
109
}
90
}
110
91
111
sub module_count {
112
    return scalar(keys(%$PERL_DEPS));
113
}
114
115
sub module_list {
116
    return keys(%$PERL_DEPS);
117
}
118
119
1;
92
1;
120
__END__
93
__END__
121
94
Lines 147-185 A module for manipulating Koha Perl dependency list objects. Link Here
147
120
148
        PREREQ_PM    => $perl_modules->prereq_pm,>
121
        PREREQ_PM    => $perl_modules->prereq_pm,>
149
122
150
=head2 required()
151
152
    This method accepts a single parameter with three possible values: a module name, the keyword 'required,' the keyword 'optional.' If passed the name of a module, a boolean value is returned indicating whether the module is required (1) or not (0). If on of the two keywords is passed in, it returns an arrayref to an array who's elements are the names of the modules specified either required or optional.
153
154
    example:
155
        C<my $is_required = $perl_modules->required(module => 'CGI::Carp');>
156
157
        C<my $optional_pm_names = $perl_modules->required(optional => 1);>
158
159
=head2 version_info()
160
161
    Depending on the parameters passed when invoking, this method will give the current status of modules currently used in Koha as well as the currently installed version if the module is installed, the current minimum required version, and the upgrade status. If passed C<module => module_name>, the method evaluates only that module. If passed C<all => 1>, all modules are evaluated.
162
123
163
    example:
124
=head2 versions_info
164
        C<my $module_status = $perl_modules->version_info('foo');>
165
166
        This usage returns a hashref with a single key/value pair. The key is the module name. The value is an anonymous hash with the following keys:
167
168
        cur_ver = version number of the currently installed version (This is 0 if the module is not currently installed.)
169
        min_ver = minimum version required by Koha
170
        upgrade = upgrade status of the module relative to Koha's requirements (0 if the installed module does not need upgrading; 1 if it does)
171
        required = 0 of the module is optional; 1 if required
172
173
        {
174
           'required' => 1,
175
           'cur_ver' => '1.30_01',
176
           'upgrade' => 0,
177
           'min_ver' => '1.29'
178
        };
179
125
180
        C<$perl_modules->version_info;>
126
        C<$perl_modules->versions_info;>
181
127
182
        This usage loads the same basic data as the previous usage into three accessors: missing_pm, upgrade_pm, and current_pm. Each of these may be accessed by using the C<get_attr> method. Each accessor returns an anonymous array who's elements are anonymous hashes. They follow this format (NOTE: Upgrade status is indicated by the accessor name.):
128
        This loads info of required modules into three accessors: missing_pm,
129
        upgrade_pm, and current_pm. Each of these may be accessed by using the
130
        C<get_attr> method. Each accessor returns an anonymous array who's
131
        elements are anonymous hashes. They follow this format (NOTE: Upgrade
132
        status is indicated by the accessor name.):
183
133
184
        [
134
        [
185
                  {
135
                  {
Lines 211-233 A module for manipulating Koha Perl dependency list objects. Link Here
211
    example:
161
    example:
212
        C<my $missing_pm = $perl_modules->get_attr('missing_pm');>
162
        C<my $missing_pm = $perl_modules->get_attr('missing_pm');>
213
163
214
=head2 module_count
215
216
    Returns a scalar value representing the current number of Perl modules used by Koha.
217
218
    example:
219
        C<my $module_count = $perl_modules->module_count;>
220
221
=head2 module_list
222
223
    Returns an array who's elements are the names of the Perl modules used by Koha.
224
225
    example:
226
        C<my @module_list = $perl_modules->module_list;>
227
228
    This is useful for commandline exercises such as:
229
230
        perl -MC4::Installer::PerlModules -e 'my $deps = C4::Installer::PerlModule->new; print (join("\n",$deps->module_list));'
231
164
232
=head1 AUTHOR
165
=head1 AUTHOR
233
166
(-)a/Makefile.PL (-1 / +2 lines)
Lines 29-35 use FindBin; # we need to enforce which C4::Installer::PerlModule is used in cas Link Here
29
29
30
use lib $FindBin::Bin;
30
use lib $FindBin::Bin;
31
31
32
use C4::Installer;
32
use C4::Installer::PerlModules;
33
33
34
my $koha_pm = C4::Installer::PerlModules->new;
34
my $koha_pm = C4::Installer::PerlModules->new;
35
35
Lines 306-311 my $target_map = { Link Here
306
  './circ'                      => 'INTRANET_CGI_DIR',
306
  './circ'                      => 'INTRANET_CGI_DIR',
307
  './clubs'                     => 'INTRANET_CGI_DIR',
307
  './clubs'                     => 'INTRANET_CGI_DIR',
308
  './course_reserves'           => 'INTRANET_CGI_DIR',
308
  './course_reserves'           => 'INTRANET_CGI_DIR',
309
  './cpanfile'                  => 'PERL_MODULE_DIR',
309
  './docs/history.txt'          => { target => 'DOC_DIR', trimdir => -1 },
310
  './docs/history.txt'          => { target => 'DOC_DIR', trimdir => -1 },
310
  './offline_circ'              => 'INTRANET_CGI_DIR',
311
  './offline_circ'              => 'INTRANET_CGI_DIR',
311
  './edithelp.pl'               => 'INTRANET_CGI_DIR',
312
  './edithelp.pl'               => 'INTRANET_CGI_DIR',
(-)a/about.pl (-1 / +1 lines)
Lines 33-39 use Try::Tiny; Link Here
33
use C4::Output;
33
use C4::Output;
34
use C4::Auth;
34
use C4::Auth;
35
use C4::Context;
35
use C4::Context;
36
use C4::Installer;
36
use C4::Installer::PerlModules;
37
37
38
use Koha;
38
use Koha;
39
use Koha::Acquisition::Currencies;
39
use Koha::Acquisition::Currencies;
(-)a/cpanfile (+176 lines)
Line 0 Link Here
1
requires 'Algorithm::CheckDigits', '0.5';
2
requires 'Authen::CAS::Client', '0.05';
3
requires 'Biblio::EndnoteStyle', '0.05';
4
requires 'Business::ISBN', '2.05';
5
requires 'Business::ISSN', '0.91';
6
requires 'Bytes::Random::Secure', '0.28';
7
requires 'CGI', '3.15';
8
requires 'CGI::Carp', '1.29';
9
requires 'CGI::Session', '4.2';
10
requires 'CGI::Session::Serialize::yaml', '4.2';
11
requires 'CPAN::Meta', '2.150006';
12
requires 'Class::Accessor', '0.3';
13
requires 'Class::Factory::Util', '1.6';
14
requires 'Crypt::Eksblowfish::Bcrypt', '0.008';
15
requires 'DBD::Mock', '1.39';
16
requires 'DBD::mysql', '4.004';
17
requires 'DBI', '1.53';
18
requires 'DBIx::Class::Schema::Loader', '0.07039';
19
requires 'DBIx::RunSQL', '0.14';
20
requires 'Data::Dumper', '2.121';
21
requires 'Data::ICal', '0.13';
22
requires 'Date::Calc', '5.4';
23
requires 'Date::Manip', '5.44';
24
requires 'DateTime', '0.58';
25
requires 'DateTime::Event::ICal', '0.08';
26
requires 'DateTime::Format::ICal', '0.09';
27
requires 'DateTime::Format::MySQL', '0.04';
28
requires 'DateTime::Set', '0.28';
29
requires 'DateTime::TimeZone', '1.20';
30
requires 'Digest::MD5', '2.36';
31
requires 'Email::Date', '1.103';
32
requires 'Email::Valid', '0.190';
33
requires 'Exception::Class', '1.38';
34
requires 'File::Slurp', '9999.13';
35
requires 'Font::TTF', '0.45';
36
requires 'GD::Barcode::UPCE', '1.1';
37
requires 'Getopt::Long', '2.35';
38
requires 'Getopt::Std', '1.05';
39
requires 'HTML::Entities', '3.69';
40
requires 'HTML::FormatText', '1.23';
41
requires 'HTML::Scrubber', '0.08';
42
requires 'HTTP::Cookies', '1.39';
43
requires 'HTTP::OAI', '3.2';
44
requires 'HTTP::Request::Common', '1.26';
45
requires 'IPC::Cmd', '0.46';
46
requires 'JSON', '2.07';
47
requires 'JSON::Validator', '0.97';
48
requires 'LWP::Simple', '1.41';
49
requires 'LWP::UserAgent', '2.033';
50
requires 'Library::CallNumber::LC', '0.22';
51
requires 'Lingua::Stem', '0.82';
52
requires 'Lingua::Stem::Snowball', '0.952';
53
requires 'List::MoreUtils', '0.21';
54
requires 'List::Util', '1.18';
55
requires 'Locale::Currency::Format', '1.28';
56
requires 'Locale::Language', '2.07';
57
requires 'Locale::Maketext', '1.19';
58
requires 'Locale::Maketext::Lexicon', '0.91';
59
requires 'Locale::PO', '0.17';
60
requires 'Log::Log4perl', '1.29';
61
requires 'MARC::Charset', '0.98';
62
requires 'MARC::File::XML', 'v1.0.1';
63
requires 'MARC::Record', 'v2.0.6';
64
requires 'MIME::Base64', '3.07';
65
requires 'MIME::Lite', '3';
66
requires 'MIME::QuotedPrint', '3.07';
67
requires 'Mail::Sendmail', '0.79';
68
requires 'Modern::Perl', '1.03';
69
requires 'Module::CPANfile', '1.1000';
70
requires 'Mojolicious', '7.21';
71
requires 'Mojolicious::Plugin::OpenAPI', '1.15';
72
requires 'Net::Z3950::ZOOM', '1.16';
73
requires 'Number::Format', '1.52';
74
requires 'OpenOffice::OODoc', '2.125';
75
requires 'PDF::API2', '2';
76
requires 'PDF::API2::Page', '2';
77
requires 'PDF::API2::Simple', '1';
78
requires 'PDF::API2::Util', '2';
79
requires 'PDF::Reuse', '0.36';
80
requires 'PDF::Reuse::Barcode', '0.05';
81
requires 'PDF::Table', 'v0.9.3';
82
requires 'POSIX', '1.09';
83
requires 'Plack::Middleware::ReverseProxy', '0.14';
84
requires 'Schedule::At', '1.06';
85
requires 'Search::Elasticsearch', '5.01';
86
requires 'Sereal::Decoder', '3.0';
87
requires 'Sereal::Encoder', '3.0';
88
requires 'Storable', '2.20';
89
requires 'String::Random', '0.22';
90
requires 'Template', '2.22';
91
requires 'Template::Plugin::HtmlToText', '0.03';
92
requires 'Template::Plugin::JSON::Escape', '0.02';
93
requires 'Term::ANSIColor', '1.1';
94
requires 'Test', '1.25';
95
requires 'Test::Harness', '2.56';
96
requires 'Test::MockModule', '0.05';
97
requires 'Test::More', '1.302073';
98
requires 'Text::Bidi', '0.03';
99
requires 'Text::CSV', '0.01';
100
requires 'Text::CSV::Encoded', '0.09';
101
requires 'Text::CSV_XS', '0.32';
102
requires 'Text::Iconv', '1.7';
103
requires 'Text::PDF', '0.29';
104
requires 'Text::Unaccent', '1.08';
105
requires 'Text::Wrap', '2005.082401';
106
requires 'Time::HiRes', '1.86';
107
requires 'Time::localtime', '1.02';
108
requires 'Try::Tiny', '0.22';
109
requires 'UNIVERSAL::can', '1.10';
110
requires 'URI::Escape', '3.31';
111
requires 'UUID', '0.05';
112
requires 'Unicode::Normalize', '0.32';
113
requires 'WWW::CSRF', '1.00';
114
requires 'XML::Dumper', '0.81';
115
requires 'XML::LibXML', '1.59';
116
requires 'XML::LibXSLT', '1.59';
117
requires 'XML::RSS', '1.31';
118
requires 'XML::SAX::ParserFactory', '1.01';
119
requires 'XML::SAX::Writer', '0.44';
120
requires 'XML::Simple', '2.14';
121
requires 'YAML', '0.71';
122
requires 'YAML::Syck', '0.71';
123
recommends 'AnyEvent', '5.0';
124
recommends 'AnyEvent::HTTP', '2.13';
125
recommends 'Archive::Extract', '0.60';
126
recommends 'Archive::Zip', '1.30';
127
recommends 'CGI::Session::Driver::memcached', '0.04';
128
recommends 'Cache::FastMmap', '1.34';
129
recommends 'Cache::Memcached', '1.30';
130
recommends 'Cache::Memcached::Fast', '0.17';
131
recommends 'Cache::Memory', '2.04';
132
recommends 'Convert::BaseN', '0.01';
133
recommends 'Crypt::GCrypt', '1.24';
134
recommends 'DBD::SQLite2', '0.33';
135
recommends 'Devel::Cover', '0.89';
136
recommends 'Digest::SHA', '5.61';
137
recommends 'File::Copy', '2.08';
138
recommends 'File::Path', '2.07';
139
recommends 'File::Temp', '0.22';
140
recommends 'GD', '2.39';
141
recommends 'Graphics::Magick', 'v1.3.5';
142
recommends 'Gravatar::URL', '1.03';
143
recommends 'HTTPD::Bench::ApacheBench', '0.73';
144
recommends 'LWP::Protocol::https', '5.836';
145
recommends 'Lingua::Ispell', '0.07';
146
recommends 'Module::Bundled::Files', '0.03';
147
recommends 'Module::Load::Conditional', '0.38';
148
recommends 'Module::Pluggable', '3.9';
149
recommends 'Moo', '1';
150
recommends 'Net::LDAP', '0.33';
151
recommends 'Net::LDAP::Filter', '0.14';
152
recommends 'Net::SFTP::Foreign', '1.73';
153
recommends 'Net::Server', '0.97';
154
recommends 'PDF::FromHTML', '0.31';
155
recommends 'Parallel::ForkManager', '0.75';
156
recommends 'Readonly', '0.01';
157
recommends 'Readonly::XS', '0.01';
158
recommends 'SMS::Send', '0.05';
159
recommends 'SOAP::Lite', '0.712';
160
recommends 'Sys::CPU', '0.52';
161
recommends 'Template::Plugin::Stash', '1.006';
162
recommends 'Test::DBIx::Class', '0.42';
163
recommends 'Test::Deep', '0.106';
164
recommends 'Test::Exception', '0.35';
165
recommends 'Test::MockObject', '1.09';
166
recommends 'Test::MockTime', '0.13';
167
recommends 'Test::Strict', '0.14';
168
recommends 'Test::WWW::Mechanize', '1.42';
169
recommends 'Test::Warn', '0.21';
170
recommends 'Test::YAML::Valid', '0.04';
171
recommends 'Text::Unidecode', '0.04';
172
recommends 'Time::Fake', '0.11';
173
recommends 'UNIVERSAL::require', '0.13';
174
recommends 'WWW::YouTube::Download', '0.56';
175
recommends 'WebService::ILS', '0.17';
176
recommends 'XML::Writer', '0.614';
(-)a/debian/list-deps (-54 / +58 lines)
Lines 1-6 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
#
2
#
3
# Write dependency list from Koha PerlDependencies.pm, in Debian format.
3
# Write dependency list from Koha cpanfile, in Debian format.
4
#
4
#
5
# Copyright 2010  Catalyst IT, Ltd
5
# Copyright 2010  Catalyst IT, Ltd
6
#
6
#
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use C4::Installer::PerlDependencies;
22
use C4::Installer::PerlModules;
23
23
24
# These are packages that may not be in the apt archive in a way that
24
# These are packages that may not be in the apt archive in a way that
25
# apt-file can find, e.g. in the Koha repo rather than the regular
25
# apt-file can find, e.g. in the Koha repo rather than the regular
Lines 38-98 my %ignore = ( Link Here
38
    'CHI::Driver::Memcached' => 1,
38
    'CHI::Driver::Memcached' => 1,
39
);
39
);
40
40
41
my $deps = $C4::Installer::PerlDependencies::PERL_DEPS;
42
43
my $prefix = "^/usr/((lib|share)/perl5|(lib|share)/perl/[0-9.]+|(lib|share)/.*-linux-gnu.*/perl/[0-9.]+|(lib|share)/.*-linux-gnu.*/perl5/[0-9.]+)";
41
my $prefix = "^/usr/((lib|share)/perl5|(lib|share)/perl/[0-9.]+|(lib|share)/.*-linux-gnu.*/perl/[0-9.]+|(lib|share)/.*-linux-gnu.*/perl5/[0-9.]+)";
44
42
45
foreach my $module ( keys %$deps ) {
43
my $modules = C4::Installer::PerlModules->new();
46
    next if $ignore{$module};
44
my $prereqs = $modules->prereqs;
47
    my $ver     = $deps->{$module}->{'min_ver'};
45
foreach my $phase ($prereqs->phases) {
48
    my $subpath = $module;
46
    foreach my $type ($prereqs->types_in($phase)) {
49
    $subpath =~ s,::,/,g;
47
        my $reqs = $prereqs->requirements_for($phase, $type);
50
    my $output = qx(apt-file -l -x search "$prefix/$subpath.pm\$");
48
        foreach my $module ( $reqs->required_modules ) {
51
    my @temp   = split( /\n/, $output );
49
            next if $ignore{$module};
52
    my @lines  = ();
50
            my $subpath = $module;
51
            $subpath =~ s,::,/,g;
52
            my $output = qx(apt-file -l -x search "$prefix/$subpath.pm\$");
53
            my @temp   = split( /\n/, $output );
54
            my @lines  = ();
53
55
54
    # Remove packages that are required/essential and always installed on
56
            # Remove packages that are required/essential and always installed on
55
    # a Debian system. Debian packages should not have unversioned
57
            # a Debian system. Debian packages should not have unversioned
56
    # dependencies on such packages.
58
            # dependencies on such packages.
57
    foreach my $line (@temp) {
59
            foreach my $line (@temp) {
58
        if ( $line ne "perl-base" ) {
60
                if ( $line ne "perl-base" ) {
59
            @lines = ( @lines, $line );
61
                    @lines = ( @lines, $line );
60
        }
62
                }
61
    }
63
            }
62
    if ( exists $overrides{$module} ) {
64
            if ( exists $overrides{$module} ) {
63
        print "$overrides{$module}\n";
65
                print "$overrides{$module}\n";
64
    }
66
            }
65
    elsif ( scalar(@lines) == 1 && $lines[0] ne "" ) {
67
            elsif ( scalar(@lines) == 1 && $lines[0] ne "" ) {
66
        my $pkg = $lines[0];
68
                my $pkg = $lines[0];
67
        print "$pkg\n";
69
                print "$pkg\n";
68
    }
70
            }
69
    elsif ( scalar(@lines) > 1 ) {
71
            elsif ( scalar(@lines) > 1 ) {
70
        foreach my $pkg (@lines) {
72
                foreach my $pkg (@lines) {
71
            print " | " if ( $pkg ne $lines[0] );
73
                    print " | " if ( $pkg ne $lines[0] );
72
            print "$pkg";
74
                    print "$pkg";
73
            print " | $pkg" . "-5.22" if ( $pkg eq "perl-modules" );
75
                    print " | $pkg" . "-5.22" if ( $pkg eq "perl-modules" );
74
            print " | $pkg" . "-5.24" if ( $pkg eq "perl-modules" );
76
                    print " | $pkg" . "-5.24" if ( $pkg eq "perl-modules" );
75
        }
77
                }
76
        print "\n";
78
                print "\n";
77
    }
79
            }
78
    elsif ( scalar(@temp) != 0 ) {
80
            elsif ( scalar(@temp) != 0 ) {
79
81
80
        # I'm an Essential and I'm OK,
82
                # I'm an Essential and I'm OK,
81
        # I install all night, and work all day.
83
                # I install all night, and work all day.
82
        # I chomp up strings. I eat my bugs.
84
                # I chomp up strings. I eat my bugs.
83
        # I go to the base install.
85
                # I go to the base install.
84
        # On Fridays I go drinking,
86
                # On Fridays I go drinking,
85
        # and have buttered commits for git.
87
                # and have buttered commits for git.
86
        # (Beer O'Clock is more than two hours
88
                # (Beer O'Clock is more than two hours
87
        # away. I don't even drink beer. There
89
                # away. I don't even drink beer. There
88
        # is no reason to be suspicious of this
90
                # is no reason to be suspicious of this
89
        # commit.)
91
                # commit.)
90
        # RM note: suspicious?  me?  always!
92
                # RM note: suspicious?  me?  always!
91
    }
93
            }
92
    elsif ( ! $deps->{$module}->{'required'} ) {
94
            elsif ( $type ne 'requires' ) {
93
        # Ignore because we don't have it and we don't care.
95
                # Ignore because we don't have it and we don't care.
94
    }
96
            }
95
    else {
97
            else {
96
        print "EEEK: unknown package for $module\n";
98
                print "EEEK: unknown package for $module\n";
99
            }
100
        }
97
    }
101
    }
98
}
102
}
(-)a/installer/install.pl (+1 lines)
Lines 30-35 use C4::Output; Link Here
30
use C4::Templates;
30
use C4::Templates;
31
use C4::Languages qw(getAllLanguages getTranslatedLanguages);
31
use C4::Languages qw(getAllLanguages getTranslatedLanguages);
32
use C4::Installer;
32
use C4::Installer;
33
use C4::Installer::PerlModules;
33
34
34
use Koha;
35
use Koha;
35
36
(-)a/t/Installer_PerlDependencies.t (-14 lines)
Lines 1-14 Link Here
1
#!/usr/bin/perl
2
#
3
# This Koha test module is a stub!  
4
# Add more tests here!!!
5
6
use strict;
7
use warnings;
8
9
use Test::More tests => 1;
10
11
BEGIN {
12
        use_ok('C4::Installer::PerlDependencies');
13
}
14
(-)a/t/Installer_PerlModules.t (-41 / +1 lines)
Lines 5-62 Link Here
5
5
6
use Modern::Perl;
6
use Modern::Perl;
7
7
8
use Test::More tests => 22;
8
use Test::More tests => 6;
9
9
10
BEGIN {
10
BEGIN {
11
        use_ok('C4::Installer::PerlModules');
11
        use_ok('C4::Installer::PerlModules');
12
}
12
}
13
13
14
$C4::Installer::PerlModules::PERL_DEPS->{'Local::Module::Upgraded'} = {
15
    'required' => '1',
16
    'min_ver' => '0.9.3',
17
    'usage' => "Testing: make sure numbers are compared numerically and not lexicographically",
18
};
19
$Local::Module::Upgraded::VERSION = '0.9.13';
20
$INC{"Local/Module/Upgraded.pm"} = 1;
21
use_ok("Local::Module::Upgraded");
22
23
$C4::Installer::PerlModules::PERL_DEPS->{'Local::Module::NotUpgraded'} = {
24
    'required' => '1',
25
    'min_ver' => '0.9.3',
26
    'usage' => "Testing: make sure numbers are compared numerically and not lexicographically",
27
};
28
$Local::Module::NotUpgraded::VERSION = '0.9.1';
29
$INC{"Local/Module/NotUpgraded.pm"} = 1;
30
use_ok("Local::Module::NotUpgraded");
31
32
my $modules;
14
my $modules;
33
ok ($modules = C4::Installer::PerlModules->new(), 'Tests modules object');
15
ok ($modules = C4::Installer::PerlModules->new(), 'Tests modules object');
34
my $prereq_pm = $modules->prereq_pm();
16
my $prereq_pm = $modules->prereq_pm();
35
ok (exists($prereq_pm->{"DBI"}), 'DBI required for installer to run');
17
ok (exists($prereq_pm->{"DBI"}), 'DBI required for installer to run');
36
ok (exists($prereq_pm->{"CGI"}), 'CGI required for installer to run' );
18
ok (exists($prereq_pm->{"CGI"}), 'CGI required for installer to run' );
37
ok (exists($prereq_pm->{"YAML"}), 'YAML required for installer to run');
19
ok (exists($prereq_pm->{"YAML"}), 'YAML required for installer to run');
38
is ($modules->required('module'=>"DBI"),1, 'DBI should return 1 since required');
39
is ($modules->required('module'=>"thisdoesn'texist"),-1, 'string should return -1 since not in hash');
40
my $required = $modules->required('required'=>1);
41
my %params = map { $_ => 1 } @$required;
42
ok (exists($params{"DBI"}), 'DBI required for installer to run');
43
my $optional = $modules->required('optional'=>1);
44
%params = map { $_ => 1 } @$optional;
45
ok (exists($params{"Test::Strict"}), 'test::strict optional for installer to run');
46
is ($optional = $modules->required('spaghetti'=>1),-1, '-1 returned when parsing in unknown parameter');
47
my $version_info = $modules->version_info('DBI');
48
ok (exists($version_info->{"required"}), 'required exists');
49
ok (exists($version_info->{"upgrade"}), 'upgrade exists');
50
is ($modules->version_info("thisdoesn'texist"),-1, 'thisdoesntexist should return -1');
51
ok ($modules->module_count() >10 , 'count should be greater than 10');
52
my @module_list = $modules->module_list;
53
%params = map { $_ => 1 } @module_list;
54
ok (exists($params{"DBI"}), 'DBI exists in array');
55
is ($modules->required('module'=>"String::Random"),1, 'String::Random should return 1 since required');
56
is ($modules->version_info(), -1, "Testing empty modules");
57
58
is($modules->version_info("Local::Module::Upgraded")->{"upgrade"},0,"Version 0.9.13 is greater than 0.9.3, so no upgrade needed");
59
is($modules->version_info("Local::Module::NotUpgraded")->{"upgrade"},1,"Version 0.9.1 is smaller than 0.9.1, so no upgrade needed");
60
20
61
subtest 'versions_info' => sub {
21
subtest 'versions_info' => sub {
62
    plan tests => 4;
22
    plan tests => 4;
(-)a/t/Installer_pm.t (-12 / +1 lines)
Lines 3-9 Link Here
3
use strict;
3
use strict;
4
use warnings;
4
use warnings;
5
5
6
use Test::More tests => 4;
6
use Test::More tests => 2;
7
use Data::Dumper;
7
use Data::Dumper;
8
8
9
BEGIN {
9
BEGIN {
Lines 13-25 BEGIN { Link Here
13
my $obj = C4::Installer::PerlModules->new;
13
my $obj = C4::Installer::PerlModules->new;
14
14
15
isa_ok($obj,'C4::Installer::PerlModules');
15
isa_ok($obj,'C4::Installer::PerlModules');
16
17
my $module_info = $obj->version_info('Test::More');
18
19
my $control = $Test::More::VERSION;
20
21
like($module_info->{cur_ver}, qr/\d/, 'returns numeric version');
22
23
is($module_info->{cur_ver}, $control, 'returns correct version');
24
25
26
- 

Return to bug 19735