This repository has been archived by the owner on Aug 23, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
sympa.spec
1147 lines (989 loc) · 35.8 KB
/
sympa.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# %1 is the path to dir bundling files (from)
# %2 is the path to dir containing original files (with)
%global unbundle_from_with() \
bundled_dir="%{buildroot}%1" \
bundled_files="$(find "${bundled_dir}" -maxdepth 1 -type f -printf '%f\\n')" \
original_dir="%2" \
for file in ${bundled_files} \
do \
if [ -f "${original_dir}/${file}" ] \
then \
rm -f "${bundled_dir}/${file}" \
ln -s "${original_dir}/${file}" "${bundled_dir}/${file}" \
fi \
done
%if 0%{?fedora} || 0%{?rhel} >= 7
%global use_systemd 1
%else
%global use_systemd 0
%endif
%global static_content %{_datadir}/sympa/static_content
# Fonts
#
# EL7 version (4.1.0) is missing some icons
%global unbundle_fontawesome 0%{?fedora}%{?el6}
# Not available for EL
%global unbundle_raleway 0%{?fedora}
# Not available
%global unbundle_foundation_icons 0
# Javascripts
#
# Not available
%global unbundle_foundation 0
# Not available for EL
%global unbundle_html5shiv 0%{?fedora}
# Not available for EL
%global unbundle_jquery 0%{?fedora}
# Available version is too old
%global unbundle_jquery_migrate 0
# Not available
%global unbundle_jquery_minicolors 0
# Not available for EL6
%global unbundle_jquery_ui 0%{?fedora}%{?el7}
# Only available for F29+
%global unbundle_jqplot 0%{?fedora}
#
%global unbundle_respond 0%{?fedora}%{?rhel}
# Licenses
# Sympa itself is GPLv2+.
# Possibly bundled fonts are :
# - fontawesome-fonts : OFL
# - fontawesome-fonts-web: OFL and MIT
# - impallari-raleway-fonts: OFL
# - foundation-icons-fonts: MIT
# Possibly bundled javascripts are :
# - js-html5shiv: MIT or GPLv2
# - js-jquery-jqplot: MIT or GPLv2
# - js-jquery: MIT
# - js-respond: MIT
# - js-jquery-ui: MIT
# - js-foundation: MIT
# - js-jquery-migrate: MIT
# - js-jquery-minicolors: MIT
%global licenses_bundled %{nil}
# OFL and MIT
%if ! %{unbundle_fontawesome}
%global licenses_bundled %{licenses_bundled} and (OFL and MIT)
%endif
# OFL
%if ! %{unbundle_raleway}
%global licenses_bundled %{licenses_bundled} and OFL
%endif
# MIT
%if ! %{unbundle_foundation_icons} || ! %{unbundle_foundation} || ! %{unbundle_jquery} || ! %{unbundle_jquery_migrate} || ! %{unbundle_jquery_minicolors} || ! %{unbundle_jquery_ui} || ! %{unbundle_respond}
%global licenses_bundled %{licenses_bundled} and MIT
%endif
# MIT or GPLv2
%if ! %{unbundle_html5shiv} || ! %{unbundle_jqplot}
%global licenses_bundled %{licenses_bundled} and (MIT or GPLv2)
%endif
#global pre_rel b.2
Name: sympa
Version: 6.2.44
Release: %{?pre_rel:0.}2%{?pre_rel:.%pre_rel}%{?dist}
Summary: Powerful multilingual List Manager
Summary(fr): Gestionnaire de listes électroniques
Summary(ja): 高機能で多言語対応のメーリングリスト管理ソフトウェア
# The License: tag depends on bundled code for a given distro/release
License: GPLv2+%{licenses_bundled}
URL: http://www.sympa.org
Source0: https://github.com/sympa-community/sympa/releases/download/%{version}%{?pre_rel}/%{name}-%{version}%{?pre_rel}.tar.gz
Source100: sympa-httpd22-fcgid.conf
Source101: sympa-httpd24-spawn_fcgi.conf
Source102: sympa-lighttpd.conf
Source103: sympa-nginx-spawn_fcgi.conf
Source104: sympa-wwsympa.init
Source105: sympa-sympasoap.init
Source106: sympa-rsyslog.conf
Source107: sympa-logrotate.conf
Source112: sympa-sysvinit-README.RPM.md
Source113: sympa-systemd-README.RPM.md
Source114: aliases.sympa.sendmail
Source115: aliases.sympa.postfix
Source129: sympa.service.d-dependencies.conf
Source130: sympa-sysconfig
# Add path to MHonArc::UTF8 so that sympa_wizard won't miss it
Patch5: sympa-6.2.36-wizard-mhonarc.patch
# RPM specific customization of site defaults
Patch13: sympa-6.2.19b.1-confdef.patch
# Disable sympa service by default
Patch14: sympa-6.2-initdefault.patch
BuildRequires: gcc, make
BuildRequires: gettext
%if %{use_systemd}
BuildRequires: systemd
%endif
# Only for development
%if 0%{?do_autoreconf}
BuildRequires: autoconf, automake, gettext-devel
%endif
BuildRequires: perl-generators
# install & check
BuildRequires: perl(Archive::Zip)
BuildRequires: perl(base)
BuildRequires: perl(Carp)
BuildRequires: perl(CGI::Cookie)
BuildRequires: perl(CGI::Fast)
BuildRequires: perl(CGI::Util)
BuildRequires: perl(Class::Singleton)
BuildRequires: perl(Config)
BuildRequires: perl(constant)
BuildRequires: perl(Cwd)
BuildRequires: perl(Data::Password)
BuildRequires: perl(DateTime)
BuildRequires: perl(DateTime::Format::Mail)
BuildRequires: perl(DBD::SQLite)
BuildRequires: perl(DBI)
BuildRequires: perl(Digest::MD5)
BuildRequires: perl(Encode)
BuildRequires: perl(Encode::MIME::Header)
BuildRequires: perl(English)
BuildRequires: perl(FCGI)
BuildRequires: perl(Fcntl)
BuildRequires: perl(feature)
BuildRequires: perl(File::Copy)
BuildRequires: perl(File::Copy::Recursive)
BuildRequires: perl(File::Find)
BuildRequires: perl(File::NFSLock)
BuildRequires: perl(File::Path)
BuildRequires: perl(File::stat)
BuildRequires: perl(File::Temp)
BuildRequires: perl(Getopt::Long)
BuildRequires: perl(HTML::Entities)
BuildRequires: perl(HTML::FormatText)
BuildRequires: perl(HTML::Parser)
BuildRequires: perl(HTML::StripScripts::Parser)
BuildRequires: perl(HTML::TreeBuilder)
BuildRequires: perl(HTTP::Request)
BuildRequires: perl(if)
BuildRequires: perl(IO::File)
BuildRequires: perl(IO::Scalar)
BuildRequires: perl(IO::Socket::SSL)
BuildRequires: perl(lib)
BuildRequires: perl(Locale::Messages)
BuildRequires: perl(LWP::UserAgent)
BuildRequires: perl(Mail::Address)
BuildRequires: perl(MIME::Base64)
BuildRequires: perl(MIME::Charset)
BuildRequires: perl(MIME::EncWords)
BuildRequires: perl(MIME::Entity)
BuildRequires: perl(MIME::Head)
BuildRequires: perl(MIME::Lite::HTML)
BuildRequires: perl(MIME::Parser)
BuildRequires: perl(MIME::Tools)
BuildRequires: perl(Net::CIDR)
BuildRequires: perl(Net::LDAP)
BuildRequires: perl(POSIX)
BuildRequires: perl(Scalar::Util)
BuildRequires: perl(SOAP::Lite)
BuildRequires: perl(SOAP::Transport::HTTP)
BuildRequires: perl(Storable)
BuildRequires: perl(strict)
BuildRequires: perl(Sys::Hostname)
BuildRequires: perl(Sys::Syslog)
BuildRequires: perl(Template)
BuildRequires: perl(Term::ProgressBar)
BuildRequires: perl(Test::Compile)
BuildRequires: perl(Test::Harness)
BuildRequires: perl(Test::More)
BuildRequires: perl(Test::Pod)
BuildRequires: perl(Text::LineFold)
BuildRequires: perl(Time::HiRes)
BuildRequires: perl(Time::Local)
# For Perl prior to 5.16.0.
%if 0%{?rhel} == 6
BuildRequires: perl(Unicode::CaseFold)
%endif
BuildRequires: perl(Unicode::GCString)
BuildRequires: perl(URI)
BuildRequires: perl(URI::Escape)
BuildRequires: perl(warnings)
BuildRequires: perl(XML::LibXML)
# authorcheck
%if 0%{?do_authorcheck}
BuildRequires: perl(Test::Fixme)
BuildRequires: perl(Test::Perl::Critic)
BuildRequires: perl(Test::Pod::Coverage)
BuildRequires: perl(Test::Pod::Spelling::CommonMistakes)
%endif
Requires(pre): shadow-utils
%if ! %{use_systemd}
Requires(post): chkconfig
Requires(preun): chkconfig
Requires(preun): initscripts
Requires(postun): initscripts
%endif
Requires: smtpdaemon
Requires: mhonarc
Requires: perl(DBD::mysql)
Requires: perl(FCGI)
# Missing Requires on EL6 and EL7
%if 0%{?el6}%{?el7}
Requires: perl(HTML::FormatText)
Requires: perl(HTML::StripScripts::Parser)
%endif
# Optional CPAN packages
Requires: perl(AuthCAS)
Requires: perl(Clone)
Requires: perl(Crypt::CipherSaber)
Requires: perl(Crypt::Eksblowfish)
Requires: perl(Crypt::OpenSSL::X509)
Requires: perl(Crypt::SMIME)
Requires: perl(Data::Password)
Requires: perl(DateTime::TimeZone)
Requires: perl(DBD::CSV)
Requires: perl(Encode::Locale)
# Recommended for handling Japanese vendor codepages.
Requires: perl(Encode::EUCJPASCII)
# Handling several Chinese standards.
Requires: perl(Encode::HanExtra)
Requires: perl(IO::Socket::SSL)
Requires: perl(List::Util::XS)
Requires: perl(Mail::DKIM::Verifier)
Requires: perl(Net::DNS)
Requires: perl(Net::SMTP)
# for Perl prior to 5.16.0.
%if 0%{?rhel} == 6
Requires: perl(Unicode::CaseFold)
%endif
Requires: perl(Unicode::Normalize)
# Bundled fonts
%if %{unbundle_fontawesome}
BuildRequires: fontawesome-fonts-web >= 4.3.0
Requires: fontawesome-fonts-web >= 4.3.0
%else
Provides: bundled(fontawesome-fonts) = 4.3.0
%endif
%if %{unbundle_raleway}
BuildRequires: impallari-raleway-fonts >= 3.0
Requires: impallari-raleway-fonts >= 3.0
%else
Provides: bundled(impallari-raleway-fonts) = 3.0
%endif
# FIXME: foundation icons
# See https://fedoraproject.org/wiki/Foundation_icons_font
# http://zurb.com/playground/uploads/upload/upload/288/foundation-icons.zip
%if %{unbundle_foundation_icons}
BuildRequires: foundation-icons-fonts >= 3.0
Requires: foundation-icons-fonts >= 3.0
%else
Provides: bundled(foundation-icons-fonts) = 3.0
%endif
# Bundled javascript libs
# foundation
%if %{unbundle_foundation}
BuildRequires: js-foundation6 >= 6.4.2
Requires: js-foundation6 >= 6.4.2
%else
Provides: bundled(js-foundation) = 6.4.2
# Bundled in bundled js-foundation
Provides: bundled(js-what-input) = 4.2.0
%endif
# html5shiv
%if %{unbundle_html5shiv}
BuildRequires: js-html5shiv >= 3.7.2
Requires: js-html5shiv >= 3.7.2
%else
Provides: bundled(js-html5shiv) = 3.7.2
%endif
# jquery
%if %{unbundle_jquery}
BuildRequires: js-jquery3 >= 3.2.1
Requires: js-jquery3 >= 3.2.1
%else
Provides: bundled(js-jquery) = 3.2.1
%endif
# jquery-migrate
%if %{unbundle_jquery_migrate}
%if 0%{?el7}
BuildRequires: python-XStatic-JQuery-Migrate >= 1.4.1
Requires: python-XStatic-JQuery-Migrate >= 1.4.1
%else
BuildRequires: xstatic-jquery-migrate-common >= 1.4.1
Requires: xstatic-jquery-migrate-common >= 1.4.1
%endif
%else
Provides: bundled(js-jquery-migrate) = 1.4.1
%endif
# jquery-minicolors
%if %{unbundle_jquery_minicolors}
BuildRequires: js-jquery-minicolors >= 2.3.1
Requires: js-jquery-minicolors >= 2.3.1
%else
Provides: bundled(js-jquery-minicolors) = 2.3.1
%endif
# jquery-ui
%if %{unbundle_jquery_ui}
%if 0%{?el7}
BuildRequires: python-XStatic-jquery-ui >= 1.12.0
Requires: python-XStatic-jquery-ui >= 1.12.0
%else
BuildRequires: xstatic-jquery-ui-common >= 1.12.0
Requires: xstatic-jquery-ui-common >= 1.12.0
%endif
%else
Provides: bundled(js-jquery-ui) = 1.12.1
%endif
# jqplot
%if %{unbundle_jqplot}
BuildRequires: js-jquery-jqplot >= 1.0.8
Requires: js-jquery-jqplot >= 1.0.8
%else
Provides: bundled(js-jquery-jqplot) = 1.0.8
%endif
# respond
%if %{unbundle_respond}
BuildRequires: js-respond >= 1.4.2
Requires: js-respond >= 1.4.2
%else
Provides: bundled(js-respond) = 1.4.2
%endif
%package httpd
Summary: Sympa with Apache HTTP Server
Summary(fr): Sympa avec Serveur HTTP Apache
Summary(ja): SympaのApache HTTP Server対応
Requires: %{name} = %{version}-%{release}
Requires: httpd
%if 0%{?fedora} || 0%{?rhel} >= 7
Requires: spawn-fcgi
%else
Requires: mod_fcgid
%endif
Conflicts: %{name}-lighttpd, %{name}-nginx
%package lighttpd
Summary: Sympa with lighttpd
Summary(fr): Sympa avec lighttpd
Summary(ja): Sympaのlighttpd対応
Requires: %{name} = %{version}-%{release}
Requires: lighttpd
Requires: lighttpd-fastcgi
Conflicts: %{name}-httpd, %{name}-nginx
%package nginx
Summary: Sympa with nginx
Summary(fr): Sympa avec nginx
Summary(ja): Sympaのnginx対応
Requires: %{name} = %{version}-%{release}
Requires: nginx
Requires: spawn-fcgi
Conflicts: %{name}-httpd, %{name}-lighttpd
%package devel-doc
Summary: Sympa devel doc
Requires: %{name} = %{version}-%{release}
%if 0%{?fedora} || 0%{?rhel} >= 7
%{?perl_default_filter}
%global __requires_exclude perl\\(Conf\\)
%global __provides_exclude perl\\(Conf\\)
%endif
%if 0%{?rhel} == 6
%filter_from_provides /perl(Conf)/d
%filter_from_requires /perl(Conf)/d
%filter_setup
%endif
%description
Sympa is scalable and highly customizable mailing list manager. It
can cope with big lists (200,000 subscribers) and comes with a
complete (user and admin) Web interface. It is internationalized,
and supports the us, fr, de, es, it, fi, and chinese locales. A
scripting language allows you to extend the behavior of commands.
Sympa can be linked to an LDAP directory or an RDBMS to create
dynamic mailing lists. Sympa provides S/MIME-based authentication
and encryption.
%description -l ja
Sympa はスケーラブルで高いカスタマイズ性を持つメーリングリスト管理
ソフトウェアです。巨大なリスト (登録者数 200,000) にも適用でき、完
全な (一般ユーザ用および管理者用) ウェブインタフェースをそなえてい
ます。国際化されており、多数の言語に対応します。内蔵のスクリプティ
ング言語でコマンドの動作を拡張できます。Sympa はまた、LDAP ディレ
クトリや RDBMS と連携して動的なメーリングリストを作成できます。ま
た、S/MIME に基づく認証や暗号化もできます。
%description httpd
Apache HTTP Server support for Sympa.
%description httpd -l ja
Sympa の Apache HTTP Server 対応。
%description lighttpd
lighttpd support for Sympa.
%description lighttpd -l ja
Sympa の lighttpd 対応。
%description nginx
nginx support for Sympa.
%description nginx -l ja
Sympa の nginx 対応。
%description devel-doc
Sympa documentation for developers.
%prep
%setup -q -n %{name}-%{version}%{?pre_rel}
%patch5 -p0 -b .mhonarc
%patch13 -p0 -b .confdef
%patch14 -p0 -b .initdefault
%build
# Development
%if 0%{?do_autoreconf}
autoreconf --install
%endif
# Give install "-p" preserving mtime to prevent unexpected update of CSS.
%configure \
--enable-fhs \
--prefix=%{_prefix} \
--bindir=%{_libexecdir}/sympa \
--docdir=%{_docdir}/%{name} \
--libexecdir=%{_libexecdir}/sympa \
--localstatedir=%{_localstatedir} \
--sysconfdir=%{_sysconfdir}/sympa \
--with-cgidir=%{_libexecdir}/sympa \
--with-confdir=%{_sysconfdir}/sympa \
%if %{use_systemd}
--without-initdir \
--with-unitsdir=%{_unitdir} \
--with-piddir=%{_rundir}/sympa \
%else
--with-initdir=%{_initrddir} \
--with-piddir=%{_localstatedir}/run/sympa/ \
%endif
--with-smrshdir=%{_sysconfdir}/smrsh \
--with-aliases_file=%{_localstatedir}/lib/sympa/sympa_aliases \
--with-perl=%{_bindir}/perl \
--with-staticdir=%{static_content} \
--with-cssdir=%{_localstatedir}/lib/sympa/css \
--with-picturesdir=%{_localstatedir}/lib/sympa/pictures \
INSTALL_DATA='install -c -p -m 644'
%make_build
# cancel workaround in Makefile getting previous version.
rm -f previous_sympa_version
pushd po/sympa; rm -f stamp-po; make; popd
pushd po/web_help; rm -f stamp-po; make; popd
%install
%make_install
%find_lang %{name}
%find_lang web_help
# Unbundle fonts from static_content/fonts
# font-awesome
%if %{unbundle_fontawesome}
%unbundle_from_with %{static_content}/fonts/font-awesome/fonts %{_datadir}/fonts/fontawesome
%unbundle_from_with %{static_content}/fonts/font-awesome/css %{_datadir}/font-awesome-web/css
%endif
# Raleway
%if %{unbundle_raleway}
rm -f %{buildroot}%{static_content}/fonts/Raleway/OFL.txt
%unbundle_from_with %{static_content}/fonts/Raleway %{_datadir}/fonts/impallari-raleway
%endif
# FIXME: foundation-icons
%if %{unbundle_foundation_icons}
rm -f %{buildroot}%{_datadir}/fonts/foundation-icons/preview.html
%unbundle_from_with %{static_content}/fonts/foundation-icons %{_datadir}/fonts/foundation-icons
%unbundle_from_with %{static_content}/fonts/foundation-icons/svgs %{_datadir}/fonts/foundation-icons/svgs
%endif
# Unbundle javascript libraries from static_content/js
# FIXME : foundation (Foundation for Sites 6, with float grid support)
%if %{unbundle_foundation}
%unbundle_from_with %{static_content}/js/foundation/js %{_datadir}/javascript/foundation/js
%unbundle_from_with %{static_content}/js/foundation/css %{_datadir}/javascript/foundation/css
# what-input.js
%unbundle_from_with %{static_content}/js/foundation/js/vendor %{_datadir}/javascript
%endif
# html5shiv
%if %{unbundle_html5shiv}
%unbundle_from_with %{static_content}/js/html5shiv %{_datadir}/javascript/
%endif
# jquery
%if %{unbundle_jquery}
%unbundle_from_with %{static_content}/js %{_datadir}/javascript/jquery/3
%endif
# FIXME : jquery-migrate
%if %{unbundle_jquery_migrate}
%unbundle_from_with %{static_content}/js %{_datadir}/javascript/jquery_migrate
%endif
# FIXME : jquery-minicolors
%if %{unbundle_jquery_minicolors}
%unbundle_from_with %{static_content}/js/jquery-minicolors %{_datadir}/javascript/jquery-minicolors
%endif
# jquery-ui
%if %{unbundle_jquery_ui}
%unbundle_from_with %{static_content}/js/jquery-ui %{_datadir}/javascript/jquery_ui
# FIXME: Unbundle theme (smoothness ?)
#unbundle_from_with %{static_content}/js/jquery-ui/images %{_datadir}/javascript/jquery_ui/themes/smoothness/images
%endif
# jqplot
%if %{unbundle_jqplot}
%unbundle_from_with %{static_content}/js/jqplot %{_datadir}/javascript/jquery-jqplot
%endif
# respond
%if %{unbundle_respond}
%unbundle_from_with %{static_content}/js/respondjs %{_datadir}/javascript
%endif
# Save version info.
mv %{buildroot}%{_sysconfdir}/sympa/data_structure.version \
%{buildroot}%{_sysconfdir}/sympa/data_structure.current_version
# Copy *httpd config files.
mkdir -p %{buildroot}%{_sysconfdir}/httpd/conf.d
%if 0%{?fedora} || 0%{?rhel} >= 7
install -m 0644 %{SOURCE101} %{buildroot}%{_sysconfdir}/httpd/conf.d/sympa.conf
%else
install -m 0644 %{SOURCE100} %{buildroot}%{_sysconfdir}/httpd/conf.d/sympa.conf
%endif
mkdir -p %{buildroot}%{_sysconfdir}/lighttpd/conf.d
install -m 0644 %{SOURCE102} %{buildroot}%{_sysconfdir}/lighttpd/conf.d/sympa.conf
mkdir -p %{buildroot}%{_sysconfdir}/nginx/conf.d
install -m 0644 %{SOURCE103} %{buildroot}%{_sysconfdir}/nginx/conf.d/sympa.conf
# Copy init scripts or unit files for nginx/spawn-fcgi etc.
%if %{use_systemd}
install -m 0644 src/etc/script/wwsympa.service \
%{buildroot}%{_unitdir}/wwsympa.service
install -m 0644 src/etc/script/sympasoap.service \
%{buildroot}%{_unitdir}/sympasoap.service
mkdir -p %{buildroot}%{_tmpfilesdir}
install -m 0644 src/etc/script/sympa-tmpfiles.conf \
%{buildroot}%{_tmpfilesdir}/sympa.conf
mkdir -p %{buildroot}%{_sysconfdir}/systemd/system/sympa.service.d
install -m 0644 %{SOURCE129} \
%{buildroot}%{_sysconfdir}/systemd/system/sympa.service.d/dependencies.conf
%else
install -m 0755 %{SOURCE104} %{buildroot}%{_initrddir}/wwsympa
install -m 0755 %{SOURCE105} %{buildroot}%{_initrddir}/sympasoap
%endif
# Copy system config file.
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
install -m 0644 %{SOURCE130} %{buildroot}%{_sysconfdir}/sysconfig/sympa
# Copy docs.
mv %{buildroot}%{_docdir}/%{name} __doc
cp -p AUTHORS.md CONTRIBUTING.md NEWS.md README.md __doc/
%if %{use_systemd}
cp -p %{SOURCE113} __doc/README.RPM.md
%else
cp -p %{SOURCE112} __doc/README.RPM.md
%endif
mv %{buildroot}%{_sysconfdir}/sympa/README __doc/
%if 0%{?el6}%{?el7}
ln -s %{_datadir}/doc/%{name}-%{version}/README \
%{buildroot}/%{_sysconfdir}/sympa/README
ln -s %{_datadir}/doc/%{name}-%{version}/README \
%{buildroot}/%{_datadir}/sympa/default/README
%else
ln -s %{_datadir}/doc/%{name}/README \
%{buildroot}/%{_sysconfdir}/sympa/README
ln -s %{_datadir}/doc/%{name}/README \
%{buildroot}/%{_datadir}/sympa/default/README
%endif
mv %{buildroot}%{_sysconfdir}/sympa/sympa.conf-dist __doc/
# Copy robot aliases.
install -m 0644 %{SOURCE114} %{SOURCE115} %{buildroot}%{_sysconfdir}/sympa/
touch %{buildroot}%{_sysconfdir}/sympa/aliases.sympa.sendmail.db
touch %{buildroot}%{_sysconfdir}/sympa/aliases.sympa.postfix.db
# Copy rsyslog config
mkdir -p %{buildroot}%{_sysconfdir}/rsyslog.d
install -m 0644 %{SOURCE106} %{buildroot}%{_sysconfdir}/rsyslog.d/sympa.conf
# Create logrotate item
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
install -m 0644 %{SOURCE107} %{buildroot}%{_sysconfdir}/logrotate.d/sympa
# Remove incomplete intranet scenario
rm -rf %{buildroot}%{_datadir}/sympa/default/create_list_templates/intranet_list \
%{buildroot}%{_datadir}/sympa/default/scenari/*intranet*
# Create configuration override structure
for conffile in \
auth.conf charset.conf crawlers_detection.conf create_list.conf \
edit_list.conf nrcpt_by_domain.conf topics.conf \
mime.types sympa.wsdl ;
do cp -a %{buildroot}%{_datadir}/%{name}/default/$conffile \
%{buildroot}%{_sysconfdir}/%{name}/;
done
# Create directory for S/MIME user certificates
mkdir -p %{buildroot}%{_localstatedir}/lib/sympa/X509-user-certs
%check
make check
%if 0%{?do_authorcheck}
make authorcheck || true
%endif
%pre
# Create "sympa" group if it does not exist
getent group sympa >/dev/null || /usr/sbin/groupadd -r sympa
# Create "sympa" user if it does not exist
getent passwd sympa >/dev/null || \
/usr/sbin/useradd -r -g sympa \
-d %{_localstatedir}/lib/sympa \
-c "System User for Sympa" \
-s "/sbin/nologin" \
sympa
# Fix CSS and pictures paths
if [ $1 -gt 1 ]; then
if [ -d %{_localstatedir}/lib/%{name}/static_content/css ]; then
mv -fu %{_localstatedir}/lib/%{name}/static_content/css/* \
%{_localstatedir}/lib/%{name}/css/ \
&& rm -rf %{_localstatedir}/lib/%{name}/static_content/css/
fi
if [ -d %{_localstatedir}/lib/%{name}/static_content/pictures ]; then
mv -fu %{_localstatedir}/lib/%{name}/static_content/pictures/* \
%{_localstatedir}/lib/%{name}/pictures/ \
&& rm -rf %{_localstatedir}/lib/%{name}/static_content/pictures/
fi
if [ ! -d %{_localstatedir}/lib/%{name}/static_content/css \
-a ! -d %{_localstatedir}/lib/%{name}/static_content/pictures \
-a -d %{_localstatedir}/lib/%{name}/static_content ]; then
rm -r %{_localstatedir}/lib/%{name}/static_content/
fi
fi
exit 0
%post
# register service
%if %{use_systemd}
%systemd_post sympa.service
%else
/sbin/chkconfig --add sympa
%endif
# create cookie
function create_cookie {
cook=`mktemp`
perl -ne 'chomp $_; print $1 if /^cookie\s+(\S.*)/' \
%{_sysconfdir}/sympa/sympa.conf > $cook
if [ '!' -s $cook ]; then
if [ -e %{_sysconfdir}/sympa/cookies.history ]; then
cp -p %{_sysconfdir}/sympa/cookies.history $cook
else
dd if=/dev/urandom bs=2048 count=1 2>/dev/null | md5sum | \
cut -d" " -f1 > $cook
fi
perl -i -pe '/^#cookie\s/ and $_ = "cookie ".`cat '$cook'`."\n"' \
%{_sysconfdir}/sympa/sympa.conf
fi
rm -f $cook
}
# create config at first time.
function create_config {
## create site configurations
if [ '!' -e %{_sysconfdir}/sympa/data_structure.version ]; then
cp -p %{_sysconfdir}/sympa/data_structure.current_version \
%{_sysconfdir}/sympa/data_structure.version
fi
## create sympa_aliases
if [ '!' -e %{_localstatedir}/lib/sympa/sympa_aliases ]; then
touch %{_localstatedir}/lib/sympa/sympa_aliases
chown sympa:sympa %{_localstatedir}/lib/sympa/sympa_aliases
chmod 644 %{_localstatedir}/lib/sympa/sympa_aliases
touch %{_localstatedir}/lib/sympa/sympa_aliases.db
chown sympa:root %{_localstatedir}/lib/sympa/sympa_aliases.db
chmod 664 %{_localstatedir}/lib/sympa/sympa_aliases.db
fi
}
function upgrade_data_structure {
# Stop sympa if it is running
%if %{use_systemd}
if systemctl is-active sympa > /dev/null 2>&1; then
/usr/bin/systemctl stop sympa > /dev/null 2>&1
ACTIVE="yes"
fi
%else
if [ -e %{_localstatedir}/lock/subsys/sympa ]; then
/sbin/service sympa stop > /dev/null 2>&1
ACTIVE="yes"
fi
%endif
# Upgrade
rm -f %{_sysconfdir}/sympa/sympa.conf.bin > /dev/null 2>&1
if %{_sbindir}/sympa.pl --upgrade > /dev/null 2>&1; then
# Start sympa if it was running previously
if [ "$ACTIVE" == "yes" ]; then
%if %{use_systemd}
/usr/bin/systemctl start sympa > /dev/null 2>&1
%else
/sbin/service sympa start > /dev/null 2>&1
%endif
fi
else
echo ============================================================
echo Notice: Failed upgrading data structure. See logfile.
echo Sympa is stopped.
echo ============================================================
fi
}
# Install
if [ $1 -eq 1 ]; then
create_cookie
create_config
echo ============================================================
echo Sympa had been installed successfully. If you installed
echo Sympa at first time, please read:
echo %{_docdir}/%{name}-%{version}/README.RPM.md
echo ============================================================
fi
# Update
if [ $1 -gt 1 ]; then
upgrade_data_structure
fi
%if 0%{?fedora} || 0%{?rhel} >= 7
%post httpd
# register service
%systemd_post wwsympa.service
%systemd_post sympasoap.service
%endif
%post nginx
# register service
%if %{use_systemd}
%systemd_post wwsympa.service
%systemd_post sympasoap.service
%else
/sbin/chkconfig --add wwsympa
/sbin/chkconfig --add sympasoap
%endif
%preun
%if %{use_systemd}
%systemd_preun sympa.service
%else
if [ $1 -eq 0 ] ; then
/sbin/service sympa stop >/dev/null 2>&1
/sbin/chkconfig --del sympa
fi
%endif
%if 0%{?fedora} || 0%{?rhel} >= 7
%preun httpd
%systemd_preun wwsympa.service
%systemd_preun sympasoap.service
%endif
%preun nginx
%if %{use_systemd}
%systemd_preun wwsympa.service
%systemd_preun sympasoap.service
%else
if [ $1 -eq 0 ] ; then
/sbin/service wwsympa stop >/dev/null 2>&1
/sbin/service sympasoap stop >/dev/null 2>&1
/sbin/chkconfig --del wwsympa
/sbin/chkconfig --del sympasoap
fi
%endif
%postun
%if %{use_systemd}
%systemd_postun_with_restart sympa.service
%else
if [ "$1" -ge "1" ] ; then
/sbin/service sympa condrestart >/dev/null 2>&1 || :
fi
%endif
%if 0%{?fedora} || 0%{?rhel} >= 7
%postun httpd
%systemd_postun_with_restart wwsympa.service
%systemd_postun_with_restart sympasoap.service
%endif
%postun nginx
%if %{use_systemd}
%systemd_postun_with_restart wwsympa.service
%systemd_postun_with_restart sympasoap.service
%else
if [ "$1" -ge "1" ] ; then
/sbin/service wwsympa condrestart >/dev/null 2>&1 || :
/sbin/service sympasoap condrestart >/dev/null 2>&1 || :
fi
%endif
%files -f %{name}.lang -f web_help.lang
%doc __doc/*
%license COPYING
%dir %attr(-,sympa,sympa) %{_sysconfdir}/sympa/
%{_sysconfdir}/sympa/README
%config(noreplace) %attr(0640,sympa,sympa) %{_sysconfdir}/sympa/sympa.conf
%config(noreplace,missingok) %attr(-,sympa,sympa) %{_sysconfdir}/sympa/auth.conf
%config(noreplace,missingok) %attr(-,sympa,sympa) %{_sysconfdir}/sympa/charset.conf
%config(noreplace,missingok) %attr(-,sympa,sympa) %{_sysconfdir}/sympa/crawlers_detection.conf
%config(noreplace,missingok) %attr(-,sympa,sympa) %{_sysconfdir}/sympa/create_list.conf
%config(noreplace,missingok) %attr(-,sympa,sympa) %{_sysconfdir}/sympa/edit_list.conf
%config(noreplace,missingok) %attr(-,sympa,sympa) %{_sysconfdir}/sympa/nrcpt_by_domain.conf
%config(noreplace,missingok) %attr(-,sympa,sympa) %{_sysconfdir}/sympa/topics.conf
%config(noreplace,missingok) %attr(-,sympa,sympa) %{_sysconfdir}/sympa/mime.types
%config(noreplace,missingok) %attr(-,sympa,sympa) %{_sysconfdir}/sympa/sympa.wsdl
%dir %attr(-,sympa,sympa) %{_sysconfdir}/sympa/create_list_templates
%dir %attr(-,sympa,sympa) %{_sysconfdir}/sympa/tasks
%dir %attr(-,sympa,sympa) %{_sysconfdir}/sympa/scenari
%dir %attr(-,sympa,sympa) %{_sysconfdir}/sympa/mail_tt2
%dir %attr(-,sympa,sympa) %{_sysconfdir}/sympa/web_tt2
%dir %attr(-,sympa,sympa) %{_sysconfdir}/sympa/custom_actions
%dir %attr(-,sympa,sympa) %{_sysconfdir}/sympa/custom_conditions
%dir %attr(-,sympa,sympa) %{_sysconfdir}/sympa/data_sources
%dir %attr(-,sympa,sympa) %{_sysconfdir}/sympa/families
%dir %attr(-,sympa,sympa) %{_sysconfdir}/sympa/search_filters
%config(missingok) %attr(-,sympa,sympa) %{_sysconfdir}/sympa/data_structure.current_version
%config(noreplace) %{_sysconfdir}/sympa/aliases.sympa.sendmail
%config(noreplace) %{_sysconfdir}/sympa/aliases.sympa.sendmail.db
%config(noreplace) %{_sysconfdir}/sympa/aliases.sympa.postfix
%config(noreplace) %{_sysconfdir}/sympa/aliases.sympa.postfix.db
%{_sysconfdir}/smrsh/*
%config(noreplace) %{_sysconfdir}/rsyslog.d/*
%config(noreplace) %{_sysconfdir}/logrotate.d/sympa
%{_sbindir}/*
%dir %{_libexecdir}/sympa/
%attr(4755,sympa,sympa) %{_libexecdir}/sympa/bouncequeue
%attr(4755,sympa,sympa) %{_libexecdir}/sympa/familyqueue
%attr(4755,sympa,sympa) %{_libexecdir}/sympa/queue
%attr(4750,root,sympa) %{_libexecdir}/sympa/sympa_newaliases-wrapper
%{_libexecdir}/sympa/sympa_soap_server.fcgi
%attr(6755,sympa,sympa) %{_libexecdir}/sympa/sympa_soap_server-wrapper.fcgi
%{_libexecdir}/sympa/wwsympa.fcgi
%attr(6755,sympa,sympa) %{_libexecdir}/sympa/wwsympa-wrapper.fcgi
%dir %{_localstatedir}/lib/sympa/
%attr(-,sympa,sympa) %{_localstatedir}/lib/sympa/arc/
%attr(-,sympa,sympa) %{_localstatedir}/lib/sympa/bounce/
%attr(-,sympa,sympa) %{_localstatedir}/lib/sympa/list_data/
%attr(-,sympa,sympa) %{_localstatedir}/lib/sympa/css/
%attr(-,sympa,sympa) %{_localstatedir}/lib/sympa/pictures/
%attr(-,sympa,sympa) %{_localstatedir}/lib/sympa/X509-user-certs/
%attr(-,sympa,sympa) %{_localstatedir}/spool/sympa/
%{_datadir}/sympa/
%{_mandir}/man1/*
%{_mandir}/man5/*
%{_mandir}/man8/*
%if %{use_systemd}
%{_unitdir}/sympa.service
%{_unitdir}/sympa-outgoing.service
%{_unitdir}/sympa-archive.service
%{_unitdir}/sympa-bounce.service
%{_unitdir}/sympa-task.service
%{_tmpfilesdir}/sympa.conf
%ghost %attr(-,sympa,sympa) %{_rundir}/sympa/
%dir %{_sysconfdir}/systemd/system/sympa.service.d/
%config(noreplace) %{_sysconfdir}/systemd/system/sympa.service.d/*
%else
%{_initrddir}/sympa
%attr(-,sympa,sympa) %{_localstatedir}/run/sympa/
%endif
%config(noreplace) %{_sysconfdir}/sysconfig/sympa
%files httpd
%config(noreplace) %{_sysconfdir}/httpd/conf.d/sympa.conf
%if 0%{?fedora} || 0%{?rhel} >= 7
%if %{use_systemd}
%{_unitdir}/wwsympa.service
%{_unitdir}/sympasoap.service
%else
%{_initrddir}/wwsympa
%{_initrddir}/sympasoap
%endif
%endif
%files lighttpd
%config(noreplace) %{_sysconfdir}/lighttpd/conf.d/sympa.conf
%files nginx
%config(noreplace) %{_sysconfdir}/nginx/conf.d/sympa.conf
%if %{use_systemd}
%{_unitdir}/wwsympa.service
%{_unitdir}/sympasoap.service
%else
%{_initrddir}/wwsympa
%{_initrddir}/sympasoap
%endif
%files devel-doc
%{_mandir}/man3/*
%changelog
* Mon Jul 15 2019 Xavier Bachelot <[email protected]> 6.2.44-2
- Don't package OChangeLog and ONEWS. Saves 5MB.
- Move developers documentation to devel-doc sub-package.
- Compute an accurate License: tag.
* Wed Jun 26 2019 Xavier Bachelot <[email protected]> 6.2.44-1
- Update to 6.2.44.
* Mon Jun 10 2019 Xavier Bachelot <[email protected]> 6.2.43-0.2.b.2
- Update to 6.2.43 beta 2.
* Thu May 23 2019 IKEDA Soji <[email protected]> 6.2.43-0.1.b.1
- Update to 6.2.43 beta 1.
- Move sympa.conf-dist to doc.
* Thu Mar 21 2019 Xavier Bachelot <[email protected]> 6.2.42-1
- Update to 6.2.42.