This repository has been archived by the owner on Jun 3, 2020. It is now read-only.
/
spacewalk-java.spec
9284 lines (7843 loc) · 395 KB
/
spacewalk-java.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
%{!?__redhat_release:%define __redhat_release UNKNOWN}
%define cobprofdir %{_localstatedir}/lib/rhn/kickstarts
%define cobprofdirup %{_localstatedir}/lib/rhn/kickstarts/upload
%define cobprofdirwiz %{_localstatedir}/lib/rhn/kickstarts/wizard
%define cobdirsnippets %{_localstatedir}/lib/rhn/kickstarts/snippets
%define realcobsnippetsdir %{_localstatedir}/lib/cobbler/snippets
%if 0%{?rhel} && 0%{?rhel} < 6
%define appdir %{_localstatedir}/lib/tomcat5/webapps
%define jardir %{_localstatedir}/lib/tomcat5/webapps/rhn/WEB-INF/lib
%else
%if 0%{?fedora} || 0%{?rhel} >= 7
%define appdir %{_localstatedir}/lib/tomcat/webapps
%define jardir %{_localstatedir}/lib/tomcat/webapps/rhn/WEB-INF/lib
%else
%define appdir %{_localstatedir}/lib/tomcat6/webapps
%define jardir %{_localstatedir}/lib/tomcat6/webapps/rhn/WEB-INF/lib
%endif
%endif
%if 0%{?fedora} || 0%{?rhel} >= 6
# RHEL5 checkstyle4 is incompatible with checkstyle5
%define run_checkstyle 1
%endif
Name: spacewalk-java
Summary: Java web application files for Spacewalk
Group: Applications/Internet
License: GPLv2
Version: 2.4.59
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
ExcludeArch: ia64
Requires: bcel
Requires: c3p0 >= 0.9.1
Requires: classpathx-mail
Requires: cobbler20
Requires: dojo
Requires: dwr >= 3
Requires: jakarta-commons-el
Requires: jakarta-commons-fileupload
Requires: jakarta-taglibs-standard
Requires: java >= 1:1.6.0
Requires: java-devel >= 1:1.6.0
Requires: jcommon
Requires: jdom
Requires: jpam
Requires: jta
Requires: log4j
Requires: oscache
Requires: redstone-xmlrpc
Requires: simple-core
Requires: simple-xml
Requires: sitemesh
Requires: spacewalk-branding
Requires: spacewalk-java-config
Requires: spacewalk-java-jdbc
Requires: spacewalk-java-lib
Requires: stringtree-json
Requires: susestudio-java-client
Requires: xalan-j2 >= 0:2.6.0
Requires: xerces-j2
%if 0%{?fedora}
Requires: classpathx-jaf
Requires: hibernate3 >= 3.6.10
Requires: hibernate3-c3p0 >= 3.6.10
Requires: hibernate3-ehcache >= 3.6.10
Requires: javassist
BuildRequires: ehcache-core
BuildRequires: hibernate3 >= 0:3.6.10
BuildRequires: hibernate3-c3p0 >= 3.6.10
BuildRequires: hibernate3-ehcache >= 3.6.10
BuildRequires: javassist
%else
Requires: hibernate3 = 0:3.2.4
BuildRequires: hibernate3 = 0:3.2.4
%endif
# EL5 = Struts 1.2 and Tomcat 5, EL6+/recent Fedoras = 1.3 and Tomcat 6
%if 0%{?rhel} && 0%{?rhel} < 6
Requires: jasper5
Requires: struts >= 0:1.2.9
Requires: tomcat5
Requires: tomcat5-servlet-2.4-api
BuildRequires: jasper5
BuildRequires: jsp
BuildRequires: struts >= 0:1.2.9
%else
%if 0%{?fedora} || 0%{?rhel} >= 7
Requires: struts >= 0:1.3.0
Requires: tomcat >= 7
Requires: tomcat-lib >= 7
Requires: tomcat-servlet-3.0-api >= 7
BuildRequires: struts >= 0:1.3.0
BuildRequires: tomcat >= 7
BuildRequires: tomcat-lib >= 7
%else
Requires: struts >= 0:1.3.0
Requires: struts-taglib >= 0:1.3.0
Requires: tomcat6
Requires: tomcat6-lib
Requires: tomcat6-servlet-2.5-api
BuildRequires: struts >= 0:1.3.0
BuildRequires: struts-taglib >= 0:1.3.0
BuildRequires: tomcat6
BuildRequires: tomcat6-lib
%endif
%endif
%if 0%{?fedora} || 0%{?rhel} >=7
Requires: apache-commons-cli
Requires: apache-commons-codec
Requires: apache-commons-discovery
Requires: apache-commons-io
Requires: apache-commons-lang
Requires: apache-commons-logging
Requires: javapackages-tools
BuildRequires: apache-commons-cli
BuildRequires: apache-commons-codec
BuildRequires: apache-commons-collections
BuildRequires: apache-commons-discovery
BuildRequires: apache-commons-io
BuildRequires: apache-commons-logging
BuildRequires: apache-commons-validator
# spelling checker is only for Fedoras (no aspell in RHEL6)
BuildRequires: aspell aspell-en libxslt
BuildRequires: javapackages-tools
BuildRequires: mvn(ant-contrib:ant-contrib)
%else
Requires: jakarta-commons-cli
Requires: jakarta-commons-codec
Requires: jakarta-commons-discovery
Requires: jakarta-commons-io
Requires: jakarta-commons-lang >= 0:2.1
Requires: jakarta-commons-logging
Requires: jpackage-utils
BuildRequires: ant-contrib
BuildRequires: ant-nodeps
BuildRequires: jakarta-commons-cli
BuildRequires: jakarta-commons-codec
BuildRequires: jakarta-commons-collections
BuildRequires: jakarta-commons-discovery
BuildRequires: jakarta-commons-io
BuildRequires: jakarta-commons-logging
BuildRequires: jakarta-commons-validator
BuildRequires: jpackage-utils
%endif
# for RHEL6 we need to filter out several package versions
%if 0%{?rhel} && 0%{?rhel} >= 6
# cglib is not compatible with hibernate and asm from RHEL6
Requires: cglib < 0:2.2
%else
Requires: cglib
%endif
BuildRequires: /usr/bin/perl
BuildRequires: /usr/bin/xmllint
BuildRequires: ant
BuildRequires: ant-apache-regexp
BuildRequires: ant-junit
BuildRequires: antlr >= 0:2.7.6
BuildRequires: bcel
BuildRequires: c3p0 >= 0.9.1
BuildRequires: cglib
BuildRequires: classpathx-mail
BuildRequires: concurrent
BuildRequires: dom4j
BuildRequires: dwr >= 3
BuildRequires: jaf
BuildRequires: jakarta-commons-el
BuildRequires: jakarta-commons-fileupload
BuildRequires: jakarta-taglibs-standard
BuildRequires: java-devel >= 1:1.6.0
BuildRequires: jcommon
BuildRequires: jdom
BuildRequires: jpam
BuildRequires: jta
BuildRequires: oscache
BuildRequires: postgresql-jdbc
BuildRequires: quartz
BuildRequires: redstone-xmlrpc
BuildRequires: simple-core
BuildRequires: simple-xml
BuildRequires: sitemesh
BuildRequires: stringtree-json
BuildRequires: susestudio-java-client
BuildRequires: tanukiwrapper
%if 0%{?run_checkstyle}
BuildRequires: checkstyle
%endif
%if ! 0%{?omit_tests} > 0
BuildRequires: translate-toolkit
%endif
Obsoletes: rhn-java < 5.3.0
Obsoletes: rhn-java-sat < 5.3.0
Obsoletes: rhn-oracle-jdbc-tomcat5 <= 1.0
Provides: rhn-java = %{version}-%{release}
Provides: rhn-java-sat = %{version}-%{release}
Provides: rhn-oracle-jdbc-tomcat5 = %{version}-%{release}
%description
This package contains the code for the Java version of the Spacewalk Web Site.
%package config
Summary: Configuration files for RHN Java
Group: Applications/Internet
Obsoletes: rhn-java-config < 5.3.0
Obsoletes: rhn-java-config-sat < 5.3.0
Provides: rhn-java-config = %{version}-%{release}
Provides: rhn-java-config-sat = %{version}-%{release}
%description config
This package contains the configuration files for the Spacewalk Java web
application and taskomatic process.
%package lib
Summary: Jar files for Spacewalk Java
Group: Applications/Internet
Obsoletes: rhn-java-lib < 5.3.0
Obsoletes: rhn-java-lib-sat < 5.3.0
Provides: rhn-java-lib = %{version}-%{release}
Provides: rhn-java-lib-sat = %{version}-%{release}
Requires: /usr/bin/sudo
%description lib
This package contains the jar files for the Spacewalk Java web application
and taskomatic process.
%package oracle
Summary: Oracle database backend support files for Spacewalk Java
Group: Applications/Internet
Requires: ojdbc14
%if 0%{?rhel} && 0%{?rhel} < 6
Requires: tomcat5
%else
%if 0%{?fedora} || 0%{?rhel} >= 7
Requires: tomcat >= 7
%else
Requires: tomcat6
%endif
%endif
Provides: spacewalk-java-jdbc = %{version}-%{release}
%description oracle
This package contains Oracle database backend files for the Spacewalk Java.
%package postgresql
Summary: PostgreSQL database backend support files for Spacewalk Java
Group: Applications/Internet
Requires: postgresql-jdbc
%if 0%{?rhel} && 0%{?rhel} < 6
Requires: tomcat5
%else
%if 0%{?fedora} || 0%{?rhel} >=7
Requires: tomcat >= 7
%else
Requires: tomcat6
%endif
%endif
Provides: spacewalk-java-jdbc = %{version}-%{release}
%description postgresql
This package contains PostgreSQL database backend files for the Spacewalk Java.
%if ! 0%{?omit_tests} > 0
%package tests
Summary: Test Classes for testing spacewalk-java
Group: Applications/Internet
BuildRequires: jmock < 2.0
Requires: jmock < 2.0
Requires: ant-junit
%description tests
This package contains testing files of spacewalk-java.
%files tests
%defattr(644,root,root,775)
%{_datadir}/rhn/lib/rhn-test.jar
%{_datadir}/rhn/unit-tests/*
%{_datadir}/rhn/unittest.xml
%{jardir}/mockobjects*.jar
%{jardir}/strutstest*.jar
%endif
%package -n spacewalk-taskomatic
Summary: Java version of taskomatic
Group: Applications/Internet
# for RHEL6 we need to filter out several package versions
%if 0%{?rhel} && 0%{?rhel} >= 6
# cglib is not compatible with hibernate and asm from RHEL6
Requires: cglib < 0:2.2
%else
Requires: cglib
%endif
Requires: bcel
Requires: c3p0 >= 0.9.1
Requires: cobbler20
Requires: concurrent
Requires: jakarta-taglibs-standard
Requires: java >= 0:1.6.0
Requires: java-devel >= 0:1.6.0
Requires: jcommon
Requires: jpam
Requires: log4j
Requires: oscache
Requires: quartz < 2.0
Requires: simple-core
Requires: spacewalk-java-config
Requires: spacewalk-java-jdbc
Requires: spacewalk-java-lib
Requires: tanukiwrapper
Requires: xalan-j2 >= 0:2.6.0
Requires: xerces-j2
%if 0%{?fedora}
Requires: hibernate3 >= 3.6.10
Requires: hibernate3-c3p0 >= 3.6.10
Requires: hibernate3-ehcache >= 3.6.10
Requires: javassist
%else
Requires: hibernate3 >= 0:3.2.4
%endif
%if 0%{?fedora} || 0%{?rhel} >= 7
Requires: apache-commons-cli
Requires: apache-commons-codec
Requires: apache-commons-dbcp
Requires: apache-commons-lang
Requires: apache-commons-logging
%else
Requires: jakarta-commons-cli
Requires: jakarta-commons-codec
Requires: jakarta-commons-dbcp
Requires: jakarta-commons-lang >= 0:2.1
Requires: jakarta-commons-logging
%endif
Conflicts: quartz >= 2.0
Obsoletes: taskomatic < 5.3.0
Obsoletes: taskomatic-sat < 5.3.0
Provides: taskomatic = %{version}-%{release}
Provides: taskomatic-sat = %{version}-%{release}
Requires(post): chkconfig
Requires(preun): chkconfig
# This is for /sbin/service
Requires(preun): initscripts
%description -n spacewalk-taskomatic
This package contains the Java version of taskomatic.
%prep
%setup -q
# missing tomcat juli JAR (needed for JSP precompilation) - bug 661244
if test -d /usr/share/tomcat6; then
mkdir -p build/build-lib
if test ! -h /usr/share/java/tomcat6/tomcat-juli.jar; then
ln -s /usr/share/tomcat6/bin/tomcat-juli.jar \
build/build-lib/tomcat-juli.jar
else
ln -s /usr/share/java/tomcat6/tomcat-juli.jar \
build/build-lib/tomcat-juli.jar
fi
fi
%if 0%{?fedora}
%define skip_xliff 1
%endif
%if ! 0%{?omit_tests} > 0 && ! 0%{?skip_xliff}
find . -name 'StringResource_*.xml' | while read i ;
do echo $i
# check for common localizations issues
ln -s $(basename $i) $i.xliff
CONTENT=$(pofilter --progress=none --nofuzzy --gnome \
--excludefilter=untranslated \
--excludefilter=purepunc \
$i.xliff 2>&1)
if [ -n "$CONTENT" ]; then
echo ERROR - pofilter errors: "$CONTENT"
exit 1
fi
rm -f $i.xliff
#check duplicate message keys in StringResource_*.xml files
CONTENT=$(/usr/bin/xmllint --format "$i" | /usr/bin/perl -lne 'if (/<trans-unit( id=".+?")?/) { print $1 if $X{$1}++ }' )
if [ -n "$CONTENT" ]; then
echo ERROR - duplicate message keys: $CONTENT
exit 1
fi
done
%endif
%build
# compile only java sources (no packing here)
ant -Dprefix=$RPM_BUILD_ROOT init-install compile
%if 0%{?run_checkstyle}
echo "Running checkstyle on java main sources"
export CLASSPATH="build/classes:build/build-lib/*"
export ADDITIONAL_OPTIONS="-Djavadoc.method.scope=public \
-Djavadoc.type.scope=package \
-Djavadoc.var.scope=package \
-Dcheckstyle.cache.file=build/checkstyle.cache.src \
-Djavadoc.lazy=false \
-Dcheckstyle.header.file=buildconf/LICENSE.txt"
find . -name *.java | grep -vE '(/test/|/jsp/|/playpen/)' | \
xargs checkstyle -c buildconf/checkstyle.xml
echo "Running checkstyle on java test sources"
export ADDITIONAL_OPTIONS="-Djavadoc.method.scope=nothing \
-Djavadoc.type.scope=nothing \
-Djavadoc.var.scope=nothing \
-Dcheckstyle.cache.file=build/checkstyle.cache.test \
-Djavadoc.lazy=false \
-Dcheckstyle.header.file=buildconf/LICENSE.txt"
find . -name *.java | grep -E '/test/' | grep -vE '(/jsp/|/playpen/)' | \
xargs checkstyle -c buildconf/checkstyle.xml
%endif
# catch macro name errors
find . -type f -name '*.xml' | xargs perl -CSAD -lne '
for (grep { $_ ne "PRODUCT_NAME" } /\@\@(\w+)\@\@/g) {
print;
$exit = 1;
}
@r = /((..)?PRODUCT_NAME(..)?)/g ;
while (@r) {
$s = shift(@r); $f = shift(@r); $l = shift(@r);
if ($f ne "@@" or $l ne "@@") {
print $s;
$exit = 1;
}
}
END { exit $exit }'
%install
rm -rf $RPM_BUILD_ROOT
# on Fedora 19 some jars are named differently
%if 0%{?fedora}
mkdir -p $RPM_BUILD_ROOT%{_javadir}
[[ -f %{_javadir}/mchange-commons-java.jar ]] && ln -s -f %{_javadir}/mchange-commons-java.jar $RPM_BUILD_ROOT%{_javadir}/mchange-commons.jar
[[ -f %{_javadir}/mchange-commons/mchange-commons-java.jar ]] && ln -s -f %{_javadir}/mchange-commons/mchange-commons-java.jar $RPM_BUILD_ROOT%{_javadir}/mchange-commons.jar
ln -s -f %{_javadir}/jboss-logging/jboss-logging.jar $RPM_BUILD_ROOT%{_javadir}/jboss-logging.jar
# create missing symlinks on fedora21
%if 0%{?fedora} >= 21
ln -s -f %{_javadir}/hibernate-jpa-2.0-api/hibernate-jpa-2.0-api.jar $RPM_BUILD_ROOT%{_javadir}/hibernate-jpa-2.0-api.jar
ln -s -f %{_javadir}/c3p0/c3p0.jar $RPM_BUILD_ROOT%{_javadir}/c3p0.jar
ln -s -f %{_javadir}/concurrent/concurrent.jar $RPM_BUILD_ROOT%{_javadir}/concurrent.jar
%endif
%endif
%if 0%{?rhel} && 0%{?rhel} < 6
ant -Dprefix=$RPM_BUILD_ROOT install-tomcat5
install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/tomcat5/Catalina/localhost/
install -m 755 conf/rhn.xml $RPM_BUILD_ROOT%{_sysconfdir}/tomcat5/Catalina/localhost/rhn.xml
%else
%if 0%{?fedora} || 0%{?rhel} >= 7
ant -Dprefix=$RPM_BUILD_ROOT install-tomcat7
install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/tomcat/Catalina/localhost/
install -m 755 conf/rhn.xml $RPM_BUILD_ROOT%{_sysconfdir}/tomcat/Catalina/localhost/rhn.xml
%else
ant -Dprefix=$RPM_BUILD_ROOT install-tomcat6
install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/tomcat6/Catalina/localhost/
install -m 755 conf/rhn.xml $RPM_BUILD_ROOT%{_sysconfdir}/tomcat6/Catalina/localhost/rhn.xml
%endif
%endif
# check spelling errors in all resources for English if aspell installed
[ -x "$(which aspell)" ] && scripts/spelling/check_java.sh .. en_US
%if 0%{?fedora}
install -d -m 755 $RPM_BUILD_ROOT%{_sbindir}
install -d -m 755 $RPM_BUILD_ROOT%{_unitdir}
%else
install -d -m 755 $RPM_BUILD_ROOT%{_initrddir}
%endif
install -d -m 755 $RPM_BUILD_ROOT%{_bindir}
install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/rhn
install -d -m 755 $RPM_BUILD_ROOT%{_prefix}/share/rhn
install -d -m 755 $RPM_BUILD_ROOT%{_prefix}/share/rhn/unit-tests
install -d -m 755 $RPM_BUILD_ROOT%{_prefix}/share/rhn/lib
install -d -m 755 $RPM_BUILD_ROOT%{_prefix}/share/rhn/classes
install -d -m 755 $RPM_BUILD_ROOT%{_prefix}/share/rhn/config-defaults
install -d -m 755 $RPM_BUILD_ROOT%{cobprofdir}
install -d -m 755 $RPM_BUILD_ROOT%{cobprofdirup}
install -d -m 755 $RPM_BUILD_ROOT%{cobprofdirwiz}
install -d -m 755 $RPM_BUILD_ROOT%{cobdirsnippets}
install -d -m 755 $RPM_BUILD_ROOT%{_var}/spacewalk/systemlogs
install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
%if 0%{?fedora}
echo "hibernate.cache.region.factory_class=net.sf.ehcache.hibernate.SingletonEhCacheRegionFactory" >> conf/default/rhn_hibernate.conf
%endif
%if 0%{?fedora} && 0%{?fedora} >= 21
echo "wrapper.java.classpath.28=/usr/share/java/log4j-1.jar" >> conf/default/rhn_taskomatic_daemon.conf
%else
echo "wrapper.java.classpath.28=/usr/share/java/log4j.jar" >> conf/default/rhn_taskomatic_daemon.conf
%endif
%if 0%{?fedora}
echo "wrapper.java.classpath.49=/usr/share/java/hibernate3/hibernate-core-3.jar
wrapper.java.classpath.61=/usr/share/java/hibernate-jpa-2.0-api.jar
wrapper.java.classpath.62=/usr/share/java/hibernate3/hibernate-ehcache-3.jar
wrapper.java.classpath.63=/usr/share/java/hibernate3/hibernate-c3p0-3.jar
wrapper.java.classpath.64=/usr/share/java/hibernate*/hibernate-commons-annotations.jar
wrapper.java.classpath.65=/usr/share/java/slf4j/api.jar
wrapper.java.classpath.66=/usr/share/java/jboss-logging.jar
wrapper.java.classpath.67=/usr/share/java/javassist.jar
wrapper.java.classpath.68=/usr/share/java/ehcache-core.jar" >> conf/default/rhn_taskomatic_daemon.conf
%else
echo "hibernate.cache.provider_class=org.hibernate.cache.OSCacheProvider" >> conf/default/rhn_hibernate.conf
echo "wrapper.java.classpath.49=/usr/share/java/hibernate3.jar" >> conf/default/rhn_taskomatic_daemon.conf
%endif
install -m 644 conf/default/rhn_hibernate.conf $RPM_BUILD_ROOT%{_prefix}/share/rhn/config-defaults/rhn_hibernate.conf
install -m 644 conf/default/rhn_taskomatic_daemon.conf $RPM_BUILD_ROOT%{_prefix}/share/rhn/config-defaults/rhn_taskomatic_daemon.conf
install -m 644 conf/default/rhn_org_quartz.conf $RPM_BUILD_ROOT%{_prefix}/share/rhn/config-defaults/rhn_org_quartz.conf
install -m 644 conf/rhn_java.conf $RPM_BUILD_ROOT%{_prefix}/share/rhn/config-defaults
install -m 755 conf/logrotate/rhn_web_api $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/rhn_web_api
# LOGROTATE >= 3.8 requires extra permission config
%if 0%{?fedora} || 0%{?rhel} > 6
sed -i 's/#LOGROTATE-3.8#//' $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/rhn_web_api
%endif
%if 0%{?fedora}
install -m 755 scripts/taskomatic $RPM_BUILD_ROOT%{_sbindir}
install -m 755 scripts/taskomatic.service $RPM_BUILD_ROOT%{_unitdir}
%else
install -m 755 scripts/taskomatic $RPM_BUILD_ROOT%{_initrddir}
%endif
install -m 755 scripts/unittest.xml $RPM_BUILD_ROOT/%{_datadir}/rhn/
install -m 644 build/webapp/rhnjava/WEB-INF/lib/rhn.jar $RPM_BUILD_ROOT%{_datadir}/rhn/lib
%if ! 0%{?omit_tests} > 0
install -m 644 build/webapp/rhnjava/WEB-INF/lib/rhn-test.jar $RPM_BUILD_ROOT%{_datadir}/rhn/lib
cp -a build/classes/com/redhat/rhn/common/conf/test/conf $RPM_BUILD_ROOT%{_datadir}/rhn/unit-tests/
%endif
install -m 644 conf/log4j.properties.taskomatic $RPM_BUILD_ROOT%{_datadir}/rhn/classes/log4j.properties
install -m 644 conf/cobbler/snippets/default_motd $RPM_BUILD_ROOT%{cobdirsnippets}/default_motd
install -m 644 conf/cobbler/snippets/keep_system_id $RPM_BUILD_ROOT%{cobdirsnippets}/keep_system_id
install -m 644 conf/cobbler/snippets/post_reactivation_key $RPM_BUILD_ROOT%{cobdirsnippets}/post_reactivation_key
install -m 644 conf/cobbler/snippets/post_delete_system $RPM_BUILD_ROOT%{cobdirsnippets}/post_delete_system
install -m 644 conf/cobbler/snippets/redhat_register $RPM_BUILD_ROOT%{cobdirsnippets}/redhat_register
ln -s -f /usr/sbin/tanukiwrapper $RPM_BUILD_ROOT%{_bindir}/taskomaticd
ln -s -f %{_javadir}/ojdbc14.jar $RPM_BUILD_ROOT%{jardir}/ojdbc14.jar
ln -s -f %{_javadir}/dwr.jar $RPM_BUILD_ROOT%{jardir}/dwr.jar
install -d -m 755 $RPM_BUILD_ROOT%{realcobsnippetsdir}
ln -s -f %{cobdirsnippets} $RPM_BUILD_ROOT%{realcobsnippetsdir}/spacewalk
touch $RPM_BUILD_ROOT%{_var}/spacewalk/systemlogs/audit-review.log
# Fedoras have cglib version that is not compatible with asm and need objectweb-asm
# Unfortunately both libraries must be installed for dependencies so we override
# the asm symlink with objectweb-asm here
%if 0%{?fedora}
ln -s -f %{_javadir}/objectweb-asm/asm-all.jar $RPM_BUILD_ROOT%{jardir}/asm_asm.jar
ln -s -f %{_javadir}/objectweb-asm/asm-all.jar $RPM_BUILD_ROOT%{_datadir}/rhn/lib/spacewalk-asm.jar
%else
ln -s -f %{_javadir}/asm/asm.jar $RPM_BUILD_ROOT%{_datadir}/rhn/lib/spacewalk-asm.jar
%endif
# 732350 - On Fedora 15, mchange's log stuff is no longer in c3p0.
%if 0%{?fedora}
ln -s -f %{_javadir}/mchange-commons.jar $RPM_BUILD_ROOT%{jardir}/mchange-commons.jar
%endif
# delete JARs which must not be deployed
rm -rf $RPM_BUILD_ROOT%{jardir}/jspapi.jar
rm -rf $RPM_BUILD_ROOT%{jardir}/jasper5-compiler.jar
rm -rf $RPM_BUILD_ROOT%{jardir}/jasper5-runtime.jar
rm -rf $RPM_BUILD_ROOT%{jardir}/tomcat*.jar
%if 0%{?omit_tests} > 0
rm -rf $RPM_BUILD_ROOT%{_datadir}/rhn/lib/rhn-test.jar
rm -rf $RPM_BUILD_ROOT/classes/com/redhat/rhn/common/conf/test/conf
rm -rf $RPM_BUILD_ROOT%{_datadir}/rhn/unittest.xml
rm -rf $RPM_BUILD_ROOT%{jardir}/mockobjects*.jar
rm -rf $RPM_BUILD_ROOT%{jardir}/strutstest*.jar
%endif
# show all JAR symlinks
echo "#### SYMLINKS START ####"
find $RPM_BUILD_ROOT%{jardir} -name *.jar
echo "#### SYMLINKS END ####"
%clean
rm -rf $RPM_BUILD_ROOT
%pre
rm -f %{realcobsnippetsdir}/spacewalk
%post -n spacewalk-taskomatic
if [ -f /etc/init.d/taskomatic ]; then
# This adds the proper /etc/rc*.d links for the script
/sbin/chkconfig --add taskomatic
fi
%preun -n spacewalk-taskomatic
if [ $1 = 0 ] ; then
if [ -f /etc/init.d/taskomatic ]; then
/sbin/service taskomatic stop >/dev/null 2>&1
/sbin/chkconfig --del taskomatic
fi
fi
%files
%defattr(644,tomcat,tomcat,775)
%attr(775, root, tomcat) %dir %{appdir}
%dir %{appdir}/rhn/
%{appdir}/rhn/apidoc/
%{appdir}/rhn/css/
%{appdir}/rhn/errata/
%{appdir}/rhn/help/
%{appdir}/rhn/img/
%{appdir}/rhn/META-INF/
%{appdir}/rhn/schedule/
%{appdir}/rhn/systems/
%{appdir}/rhn/users/
%{appdir}/rhn/errors/
%{appdir}/rhn/*.jsp
%{appdir}/rhn/WEB-INF/classes
%{appdir}/rhn/WEB-INF/decorators
%{appdir}/rhn/WEB-INF/includes
%{appdir}/rhn/WEB-INF/nav
%{appdir}/rhn/WEB-INF/pages
%{appdir}/rhn/WEB-INF/*.xml
# list of all jar symlinks without any version numbers
# and wildcards (except non-symlink velocity)
%{jardir}/antlr.jar
%{jardir}/bcel.jar
%{jardir}/c3p0*.jar
%{jardir}/cglib.jar
%{jardir}/commons-beanutils.jar
%{jardir}/commons-cli.jar
%{jardir}/commons-codec.jar
%{jardir}/commons-collections.jar
%{jardir}/commons-digester.jar
%{jardir}/commons-discovery.jar
%{jardir}/commons-el.jar
%{jardir}/commons-fileupload.jar
%{jardir}/commons-io.jar
%{jardir}/commons-lang.jar
%{jardir}/commons-logging.jar
%{jardir}/*commons-validator.jar
%{jardir}/concurrent*.jar
%{jardir}/dom4j.jar
%{jardir}/dwr.jar
%{jardir}/hibernate3*
%if 0%{?fedora}
%{jardir}/ehcache-core.jar
%{jardir}/*_hibernate-commons-annotations.jar
%{jardir}/hibernate-jpa-2.0-api*.jar
%{jardir}/javassist.jar
%{jardir}/slf4j_api.jar
%{jardir}/slf4j_log4j12*.jar
%{jardir}/mchange-commons.jar
%{_javadir}/mchange-commons.jar
%{_javadir}/jboss-logging.jar
%{jardir}/*jboss-logging.jar
%if 0%{?fedora} >= 21
%{_javadir}/c3p0.jar
%{_javadir}/concurrent.jar
%{_javadir}/hibernate-jpa-2.0-api.jar
%endif
%endif
%{jardir}/jaf.jar
%{jardir}/javamail.jar
%{jardir}/jcommon*.jar
%{jardir}/jdom.jar
%{jardir}/jpam.jar
%{jardir}/jta.jar
%{jardir}/log4j*.jar
%{jardir}/oro.jar
%{jardir}/oscache.jar
%{jardir}/quartz.jar
%{jardir}/redstone-xmlrpc-client.jar
%{jardir}/redstone-xmlrpc.jar
%{jardir}/rhn.jar
%{jardir}/simple-core.jar
%{jardir}/simple-xml.jar
%{jardir}/sitemesh.jar
%{jardir}/stringtree-json.jar
%{jardir}/susestudio-java-client.jar
%{jardir}/taglibs-core.jar
%{jardir}/taglibs-standard.jar
%{jardir}/tanukiwrapper.jar
%{jardir}/velocity-*.jar
%{jardir}/xalan-j2.jar
%{jardir}/xerces-j2.jar
%{jardir}/xml-commons-apis.jar
# asm-1.5.3-7.jpp5.noarch (F14, F13, EL6)
# asm-1.5.3-1jpp.ep1.1.el5.2.noarch (EL5)
%{jardir}/asm_asm.jar
#%{jardir}/asmasm.jar
#%{jardir}/asmasm-analysis.jar
#%{jardir}/asmasm-attrs.jar
#%{jardir}/asmasm-tree.jar
#%{jardir}/asmasm-util.jar
#%{jardir}/asmasm-xml.jar
#%{jardir}/asmkasm.jar
# EL5 = Struts 1.2 and Tomcat 5, EL6+/recent Fedoras = 1.3 and Tomcat 6
%if 0%{?rhel} && 0%{?rhel} < 6
%{jardir}/struts.jar
%else
%{jardir}/struts*.jar
%{jardir}/commons-chain.jar
%endif
%dir %{cobprofdir}
%dir %{cobprofdirup}
%dir %{cobprofdirwiz}
%dir %{cobdirsnippets}
%config %{cobdirsnippets}/default_motd
%config %{cobdirsnippets}/keep_system_id
%config %{cobdirsnippets}/post_reactivation_key
%config %{cobdirsnippets}/post_delete_system
%config %{cobdirsnippets}/redhat_register
%if 0%{?rhel} && 0%{?rhel} < 6
%config(noreplace) %{_sysconfdir}/tomcat5/Catalina/localhost/rhn.xml
%else
%if 0%{?fedora} || 0%{?rhel} >= 7
%config(noreplace) %{_sysconfdir}/tomcat/Catalina/localhost/rhn.xml
%else
%config(noreplace) %{_sysconfdir}/tomcat6/Catalina/localhost/rhn.xml
%endif
%endif
%{realcobsnippetsdir}/spacewalk
%dir %attr(755, tomcat, root) %{_var}/spacewalk/systemlogs
%ghost %attr(644, tomcat, root) %{_var}/spacewalk/systemlogs/audit-review.log
%files -n spacewalk-taskomatic
%defattr(644,root,root,775)
%if 0%{?fedora}
%attr(755, root, root) %{_sbindir}/taskomatic
%attr(755, root, root) %{_unitdir}/taskomatic.service
%else
%attr(755, root, root) %{_initrddir}/taskomatic
%endif
%{_bindir}/taskomaticd
%{_datadir}/rhn/lib/spacewalk-asm.jar
%files config
%defattr(644,root,root,775)
%{_prefix}/share/rhn/config-defaults/rhn_hibernate.conf
%{_prefix}/share/rhn/config-defaults/rhn_taskomatic_daemon.conf
%{_prefix}/share/rhn/config-defaults/rhn_org_quartz.conf
%{_prefix}/share/rhn/config-defaults/rhn_java.conf
%config %{_sysconfdir}/logrotate.d/rhn_web_api
%files lib
%defattr(644,root,root,775)
%{_datadir}/rhn/classes/log4j.properties
%{_datadir}/rhn/lib/rhn.jar
%files oracle
%defattr(644, tomcat, tomcat)
%{jardir}/ojdbc14.jar
%files postgresql
%defattr(644, tomcat, tomcat)
%{jardir}/postgresql-jdbc.jar
%changelog
* Thu Aug 27 2015 Jan Dobes 2.4.59-1
- 1000415 - add icon for compliance status
- 1000415 - show diff icon in separate column
- 1000415 - change icon for empty diff
- making confirm page readable
- Organization users page: fix typo
* Wed Aug 26 2015 Jan Dobes 2.4.58-1
- correct message
- this is not a toolbar
- shift this menu to right
- vim version tags removed
- java unit tests: fixes after 1229427
- ChannelSoftwareHandler documentation: checksum is required now
* Thu Aug 20 2015 Jan Dobes 2.4.57-1
- 1229427 - support checksum change when cloning as in WebUI
- 1229427 - channels without checksum are no longer supported
- bump year in all languages
* Wed Aug 19 2015 Jan Dobes 2.4.56-1
- removing duplicate button
- bump year
* Wed Aug 19 2015 Jan Dobes 2.4.55-1
- 1250067 - unschedule actions only on single system
* Mon Aug 17 2015 Jan Dobes 2.4.54-1
- 1252166 - remove results of rescheduled remote script actions immediately
* Fri Aug 14 2015 Grant Gainey 2.4.53-1
- 1253793 - Fixing IE8 display issues * Add respond.js/html5-shim for IE8 *
Block editarea.js, which breaks respond.js under IE8, from executing under
IE8
* Fri Aug 14 2015 Tomas Lestach <tlestach@redhat.com> 2.4.52-1
- 1253495 - Improve configchannel.channelExists API efficiency
* Fri Aug 14 2015 Tomas Lestach <tlestach@redhat.com> 2.4.51-1
- 1228589 - need to query rhnOrgDistChannelMap that is per organization
- 1228589 - prevent NullPointerException when chaning base channels via SSM
* Wed Aug 12 2015 Jan Dobes 2.4.50-1
- 1252166 - simplify logic
- 1252166 - delete status of previous action run
- 1252166 - check if failed only this server action
- 1252166 - reschedule only relevant server action
* Tue Aug 11 2015 Jiri Dostal <jdostal@redhat.com> 2.4.49-1
- [RFE] 1167999 - Osa ping for API, check sendOsaPing/getOsaPing methods
* Fri Aug 07 2015 Tomas Kasparek <tkasparek@redhat.com> 2.4.48-1
- reremove unsused SetDecl
- don't cleanup set when adding packages to a channel
* Tue Aug 04 2015 Jiri Dostal <jdostal@redhat.com> 2.4.47-1
- 1241945 - Fixed - search field only allows 40 characters
* Tue Aug 04 2015 Jiri Dostal <jdostal@redhat.com> 2.4.46-1
- [RFE] 1097634 - Added option to schedule sync with latest packages
* Mon Aug 03 2015 Tomas Lestach <tlestach@redhat.com> 2.4.45-1
- 1219140 - skip errata clone events, where channel or erratum aren't available
anymore (were deleted in the meantime)
- 1219140 - let errata.cloneAsync process the cloning process async
* Fri Jul 31 2015 Tomas Lestach <tlestach@redhat.com> 2.4.44-1
- 1179479 - add last boot and registration date to
systemgroup.listSystemsMinimal API
* Fri Jul 31 2015 Tomas Lestach <tlestach@redhat.com> 2.4.43-1
- detect removed packages during repo generation
- sort the channels for rego generation task
- set the policy for blocked execution (concurrent settings)
- unmark channel in progress for failed repomd tasks
- mark ChannelRepodataWorker failed, when exception is thrown
- removing unused loadErrata() from ErrataQueueWorker
- modified will be set by the rhnRepoRegenQueue update trigger
* Fri Jul 24 2015 Jan Dobes 2.4.42-1
- adding link to reposync logs
- adding progress bar showing sync status
- disable sync button and show message if reposync is in progress
- Sort api list
- Remove test handler from API
* Fri Jul 24 2015 Tomas Kasparek <tkasparek@redhat.com> 2.4.41-1
- require cobbler20 - Spacewalk is not working with upstream cobbler anyway
* Wed Jul 22 2015 Jiri Dostal <jdostal@redhat.com> 2.4.40-1
- 1181152 - XSS when altering user details and going somewhere where you are
choosing user - Escaped tags in real names
- Make RhnServletListenerTest not extend RhnBaseTestCase
* Tue Jul 21 2015 Tomas Lestach <tlestach@redhat.com> 2.4.39-1
- introduce org.setErrataEmailNotifsForOrg and org.isErrataEmailNotifsForOrg
API calls
* Mon Jul 20 2015 Tomas Lestach <tlestach@redhat.com> 2.4.38-1
- introduce org.setOrgConfigManagedByOrgAdmin and
org.isOrgConfigManagedByOrgAdmin API calls
* Mon Jul 20 2015 Tomas Lestach <tlestach@redhat.com> 2.4.37-1
- update organization configuration description
- spacewalk/satellite admin may allow org admin to manage org configuration
- re-use same org config jsp code
- introduce errata_emails_enabled per org
- make the Organization Configuration pages available also to org amin
- Fix docs
* Wed Jul 15 2015 Jan Dobes 2.4.36-1
- prevent ISE if taskomatic is not running
- get files only for correct channel
* Tue Jul 14 2015 Tomas Kasparek <tkasparek@redhat.com> 2.4.35-1
- allow to change 1st organization name
* Mon Jul 13 2015 Jan Dobes 2.4.34-1
- properly close 'a' tag
- removing dead code
- do not try to translate certain messages several times
* Mon Jul 13 2015 Matej Kollar <mkollar@redhat.com> 2.4.33-1
- Grammar fix
* Fri Jul 10 2015 Tomas Lestach <tlestach@redhat.com> 2.4.32-1
- 1235955 - fix detection of systems requiring reboot
* Thu Jul 09 2015 Jiri Dostal <jdostal@redhat.com> 2.4.31-1
- Bug 1098804 - fixed broken link, labels
* Thu Jul 09 2015 Tomas Lestach <tlestach@redhat.com> 2.4.30-1
- log debug messages only if debug is enabled
- Fix queue size: consider possible remainders from last run
- Log message when finished errata cache for a server or channel
- Remove some duplicated empty lines
- Remove unused return value that was always null
- Remove unused parameter to TaskQueue.run()
- Log the current queue size before every job run (DEBUG)
- Fix log message when finished with server
* Fri Jul 03 2015 Jan Dobes 2.4.29-1
- removing dead code
- fixing system.listUngroupedSystems API
* Fri Jul 03 2015 Jan Dobes 2.4.28-1
- removing obsolete file
- configure ivy resolver
* Fri Jul 03 2015 Matej Kollar <mkollar@redhat.com> 2.4.27-1
- Unify profile creation/update with one submit button instead of two.
- Fix file input control alignment issue with form-control (bsc#873203)
* Mon Jun 29 2015 Jan Dobes 2.4.26-1
- checksum type None is no longer available
- Make arch x86_64 the default when creating new channels.
- Remove checksum type None. It prevents metadata generation.
- do not recreate the option tags, just change visibility
- New Channel: Fix setting the default architecture/checksum when selecting
back Parent: None
* Fri Jun 26 2015 Tomas Kasparek <tkasparek@redhat.com> 2.4.25-1
- Avoid deadlock in CompareConfigFilesTask when a
rhn_channel.update_needed_cache is in progress
- Server.listConfigDiffEnabledSystems: fix indentation
- Recommend cobbler20 with all packages requiring cobbler on Fedora 22
* Fri Jun 12 2015 Jan Dobes 2.4.24-1
- 1227700 - add missing country code
- 1227700 - removing invalid title
- TaskoXmlRpcHandler: dead code removed
* Tue Jun 09 2015 Tomas Kasparek <tkasparek@redhat.com> 2.4.23-1
- Fix adding roles: make sure that ORG admin is last
- Fix javadoc and remove some superfluous newlines
- Simplify getCandidates() to return a list of task objects
- Remove unused Date variable
- Do not remove tasks from DB during getCandidates() (bsc#932052)
- Verify forward path and query ignoring the order of parameters
* Fri May 29 2015 Jan Dobes 2.4.22-1
- Get rid of IE7 compatibility mode enforcement
- ErrataManager: fix stack update case
- fixing message
- removing unused import
- KickstartScheduleCommand: always use activation key data
- KickstartScheduleCommand: dead code removed
* Thu May 28 2015 Tomas Kasparek <tkasparek@redhat.com> 2.4.21-1
- remove redundant abstract modifier
- fix checkstyle issues on Fedora 22
- ErrataManagerTest: correct assertion message
* Fri May 22 2015 Tomas Lestach <tlestach@redhat.com> 2.4.20-1
- expect a Number instead of an Integer
* Fri May 22 2015 Jan Dobes 2.4.19-1
- 1201719 - wait for current transaction end
- SystemHandler cleanup
- fix checkstyle issue
- Extract utility method in HibernateFactory
- ErrataManagerTest: correct comment to agree with code
* Mon May 18 2015 Tomas Lestach <tlestach@redhat.com> 2.4.18-1
- enhance task creation logging
- removing @Override annotation for method that isn't overriden
* Mon May 18 2015 Tomas Kasparek <tkasparek@redhat.com> 2.4.17-1
- 1221224 - display schema upgrade required message on CreateFirstUser page
* Thu May 14 2015 Stephen Herr <sherr@redhat.com> 2.4.16-1
- Kickstart: install the latest available koan package, not first found
* Thu May 14 2015 Grant Gainey 2.4.15-1
- 1221739 - EXISTS is an Oracle keyword, don't use it casually
* Wed May 13 2015 Stephen Herr <sherr@redhat.com> 2.4.14-1
- Change Activation Key Child Channels from multiple select to checkboxes
* Tue May 12 2015 Stephen Herr <sherr@redhat.com> 2.4.13-1
- hasPreflag(): improve documentation about which rpm flags are evaluated
- fix generating pre-equires (pre="1" in metadata)
* Thu May 07 2015 Jan Dobes <jdobes@redhat.com> 2.4.12-1
- make checkstyle compatible with newer versions and enable on fedora
* Wed May 06 2015 Tomas Lestach <tlestach@redhat.com> 2.4.11-1
- 1218705 - allow read-only user to call find* APIs