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
|
<project name="YaCy" default="all" basedir=".">
<description>
YaCy - a Peer to Peer Web Search Engine
</description>
<!--
# THIS IS THE YACY BUILD SCRIPT
# YOU CAN USE IT TO COMPILE YOUR OWN RELEASE
# THE TARGET OF THE COMPILATION CAN BE FOUND
# IN THE 'RELEASE' DIRECTORY AFTERWARDS
# YOU NEED APACHE ANT TO USE THIS SCRIPT
# ==========================================
# This Software is Copyrighted
# (C) by Michael Peter Christen; mc@yacy.net
# first published on http://yacy.net
# Frankfurt, Germany, 2005-2009
#
# This program 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 Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
<!-- defining the timestamp format -->
<tstamp>
<format property="REPL_DATE_FORMAT" pattern="yyyymmdd" />
</tstamp>
<!-- defining all needed directory names -->
<property name="yacyroot" location="."/>
<property name="addon" location="addon"/>
<property name="src" location="source"/>
<property name="data" location="DATA"/>
<property name="lib" location="lib"/>
<property name="libt" location="libt"/>
<property name="libbuild" location="libbuild"/>
<property name="build" location="classes"/>
<property name="htroot" location="htroot"/>
<property name="langstats" location="langstats"/>
<property name="locales" location="locales"/>
<property name="skins" location="skins"/>
<property name="ranking" location="ranking"/>
<property name="release" location="RELEASE"/>
<property name="htdocsWWW" location="${data}/HTDOCS/www"/>
<property name="release_main" location="${release}/MAIN"/>
<property name="release_windows" location="${release}/WINDOWS"/>
<property name="svnEntriesFile" location=".svn/entries"/>
<property name="defaults" location="defaults"/>
<!-- variables for installonlinux target-->
<property name="DESTDIR" value="DESTDIR"/>
<property name="PKGMANAGER" value="false"/>
<property name="RESTARTCMD" value="/etc/init.d/yacy restart"/>
<!-- determining if the .svn directory exists -->
<condition property="svnEntriesFileExists">
<available file="${svnEntriesFile}" />
</condition>
<!--
if the .svn directory exists we try to determine the real
svn revision number of the working base now
-->
<target name="buildSvnRevNr">
<delete file="${libbuild}/svnRevNr.jar" failonerror="false" />
<javac srcdir="${libbuild}/svnRevNr" />
<jar destfile="${libbuild}/svnRevNr.jar" basedir="${libbuild}/svnRevNr">
<manifest>
<attribute name="Main-Class" value="svnRevNrParser"/>
</manifest>
</jar>
</target>
<target name="determineRevisionNr" if="svnEntriesFileExists" depends="buildSvnRevNr">
<!-- define a custom ant task to read the revision number from file -->
<taskdef resource="svnRevNrParser.properties" classpath="${libbuild}/svnRevNr.jar"/>
<!-- determine the revision number -->
<echo message="Trying to read Revision number from file ${svnEntriesFile}"/>
<svnrevnr file="${svnEntriesFile}" property="baseRevisionNr"/>
<!-- replacing the old with the new revision number -->
<copy file="build.properties" tofile="build.properties.new">
<filterchain>
<tokenfilter>
<replaceregex pattern="^releaseNr=(.*)"
replace="releaseNr=$Revision: ${baseRevisionNr} $" />
</tokenfilter>
</filterchain>
</copy>
<delete file="build.properties"/>
<move file="build.properties.new" tofile="build.properties"/>
</target>
<!-- reading the build properties from file -->
<target name="readBuildProperties" depends="determineRevisionNr">
<!-- loading some property values from file -->
<loadproperties srcFile="build.properties">
<filterchain>
<tokenfilter>
<replaceregex pattern="^releaseNr=\$Revision:\s(.*)\s\$"
replace="releaseNr=\1"/>
</tokenfilter>
</filterchain>
</loadproperties>
</target>
<!-- initializing all needed variables -->
<target name="init" depends="readBuildProperties">
<mkdir dir="${build}/de/anomic/crawler"/>
<mkdir dir="${build}/de/anomic/data"/>
<mkdir dir="${build}/de/anomic/htmlFilter"/>
<mkdir dir="${build}/de/anomic/http"/>
<mkdir dir="${build}/de/anomic/kelondro"/>
<mkdir dir="${build}/de/anomic/net"/>
<mkdir dir="${build}/de/anomic/index"/>
<mkdir dir="${build}/de/anomic/plasma"/>
<mkdir dir="${build}/de/anomic/plasma/parser"/>
<mkdir dir="${build}/de/anomic/server"/>
<mkdir dir="${build}/de/anomic/tools"/>
<mkdir dir="${build}/de/anomic/ymage"/>
<mkdir dir="${build}/de/anomic/yacy"/>
<mkdir dir="${build}/de/anomic/yacy/seedUpload"/>
<mkdir dir="${data}"/>
<mkdir dir="${release}"/>
<!-- YaCy Release Date -->
<filter token="REPL_DATE" value="${DSTAMP}"/>
<filter token="REPL_RELEASE" value="${stdReleaseFile}"/>
<!-- YaCy Release Version number -->
<echo message="YaCy Version number: ${releaseVersion}" />
<filter token="REPL_VERSION" value="${releaseVersion}" />
<!-- YaCy SVN Revision number -->
<echo message="YaCy Revision number: ${releaseNr}" />
<filter token="REPL_REVISION_NR" value="${releaseNr}"/>
<!-- YaCy root directory -->
<filter token="REPL_YACY_ROOT_DIR" value="${yacyroot}"/>
<filter token="REPL_PKGMANAGER" value="${PKGMANAGER}"/>
<filter token="REPL_RESTARTCMD" value="${RESTARTCMD}"/>
<!-- apply replacments -->
<delete file="${build}/de/anomic/yacy/yacyBuildProperties.java" failonerror="false"/>
<copy file="${src}/de/anomic/yacy/yacyBuildProperties.java" tofile="${build}/de/anomic/yacy/yacyBuildProperties.java" overwrite="true" filtering="true" />
</target>
<target name="compileMain" depends="init" description="Compiling the yacy sources ...">
<!-- defining the classpath that should be used for compiling -->
<path id="project.class.path">
<pathelement location="${build}" />
<pathelement location="${htroot}" />
<pathelement location="${lib}/activation.jar" />
<pathelement location="${lib}/FontBox-0.1.0-dev.jar" />
<pathelement location="${lib}/J7Zip-modified.jar" />
<pathelement location="${lib}/PDFBox-0.7.3.jar" />
<pathelement location="${lib}/bcmail-jdk14-139.jar" />
<pathelement location="${lib}/bcprov-jdk14-139.jar" />
<pathelement location="${lib}/bzip2.jar" />
<pathelement location="${lib}/commons-codec-1.3.jar" />
<pathelement location="${lib}/commons-fileupload-1.2.1.jar" />
<pathelement location="${lib}/commons-httpclient-3.1.jar" />
<pathelement location="${lib}/commons-io-1.4.jar" />
<pathelement location="${lib}/commons-jxpath-1.3.jar" />
<pathelement location="${lib}/commons-logging-1.1.1.jar" />
<pathelement location="${lib}/jakarta-oro-2.0.7.jar" />
<pathelement location="${lib}/jrpm-SNAPSHOT.jar" />
<pathelement location="${lib}/jsch-0.1.21.jar" />
<pathelement location="${lib}/log4j-1.2.9.jar" />
<pathelement location="${lib}/mysql-connector-java-5.1.7-bin.jar" />
<pathelement location="${lib}/odf_utils_05_11_29.jar" />
<pathelement location="${lib}/poi-3.2-FINAL-20081019.jar" />
<pathelement location="${lib}/poi-scratchpad-3.2-FINAL-20081019.jar" />
<pathelement location="${lib}/servlet-api.jar" />
<pathelement location="${lib}/tm-extractors-1.0.jar" />
<pathelement location="${lib}/webcat-0.1-swf.jar" />
<pathelement location="${lib}/xerces.jar" />
</path>
<!-- compiling yacyBuildProperties.java -->
<javac srcdir="${build}" destdir="${build}" sourcepath="${src}"
includes="de/anomic/yacy/yacyBuildProperties.java"
source="${javacSource}" target="${javacTarget}">
<classpath refid="project.class.path" />
<compilerarg value="-Xlint"/>
</javac>
<delete file="${build}/BuildProperties.java" />
<!-- compiling the main sources -->
<javac srcdir="${src}/" destdir="${build}"
excludes="de/anomic/yacy/yacyBuildProperties.java"
debug="true" debuglevel="lines,vars,source"
source="${javacSource}" target="${javacTarget}">
<classpath refid="project.class.path" />
<compilerarg value="-Xlint"/>
</javac>
<!-- compiling htroot, htroot/yacy and htroot/htdocsdefault -->
<javac srcdir="${htroot}/"
excludes="processing/**"
classpathref="project.class.path"
debug="true" debuglevel="lines,vars,source"
source="${javacSource}" target="${javacTarget}">
<compilerarg value="-Xlint"/>
</javac>
</target>
<target name="compileHtdocsWWW" depends="compileMain" description="Compiling and zipping userspecific servlets">
<!-- defining the classpath that should be used for compiling -->
<path id="htdocsWWW.class.path">
<pathelement location="${build}"/>
<pathelement location="${htroot}"/>
<!-- userspecific libs -->
<pathelement location="${htdocsWWW}/lib/*.jar" />
<pathelement location="${htdocsWWW}/" />
</path>
<!-- compiling htroot, htroot/yacy and htroot/htdocsdefault -->
<javac srcdir="${htdocsWWW}/"
classpathref="htdocsWWW.class.path"
debug="true" debuglevel="lines,vars,source"
source="${javacSource}" target="${javacTarget}" />
</target>
<target name="all" depends="compileMain">
</target>
<target name="copyMain4Dist" depends="compileMain">
<!-- copy main class files -->
<copy todir="${release_main}/classes" failonerror="false">
<fileset dir="${build}">
<include name="**/*.*"/>
</fileset>
</copy>
<!-- copy yacy.jar (if available) -->
<copy todir="${release_main}" file="yacy.jar" failonerror="false"/>
<!-- copy all libs -->
<copy todir="${release_main}/lib">
<fileset dir="${lib}"
includes="**/*"/>
</copy>
<!-- copy build libs -->
<copy todir="${release_main}/libbuild">
<fileset dir="${libbuild}"
includes="**/*"/>
</copy>
<!-- copy configuration files -->
<copy todir="${release_main}">
<fileset dir=".">
<include name="yacy.logging"/>
<include name="yacy.yellow"/>
<include name="yacy.badwords.example"/>
<include name="yacy.stopwords"/>
<include name="yacy.parser"/>
<include name="httpd.mime"/>
</fileset>
</copy>
<!-- copy defaults -->
<copy todir="${release_main}/defaults">
<fileset dir="${defaults}"
includes="**/*"/>
</copy>
<!-- copy Unix wrappers -->
<copy todir="${release_main}">
<fileset dir=".">
<include name="startYACY.sh"/>
<include name="stopYACY.sh"/>
<include name="killYACY.sh"/>
<include name="updateYACY.sh"/>
<include name="restart.sh"/>
<include name="startYACY.command"/>
<include name="stopYACY.command"/>
</fileset>
</copy>
<!-- copy other wrappers -->
<copy todir="${release_main}">
<fileset dir=".">
<include name="startYACY.bat"/>
<include name="startYACY_debug.bat"/>
<include name="stopYACY.bat"/>
<include name="getWin32MaxHeap.bat"/>
<!--
<include name="startYACY_Win9x.bat"/>
<include name="startYACY_noconsole_Win9x.bat"/>
<include name="stopYACY_Win9x.bat"/>
-->
</fileset>
</copy>
<copy todir="${release_main}" file="yacy.exe" failonerror="false"/>
<!-- copy locales -->
<copy todir="${release_main}/locales">
<fileset dir="${locales}">
<include name="*"/>
</fileset>
</copy>
<!-- copy skins -->
<copy todir="${release_main}/skins">
<fileset dir="${skins}">
<include name="*"/>
</fileset>
</copy>
<!-- copy language statistics files -->
<copy todir="${release_main}/langstats">
<fileset dir="${langstats}">
<include name="*"/>
</fileset>
</copy>
<!-- copy documentation -->
<copy todir="${release_main}">
<fileset dir=".">
<include name="readme.txt"/>
<include name="gpl.txt"/>
<include name="ChangeLog"/>
<include name="AUTHORS"/>
<include name="COPYRIGHT"/>
<include name="NOTICE"/>
</fileset>
</copy>
<!-- copy source code -->
<copy todir="${release_main}/source">
<fileset dir="${src}">
<include name="**/*.*"/>
</fileset>
</copy>
<!-- copy server pages -->
<copy todir="${release_main}/htroot">
<fileset dir="${htroot}">
<include name="**/*"/>
</fileset>
</copy>
<!-- copy add-on's -->
<copy todir="${release_main}/addon">
<fileset dir="${addon}">
<include name="**/*"/>
</fileset>
</copy>
<!-- copy ranking files -->
<copy todir="${release_main}/ranking">
<fileset dir="${ranking}">
<include name="**/*"/>
</fileset>
</copy>
<!-- copy development tools -->
<copy todir="${release_main}">
<fileset dir=".">
<include name="build.xml"/>
<include name="build.properties"/>
</fileset>
</copy>
<!-- copy searchtest -->
<copy todir="${release_main}/bin">
<fileset dir="bin">
<include name="searchtest*"/>
<include name="localsearch.sh"/>
<include name="up.sh"/>
<include name="down.sh"/>
</fileset>
</copy>
</target>
<target name="copyMain4SourceDist" depends="init,clean">
<!-- copy main class files -->
<copy todir="${release_source}/classes" failonerror="false">
<fileset dir="${build}">
<include name="**/*.*"/>
</fileset>
</copy>
<!-- copy libs -->
<copy todir="${release_source}/lib">
<fileset dir="${lib}"
includes="**/*"/>
</copy>
<copy todir="${release_source}/libt">
<fileset dir="${libt}"
includes="**/*"/>
</copy>
<copy todir="${release_source}/libbuild">
<fileset dir="${libbuild}"
includes="**/*"/>
</copy>
<!-- copy configuration files -->
<copy todir="${release_source}">
<fileset dir=".">
<include name="yacy.logging"/>
<include name="yacy.yellow"/>
<include name="yacy.badwords.example"/>
<include name="yacy.stopwords"/>
<include name="yacy.parser"/>
<include name="httpd.mime"/>
<include name="superseed.txt"/>
</fileset>
</copy>
<!-- copy defaults -->
<copy todir="${release_source}/defaults">
<fileset dir="${defaults}"
includes="**/*"/>
</copy>
<!-- copy Unix wrappers -->
<copy todir="${release_source}">
<fileset dir=".">
<include name="startYACY.sh"/>
<include name="stopYACY.sh"/>
<include name="killYACY.sh"/>
<include name="restart.sh"/>
<include name="startYACY.command"/>
<include name="stopYACY.command"/>
</fileset>
</copy>
<!-- copy other wrappers -->
<copy todir="${release_source}">
<fileset dir=".">
<include name="startYACY.bat"/>
<include name="startYACY_noconsole.bat"/>
<include name="stopYACY.bat"/>
<include name="getWin32MaxHeap.bat"/>
<!--
<include name="startYACY_Win9x.bat"/>
<include name="startYACY_noconsole_Win9x.bat"/>
<include name="stopYACY_Win9x.bat"/>
-->
</fileset>
</copy>
<!-- copy locales -->
<copy todir="${release_source}/locales">
<fileset dir="${locales}">
<include name="*"/>
</fileset>
</copy>
<!-- copy skins -->
<copy todir="${release_source}/skins">
<fileset dir="${skins}">
<include name="*"/>
</fileset>
</copy>
<!-- copy language statistics files -->
<copy todir="${release_source}/langstats">
<fileset dir="${langstats}">
<include name="*"/>
</fileset>
</copy>
<!-- copy documentation -->
<copy todir="${release_source}">
<fileset dir=".">
<include name="readme.txt"/>
<include name="gpl.txt"/>
<include name="ChangeLog"/>
<include name="AUTHORS"/>
<include name="COPYRIGHT"/>
<include name="NOTICE"/>
</fileset>
</copy>
<!-- copy source code -->
<copy todir="${release_source}/source">
<fileset dir="${src}">
<include name="**/*.*"/>
</fileset>
</copy>
<!-- copy server pages -->
<copy todir="${release_source}/htroot">
<fileset dir="${htroot}">
<include name="**/*"/>
</fileset>
</copy>
<!-- copy add-on's -->
<copy todir="${release_source}/addon">
<fileset dir="${addon}">
<include name="**/*"/>
</fileset>
</copy>
<!-- copy ranking files -->
<copy todir="${release_source}/ranking">
<fileset dir="${ranking}">
<include name="**/*"/>
</fileset>
</copy>
<!-- copy development tools -->
<copy todir="${release_source}">
<fileset dir=".">
<include name="build.xml"/>
<include name="build.properties"/>
</fileset>
</copy>
<!-- copy searchtest -->
<copy todir="${release_main}/bin">
<fileset dir="bin">
<include name="searchtest.*"/>
<include name="localsearch.sh"/>
</fileset>
</copy>
</target>
<!-- =======================================================================================================
making a release file for yacy
======================================================================================================= -->
<target name="dist" depends="copyMain4Dist" description="make for standard YaCy">
<tar destfile="${release}/${stdReleaseFile}" compression="gzip" defaultexcludes="yes" longfile="fail">
<!-- packing all files into a gzipped tar -->
<tarfileset dir="${release_main}" prefix="${releaseFileParentDir}/" dirmode="${accessRightsDir}" mode="${accessRightsExecutable}">
<include name="**/*.sh"/>
<include name="**/*.command"/>
</tarfileset>
<tarfileset dir="${release_main}" prefix="${releaseFileParentDir}/" dirmode="${accessRightsDir}" mode="${accessRightsFile}" >
<include name="**/*"/>
<exclude name="**/*.sh"/>
<exclude name="**/*.command"/>
</tarfileset>
</tar>
<delete dir="${release_main}"/>
<delete dir="${release_windows}" failonerror="false" />
<delete dir="${release}/SPECS" failonerror="false" />
</target>
<target name="sdist" depends="copyMain4SourceDist" description="make for standard source YaCy">
<tar destfile="${release}/${sourceReleaseFile}" compression="gzip" defaultexcludes="yes" longfile="fail">
<!-- packing all files into a gzipped tar -->
<tarfileset dir="${release_source}" prefix="${releaseFileParentDir}/" dirmode="${accessRightsDir}" mode="${accessRightsExecutable}">
<include name="**/*.sh"/>
<include name="**/*.command"/>
</tarfileset>
<tarfileset dir="${release_source}" prefix="${releaseFileParentDir}/" dirmode="${accessRightsDir}" mode="${accessRightsFile}" >
<include name="**/*"/>
<exclude name="**/*.sh"/>
<exclude name="**/*.command"/>
</tarfileset>
</tar>
<delete dir="${release_source}"/>
</target>
<!-- make clean -->
<target name="clean" description="make clean">
<delete dir="${release_main}" failonerror="false"/>
<delete file="${build}/de/anomic/yacy/yacyBuildProperties.java" failonerror="false"/>
<delete file="yacy.jar" failonerror="false"/>
<delete file="yacy.exe" failonerror="false"/>
<delete file="${lib}/svnRevNr.jar" failonerror="false"/>
<delete file="${libbuild}/svnRevNr.jar" failonerror="false"/>
<delete failonerror="false">
<fileset dir="${src}" includes="**/*.class" />
<fileset dir="${build}" includes="**/*.class" />
<fileset dir="${htroot}" includes="**/*.class" />
<fileset dir="${libbuild}/svnRevNr" includes="**/*.class" />
</delete>
</target>
<target name="installonlinux">
<!-- check for jar-file -->
<available file="yacy.jar" property="built"/>
<fail message="Please build yacy with 'ant clean build-jar'" unless="built"/>
<!-- copy main class files -->
<copy todir="${DESTDIR}/usr/share/java/">
<fileset dir=".">
<include name="yacy.jar"/>
</fileset>
</copy>
<!-- copy configuration files -->
<copy todir="${DESTDIR}/usr/share/yacy">
<fileset dir=".">
<include name="yacy.logging"/>
<include name="yacy.yellow"/>
<include name="yacy.badwords.example"/>
<include name="yacy.stopwords"/>
<include name="yacy.parser"/>
<include name="httpd.mime"/>
</fileset>
</copy>
<!-- copy defaults -->
<copy todir="${DESTDIR}/usr/share/yacy/defaults">
<fileset dir="${defaults}"
includes="**/*"/>
</copy>
<!-- copy locales -->
<copy todir="${DESTDIR}/usr/share/yacy/locales">
<fileset dir="${locales}">
<include name="*"/>
</fileset>
</copy>
<!-- copy skins -->
<copy todir="${DESTDIR}/usr/share/yacy/skins">
<fileset dir="${skins}">
<include name="*"/>
</fileset>
</copy>
<!-- copy language statistics files -->
<copy todir="${DESTDIR}/usr/share/yacy/langstats">
<fileset dir="${langstats}">
<include name="*"/>
</fileset>
</copy>
<!-- copy documentation -->
<copy todir="${DESTDIR}/usr/share/doc/yacy">
<fileset dir=".">
<include name="readme.txt"/>
<include name="ChangeLog"/>
<include name="AUTHORS"/>
<include name="COPYRIGHT"/>
<include name="NOTICE"/>
</fileset>
</copy>
<!-- copy server pages -->
<copy todir="${DESTDIR}/usr/share/yacy/htroot">
<fileset dir="${htroot}">
<include name="**/*"/>
<exclude name="yacy/seedUpload/**"/>
</fileset>
<fileset dir="${htroot}">
<include name="yacy/seedUpload/yacySeedUploadFile.html"/>
<include name="yacy/seedUpload/yacySeedUploadFtp.html"/>
</fileset>
</copy>
<!-- copy ranking files -->
<copy todir="${DESTDIR}/usr/share/yacy/ranking">
<fileset dir="${ranking}">
<include name="**/*"/>
</fileset>
</copy>
<!-- work around a feature/bug :( -->
<mkdir dir="${DESTDIR}/usr/share/yacy/xlib" />
<!-- prepare /var/lib/yacy -->
<mkdir dir="${DESTDIR}/var/lib/yacy" />
<mkdir dir="${DESTDIR}/var/lib/yacy/LOG" />
<mkdir dir="${DESTDIR}/var/lib/yacy/SETTINGS" />
<mkdir dir="${DESTDIR}/etc" />
<mkdir dir="${DESTDIR}/var/log" />
<symlink link="${DESTDIR}/usr/share/yacy/DATA"
resource="../../../var/lib/yacy"/>
<symlink link="${DESTDIR}/etc/yacy"
resource="../var/lib/yacy/SETTINGS"/>
<symlink link="${DESTDIR}/var/log/yacy"
resource="../lib/yacy/LOG"/>
</target>
<!-- run YaCy (needed for NetBeans4) -->
<target name="run" description="Run YaCy">
<!-- debug options:
java -Xrunhprof:help
Hprof usage: -Xrunhprof[:help]|[:<option>=<value>, ...]
Option Name and Value Description Default
_____________________ ___________ _______
heap=dump|sites|all heap profiling all
cpu=samples|times|old CPU usage off
monitor=y|n monitor contention n
format=a|b ascii or binary output a
file=<file> write data to file java.hprof(.txt for ascii)
net=<host>:<port> send data over a socket write to file
depth=<size> stack trace depth 4
cutoff=<value> output cutoff point 0.0001
lineno=y|n line number in traces? y
thread=y|n thread in traces? n
doe=y|n dump on exit? y
gc_okay=y|n GC okay during sampling y
Example: java -Xrunhprof:cpu=samples,file=log.txt,depth=3 FooClass
Note: format=b cannot be used with cpu=old|times
-->
<java classname="yacy" fork="yes">
<classpath>
<pathelement location="${build}"/>
<pathelement location="${htroot}"/>
<pathelement location="${lib}" />
<fileset dir="${lib}" includes="**/*.jar" />
</classpath>
<!--<arg value="-Xrunhprof"/>-->
<arg line="-start"/>
<!-- <arg line="-migratewords"/>-->
<!-- <arg line="-start ${user.dir}"/>-->
</java>
</target>
<!-- run a single file (selected in NetBeans4) -->
<target name="run-single" depends="compileMain" description="Run Single File">
<fail unless="classname">Must set property 'classname'</fail>
<java classname="yacy" fork="yes">
<classpath refid="run.classpath"/>
<classpath>
<pathelement location="${build}"/>
<pathelement location="${htroot}"/>
<pathelement location="${lib}" />
<fileset dir="${lib}" includes="**/*.jar" />
</classpath>
<arg line=""/>
</java>
</target>
<!-- run YaCy with remote debugging enabled on port 8000 -->
<target name="debug" description="Debug YaCy">
<java classname="yacy" fork="yes">
<classpath>
<pathelement location="${build}"/>
<pathelement location="${htroot}"/>
<pathelement location="${lib}" />
<fileset dir="${lib}" includes="**/*.jar" />
</classpath>
<arg line="-start"/>
<jvmarg line="-Xdebug"/>
<jvmarg line="-Xnoagent"/>
<jvmarg line="-Djava.compiler=none"/>
<jvmarg line="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"/>
</java>
</target>
<!-- stop YaCy again -->
<target name="stop" description="Stop YaCy">
<java classname="yacy" fork="yes">
<classpath>
<pathelement location="${build}"/>
<pathelement location="${htroot}"/>
<pathelement location="${lib}" />
<fileset dir="${lib}" includes="**/*.jar" />
</classpath>
<arg line="-stop"/>
</java>
</target>
<!-- create the html-documentation from javadoc -->
<target name="create-doc" description="Create the javadoc-HTML-Pages">
<javadoc destdir="doc/api"
author="true"
version="true"
use="false"
encoding="iso-8859-1"
windowtitle="YaCy API Documentation">
<classpath>
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
<pathelement location="${build}"/>
</classpath>
<fileset dir="source" defaultexcludes="yes">
<include name="**/*.java" />
</fileset>
<fileset dir="htroot" defaultexcludes="yes">
<include name="**/*.java" />
</fileset>
</javadoc>
</target>
<target name="build-jar" depends="compileMain">
<jar destfile="yacy.jar" basedir="${build}/">
<manifest>
<attribute name="Main-Class" value="yacy"/>
</manifest>
</jar>
</target>
<!--
Explanation of the confusing Exe Targets:
-makeWinStartExe creates a windows-program, which starts yacy instead
of the startYACY.bat file.
-distWithWinStartExe creates a tarball with the program included
This needs jsmoothgen
-distWininstaller and
winInstallerExe build a installer-programm for windows, instead of a tar.gz.
This needs nsis-ant-1.2.jar in the yacyfolder.
-->
<target name="rpm" depends="all" description="Creates the main rpm-package and another for lib">
<mkdir dir="${release}/RPMS/noarch" />
<mkdir dir="${release}/BUILD" />
<copy file="yacy-svn-4.spec" tofile="${release}/SPECS/yacy-svn.spec" overwrite="true" filtering="true" />
<rpm specFile="yacy-svn.spec" topDir="${release}" />
<move file="${release}/RPMS/noarch/yacy-${releaseVersion}_${releaseNr}-3.noarch.rpm"
tofile="${release}/yacy-${releaseVersion}_${releaseNr}-3.noarch.rpm" />
<move file="${release}/RPMS/noarch/yacy-lib-${releaseVersion}_${releaseNr}-3.noarch.rpm"
tofile="${release}/yacy-lib-${releaseVersion}_${releaseNr}-3.noarch.rpm" />
<delete dir="${release}/SPECS" failonerror="false" />
<delete dir="${release}/RPMS" failonerror="false" />
<delete dir="${release_windows}" failonerror="false" />
</target>
<!-- Alias -->
<target name="distWinInstaller" depends="winInstallerExe">
</target>
<target name="winInstallerExe" depends="copyMain4Dist" description="Creates the windows installer.exe">
<!-- http://nsisant.sourceforge.net/ -->
<mkdir dir="${release_windows}" />
<copy file="build.nsi" tofile="${release_windows}/build.nsi" overwrite="true" filtering="true" />
<taskdef name="nsis" classname="net.sf.nsisant.Task">
<classpath location="${libbuild}/nsisant-1.2.jar"/>
</taskdef>
<nsis script="${release_windows}/build.nsi" nocd="yes" verbosity="2" />
<move file="${release_windows}/yacy_v${releaseVersion}_${DSTAMP}_${releaseNr}.exe"
tofile="${release}/yacy_v${releaseVersion}_${DSTAMP}_${releaseNr}.exe" />
<delete dir="${release_main}"/>
<delete dir="${release_windows}" failonerror="false" />
</target>
<target name="deb" depends="init" description="Creates a debian package">
<!-- replacing the old with the new revision number -->
<replaceregexp file="debian/changelog"
match="yacy \(.*\) unstable; urgency=low"
replace="yacy (${releaseVersion}svn${baseRevisionNr}) unstable; urgency=low" />
<!-- build debian package -->
<exec executable="dpkg-buildpackage">
<arg value="-b"/>
<arg value="-rfakeroot"/>
<arg value="-uc"/>
</exec>
<replaceregexp file="debian/changelog"
match="yacy \(.*\) unstable; urgency=low"
replace="yacy (*auto-svn-version*) unstable; urgency=low" />
</target>
<target name="sign" depends="readBuildProperties" description="sign current release file in RELEASE/ with $privateKey">
<java classname="de.anomic.tools.CryptoLib" failonerror="true">
<classpath>
<pathelement location="${build}"/>
</classpath>
<arg line="--sign ${privateKeyFile} ${release}/${stdReleaseFile}"/>
</java>
</target>
<target name="genkey" depends="readBuildProperties" description="generate a pair of keys and write it to $privateKey and $privateKey.pub">
<!-- TODO: check doesn't work! why?? -->
<fail message="There is already a private Key!!">
<condition>
<available file="$privateKey" type="file" />
</condition>
</fail>
<java classname="de.anomic.tools.CryptoLib" failonerror="true">
<classpath>
<pathelement location="${build}"/>
</classpath>
<arg line="--gen-key ${privateKeyFile} ${privateKeyFile}.pub"/>
</java>
<chmod file="${privateKeyFile}" perm="600"/>
</target>
</project>
|