~i2p.packages/i2p/trunk

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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
<?xml version="1.0" encoding="ISO-8859-1"?>
<project basedir="." default="all" name="i2p"
    xmlns:artifact="antlib:org.apache.maven.artifact.ant">

    <!-- Include property files so that values can be easily overridden.
         Users should create an override.properties file to make changes.
     -->
    <property file="override.properties"/>
    <property file="build.properties"/>
    <!--  When changing, also change javadoc URL in build.properties, and checksum in apps/jetty/build.xml -->
    <property name="jetty.ver" value="9.2.29.v20191105" />
    <property name="tomcat.ver" value="8.5.50" />

    <!-- You probably don't want to change anything from here down -->
    <target name="help" depends="all" />
    <target name="all" >
        <echo message="Useful targets: " />
        <echo message="  pkg:       distclean then package everything up (updater, installer)" />
        <echo message="  dist:      pkg and javadoc" />
        <echo message="  dist200:   pkg, updater200, and javadoc" />
        <echo message="  installer: build the GUI installer" />
        <echo message="  installer-freebsd: build the GUI installer (FreeBSD only)" />
        <echo message="  installer-linux: build the GUI installer (Linux only)" />
        <echo message="  installer-osx: build the GUI installer (OSX only)" />
        <echo message="  installer-windows: build the GUI installer (Windows only)" />
        <echo message="  installer-nowindows: build the GUI installer (all but Windows)" />
        <echo message="  installer5, installer5-linux, installer5-nowindows, installer5-windows: use IzPack 5" />
        <echo message="  osxLauncher: build the Mac OS X router/GUI launcher (OSX only)" />
        <echo message="  bbLauncher: build the Browser Bundle router launcher" />
        <echo message="  tarball:   tar the full install into i2p.tar.bz2 (extracts to build a new clean install)" />
        <echo message="  updater:   Package the built files in i2pupdate.zip (extracts safely over existing installs)" />
        <echo message="  updater200: Updater compressed with pack200 (creates i2pupdate200.zip, 60% smaller)" />
        <echo message="  signed-updater200: Signed updater compressed with pack200 (creates i2pupdate.su3, 60% smaller)" />
        <echo message="  updaterWithJavadoc: updater including the javadocs, for display in the console" />
        <echo message="  updater200WithJavadoc: updater including the javadocs, for display in the console (creates i2pupdate200.zip)" />
        <echo message="  signed-updater200WithJavadoc: Signed updater including the javadocs, for display in the console (creates i2pupdate.su3)" />
        <echo message="  updaterWithJavadocAndJetty: updater including the javadocs, for display in the console, and Jetty " />
        <echo message="  updater200WithJavadocAndJetty: updater including the javadocs, for display in the console, and Jetty (creates i2pupdate200.zip)" />
        <echo message="  signed-updater200WithJavadocAndJetty: Signed updater including the javadocs, for display in the console, and Jetty (creates i2pupdate.su3)" />
        <echo message="  updaterWithJetty: Updater including Jetty" />
        <echo message="  updater200WithJetty: Updater including Jetty" />
        <echo message="  signed-updater200withJetty: Signed updater including Jetty" />
        <echo message="  updaterWithJettyFixes: updater including local jetty patches" />
        <echo message="  updaterWithGeoIP: updater including GeoIP Files" />
        <echo message="  updaterWithJettyFixesAndGeoIP" />
        <echo message="  updaterWithJettyFixesAndJbigi" />
        <echo message="  updaterWithJbigi" />
        <echo message="  updater200WithJbigi" />
        <echo message="  updaterSmall:   updater with the essentials only - no SAM, i2psnark, SusiMail, SusiDNS, or history.txt" />
        <echo message="  updaterRouter:  updater with the i2p.jar and router.jar only" />
        <echo message="  distclean: clean up all derived files" />
        <!-- <echo message="  syndie:    generate a standalone syndie install" /> -->
        <echo message="  desktopgui: generate a standalone desktopgui install" />
        <echo message="  i2psnark:  generate a standalone i2psnark install" />
        <echo message="  justBOB:  generate a standalone BOB-one.jar" />
        <echo message="  javadoc:   generate javadoc for the entire project into ./build/javadoc and ./javadoc.zip" />
        <echo message="  javadoc-test: Javadocs for unit test classes (build/javadoc-test)" />
        <echo message="  slackpkg:  generate Slackware package in ./Slackware/i2p" />
        <echo message="  debianhowto: instructions on building Debian packages" />
        <echo message="  debian: generate Debian packages in ../" />
        <echo message="          run &quot;ant debianhowto&quot; for instructions" />
        <echo message="  debian-clean: rollback debian specific patches and run the &quot;distclean&quot; target (done automatically at the end of the &quot;debian&quot; target)" />
        <!-- <echo message="  debianrepo: build a Debian repository (reprepro required)" /> -->
        <echo message="  poupdate: update the .po files for translators" />
        <echo message="  pkg-portable-win32:  build a minimum portable version for win32" />
        <echo message="  bench: build the benchmarks" />
   </target>
    <target name="debianhowto">
            <echo message="To build debian packages, you must make sure that you have" />
            <echo message="the necessary build-dependencies installed." />
            <echo message="The packages required to build can be found in the file "/>
            <echo message="&quot;debian/control&quot; in the &quot;Build-Depends&quot; field."/>
            <echo message="In addition to those packages, be sure to install &quot;fakeroot&quot;,"/>
            <echo message="&quot;quilt&quot; and &quot;build-essential&quot;!" />
            <echo message="" />
            <echo message="The following command will install the build dependencies for you:" />
            <echo message=" " />
            <echo message="sudo apt-get install debhelper ant debconf default-jdk gettext libgmp-dev po-debconf fakeroot \" />
            <echo message="  build-essential quilt dh-apparmor dh-systemd libservice-wrapper-java libjson-simple-java \"  />
            <echo message="  devscripts libjetty9-java libtomcat8-java libtaglibs-standard-jstlel-java libgetopt-java"  />
            <echo message=" " />
            <echo message="The following command will install the additional runtime dependencies:" />
            <echo message="sudo apt-get install geoip-database famfamfam-flag-png" />
            <echo message=" " />
            <echo message="Once the dependencies are installed, run &quot;ant debian&quot;"/>
            <echo message="to patch the source and build the packages." />
    </target>

    <property name="gpg" value="gpg" />

    <macrodef name="gpgsign">
        <attribute name="file" />
        <sequential>
            <delete file="@{file}.sig" quiet="true" />
            <exec executable="${gpg}" failonerror="true">
                <arg value="-u" />
                <arg value="${release.gpg.keyid}" />
                <arg value="-b" />
                <arg value="@{file}" />
            </exec>
            <chmod type="file" perm="444">
                <fileset dir="${basedir}">
                    <include name="@{file} @{file}.sig" />
                </fileset>
            </chmod>
        </sequential>
    </macrodef>

    <macrodef name="gpgsignasc">
        <attribute name="file" />
        <sequential>
            <delete file="@{file}.asc" quiet="true" />
            <exec executable="${gpg}" failonerror="true">
                <arg value="-u" />
                <arg value="${release.gpg.keyid}" />
                <arg value="-ab" />
                <arg value="@{file}" />
            </exec>
            <chmod type="file" perm="444">
                <fileset dir="${basedir}">
                    <include name="@{file} @{file}.asc" />
                </fileset>
            </chmod>
        </sequential>
    </macrodef>

    <macrodef name="mktorrent">
        <attribute name="file" />
        <sequential>
            <delete file="@{file}.torrent" quiet="true"/>
            <java classname="org.klomp.snark.Storage" fork="true" failonerror="true">
                <classpath>
                    <pathelement location="build/i2p.jar" />
                    <pathelement location="build/i2psnark.jar" />
                </classpath>
                <arg value="-a" />
                <arg value="http://tracker2.postman.i2p/announce.php" />
                <arg value="-c" />
                <arg value="${build.built-by}" />
                <arg value="@{file}" />
            </java>
        </sequential>
    </macrodef>

    <macrodef name="sha256sum">
        <attribute name="file" />
        <sequential>
            <!--
                 Note: "local" only works with ant 1.8+. This limitation shouldn't be
                 a big deal since this macro is only called by the release
                 target.
             -->
            <local name="file-sum"/>
            <checksum format="MD5SUM" file="@{file}" property="file-sum" algorithm="sha-256"/>
            <echo message="${file-sum}  @{file}" />
        </sequential>
    </macrodef>

    <macrodef name="sudsign">
        <attribute name="infile" />
        <attribute name="outfile" />
        <sequential>
            <input message="Enter sud/su2 private signing key file:" addproperty="release.privkey" />
            <fail message="You must enter an existing file path." >
                <condition>
                    <or>
                        <equals arg1="${release.privkey}" arg2=""/>
                        <not>
                            <length file="${release.privkey}" when="greater" length="0" />
                        </not>
                    </or>
                </condition>
            </fail>
            <echo message="Key file is ${release.privkey}" />
            <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
                <classpath>
                    <pathelement location="build/i2p.jar" />
                </classpath>
                <arg value="sign" />
                <arg value="@{infile}" />
                <arg value="@{outfile}" />
                <arg value="${release.privkey}" />
                <arg value="${release.number}" />
            </java>
            <echo message="Verify version and VALID signature:" />
            <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
                <classpath>
                    <pathelement location="build/i2p.jar" />
                </classpath>
                <arg value="verifysig" />
                <arg value="@{outfile}" />
            </java>
            <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
                <classpath>
                    <pathelement location="build/i2p.jar" />
                </classpath>
                <arg value="verifyversion" />
                <arg value="@{outfile}" />
            </java>
            <java classname="net.i2p.crypto.TrustedUpdate" fork="true" failonerror="true">
                <classpath>
                    <pathelement location="build/i2p.jar" />
                </classpath>
                <arg value="showversion" />
                <arg value="@{outfile}" />
            </java>
        </sequential>
    </macrodef>

    <macrodef name="su3sign">
        <attribute name="infile" />
        <attribute name="outfile" />
        <attribute name="sigtype" />
        <attribute name="su3.ver" />
        <sequential>
        <input message="Enter su3 private signing key store:" addproperty="release.privkey.su3" />
        <fail message="You must enter an existing file path." >
            <condition>
                <or>
                    <equals arg1="${release.privkey.su3}" arg2=""/>
                    <not>
                        <length file="${release.privkey.su3}" when="greater" length="0" />
                    </not>
                </or>
            </condition>
        </fail>
        <input message="Enter su3 key name (you@mail.i2p):" addproperty="release.signer.su3" />
        <fail message="You must enter a name." >
            <condition>
                <equals arg1="${release.signer.su3}" arg2=""/>
            </condition>
        </fail>
        <input message="Enter su3 key password for ${release.signer.su3}:" addproperty="release.password.su3" />
        <fail message="You must enter a password." >
            <condition>
                <equals arg1="${release.password.su3}" arg2=""/>
            </condition>
        </fail>
            <java classname="net.i2p.crypto.SU3File" inputstring="${release.password.su3}" fork="true" failonerror="true">
                <classpath>
                    <pathelement location="build/i2p.jar" />
                </classpath>
                <arg value="sign" />
                <arg value="-c" />
                <arg value="@{sigtype}" />
                <arg value="-t" />
                <arg value="RSA_SHA512_4096" />
                <arg value="@{infile}" />
                <arg value="@{outfile}" />
                <arg value="${release.privkey.su3}" />
                <arg value="@{su3.ver}" />
                <arg value="${release.signer.su3}" />
            </java>
            <echo message="Verify version and VALID signature:" />
            <java classname="net.i2p.crypto.SU3File" fork="true" failonerror="true">
                <classpath>
                    <pathelement location="build/i2p.jar" />
                </classpath>
                <!-- set base dir so it can find the pubkey cert -->
                <jvmarg value="-Di2p.dir.base=installer/resources" />
                <arg value="verifysig" />
                <arg value="@{outfile}" />
            </java>
            <java classname="net.i2p.crypto.SU3File" fork="true" failonerror="true">
                <classpath>
                    <pathelement location="build/i2p.jar" />
                </classpath>
                <!-- set base dir so it can find the pubkey cert -->
                <jvmarg value="-Di2p.dir.base=installer/resources" />
                <arg value="showversion" />
                <arg value="@{outfile}" />
            </java>
        </sequential>
    </macrodef>

    <target name="dist" depends="pkg, javadoc" />
    <target name="dist200" depends="pkg200, javadoc" />
    <target name="build" depends="build2">
        <!-- so we don't build standalone for the updater -->
        <!-- This builds apps/i2psnark/java/i2psnark-standalone.zip,
          -   which we don't distribute anywhere...
        <ant dir="apps/i2psnark/java/" target="standalone" />
        -->
    </target>
    <target name="build2" depends="builddep, jar, buildWEB" />
    <target name="buildSmall" depends="builddepSmall, jarSmall, buildWEB" />
    <target name="buildclean" depends="distclean, build" />

    <target name="builddep" depends="builddepSmall, buildBOB, buildSAM, buildSusiMail, buildSusiDNS, buildI2PSnark, buildI2PControl" />

    <target name="builddepSmall" depends="buildrouter, buildSystray, buildDesktopGui, buildRouterConsole, buildStreaming, buildI2PTunnel, buildAddressbook" />

    <!-- start of buildX, one for each sub-build.xml.
         Do not put ant tasks in the sub-build.xmls anymore,
         so the build will go faster.
      -->

    <target name="-setepoch">
        <exec executable="date" outputproperty="epoch" errorproperty="dc.error" failifexecutionfails="true" >
            <arg value="+%s" />
        </exec>
        <echo message="Epoch is: ${epoch}" />
    </target>

    <target name="bbLauncher" depends="build">
        <sequential>
            <exec executable="./sbt" dir="launchers" failonerror="true">
                <arg value="browserbundle:clean" />
            </exec>
            <exec executable="./sbt" dir="launchers" failonerror="true">
                <arg value="browserbundle:assembly" />
            </exec>
        </sequential>
    </target>

    <target name="osxLauncher" depends="build,preppkg-osx">
        <sequential>
            <exec executable="./sbt" dir="launchers" failonerror="true">
                <arg value="macosx:cleanAllTask" />
            </exec>
            <exec executable="./sbt" dir="launchers" failonerror="true">
                <arg value="macosx:buildAppBundleTask" />
            </exec>
        </sequential>
    </target>

    <target name="buildBOB" depends="buildStreaming" >
        <ant dir="apps/BOB/" target="jar" />
        <copy file="apps/BOB/dist/BOB.jar" todir="build/" />
    </target>

    <target name="buildSAM" depends="buildStreaming" >
        <ant dir="apps/sam/java/" target="jar" />
        <copy file="apps/sam/java/build/sam.jar" todir="build/" />
    </target>

    <target name="buildSusiMail" depends="buildCore, buildJetty" >
        <ant dir="apps/susimail/" target="war" />
        <copy file="apps/susimail/susimail.war" todir="build/" />
    </target>

    <!-- jar (not war) for testing only -->
    <target name="buildSusiMailJar" depends="buildCore, buildJetty" >
        <ant dir="apps/susimail/" target="jar" />
        <copy file="apps/susimail/susimail.jar" todir="build/" />
    </target>

    <target name="buildSusiDNS" depends="buildCore, buildJetty, buildImagegen, buildAddressbook" >
        <ant dir="apps/susidns/src" target="all" />
        <copy file="apps/susidns/src/susidns.war" todir="build/" />
    </target>

    <target name="buildImagegen" depends="buildCore, buildJetty" >
        <ant dir="apps/imagegen" target="build" />
        <copy file="apps/imagegen/imagegen/build/imagegen.war" todir="build/" />
    </target>

    <target name="buildI2PControl" depends="buildRouter, buildJetty" >
        <ant dir="apps/i2pcontrol" target="war" />
        <copy file="apps/i2pcontrol/build/jsonrpc.war" todir="build/" />
    </target>

    <target name="buildI2PSnark" depends="buildStreaming, buildJetty, buildSystray" >
        <ant dir="apps/i2psnark/java/" target="war" />
        <copy file="apps/i2psnark/i2psnark.war" todir="build/" />
        <copy file="apps/i2psnark/java/build/i2psnark.jar" todir="build/" />
    </target>

    <!-- jar (not war) for Android -->
    <target name="buildAddressbookJar" depends="buildCore" >
        <ant dir="apps/addressbook/" target="jar" />
        <copy file="apps/addressbook/dist/addressbook.jar" todir="build/" />
    </target>

    <target name="buildAddressbook" depends="buildCore" >
        <ant dir="apps/addressbook/" target="all" />
        <copy file="apps/addressbook/dist/addressbook.jar" todir="build/" />
        <!-- war is empty, only for updates -->
        <copy file="apps/addressbook/dist/addressbook.war" todir="build/" />
    </target>

    <!-- Both jars and no war, for Android -->
    <target name="buildI2PTunnelJars" depends="buildStreaming" >
        <ant dir="apps/i2ptunnel/java/" target="uiJar" />
        <copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/" />
        <copy file="apps/i2ptunnel/java/build/i2ptunnel-ui.jar" todir="build/" />
    </target>

    <target name="buildI2PTunnel" depends="buildStreaming, buildJetty, buildImagegen" >
        <ant dir="apps/i2ptunnel/java/" target="build" />
        <copy file="apps/i2ptunnel/java/build/i2ptunnel.jar" todir="build/" />
        <copy file="apps/i2ptunnel/java/build/i2ptunnel.war" todir="build/" />
    </target>

    <target name="buildDesktopGui" depends="buildCore, buildrouter, buildSystray" >
        <ant dir="apps/desktopgui" target="jar" />
        <copy file="apps/desktopgui/dist/desktopgui.jar" todir="build/" />
    </target>

    <target name="buildRouterConsole" depends="buildrouter, buildSystray, buildDesktopGui, buildJetty, buildJrobin" >
        <ant dir="apps/routerconsole/java/" target="jar" />
    </target>

    <!-- newsxml.jar only (subset of routerconsole, no war) for Android -->
    <target name="buildNewsXMLJar" depends="buildRouter" >
        <ant dir="apps/routerconsole/java/" target="newsxmljar" />
    </target>

    <target name="buildJetty" depends="buildCore" >
        <ant dir="apps/jetty" target="build" />
        <copy todir="build/" >
            <fileset dir="apps/jetty/jettylib" excludes="ant.jar" />
        </copy>
    </target>

    <target name="buildSystray" depends="buildCore" >
        <ant dir="apps/systray/java/" target="jar" />
        <copy file="apps/systray/java/build/systray.jar" todir="build/" />
    </target>

    <target name="buildStreaming" depends="buildMinistreaming" >
        <ant dir="apps/streaming/java/" target="jar" />
        <copy file="apps/streaming/java/build/streaming.jar" todir="build/" />
    </target>

    <target name="buildMinistreaming" depends="buildCore" >
        <ant dir="apps/ministreaming/java/" target="jar" />
        <copy file="apps/ministreaming/java/build/mstreaming.jar" todir="build/" />
    </target>

    <target name="buildRouter" depends="buildrouter" />
    <target name="buildrouter" depends="buildCore" >
        <ant dir="router/java/" target="jar" />
        <copy file="router/java/build/router.jar" todir="build/" />
    </target>

    <target name="buildCore" depends="buildProperties" >
        <ant dir="core/java/" target="jar" />
        <copy file="core/java/build/i2p.jar" todir="build/" />
    </target>

    <target name="buildJrobin" depends="buildCore" >
        <ant dir="apps/jrobin/java/" target="jar" />
        <copy file="apps/jrobin/java/build/jrobin.jar" todir="build/" />
    </target>

    <target name="buildProperties" depends="getMtnRev, getReleaseNumber, getBuildNumber, setBuildTimestamp, disableManifestClasspath" >
        <!-- default if not set above -->
        <property name="workspace.version" value="unknown" />
        <!-- default if not set by setBuildTimestamp -->
        <property name="build.timestamp" value="reproducible" />
        <!-- default if not set by disableManifestClasspath -->
        <property name="manifest.classpath.name" value="Class-Path" />
        <property name="full.version" value="${release.number}-${i2p.build.number}${build.extra}" />
        <echo message="Building version ${full.version} (mtn rev ${workspace.version})" />
    </target>

    <target name="setBuildTimestamp" unless="${build.reproducible}" >
        <tstamp>
            <format property="build.timestamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC" locale="en" />
        </tstamp>
    </target>

    <!-- Disable Class-Path in jar manifests by renaming it (Fedora) -->
    <target name="disableManifestClasspath" if="${without-manifest-classpath}" >
        <property name="manifest.classpath.name" value="Disabled-Class-Path" />
    </target>

    <target name="buildWEB" depends="buildRouterConsole" >
        <copy file="apps/routerconsole/java/build/routerconsole.jar" todir="build/" />
        <copy file="apps/routerconsole/java/build/routerconsole.war" todir="build/" />
    </target>

    <target name="buildTools" depends="buildrouter" >
        <ant dir="installer/tools/java" target="jar" />
        <copy file="installer/tools/java/build/tools.jar" todir="build/" />
    </target>

    <!-- end of sub-build.xml targets -->

    <!-- monotone targets -->

    <target name="checkForMtn" >
        <available property="mtn.available" file="_MTN" type="dir" />
    </target>

    <target name="failIfNoMtn" depends="checkForMtn">
        <fail message="This target cannot be used without Monotone! Use &quot;fakeroot debian/rules get-orig-source&quot; instead.">
            <condition>
                <not>
                    <isset property="mtn.available" />
                </not>
            </condition>
        </fail>
    </target>

    <target name="getMtnRev" depends="checkForMtn" if="mtn.available" >
        <exec executable="mtn" outputproperty="workspace.version" errorproperty="mtn.error1" failifexecutionfails="false" >
            <arg value="automate" />
            <arg value="get_base_revision_id" />
        </exec>
    </target>

    <target name="trimMtnRev" depends="getMtnRev">
        <exec executable="cut" inputstring="${workspace.version}" outputproperty="MtnShortHash" errorproperty="cut.error1" failifexecutionfails="true" >
            <arg value="-c" />
            <arg value="1-8" />
        </exec>
        <echo message="Short version is: ${MtnShortHash}" />
    </target>

    <target name="checkIfBumped">
        <exec executable="mtn" outputproperty="bumped" errorproperty="mtn.error2" failifexecutionfails="false" >
            <arg value="ls" />
            <arg value="ch" />
            <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
        </exec>
        <condition property="bumped.already">
            <not>
                <equals arg1="${bumped}" arg2=""/>
            </not>
        </condition>
    </target>

    <target name="bump" depends="bumpBuild" />
    <target name="bumpBuild" depends="checkIfBumped, getBuildNumber" unless="bumped.already">
        <exec executable="dc" outputproperty="new.i2p.build.number" errorproperty="dc.error" failifexecutionfails="true" >
            <arg value="-e" />
            <arg value="${i2p.build.number} 1 + n" />
        </exec>
        <echo message="Build number is now: ${new.i2p.build.number}${build.extra}" />
        <replaceregexp byline="true" file="router/java/src/net/i2p/router/RouterVersion.java"
            match='(^\s+public\s+final\s+static\s+long\s+BUILD\s+=\s+)[0-9]+;' replace='\1${new.i2p.build.number};'/>
    </target>

    <target name="revisions" depends="getReleaseNumber, getBuildNumber">
        <!-- mtn log __brief __no-graph __to t:i2p-0.9.xx | cut -d ' ' -f 2 | sort | uniq -c | sort -rn -->
        <exec executable="mtn" outputproperty="getrevisions1" errorproperty="reverror1" failifexecutionfails="true" >
            <arg value="log" />
            <arg value="--brief" />
            <arg value="--no-graph" />
            <arg value="--to" />
            <arg value="t:i2p-${release.number}" />
        </exec>
        <exec executable="cut" inputstring="${getrevisions1}" outputproperty="getrevisions2" failifexecutionfails="true" >
            <arg value="-d" />
            <arg value=" " />
            <arg value="-f" />
            <arg value="2" />
        </exec>
        <exec executable="sort" inputstring="${getrevisions2}" outputproperty="getrevisions3" failifexecutionfails="true" >
        </exec>
        <exec executable="uniq" inputstring="${getrevisions3}" outputproperty="getrevisions4" failifexecutionfails="true" >
            <arg value="-c" />
        </exec>
        <exec executable="sort" inputstring="${getrevisions4}" outputproperty="getrevisions5" failifexecutionfails="true" >
            <arg value="-rn" />
        </exec>
        <echo message="Revisions since ${release.number}:" />
        <echo message="${getrevisions5}" />
    </target>

    <!-- end monotone targets -->

    <!-- launch4j targets -->

    <condition property="noExe">
        <not>
            <!-- We only have launch4j binaries for the following systems -->
            <and>
                <or>
                    <os arch="x86" />
                    <os arch="i386" />
                    <os arch="i586" />
                    <os arch="i686" />
                    <os arch="amd64" />
                    <os arch="x86_64" />
                </or>
                <or>
                    <os name="Linux" />
                    <os family="windows" />
                </or>
            </and>
        </not>
    </condition>

    <!-- this makes an empty build/launchi2p.jar and the build/i2p.exe for the no-wrapper windows startup, if possible -->
    <target name="buildexe" depends="buildProperties, launch4j" unless="noExe">
        <echo message="See the file &quot;build.properties&quot; if this step fails." />
        <jar destfile="./build/launchi2p.jar">
            <manifest>
                <attribute name="Main-Class" value="net.i2p.router.RouterLaunch" />
                <attribute name="Class-Path" value="lib/i2p.jar lib/router.jar lib/jbigi.jar lib/BOB.jar lib/sam.jar lib/mstreaming.jar lib/streaming.jar lib/routerconsole.jar lib/i2ptunnel.jar lib/org.mortbay.jetty.jar lib/javax.servlet.jar lib/jasper-runtime.jar lib/commons-el.jar lib/wrapper.jar lib/systray.jar lib/desktopgui.jar lib/i2psnark.jar lib/jrobin.jar lib/jstl.jar lib/standard.jar lib/jetty-continuation.jar lib/jetty-deploy.jar lib/jetty-http.jar lib/jetty-i2p.jar lib/jetty-io.jar lib/jetty-rewrite-handler.jar lib/jetty-security.jar lib/jetty-servlet.jar lib/jetty-servlets.jar lib/jetty-start.jar lib/jetty-util.jar lib/jetty-webapp.jar lib/jetty-xml.jar" />
                <attribute name="Built-By" value="${build.built-by}" />
                <attribute name="Build-Date" value="${build.timestamp}" />
                <attribute name="Base-Revision" value="${workspace.version}" />
            </manifest>
        </jar>
        <!-- now the standalone launcher exe -->
        <launch4j configFile="./installer/i2pstandalone.xml" />
        <!-- thazzit -->
    </target>

    <target name="launch4j">
        <taskdef name="launch4j"
                 classname="net.sf.launch4j.ant.Launch4jTask"
                 classpath="${basedir}/installer/lib/launch4j/launch4j.jar:${basedir}/installer/lib/launch4j/lib/xstream.jar" />
     </target>

    <!-- end launch4j targets -->

     <!--
          the files are now copied to the build directory
          in the build* targets
      -->
     <target name="jar" depends="jarSmall" />
     <target name="jarSmall" depends="builddepSmall" />

    <!-- Custom target to collect the jars that I2P-Bote needs to compile, so it can compile from source. -->
    <target name="jarBote" depends="buildRouter, buildStreaming, buildJetty" >
        <copy file="apps/susidns/src/lib/jstl.jar" todir="build/" />
        <copy file="apps/susidns/src/lib/standard.jar" todir="build/" />
    </target>

    <!-- jbigi targets -->

    <target name="jbigi-list-changes" depends="checkForMtn" if="mtn.available">
        <exec executable="mtn" outputproperty="workspace.changes.jbigi" errorproperty="mtn.error.jbigi" failifexecutionfails="false" >
            <arg value="list" />
            <arg value="changed" />
            <arg value="installer/lib/jbigi" />
        </exec>
        <!-- \n in an attribute value generates an invalid manifest -->
        <exec executable="tr" inputstring="${workspace.changes.jbigi}" outputproperty="workspace.changes.jbigi.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
            <arg value="-s" />
            <arg value="&quot;[:space:]&quot;" />
            <arg value="," />
        </exec>
    </target>

    <target name="jbigi" depends="buildProperties, jbigi-list-changes">
        <!-- set if unset -->
        <property name="workspace.changes.jbigi.tr" value="" />
        <mkdir dir="./build" />
        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
            <fileset dir="installer/lib/jbigi" includes="*.so *.dll *.jnilib" />
            <manifest>
                <attribute name="Built-By" value="${build.built-by}" />
                <attribute name="Build-Date" value="${build.timestamp}" />
                <attribute name="Base-Revision" value="${workspace.version}" />
                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
            </manifest>
        </jar>
    </target>

    <target name="jbigi-nowindows" depends="buildProperties, jbigi-list-changes">
        <!-- set if unset -->
        <property name="workspace.changes.jbigi.tr" value="" />
        <delete file="build/jbigi.jar" failonerror="false" quiet="true" />
        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
            <fileset dir="installer/lib/jbigi" includes="*.so *.jnilib" />
            <manifest>
                <attribute name="Built-By" value="${build.built-by}" />
                <attribute name="Build-Date" value="${build.timestamp}" />
                <attribute name="Base-Revision" value="${workspace.version}" />
                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
            </manifest>
        </jar>
    </target>

    <!-- Now system-specific jbigis in alphabetical order -->
    <target name="jbigi-freebsd-only"  depends="buildProperties, jbigi-list-changes">
        <!-- set if unset -->
        <property name="workspace.changes.jbigi.tr" value="" />
        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
            <fileset dir="installer/lib/jbigi" includes="*bsd*.so" />
            <manifest>
                <attribute name="Built-By" value="${build.built-by}" />
                <attribute name="Build-Date" value="${build.timestamp}" />
                <attribute name="Base-Revision" value="${workspace.version}" />
                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
            </manifest>
        </jar>
    </target>

    <target name="jbigi-linux-only"  depends="buildProperties, jbigi-list-changes">
        <!-- set if unset -->
        <property name="workspace.changes.jbigi.tr" value="" />
        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
            <fileset dir="installer/lib/jbigi" includes="*linux*.so" />
            <manifest>
                <attribute name="Built-By" value="${build.built-by}" />
                <attribute name="Build-Date" value="${build.timestamp}" />
                <attribute name="Base-Revision" value="${workspace.version}" />
                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
            </manifest>
        </jar>
    </target>

    <target name="jbigi-linux-x86-only"  depends="buildProperties, jbigi-list-changes">
        <!-- set if unset -->
        <property name="workspace.changes.jbigi.tr" value="" />
        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
            <fileset dir="installer/lib/jbigi" includes="*linux*.so" excludes="*linux-arm*.so,*linux-ppc*.so" />
            <manifest>
                <attribute name="Built-By" value="${build.built-by}" />
                <attribute name="Build-Date" value="${build.timestamp}" />
                <attribute name="Base-Revision" value="${workspace.version}" />
                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
            </manifest>
        </jar>
    </target>

    <target name="jbigi-linux-x86-64-only"  depends="buildProperties, jbigi-list-changes">
        <!-- set if unset -->
        <property name="workspace.changes.jbigi.tr" value="" />
        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
            <fileset dir="installer/lib/jbigi" includes="*linux*_64.so libjcpuid-x86_64-linux.so" excludes="*linux-arm*.so,*linux-ppc*.so" />
            <manifest>
                <attribute name="Built-By" value="${build.built-by}" />
                <attribute name="Build-Date" value="${build.timestamp}" />
                <attribute name="Base-Revision" value="${workspace.version}" />
                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
            </manifest>
        </jar>
    </target>

    <target name="jbigi-linux-nonx86-only"  depends="buildProperties, jbigi-list-changes">
        <!-- set if unset -->
        <property name="workspace.changes.jbigi.tr" value="" />
        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
            <fileset dir="installer/lib/jbigi" includes="*linux-arm*.so,*linux-ppc*.so" />
            <manifest>
                <attribute name="Built-By" value="${build.built-by}" />
                <attribute name="Build-Date" value="${build.timestamp}" />
                <attribute name="Base-Revision" value="${workspace.version}" />
                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
            </manifest>
        </jar>
    </target>

    <target name="jbigi-osx-only"  depends="buildProperties, jbigi-list-changes" >
        <!-- set if unset -->
        <property name="workspace.changes.jbigi.tr" value="" />
        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
            <fileset dir="installer/lib/jbigi" includes="*.jnilib" />
            <manifest>
                <attribute name="Built-By" value="${build.built-by}" />
                <attribute name="Build-Date" value="${build.timestamp}" />
                <attribute name="Base-Revision" value="${workspace.version}" />
                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
            </manifest>
        </jar>
    </target>

    <target name="jbigi-windows-only" depends="buildProperties, jbigi-list-changes" >
        <!-- set if unset -->
        <property name="workspace.changes.jbigi.tr" value="" />
        <delete file="build/jbigi.jar" failonerror="false" quiet="true" />
        <jar destfile="build/jbigi.jar" whenmanifestonly="fail" >
            <fileset dir="installer/lib/jbigi" includes="*windows*.dll" />
            <manifest>
                <attribute name="Built-By" value="${build.built-by}" />
                <attribute name="Build-Date" value="${build.timestamp}" />
                <attribute name="Base-Revision" value="${workspace.version}" />
                <attribute name="Workspace-Changes" value="${workspace.changes.jbigi.tr}" />
            </manifest>
        </jar>
    </target>

    <!-- end jbigi targets -->

    <target name="poupdate-source" depends="set-lg2-en, poupdate" />

    <target name="set-lg2-en" >
        <property name="lg2" value="en" />
    </target>

    <!-- the apps need to compile the jsps to poupdate -->
    <target name="poupdate" depends="buildRouter, buildStreaming, buildSystray, buildJetty, buildDesktopGui, buildJrobin" >
        <echo message="Setting environment variable LG2 to a lang code (eg: de,zh,nl etc)" />
        <echo message=" will restrict language update to the language you specified, leaving other language untact." />
        <!-- set if unset -->
        <property name="lg2" value="" />
        <ant dir="core/java/" target="poupdate" />
        <ant dir="router/java/" target="poupdate" />
        <ant dir="apps/routerconsole/java/" >
            <target name="poupdate" />
            <target name="poupdate-news" />
            <target name="poupdate-countries" />
        </ant>
        <ant dir="apps/i2psnark/java/" target="poupdate" />
        <ant dir="apps/i2ptunnel/java/" >
            <target name="poupdate" />
            <target name="poupdate-proxy" />
        </ant>
        <ant dir="apps/susidns/src/" target="poupdate" />
        <ant dir="apps/susimail/" target="poupdate" />
        <ant dir="apps/desktopgui" target="poupdate" />
        <ant dir="installer/resources/locale" target="poupdate" />
        <ant dir="apps/ministreaming/java" target="poupdate" />
    </target>

    <condition property="no.bundle">
        <isfalse value="${require.gettext}" />
    </condition>

    <target name="prep-script-translation" unless="no.bundle" >
        <!-- script translation added in 0.8.13, enabled in 0.9.5. -->
        <ant dir="installer/resources/locale" target="bundle" />
        <copy todir="pkg-temp/locale/">
            <fileset dir="installer/resources/locale/mo/" />
        </copy>
    </target>

    <target name="javadoc" depends="getReleaseNumber, getBuildNumber" >
        <ant dir="apps/jetty" target="ensureJettylib" />
        <mkdir dir="./build" />
        <mkdir dir="./build/javadoc" />
        <javadoc access="package"
            source="${javac.version}"
            destdir="./build/javadoc"
            packagenames="*"
            use="true"
            splitindex="true"
            failonerror="true"
            additionalparam="-notimestamp"
            doctitle="I2P Javadocs for Release ${release.number} Build ${i2p.build.number}${build.extra}"
            windowtitle="I2P Anonymous Network - Java Documentation - Version ${release.number}">
            <group title="Core SDK (i2p.jar)" packages="net.i2p:net.i2p.*:net.i2p.client:net.i2p.client.*:net.i2p.internal:net.i2p.internal.*:freenet.support.CPUInformation:gnu.crypto.*:gnu.getopt:gnu.gettext:com.nettgryppa.security:org.apache.http.conn.ssl:org.apache.http.conn.util:org.apache.http.util:org.json.simple:org.json.simple.*:com.southernstorm.noise.crypto.x25519:com.southernstorm.noise.crypto.chacha20" />
            <group title="Streaming Library" packages="net.i2p.client.streaming:net.i2p.client.streaming.impl" />
            <group title="Router" packages="net.i2p.router:net.i2p.router.*:net.i2p.data.i2np:net.i2p.data.router:org.cybergarage:org.cybergarage.*:org.freenetproject:org.xlattice.crypto.filters:com.maxmind.*:com.southernstorm.noise.*" />
            <group title="Router Console" packages="net.i2p.router.web:net.i2p.router.web.*:net.i2p.router.update:net.i2p.router.sybil:edu.internet2.ndt:net.i2p.router.news:com.vuze.*" />
            <!-- apps and bridges starting here, alphabetical please -->
            <group title="Addressbook Application" packages="net.i2p.addressbook:net.i2p.router.naming:net.metanotion:net.metanotion.*" />
            <group title="BOB Bridge" packages="net.i2p.BOB" />
            <group title="BOB Demos" packages="net.i2p.BOB.Demos.echo.echoclient:net.i2p.BOB.Demos.echo.echoserver" />
            <group title="Desktopgui Application" packages="net.i2p.desktopgui:net.i2p.desktopgui.*" />
            <group title="I2PControl Application" packages="net.i2p.i2pcontrol:net.i2p.i2pcontrol.*:org.mindrot.jbcrypt:com.thetransactioncompany.jsonrpc2:com.thetransactioncompany.jsonrpc2.*" />
            <group title="I2PSnark Application" packages="org.klomp.snark:org.klomp.snark.*" />
            <group title="I2PTunnel Application" packages="net.i2p.i2ptunnel:net.i2p.i2ptunnel.*" />
            <group title="Imagegen Application" packages="com.docuverse.identicon:com.google.zxing:com.google.zxing.*:net.i2p.imagegen" />
            <group title="Installer Utilities" packages="net.i2p.installer" />
            <group title="Jetty Utilities" packages="net.i2p.jetty:net.i2p.servlet:net.i2p.servlet.*" />
            <group title="JRobin Library" packages="org.jrobin:org.jrobin.*:engine.misc" />
            <group title="SAM Bridge" packages="net.i2p.sam" />
            <group title="SAM Demos" packages="net.i2p.sam.client" />
            <group title="SusiDNS Application" packages="i2p.susi.dns:net.i2p.addressbook.servlet" />
            <group title="SusiMail Application" packages="i2p.susi.webmail:i2p.susi.webmail.*:i2p.susi.debug:i2p.susi.util" />
            <group title="Systray Application" packages="net.i2p.apps.systray" />
            <sourcepath>
                <pathelement location="core/java/src" />
                <pathelement location="router/java/src" />
                <pathelement location="apps/ministreaming/java/src" />
                <pathelement location="apps/streaming/java/src" />
                <pathelement location="apps/i2ptunnel/java/src" />
                <pathelement location="apps/systray/java/src" />
                <pathelement location="apps/desktopgui/src" />
                <pathelement location="apps/routerconsole/java/src" />
                <pathelement location="apps/addressbook/java/src" />
                <pathelement location="apps/i2psnark/java/src" />
                <pathelement location="apps/sam/java/src" />
                <pathelement location="apps/BOB/src" />
                <pathelement location="apps/BOB/Demos/echo/echoclient/src" />
                <pathelement location="apps/BOB/Demos/echo/echoserver/src" />
                <pathelement location="apps/susidns/src/java/src" />
                <pathelement location="apps/susimail/src/src" />
                <pathelement location="apps/jetty/java/src" />
                <pathelement location="apps/imagegen/imagegen/webapp/src/main/java" />
                <pathelement location="apps/imagegen/identicon/core/src/main/java" />
                <pathelement location="apps/imagegen/zxing/core/src/main/java" />
                <pathelement location="apps/imagegen/zxing/javase/src/main/java" />
                <pathelement location="apps/jrobin/java/src" />
                <pathelement location="installer/java/src" />
                <pathelement location="apps/i2pcontrol/java" />
            </sourcepath>
            <classpath>
                <!-- warning, some entries are needed for Debian builds only -->
                <pathelement location="apps/jetty/jettylib/org.mortbay.jetty.jar" />
                <pathelement location="apps/jetty/jettylib/jasper-runtime.jar" />
                <pathelement location="apps/jetty/jettylib/javax.servlet.jar" />
                <pathelement location="apps/jetty/jettylib/jetty-deploy.jar" />
                <pathelement location="apps/jetty/jettylib/jetty-http.jar" />
                <pathelement location="apps/jetty/jettylib/jetty-security.jar" />
                <pathelement location="apps/jetty/jettylib/jetty-servlet.jar" />
                <pathelement location="apps/jetty/jettylib/jetty-servlets.jar" />
                <pathelement location="apps/jetty/jettylib/jetty-start.jar" />
                <pathelement location="apps/jetty/jettylib/jetty-util.jar" />
                <pathelement location="apps/jetty/jettylib/jetty-webapp.jar" />
                <pathelement location="apps/jetty/jettylib/jetty-xml.jar" />
                <pathelement location="apps/jetty/jettylib/tomcat-api.jar" />
                <pathelement location="installer/lib/wrapper/all/wrapper.jar" />
                <!-- following are only for debian builds -->
                <pathelement location="core/java/build/libintl.jar" />
                <pathelement location="core/java/build/gnu-getopt.jar" />
                <pathelement location="core/java/build/json-simple.jar" />
            </classpath>
            <!-- These variables are stored in build.properties.
                  End-users can override by creating the file override.properties -->
            <link offline="true" href="${javasedocs.url}" packagelistLoc="installer/resources/package-lists/java/" />
            <link offline="true" href="${javaeedocs.url}" packagelistLoc="installer/resources/package-lists/javaee/" />
            <link offline="true" href="${jettydocs.url}" packagelistLoc="installer/resources/package-lists/jetty/" />
            <link offline="true" href="${wrapperdocs.url}" packagelistLoc="installer/resources/package-lists/wrapper/" />
        </javadoc>
    </target>

    <target name="javadoc-zip" depends="javadoc">
        <zip destfile="javadoc.zip" basedir="build" level="9" includes="javadoc\**" />
    </target>

    <target name="javadoc-test" depends="buildRouter, javadoc" >
        <mkdir dir="./build" />
        <mkdir dir="./build/javadoc-test" />

        <!-- set junit home to the old default unless overridden elsewhere -->
        <property name="junit.home" value="${ant.home}/lib/" />
        <javadoc access="package"
            destdir="./build/javadoc-test"
            packagenames="*"
            use="true"
            splitindex="true"
            doctitle="I2P Unit Test Javadocs for Release ${release.number} Build ${i2p.build.number}${build.extra}"
            windowtitle="I2P Anonymous Network - Java Documentation - Version ${release.number}">
            <group title="Core SDK" packages="net.i2p:net.i2p.*:net.i2p.client:net.i2p.client.*:net.i2p.internal:net.i2p.internal.*:freenet.support.CPUInformation:gnu.crypto.*:gnu.gettext:org:com.nettgryppa.security:net.metanotion:net.metanotion.*" />
            <group title="Router" packages="net.i2p.router:net.i2p.router.*:net.i2p.data.i2np:org.cybergarage.*:org.freenetproject:org.xlattice.crypto.filters" />
            <sourcepath>
                <pathelement location="core/java/test/junit" />
                <pathelement location="router/java/test/junit" />
                <pathelement location="core/java/test/scalatest" />
            </sourcepath>
            <classpath>
                <pathelement location="build/i2p.jar" />
                <pathelement location="build/router.jar" />
                <pathelement location="${junit.home}/junit4.jar" />
                <pathelement location="${hamcrest.home}/hamcrest-all.jar" />
            </classpath>
            <!--
                 These variables are stored in build.properties.
                 End-users can override by creating the file override.properties
            -->
            <link offline="true" href="${javasedocs.url}" packagelistLoc="installer/resources/package-lists/java/" />
            <link offline="true" href="${junitdocs.url}" packagelistLoc="installer/resources/package-lists/junit/" />
            <link offline="true" href="${i2pdocs.url}" packagelistLoc="build/javadoc/" />
        </javadoc>
        <echo message="Warning, javadoc embeds timestamps in the output, run with 'TZ=UTC ant javadoc' if you plan to distribute" />
    </target>

    <target name="getReleaseNumber">
        <loadfile srcfile="core/java/src/net/i2p/CoreVersion.java" property="release.number">
            <filterchain>
                <linecontains>
                    <contains value="public final static String VERSION"/>
                </linecontains>
                <tokenfilter>
                    <replaceregex pattern='.*"([^"]+)";' replace="\1" flags="gi" />
                </tokenfilter>
                <striplinebreaks/>
                <trim/>
            </filterchain>
        </loadfile>
        <property name="release.number" value="unknown" />
        <echo message="Release number is ${release.number}" />
    </target>

    <target name="getBuildNumber">
        <loadfile srcfile="router/java/src/net/i2p/router/RouterVersion.java" property="i2p.build.number">
            <filterchain>
                <linecontains>
                    <contains value="public final static long BUILD" />
                </linecontains>
                <tokenfilter>
                    <replaceregex pattern=".*=\s+([0-9]+);" replace="\1" flags="gi" />
                </tokenfilter>
                <trim/>
                <striplinebreaks/>
            </filterchain>
        </loadfile>
        <loadfile srcfile="router/java/src/net/i2p/router/RouterVersion.java" property="build.extra">
            <filterchain>
                <linecontains>
                    <contains value="public final static String EXTRA" />
                </linecontains>
                <tokenfilter>
                    <replaceregex pattern='.*"(.*)";' replace="\1" flags="gi" />
                </tokenfilter>
                <trim/>
                <striplinebreaks/>
            </filterchain>
        </loadfile>
        <property name="i2p.build.number" value="??" />
        <property name="build.extra" value="" />
        <echo message="Build number is ${i2p.build.number}${build.extra}" />
    </target>

    <target name="verifyReleaseBuildNumbers" depends="getReleaseNumber, getBuildNumber" >
        <echo message="SDK: ${java.vendor} ${java.version} (${java.runtime.name} ${java.runtime.version})" />
        <fail message="Bad release number: ${release.number}" >
            <condition>
                <or>
                    <equals arg1="${release.number}" arg2="unknown"/>
                    <equals arg1="${release.number}" arg2=""/>
                </or>
            </condition>
        </fail>
        <fail message="Non-zero build number: ${i2p.build.number}" >
            <condition>
                <not>
                    <equals arg1="${i2p.build.number}" arg2="0"/>
                </not>
            </condition>
        </fail>
        <fail message="Non-empty extra build: ${build.extra}" >
            <condition>
                <not>
                    <equals arg1="${build.extra}" arg2=""/>
                </not>
            </condition>
        </fail>
    </target>

    <target name="-pre-sign">
            <!-- if you're distributing su3 files to others, at a minimum you should set these -->
            <fail message="javac.compilerargs must contain a -bootclasspath option in override.properties">
                <condition>
                    <not><contains string="${javac.compilerargs}" substring="-bootclasspath"/></not>
                </condition>
            </fail>
            <fail message="javac.compilerargs7 must contain a -bootclasspath option in override.properties">
                <condition>
                    <not><contains string="${javac.compilerargs7}" substring="-bootclasspath"/></not>
                </condition>
            </fail>
            <fail message="build.built-by must be set in override.properties">
                <condition>
                    <equals arg1="${build.built-by}" arg2="unknown"/>
                </condition>
            </fail>
            <fail message="require.gettext must be true">
                <condition>
                    <not><equals arg1="${require.gettext}" arg2="true"/></not>
                </condition>
            </fail>
    </target>

    <target name="-pre-release" depends="-pre-sign, failIfNoMtn">
            <echo message="================================================================" />
            <echo message="Did you update these files?" />
            <exec executable="ls" failonerror="true">
                    <arg value="-l" />
                    <arg value="history.txt" />
                    <arg value="installer/install.xml" />
                    <arg value="core/java/src/net/i2p/CoreVersion.java" />
                    <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
            </exec>
            <echo message="Everything is checked in, right? Let's be sure:" />
            <exec executable="mtn" failonerror="true">
                    <arg value="st" />
            </exec>
            <echo message="If there are any modified files above, stop now!" />
            <echo message="================================================================" />
            <sleep seconds="3"/>
    </target>

    <target name="clean" depends="pkgclean" >
        <delete dir="./build" />
        <delete dir="./reports" />
        <delete file="installer/lib/izpack/patches.jar" failonerror="false" quiet="true" />
        <delete dir="installer/lib/izpack5/patches/java/build" quiet="true" />
        <delete file="syndie-standalone.zip" failonerror="false" quiet="true" />
        <delete file="i2psnark-standalone.zip" failonerror="false" quiet="true" />
        <delete file="BOB-one.jar" failonerror="false" quiet="true" />
        <delete file="core/java/cobertura.ser"/>
        <delete file="javadoc.zip" />
        <delete file="i2p.fba" />
        <delete file="${sloccount.report.file}" />
        <delete file="mavencentral-i2p.jar" />
        <delete file="mavencentral-router.jar" />
        <delete file="mavencentral-mstreaming.jar" />
        <delete file="mavencentral-streaming.jar" />
        <delete file="mavencentral-servlet-i2p.jar" />
    </target>

    <target name="distclean" depends="clean">
        <delete failonerror="false" quiet="true">
            <fileset dir="." includes="i2pinstall* *.deb i2p_*.bz2 i2pupdate* i2psource* *.sig *.torrent" />
        </delete>
        <ant dir="core/java/" target="distclean" />
        <ant dir="router/java/" target="distclean" />
        <ant dir="installer/java" target="distclean" />
        <ant dir="apps/ministreaming/java/" target="distclean" />
        <ant dir="apps/streaming/java/" target="distclean" />
        <ant dir="apps/i2ptunnel/java/" target="distclean" />
        <ant dir="apps/sam/java/" target="distclean" />
        <ant dir="apps/BOB" target="clean" />
        <ant dir="apps/desktopgui" target="clean" />
        <ant dir="apps/routerconsole/java/" target="distclean" />
        <ant dir="apps/addressbook/" target="distclean" />
        <ant dir="apps/susimail/" target="distclean" />
        <ant dir="apps/susidns/src/" target="distclean" />
        <ant dir="apps/systray/java/" target="distclean" />
        <ant dir="apps/i2psnark/java/" target="distclean" />
        <ant dir="apps/jetty/" target="distclean" />
        <ant dir="apps/imagegen/" target="distclean" />
        <ant dir="apps/jrobin/java" target="distclean" />
        <delete dir="core/c/jbigi/bin" />
        <delete dir="core/c/jbigi/lib" />
        <delete dir="core/c/jcpuid/lib" />
        <ant dir="installer/resources/locale" target="distclean" />
        <ant dir="installer/tools/java" target="distclean" />
        <delete dir="installer/lib/izpack5/patches/java/build" quiet="true" />
	<!--
		NOTE! We need to turn off the default excludes for these
		patterns to work.
		These are the defaultexcludes in Ant as seen on
		http://ant.apache.org/manual/CoreTasks/defaultexcludes.html
		     **/*~
                     **/#*#
                     **/.#*
                     **/%*%
                     **/._*
                     **/CVS
                     **/CVS/**
                     **/.cvsignore
                     **/SCCS
                     **/SCCS/**
                     **/vssver.scc
                     **/.svn
                     **/.svn/**
                     **/.DS_Store
		The only recourse is to remove the offending ones.
		We do this here, as we only need one change, and then put it
		back after we are done with it.
	-->
	<defaultexcludes remove="**/*~"/>

        <delete>
            <fileset dir="." includes="**/*.class **/*.java~ **/*.txt~ **/*.xml~ **/*.sh~ **/*.SlackBuild~" />
	    <!--
	    	Less common, but they pollute my workspace here, so we
            	might as well nuke these as well. Are there any others?

            	!!??? Why don't we just nuke "**/*~" ???!!

            	++Sponge
            -->
        </delete>
	<!--
		Now we put the defaults back
	-->
	<defaultexcludes default="true"/>
    </target>

    <target name="webappDistclean">
        <ant dir="apps/i2ptunnel/java/" target="distclean" />
        <ant dir="apps/routerconsole/java/" target="distclean" />
        <ant dir="apps/addressbook/" target="distclean" />
        <ant dir="apps/susimail/" target="distclean" />
        <ant dir="apps/susidns/src/" target="distclean" />
        <ant dir="apps/i2psnark/java/" target="distclean" />
        <ant dir="apps/imagegen/" target="distclean" />
    </target>

    <target name="pkg" depends="distclean, updater, preppkg, installer" />

    <target name="pkg200" depends="distclean, updater200, preppkg, installer" />

    <target name="pkgclean" depends="deletepkg-temp">
        <delete>
            <fileset dir="." includes="i2p.tar.bz2 install.jar i2pupdate.zip i2pupdate200.zip" />
        </delete>
    </target>

    <target name="preppkg" depends="preppkg-linux, preppkg-freebsd, preppkg-osx, preppkg-windows, jbigi">
        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
        <copy todir="pkg-temp/lib/wrapper/solaris/">
            <fileset dir="installer/lib/wrapper/solaris/" excludes="*.txt" />
        </copy>
     <!-- Force using the new wrapper.jar.
          The new jar with the old windows binaries will output a warning on windows.
          We do not generate release files from this target.
          See preppkg-windows-only target below.
      -->
        <copy overwrite="true" file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
    </target>

    <target name="preppkg-nowindows" depends="preppkg-linux, preppkg-freebsd, preppkg-osx, jbigi-nowindows">
        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
        <copy todir="pkg-temp/lib/wrapper/solaris/">
            <fileset dir="installer/lib/wrapper/solaris/" excludes="*.txt" />
        </copy>
        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
    </target>

    <target name="preppkgRepack" depends="preppkg-linux, preppkg-freebsd, preppkg-osx, preppkg-windows, jbigi">
        <ant target="repack200" />
        <!-- no use doing repack200 on jbigi.jar -->
        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
        <copy todir="pkg-temp/lib/wrapper/solaris/">
            <fileset dir="installer/lib/wrapper/solaris/" excludes="*.txt" />
        </copy>
    </target>

    <target name="preppkg-freebsd" depends="preppkg-unix">
        <copy todir="pkg-temp/lib/wrapper/freebsd/">
            <fileset dir="installer/lib/wrapper/freebsd/" excludes="*.txt" />
        </copy>
        <copy todir="pkg-temp/lib/wrapper/freebsd64/">
            <fileset dir="installer/lib/wrapper/freebsd64" excludes="*.txt" />
        </copy>
    </target>

    <target name="preppkg-freebsd-only" depends="preppkg-freebsd, jbigi-freebsd-only" >
        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
    </target>

    <!-- only what is needed for debian, etc. -->
    <target name="preppkg-linux-only" depends="preppkg-linux, jbigi-linux-only" >
        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
    </target>

    <!-- This is the target called by debian/rules -->
    <target name="preppkg-unix" depends="preppkg-base, prep-script-translation" >
        <copy file="installer/resources/runplain.sh" todir="pkg-temp/" />
        <copy file="installer/resources/eepget" todir="pkg-temp/" />
        <copy file="installer/resources/i2prouter" todir="pkg-temp/" />
        <copy file="installer/resources/osid" todir="pkg-temp/" />
        <copy file="installer/resources/postinstall.sh" todir="pkg-temp/" />
        <copy todir="pkg-temp/man/">
            <fileset dir="installer/resources/man/" />
        </copy>
    </target>

    <target name="preppkg-linux" depends="preppkg-linux-x86,preppkg-linux-nonx86" />

    <target name="preppkg-linux-x86" depends="preppkg-unix">
        <copy todir="pkg-temp/lib/wrapper/linux/">
            <fileset dir="installer/lib/wrapper/linux/" excludes="*.txt" />
        </copy>
        <copy todir="pkg-temp/lib/wrapper/linux64/">
            <fileset dir="installer/lib/wrapper/linux64/" excludes="*.txt" />
        </copy>
    </target>

    <target name="preppkg-linux-nonx86" depends="preppkg-unix">
        <copy todir="pkg-temp/lib/wrapper/linux-ppc/">
            <fileset dir="installer/lib/wrapper/linux-ppc/" excludes="*.txt" />
        </copy>
        <copy todir="pkg-temp/lib/wrapper/linux-armv5/">
            <fileset dir="installer/lib/wrapper/linux-armv5/" excludes="*.txt" />
        </copy>
        <copy todir="pkg-temp/lib/wrapper/linux-armv6/">
            <fileset dir="installer/lib/wrapper/linux-armv6/" excludes="*.txt" />
        </copy>
    </target>

    <target name="preppkg-osx" depends="preppkg-unix">
        <!--<copy file="installer/resources/I2P Router Console.webloc" todir="pkg-temp/" />-->
        <copy todir="pkg-temp/Start I2P Router.app">
	    <fileset dir="installer/resources/Start I2P Router.app" />
	</copy>
        <copy todir="pkg-temp/lib/wrapper/macosx/">
            <fileset dir="installer/lib/wrapper/macosx/" excludes="*.txt" />
        </copy>
        <copy file="installer/resources/net.i2p.router.plist.template" todir="pkg-temp/" />
        <copy file="installer/resources/install_i2p_service_osx.command" todir="pkg-temp/" />
        <copy file="installer/resources/uninstall_i2p_service_osx.command" todir="pkg-temp/" />
    </target>

    <target name="preppkg-osx-only" depends="preppkg-osx, jbigi-osx-only" >
        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
    </target>

    <target name="preppkg-windows" depends="preppkg-base, preplicenses-windows, buildUtilityJar, buildexe">
        <copy file="build/i2p.exe" todir="pkg-temp/" failonerror="false" />
        <copy file="installer/resources/eepget.bat" todir="pkg-temp/" />
        <copy file="installer/resources/i2prouter.bat" todir="pkg-temp/" />
        <copy file="installer/resources/fixperms.bat" todir="pkg-temp/" />
        <copy file="installer/resources/install_i2p_service_winnt.bat" todir="pkg-temp/" />
        <copy file="installer/resources/set_config_dir_for_nt_service.bat" todir="pkg-temp/" />
        <copy file="installer/resources/uninstall_i2p_service_winnt.bat" todir="pkg-temp/" />
        <copy file="build/utility.jar" todir="pkg-temp" />
        <copy todir="pkg-temp/lib/wrapper/win32/">
            <fileset dir="installer/lib/wrapper/win32/" excludes="*.txt" />
        </copy>
        <copy todir="pkg-temp/lib/wrapper/win64/">
            <fileset dir="installer/lib/wrapper/win64/" excludes="*.txt" />
        </copy>
    </target>

    <target name="preppkg-windows-only" depends="preppkg-windows, jbigi-windows-only">
        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
     <!-- Win binaries are down-rev from the others, so use the old jar.
          This will not overwrite, so preppkg (for all OSes) will get the new jar with
          the old binaries, which will probably work but will output a warning.
          The windows-only installer will get the correct jar.
        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
      -->
        <copy overwrite="true" file="installer/lib/wrapper/win-all/wrapper.jar" todir="pkg-temp/lib" />
    </target>

    <!-- see targets below for conditional copying -->
    <target name="preppkg-base" depends="build, preplicenses, prepConsoleDocs, prepthemeupdates, prepCertificates, prepRouterInfos, copyjetty, copytomcat-unlesspkg, copyjstl-unlesspkg, copystandard-unlesspkg, copyflags, truncatehistory">
        <!-- if updater200 was run previously, it left *.pack files in pkg-temp -->
        <!-- Also remove deletelist.txt used for updater only -->
        <delete>
            <fileset dir="pkg-temp" includes="**/*.jar.pack **/*.war.pack deletelist.txt" />
        </delete>
        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
        <copy file="build/router.jar" todir="pkg-temp/lib/" />
        <copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
        <!-- Updated in 0.9.28; name without version so we can overwrite if we upgrade  -->
        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
        <copy file="build/systray.jar" todir="pkg-temp/lib" />
        <copy file="build/i2psnark.jar" todir="pkg-temp/lib/" />
        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
        <copy file="build/addressbook.jar" todir="pkg-temp/lib/" />
        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
        <copy file="build/imagegen.war" todir="pkg-temp/webapps/" />
        <copy file="build/jsonrpc.war" todir="pkg-temp/webapps/" />
        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
        <copy file="apps/i2psnark/i2psnark.config" todir="pkg-temp/" />
        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
        <copy file="installer/resources/clients.config" todir="pkg-temp/" />
        <copy file="installer/resources/i2ptunnel.config" todir="pkg-temp/" />
        <copy file="installer/resources/wrapper.config" todir="pkg-temp/" />
        <copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
        <copy file="INSTALL-headless.txt" todir="pkg-temp/" />
        <mkdir dir="pkg-temp/scripts" />
        <copy file="apps/proxyscript/i2pProxy.pac" todir="pkg-temp/scripts/" />
        <copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
        <copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
        <copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
        <copy file="installer/resources/uninstall.ico" todir="pkg-temp/docs/" />
        <!-- Eepsite stuff here -->
        <mkdir dir="pkg-temp/eepsite" />
        <copy todir="pkg-temp/eepsite/" >
            <fileset dir="installer/resources/eepsite/" excludes="**/.placeholder" />
        </copy>
        <copy file="installer/resources/themes/console/images/favicon.ico" tofile="pkg-temp/eepsite/docroot/favicon.ico" />
    </target>

    <target name="copyflags" depends="copyflags-unlesspkg" >
        <copy todir="pkg-temp/eepsite/docroot/help/lib/" >
            <fileset dir="installer/resources/icons/flags16x11" includes="lang_ar.png" />
        </copy>
    </target>

    <target name="copyflags-unlesspkg" unless="${with-famfamfam-flag-png}" >
        <copy todir="pkg-temp/eepsite/docroot/help/lib/" >
            <fileset dir="installer/resources/icons/flags/" includes="az.png cn.png de.png es.png fr.png hu.png id.png ir.png it.png jp.png nl.png pl.png pt.png ro.png ru.png se.png tr.png us.png" />
        </copy>
        <copy todir="pkg-temp/docs/icons/flags" >
          <!-- base flags/ dir only. flags16x11/ dir already copied by prepConsoleDocs target -->
          <fileset dir="installer/resources/icons/flags" />
        </copy>
    </target>

    <target name="copyjetty" depends="copyjetty-unlesspkg" >
        <copy file="build/jetty-i2p.jar" todir="pkg-temp/lib" />
    </target>

    <target name="copyjetty-unlesspkg" unless="${with-libjetty9-java}" >
        <copy todir="pkg-temp/lib" >
            <fileset dir="build" includes="javax.servlet.jar jetty*.jar org.mortbay.*.jar" excludes="jetty-i2p.jar" />
        </copy>
    </target>

    <target name="settomcatprop" >
        <condition property="with-libtomcat-java" >
            <or>
                <istrue value="${with-libtomcat6-java}" />
                <istrue value="${with-libtomcat7-java}" />
                <istrue value="${with-libtomcat8-java}" />
                <istrue value="${with-libtomcat9-java}" />
            </or>
        </condition>
    </target>

    <target name="copytomcat-unlesspkg" depends="settomcatprop" unless="${with-libtomcat-java}" >
        <copy todir="pkg-temp/lib" >
            <fileset dir="build" includes="commons*.jar jasper*.jar javax*.jar" />
        </copy>
    </target>

    <!--
       jstl.jar
       glassfish-javaee.jar has ancient and conflicting classes, e.g. javax.mail,
       and libjstl1.1-java isn't sufficient,
       so we only skip it with libtaglibs-standard
    -->
    <target name="copyjstl-unlesspkg" unless="${with-libtaglibs-standard}" >
        <copy file="apps/susidns/src/lib/jstl.jar" todir="pkg-temp/lib/" />
    </target>

    <!-- standard.jar -->
    <target name="copystandard-unlesspkg" depends="copystandard-unlesspkg1, copystandard-unlesspkg2" />
    <target name="copystandard-unlesspkg1" >
        <condition property="with-any-standard-pkg" >
            <or>
                <istrue value="${with-libtaglibs-standard}" />
                <istrue value="${with-glassfish-javaee}" />
                <istrue value="${libjakarta-taglibs-standard-java}" />
            </or>

        </condition>
    </target>
    <target name="copystandard-unlesspkg2" unless="${with-any-standard-pkg}" >
        <copy file="apps/susidns/src/lib/standard.jar" todir="pkg-temp/lib/" />
    </target>

    <!-- does NOT include launch4j licenses for Windows builds -->
    <target name="preplicenses" depends="preplicenses-unlesspkg" >
        <copy file="LICENSE.txt" todir="pkg-temp/" />
        <copy todir="pkg-temp/licenses/" >
          <fileset dir="licenses/" />
        </copy>
        <copy file="apps/imagegen/identicon/README.md" tofile="pkg-temp/licenses/LICENSE-Identicon.txt" />
        <copy file="apps/desktopgui/LICENSE" tofile="pkg-temp/licenses/LICENSE-DesktopGUI.txt" />
    </target>

    <target name="preplicenses-unlesspkg" depends="settomcatprop" unless="${with-libtomcat-java}" >
        <copy file="apps/jetty/apache-tomcat-${tomcat.ver}/NOTICE" tofile="pkg-temp/licenses/NOTICE-Tomcat.txt" />
    </target>

    <!-- DOES include launch4j licenses for Windows builds -->
    <target name="preplicenses-windows" depends="preplicenses">
        <!--
              The license in launch4j/ is a BSD license for launch4j
              The license in launch4j/head is a MIT license for the code that is actually wrapped around the jars
              So we include the MIT one in our binary package
         -->
        <copy file="installer/lib/launch4j/head/LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Launch4j.txt" />
        <!--  Not sure if these are used or should be included -->
        <copy file="installer/lib/launch4j/lib/foxtrot.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-Foxtrot.txt" />
        <copy file="installer/lib/launch4j/lib/JGoodies.Forms.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-JGoodies-Forms.txt" />
        <copy file="installer/lib/launch4j/lib/JGoodies.Looks.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-JGoodies-Looks.txt" />
        <copy file="installer/lib/launch4j/lib/XStream.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-XStream.txt" />
    </target>

    <target name="prepthemeupdates">
        <copy todir="pkg-temp/docs/themes/" >
            <fileset dir="installer/resources/themes/" />
        </copy>
    </target>

    <!-- SSL Certs -->
    <target name="prepCertificates" depends="buildCore">
        <copy todir="pkg-temp/certificates/" >
          <fileset dir="installer/resources/certificates/" />
        </copy>
        <java classname="net.i2p.crypto.CertUtil" fork="true" failonerror="true">
            <classpath>
                <pathelement location="build/i2p.jar" />
            </classpath>
            <arg value="checkall" />
            <arg value="pkg-temp/certificates" />
        </java>
    </target>

    <condition property="no.bundle.routerInfos">
        <isfalse value="${bundle.routerInfos}" />
    </condition>

    <target name="prepRouterInfos" depends="buildrouter, buildTools" unless="no.bundle.routerInfos">
        <delete dir="pkg-temp/netDb" />
        <mkdir dir="pkg-temp/netDb" />
        <java classname="net.i2p.router.networkdb.kademlia.BundleRouterInfos" fork="true" failonerror="true">
            <classpath>
                <pathelement location="build/i2p.jar" />
                <pathelement location="core/java/build/gnu-getopt.jar" />
                <pathelement location="build/router.jar" />
                <pathelement location="build/tools.jar" />
            </classpath>
            <arg value="-i" />
            <arg value="${bundle.routerInfos.i2pConfigDir}" />
            <arg value="-o" />
            <arg value="pkg-temp/netDb" />
            <arg value="-c" />
            <arg value="${bundle.routerInfos.count}" />
        </java>
    </target>

    <target name="-areRouterInfosEnabled">
        <fail message="Option requires &quot;bundle.routerInfos&quot; to be configured. Please read &quot;build.properties&quot; for more info." >
            <condition>
                <isfalse value="${bundle.routerInfos}" />
            </condition>
        </fail>
    </target>

    <target name="i2pseeds" depends="-setepoch, -areRouterInfosEnabled, prepRouterInfos">
        <delete file="i2pseeds.zip" />
        <delete file="i2pseeds.su3" />
        <zip destfile="i2pseeds.zip" basedir="pkg-temp/netDb" whenempty="fail" />
        <su3sign infile="i2pseeds.zip" sigtype="RESEED" outfile="i2pseeds.su3" su3.ver="${epoch}" />
    </target>

    <!-- this is no longer required, izpack 4.3.0 supports headless installs with java -jar i2pinstall.exe -console -->
    <!-- and this is no longer used by the SlackBuild -->
    <target name="tarball" depends="preppkg">
        <tar compression="bzip2" destfile="i2p.tar.bz2">
            <tarfileset dir="pkg-temp" includes="**/*" prefix="i2p" />
        </tar>
    </target>

    <target name="deletepkg-temp">
        <delete dir="pkg-temp" />
        <delete dir="./pkg-mavencentral" />
    </target>

    <!-- readme and proxy error page files, initialNews.xml files, GeoIP files, and flag icons -->
    <target name="prepConsoleDocs" depends="prepConsoleDocUpdates, prepgeoupdate" >
        <copy todir="pkg-temp/docs/initialNews/">
          <fileset dir="installer/resources/initialNews/" />
        </copy>
        <!-- ensure the proxy files have the correct line endings -->
        <fixcrlf srcdir="pkg-temp/docs" includes="*.ht" encoding="utf8" eol="crlf" />
    </target>

    <!-- readme and proxy error page files -->
    <target name="prepConsoleDocUpdates">
        <copy todir="pkg-temp/docs/" >
          <fileset dir="installer/resources/readme/" includes="readme*.html" />
          <fileset dir="installer/resources/proxy/" includes="*.ht" />
          <!--
               As of 0.9.36:
               All new and changed flags must go in the flags16x11/ dir,
               which will be checked first by flags.jsp.
               The flags/ dir is the original set from famfamfam,
               which may be symlinked in package installs.
           -->
          <fileset dir="installer/resources/" includes="icons/flags16x11/*" />
        </copy>
    </target>

    <target name="consoleDocs" depends="deletepkg-temp, prepConsoleDocs">
        <zip destfile="docs.zip" basedir="pkg-temp" whenempty="fail" />
    </target>

    <target name="copyJavadoc" depends="javadoc">
        <copy todir="pkg-temp/docs/javadoc" >
          <fileset dir="build/javadoc/" />
        </copy>
    </target>

    <target name="updater200" depends="prepupdate, preplicenses, pack200, zipit200" />
    <target name="updater200WithJetty" depends="prepjupdate, preplicenses, pack200, zipit200" />
    <target name="updater200WithJettyAndJbigi" depends="prepjupdate, prepjbigiupdate, preplicenses, pack200, zipit200" />
    <target name="updater200WithJettyAndGeoIP" depends="prepjupdate, prepgeoupdate, preplicenses, pack200, zipit200" />
    <target name="updater200WithJettyFixes" depends="prepjupdatefixes, preplicenses, pack200, zipit200" />
    <target name="updater200WithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, pack200, zipit200" />
    <target name="updater200WithJbigi" depends="prepupdate, prepjbigiupdate, preplicenses, pack200, zipit200" />
    <target name="updater" depends="prepupdate, preplicenses, zipit" />
    <target name="updaterRepack" depends="prepupdate, preplicenses, repack200, zipit" />
    <target name="updaterWithJavadoc" depends="prepupdate, preplicenses, copyJavadoc, zipit" />
    <target name="updater200WithJavadoc" depends="prepupdate, preplicenses, copyJavadoc, pack200, zipit200" />
    <target name="updaterWithJavadocAndJetty" depends="prepjupdate, preplicenses, copyJavadoc, zipit" />
    <target name="updater200WithJavadocAndJetty" depends="prepjupdate, preplicenses, copyJavadoc, pack200, zipit200" />
    <target name="updaterWithGeoIP" depends="prepupdate, prepgeoupdate, preplicenses, zipit" />
    <target name="updaterWithJetty" depends="prepjupdate, preplicenses, zipit" />
    <target name="updaterWithJettyRepack" depends="prepjupdate, preplicenses, repack200, zipit" />
    <target name="updaterWithJettyAndJbigiRepack" depends="prepjupdate, prepjbigiupdate, preplicenses, repack200, zipit" />
    <target name="updaterWithJettyAndGeoIPRepack" depends="prepjupdate, prepgeoupdate, preplicenses, repack200, zipit" />
    <target name="updaterWithJettyFixes" depends="prepjupdatefixes, preplicenses, zipit" />
    <target name="updaterWithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, zipit" />
    <target name="updaterWithJettyFixesAndGeoIP" depends="prepjupdatefixes, prepgeoupdate, preplicenses, zipit" />
    <target name="updaterWithJbigi" depends="prepupdate, prepjbigiupdate, preplicenses, zipit" />
    <target name="updaterSmall" depends="prepupdateSmall, zipit" />
    <target name="updaterRouter" depends="prepupdateRouter, zipit" />

    <target name="-sign-update" depends="buildrouter">
        <su3sign infile="i2pupdate200.zip" sigtype="ROUTER" outfile="i2pupdate.su3" su3.ver="${full.version}" />
    </target>

    <target name="signed-updater200" depends="-pre-sign, updater200, -sign-update" />
    <target name="signed-updater200WithJetty" depends="-pre-sign, updater200WithJetty, -sign-update" />
    <target name="signed-updater200WithJettyAndGeoIP" depends="-pre-sign, updater200WithJettyAndGeoIP, -sign-update" />
    <target name="signed-updater200WithJavadoc" depends="-pre-sign, updater200WithJavadoc, -sign-update" />
    <target name="signed-updater200WithJavadocAndJetty" depends="-pre-sign, updater200WithJavadocAndJetty, -sign-update" />

    <target name="zipit" depends="getReleaseNumber">
        <!--
             As of release 0.8.8, the router will enforce a zipfile comment equal to the
             version number in the sud/su2 header, since the version in the header is NOT
             covered by the signature.
         -->
        <zip destfile="i2pupdate.zip" basedir="pkg-temp" whenempty="fail" comment="${release.number}" />
       <!-- just a test, makes almost no difference
        <tar destfile="i2pupdate.tgz" basedir="pkg-temp" compression="gzip" />
        <tar destfile="i2pupdate.tbz" basedir="pkg-temp" compression="bzip2" />
       -->
    </target>

    <target name="zipit200" depends="getReleaseNumber" >
        <zip destfile="i2pupdate200.zip" basedir="pkg-temp" whenempty="fail" comment="${release.number}" />
    </target>

    <target name="pack200">
        <!-- pack200 will only pack to a .pack file, and only from a .jar file, so we put another .jar on the end -->
        <!-- can't pack an empty jar or one without classes, it will fail to unpack on Java 5;
          -  see http://bugs.sun.com/view_bug.do?bug_id=6712743
          -->
        <!-- *nix here -->
        <exec executable="sh" osfamily="unix" failonerror="true">
            <arg value="-c" />
            <arg value="for i in pkg-temp/lib/*.jar pkg-temp/webapps/*war; do if [ $i = pkg-temp/lib/commons-logging.jar -o $i = pkg-temp/lib/jasper-compiler.jar -o $i = pkg-temp/lib/jbigi.jar -o $i = pkg-temp/lib/jetty-java5-threadpool.jar -o $i = pkg-temp/lib/jetty-sslengine.jar -o $i = pkg-temp/webapps/addressbook.war ]; then continue; fi; echo pack200 $i; mv $i $i.jar; pack200 -g $i.pack $i.jar; rm -f $i.jar; done" />
        </exec>
        <exec executable="sh" osfamily="mac" failonerror="true">
            <arg value="-c" />
            <arg value="for i in pkg-temp/lib/*.jar pkg-temp/webapps/*war; do if [ $i = pkg-temp/lib/commons-logging.jar -o $i = pkg-temp/lib/jasper-compiler.jar -o $i = pkg-temp/lib/jbigi.jar -o $i = pkg-temp/lib/jetty-java5-threadpool.jar -o $i = pkg-temp/lib/jetty-sslengine.jar -o $i = pkg-temp/webapps/addressbook.war ]; then continue; fi; echo pack200 $i; mv $i $i.jar; pack200 -g $i.pack $i.jar; rm -f $i.jar; done" />
        </exec>
        <!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
        <exec executable="cmd" osfamily="windows" failonerror="true">
            <arg value="/c" />
            <!-- TODO implement fix above -->
            <arg value="for %i in (pkg-temp\webapps\*.war) do move %i %i.jar &amp;&amp; pack200 -g pkg-temp\webapps\%~ni.war.pack %i.jar &amp;&amp; del %i.jar" />
        </exec>
        <exec executable="cmd" osfamily="windows" failonerror="true">
                <arg value="/c" />
                <arg value="for %i in (pkg-temp\lib\*.jar) do pack200 -g %i.pack %i &amp;&amp; del %i" />
        </exec>
    </target>

    <!-- saves about 1% on average (more on jars with multiple compiled po files since they have lots of common strings) -->
    <target name="repack200">
        <!-- pack200 will only repack a .jar file, so we put another .jar on the end -->
        <!-- *nix here -->
        <exec executable="sh" osfamily="unix" failonerror="true">
            <arg value="-c" />
            <arg value="for i in pkg-temp/lib/*.jar pkg-temp/webapps/*war; do echo pack200 -r $i; mv $i $i.jar; pack200 -r $i.jar; mv $i.jar $i; done" />
        </exec>
        <exec executable="sh" osfamily="mac" failonerror="true">
            <arg value="-c" />
            <arg value="for i in pkg-temp/lib/*.jar pkg-temp/webapps/*war; do echo pack200 -r $i; mv $i $i.jar; pack200 -r $i.jar; mv $i.jar $i; done" />
        </exec>
        <!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
        <exec executable="cmd" osfamily="windows" failonerror="true">
            <arg value="/c" />
            <arg value="for %i in (pkg-temp\webapps\*.war) do move %i %i.jar &amp;&amp; pack200 -r %i.jar &amp;&amp; move %i.jar %i" />
        </exec>
        <exec executable="cmd" osfamily="windows" failonerror="true">
                <arg value="/c" />
                <arg value="for %i in (pkg-temp\lib\*.jar) do pack200 -r %i" />
        </exec>
    </target>

    <target name="prepupdate" depends="build2, prepupdateSmall, prepConsoleDocUpdates, prepCertificates, prep-script-translation, truncatehistory">
        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
        <copy file="build/i2psnark.jar" todir="pkg-temp/lib" />
        <!-- include systray changes in 0.7.5 -->
        <copy file="build/systray.jar" todir="pkg-temp/lib/" />
       <!-- removed from updater in 0.9, added back in 0.9.26 -->
        <copy file="build/desktopgui.jar" todir="pkg-temp/lib/" />
        <copy file="build/susimail.war" todir="pkg-temp/webapps/" />
        <copy file="build/susidns.war" todir="pkg-temp/webapps/" />
        <copy file="build/imagegen.war" todir="pkg-temp/webapps/" />
        <copy file="build/jsonrpc.war" todir="pkg-temp/webapps/" />
        <!-- as of 0.7.12; last changed in 0.9; removed from update in 0.9.26 -->
      <!--
        <copy file="apps/susidns/src/lib/jstl.jar" todir="pkg-temp/lib/" />
        <copy file="apps/susidns/src/lib/standard.jar" todir="pkg-temp/lib/" />
       -->
        <copy file="build/i2psnark.war" todir="pkg-temp/webapps/" />
        <copy file="installer/resources/deletelist.txt" todir="pkg-temp/" />
        <copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
        <copy todir="pkg-temp/man/">
            <fileset dir="installer/resources/man/" />
        </copy>
    </target>

    <target name="truncatehistory">
        <copy file="history.txt" todir="pkg-temp/" />
        <!-- the following overwrites history.txt on unix to shrink the update file -->
        <copy file="history.txt" tofile="pkg-temp/history.txt" overwrite="true">
            <filterchain>
                <headfilter lines="1500" />
            </filterchain>
        </copy>
        <concat append="true" destfile="pkg-temp/history.txt">&#10;&#10;----------------&#10;&#10;EARLIER HISTORY IS AVAILABLE IN THE SOURCE PACKAGE</concat>
    </target>

    <target name="prepupdateSmall" depends="buildSmall, prepupdateRouter, prepjupdatefixes, prepthemeupdates">
        <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
        <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
        <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
        <copy file="build/routerconsole.jar" todir="pkg-temp/lib/" />
        <!-- Updated in 0.9.28 -->
        <!-- name without version so we can overwrite if we upgrade  -->
        <copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
        <copy file="build/i2ptunnel.war" todir="pkg-temp/webapps/" />
        <copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
        <copy file="build/addressbook.jar" todir="pkg-temp/lib/" />
        <copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
        <!-- decapitalized the file in 0.7.8 -->
        <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
        <copy file="installer/resources/continents.txt" todir="pkg-temp/geoip/" />
      <!--
        <copy file="installer/resources/public-suffix-list.txt" todir="pkg-temp/geoip/" />
       -->
    </target>

    <target name="prepupdateRouter" depends="buildrouter, deletepkg-temp">
        <copy file="build/i2p.jar" todir="pkg-temp/lib/" />
        <copy file="build/router.jar" todir="pkg-temp/lib/" />
    </target>

    <!-- jbigi.jar -->
    <target name="prepjbigiupdate" depends="jbigi">
        <copy file="build/jbigi.jar" todir="pkg-temp/lib/" />
    </target>

    <!-- GeoIP files -->
    <target name="prepgeoupdate" depends="prepgeoupdate-unlesspkg" >
        <copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
        <copy file="installer/resources/continents.txt" todir="pkg-temp/geoip/" />
      <!--
        <copy file="installer/resources/public-suffix-list.txt" todir="pkg-temp/geoip/" />
       -->
    </target>

    <!-- GeoIP files, set withGeoIPDatabase=true in override.properties to prevent -->
    <!-- As of 0.9.26, the files are not included in Debian/Ubuntu builds. -->
    <target name="prepgeoupdate-unlesspkg" unless="${with-geoip-database}" >
        <mkdir dir="pkg-temp/geoip" />
      <!--
        <copy file="installer/resources/geoip.txt" todir="pkg-temp/geoip/" />
        <copy file="installer/resources/geoipv6.dat.gz" todir="pkg-temp/geoip/" />
       -->
        <gunzip src="installer/resources/GeoLite2-Country.mmdb.gz" dest="pkg-temp/geoip/GeoLite2-Country.mmdb" />
    </target>

    <!-- All jetty jars required for update.
         TODO do we need to bother updating jasper?
      -->
    <target name="prepjupdate" depends="prepupdate, buildWEB">
        <copy todir="pkg-temp/lib" >
            <fileset dir="build" includes="commons*.jar jasper*.jar javax*.jar jetty*.jar jsp*.jar org.mortbay.*.jar" />
        </copy>
        <!--  We have to package the new eepsite files for MigrateJetty.java, but we
              can't overwrite an existing eepsite dir in a non-split configuration.
          -->
        <copy todir="pkg-temp/eepsite-jetty9" >
            <fileset dir="installer/resources/eepsite" includes="*.xml contexts/* etc/*" />
        </copy>
    </target>

    <target name="delete-j6-update">
        <delete dir="pkg-temp/eepsite-jetty9" />
    </target>

    <!-- Jetty 6 I2P logging addons, not really fixes -->
    <target name="prepjupdatefixes" depends="buildWEB">
        <copy file="build/jetty-i2p.jar" todir="pkg-temp/lib/" />
    </target>

    <target name="util-list-changes" depends="checkForMtn" if="mtn.available" >
        <exec executable="mtn" outputproperty="workspace.changes.util" errorproperty="mtn.error.util" failifexecutionfails="false" >
            <arg value="list" />
            <arg value="changed" />
            <arg value="core/java/src/net/i2p/util" />
        </exec>
        <!-- \n in an attribute value generates an invalid manifest -->
        <exec executable="tr" inputstring="${workspace.changes.util}" outputproperty="workspace.changes.util.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
            <arg value="-s" />
            <arg value="[:space:]" />
            <arg value="," />
        </exec>
    </target>

    <target name="izpack-patches" >
            <taskdef name="izpack"
                     classpath="${basedir}/installer/lib/izpack/patches.jar:${basedir}/installer/lib/izpack/standalone-compiler.jar"
                     classname="com.izforge.izpack.ant.IzPackTask" />
        <jar destfile="${basedir}/installer/lib/izpack/patches.jar"
             basedir="${basedir}/installer/lib/izpack/patches" />
    </target>

    <target name="buildUtilityJar" depends="buildCore">
        <ant dir="installer/java" target="build" />
    </target>

    <!-- IzPack 4 -->
    <target name="installer" depends="preppkg, buildProperties, util-list-changes, izpack-patches, buildUtilityJar" >
        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
        <ant target="installerexe" />
    </target>

    <!-- IzPack 5 -->
    <target name="ensureIzpack5" >
        <!-- set if unset -->
        <property name="izpack5.home" value="${user.home}/IzPack" />
        <condition property="izpack5.available" >
            <available file="${izpack5.home}" type="dir" />
        </condition>
        <fail message="Error - IzPack 5.1.x must be installed at ${izpack5.home}, or set izpack5.home=/PATH/TO/IzPack in override.properties, or download from http://izpack.org/downloads/ and install" >
            <condition>
                <not>
                    <isset property="izpack5.available" />
                </not>
            </condition>
        </fail>
        <path id="izpack5.lib.path">
            <fileset dir="${izpack5.home}/lib" includes="*.jar"/>
        </path>
        <taskdef name="izpack5"
                 classpathref="izpack5.lib.path"
                 classname="com.izforge.izpack.ant.IzPackTask" />
    </target>

    <target name="izpack5-patches" depends="ensureIzpack5, buildProperties" >
        <ant dir="installer/lib/izpack5/patches/java/" target="jar" />
    </target>

    <target name="installer5" depends="izpack5-patches, preppkg, buildProperties, util-list-changes, buildUtilityJar" >
        <izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
        <ant target="installer5exe" />
    </target>

    <!-- This makes i2pinstall.exe from install.jar using the bundled launch4j.
         Warning: launch4j-created files CANNOT be Windows-signed.
         They will be corrupted.
      -->
    <target name="installerexe" depends="launch4j" unless="noExe">
        <echo message="See the file &quot;build.properties&quot; if this step fails." />
        <!-- now the installer exe -->
        <launch4j configFile="./installer/i2pinstaller.xml" />
        <!-- thazzit -->
    </target>

    <!-- This makes i2pinstall.exe from install.jar using IzPack5's izpack2exe.py (not bundled)
         izpack2exe-created files CAN be Windows-signed.
      -->
    <target name="installer5exe" unless="noExe">
        <!-- You must have the optional IzPack utils installed for this -->
        <!-- izpack doesn't come with +x permission when installed -->
        <chmod type="file" file="${izpack5.home}/utils/wrappers/izpack2exe/7za" perm="+x" />
        <chmod type="file" file="${izpack5.home}/utils/wrappers/izpack2exe/izpack2exe.py" perm="+x" />
        <!--
             Note that we must specify the 7za path to use the one from IzPack, which is very old.
             Either 7zr (from Debian package p7zip) or 7za (from Debian package p7zip-full)
             will work, but ONLY if the 7za/7zr command line is changed in izpack2exe.py
             as follows, because their default is LZMA2, which dosn't work on Windows.
             So we don't want any Debian 7za picked up in the PATH.
             See /usr/share/doc/p7zip/DOC/MANUAL/cmdline/switches/method.htm
             old:
             p7zcmd = '"%s" a -mmt -t7z -mx=9 installer.7z "%s"' % (p7z, files)
             new:
             p7zcmd = '"%s" a -mmt -t7z -mx=9 -m0=LZMA installer.7z "%s"' % (p7z, files)

             We also use IzPack's customized 7zS.sfx file, which uses a customized icon
             (but not our icon, sadly)

             More info: https://izpack.atlassian.net/wiki/spaces/IZPACK/pages/491541/IzPack+Utilities
         -->
        <exec executable="${izpack5.home}/utils/wrappers/izpack2exe/izpack2exe.py" failonerror="true">
            <arg value="--file=${basedir}/install.jar" />
            <arg value="--with-7z=${izpack5.home}/utils/wrappers/izpack2exe/7za" />
            <arg value="--no-upx" />
            <arg value="--output=${basedir}/i2pinstall.exe" />
        </exec>
    </target>

    <!-- Custom installers -->
    <!-- IzPack 4 -->
    <target name="installer-nowindows" depends="clean, preppkg-nowindows, izpack-patches" >
        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}.jar" installerType="standard" basedir="${basedir}" />
    </target>

    <!-- IzPack 5 -->
    <target name="installer5-nowindows" depends="clean, izpack5-patches, preppkg-nowindows" >
        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
        <izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/i2pinstall_${full.version}.jar" installerType="standard" basedir="${basedir}" />
    </target>


    <target name="installer-freebsd" depends="clean, preppkg-freebsd-only, izpack-patches" >
        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_freebsd-only.jar" installerType="standard" basedir="${basedir}" />
    </target>

    <!-- IzPack 4 -->
    <target name="installer-linux" depends="clean, preppkg-linux-only, izpack-patches" >
        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_linux-only.jar" installerType="standard" basedir="${basedir}" />
    </target>

    <!-- IzPack 5 -->
    <target name="installer5-linux" depends="clean, izpack5-patches, preppkg-linux-only" >
        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
        <izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/i2pinstall_${full.version}_linux-only.jar" installerType="standard" basedir="${basedir}" />
    </target>


    <target name="installer-osx" depends="clean, checkForIzpack2App, preppkg-osx-only, izpack-patches">
        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
        <mkdir dir="pkg-temp/osx" />
        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_osx-only.jar" installerType="standard" basedir="${basedir}" />
        <ant target="installer2app" />
        <delete dir="pkg-temp/osx" />
    </target>

    <target name="checkForIzpack2App">
        <!-- we'll set the izpack2app binary name if it's not been set elsewhere yet -->
        <property name="izpack2app.binary" value="${user.home}/IzPack/utils/wrappers/izpack2app/izpack2app.py" />
        <available property="izpack2app.available" file="${izpack2app.binary}" />
    </target>

    <target name="installer2app" if="izpack2app.available">
        <mkdir dir="pkg-temp/osx" />
        <exec executable="python" failonerror="true">
            <arg value="${izpack2app.binary}" />
            <arg value="${basedir}/i2pinstall_${full.version}_osx-only.jar" />
            <arg value="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" />
        </exec>

        <tar longfile="gnu" destfile="${basedir}/i2pinstall_${full.version}_osx.tar.bz2" compression="bzip2">
            <tarfileset dir="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" prefix="/i2p-${full.version}_osx-install.app" filemode="644">
                <include name="**/**" />
                <exclude name="Contents/MacOS/*" />
            </tarfileset>
            <tarfileset dir="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" prefix="/i2p-${full.version}_osx-install.app" filemode="755">
                <include name="Contents/MacOS/*" />
            </tarfileset>
        </tar>
    </target>

    <!-- call between installer-xxx and installer-windows -->
    <target name="delete-nonwindows">
        <delete dir="pkg-temp/lib/wrapper/" />
        <delete dir="pkg-temp/locale/" />
        <delete dir="pkg-temp/man/" />
        <delete dir="pkg-temp/Start I2P Router.app/" />
        <delete dir="pkg-temp" includes="eepget i2prouter INSTALL-headless.txt osid postinstall.sh runplain.sh" />
    </target>

    <!-- IzPack 4 -->
    <target name="installer-windows" depends="clean, preppkg-windows-only, util-list-changes, izpack-patches, buildUtilityJar" >
        <fixcrlf srcdir="pkg-temp" includes="*.config *.bat *.cmd **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="crlf"/>
        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
        <ant target="installerexe" />
        <delete file="${basedir}/install.jar" />
        <move file="${basedir}/i2pinstall.exe" tofile="${basedir}/i2pinstall_${full.version}_windows.exe" />
    </target>

    <!-- IzPack 5 -->
    <target name="installer5-windows" depends="clean, izpack5-patches, preppkg-windows-only, util-list-changes, buildUtilityJar" >
        <fixcrlf srcdir="pkg-temp" includes="*.config *.bat *.cmd **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="crlf"/>
        <izpack5 input="${basedir}/installer/install5.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
        <ant target="installer5exe" />
        <delete file="${basedir}/install.jar" />
        <move file="${basedir}/i2pinstall.exe" tofile="${basedir}/i2pinstall_${full.version}_windows.exe" />
    </target>

    <!-- this is broken as installer-xxx targets may delete (or not delete) things in pkg-temp -->
    <target name="installer-all" depends="installer-freebsd, installer-linux, installer-osx, installer-windows, installer-nowindows, installer" >
    </target>
    <!-- end custom installers -->

    <!-- unit tests -->
    <target name="buildCoreTest">
        <ant dir="core/java/" target="jarTest" />
    </target>
    <target name="buildRouterTest" depends="buildCoreTest">
        <ant dir="router/java/" target="jarTest" />
    </target>
    <target name="buildTest" depends="buildRouterTest">
        <copy file="core/java/build/i2ptest.jar" todir="build" />
        <copy file="router/java/build/routertest.jar" todir="build" />
        <!-- broken -->
      <!--
        <ant dir="apps/ministreaming/java/" target="junit.compileTest" />
        <ant dir="apps/streaming/java/" target="junit.compileTest" />
       -->
    </target>
    <target name="prepTest" depends="prepupdate, buildTest">
        <!-- overwrite i2p.jar and router.jar with the test versions -->
        <copy file="build/i2ptest.jar" tofile="pkg-temp/lib/i2p.jar" overwrite="true" />
        <copy file="build/routertest.jar" tofile="pkg-temp/lib/router.jar" overwrite="true" />
    </target>
    <target name="updateTest" depends="prepTest, zipit" />
    <target name="junit.test" depends="buildProperties, jbigi" >
        <ant dir="core/java/" target="junit.test" />
        <ant dir="router/java/" target="junit.test" />
        <ant dir="apps/ministreaming/java/" target="junit.test" />
        <ant dir="apps/streaming/java/" target="junit.test" />
    </target>
    <target name="scalatest.test" depends="buildProperties, jbigi" >
        <ant dir="core/java/" target="scalatest.test" />
        <!-- note there are no router scala tests yet -->
        <ant dir="router/java/" target="scalatest.test" />
    </target>
    <!-- both junit and scala -->
    <target name="test" depends="testCore, testRouter, testMinistreaming, testStreaming" />
    <target name="testCore" depends="buildProperties, jbigi" >
        <ant dir="core/java/" target="test" />
    </target>
    <target name="testRouter" depends="buildProperties, jbigi" >
        <ant dir="router/java/" target="test" />
    </target>
    <target name="testMinistreaming" depends="buildProperties, jbigi" >
        <ant dir="apps/ministreaming/java/" target="test" />
    </target>
    <target name="testStreaming" depends="buildProperties" >
        <ant dir="apps/streaming/java/" target="test" />
    </target>
    <target name="scalatest.report" depends="buildProperties" >
        <ant dir="core/java/" target="scalatest.report" />
        <ant dir="router/java/" target="scalatest.report" />
    </target>
    <target name="junit.report" depends="buildProperties" >
        <ant dir="core/java/" target="junit.report" />
        <ant dir="router/java/" target="junit.report" />
        <ant dir="apps/ministreaming/java/" target="junit.report" />
        <ant dir="apps/streaming/java/" target="junit.report" />
    </target>
    <target name="clover.report" depends="buildProperties" if="with.clover">
        <ant dir="core/java/" target="clover.report" />
        <ant dir="router/java/" target="clover.report" />
        <ant dir="apps/ministreaming/java" target="clover.report" />
        <ant dir="apps/streaming/java" target="clover.report" />
    </target>
    <target name="cobertura.report" depends="buildProperties" if="with.cobertura">
        <ant dir="core/java/" target="cobertura.report" />
        <ant dir="router/java/" target="cobertura.report" />
        <ant dir="apps/ministreaming/java" target="cobertura.report" />
        <ant dir="apps/streaming/java" target="cobertura.report" />
    </target>
    <target name="test.report" depends="junit.report, scalatest.report, clover.report, cobertura.report"/>
    <target name="fulltest" depends="buildProperties, jbigi" >
        <ant dir="core/java/" target="fulltest" />
        <ant dir="router/java/" target="fulltest" />
        <ant dir="apps/ministreaming/java" target="fulltest" />
        <ant dir="apps/streaming/java" target="fulltest" />
    </target>
    <target name="jenkins.cobertura.report" depends="cobertura.report">
        <!--
             The jenkins cobertura plugin couldn't find the source files.
         -->
        <replaceregexp byline="true" file="reports/core/cobertura/coverage.xml"
            match='filename="net' replace='filename="core/java/src/net'/>
        <replaceregexp byline="true" file="reports/core/cobertura/coverage.xml"
            match="&lt;source&gt;./src" replace='&lt;source&gt;./core/java/src'/>

        <replaceregexp byline="true" file="reports/router/cobertura/coverage.xml"
            match='filename="net' replace='filename="router/java/src/net'/>
        <replaceregexp byline="true" file="reports/router/cobertura/coverage.xml"
            match="&lt;source&gt;./src" replace="&lt;source&gt;router/java/src"/>

        <replaceregexp byline="true" file="reports/ministreaming/cobertura/coverage.xml"
            match='filename="net' replace='filename="apps/ministreaming/java/src/net'/>
        <replaceregexp byline="true" file="reports/ministreaming/cobertura/coverage.xml"
            match="&lt;source&gt;./src" replace="&lt;source&gt;apps/ministreaming/java/src"/>

        <replaceregexp byline="true" file="reports/streaming/cobertura/coverage.xml"
            match='filename="net' replace='filename="apps/streaming/java/src/net'/>
        <replaceregexp byline="true" file="reports/streaming/cobertura/coverage.xml"
            match="&lt;source&gt;./src" replace="&lt;source&gt;apps/streaming/java/src"/>
    </target>
    <!-- end unit tests -->

    <target name="testscripts" >
        <exec executable="tests/scripts/checkcerts.sh" failonerror="true" />
        <exec executable="tests/scripts/checkpo.sh" failonerror="true" />
        <exec executable="tests/scripts/checkutf8.sh" failonerror="true" />
        <exec executable="tests/scripts/checkxml.sh" failonerror="true" />
        <exec executable="tests/scripts/checkscripts.sh" failonerror="true" />
    </target>


    <target name="testscripts-net" >
        <exec executable="tests/scripts/checkremotecerts.sh" failonerror="true" />
    </target>

    <target name="testscripts-all" depends="testscripts,testscripts-net" />

    <target name="bench" depends="jbigi" >
        <ant dir="core/java/" target="bench.jar" />
    </target>

    <!-- <target name="syndie" >
        <ant dir="apps/syndie/java/" target="standalone" />
        <copy file="apps/syndie/java/syndie-standalone.zip" todir="." />
    </target> -->

    <!-- standalone i2psnark zip -->
    <target name="i2psnark" depends="buildStreaming, buildJetty, buildSystray" >
        <ant dir="apps/i2psnark/java" target="standalone" />
        <copy file="apps/i2psnark/java/i2psnark-standalone.zip" todir="." />
    </target>

    <target name="slackpkg">
        <ant dir="Slackware/i2p/" target="slackpkg" />
    </target>
    <target name="justBOB" depends="builddepSmall, jbigi">
        <ant dir="apps/BOB/" target="onejar" />
        <copy file="apps/BOB/dist/BOB-one.jar" todir="." />
    </target>

    <target name="sloccount.report">
        <property name="sloccount.report.file" value="sloccount.sc" />
        <echo message="Generating sloccount report (this will take awhile)" />
        <exec executable="sloccount" failonerror="true">
            <arg value="--details"/>
            <arg value="--wide"/>
            <arg value="${basedir}"/>
            <redirector output="${sloccount.report.file}">
                <outputfilterchain>
                    <linecontainsregexp negate="true">
                        <regexp pattern="(Warning: |lib/launch4j|_MTN|reports|pkg-temp|licenses|i2p\.fba|gmp-|WEB-INF)" />
                    </linecontainsregexp>
                    <linecontains negate="true">
                        <contains value="${sloccount.report.file}" />
                    </linecontains>
                </outputfilterchain>
            </redirector>
        </exec>
        <echo message="sloccount report saved to the file &quot;${sloccount.report.file}&quot;" />
    </target>

    <target name="findbugs" depends="build2, buildUtilityJar">
        <echo message="Starting findbugs, this will take a while..." />
        <!-- ref: https://github.com/spotbugs/spotbugs/issues/148 -->
        <echo message="If this doesn't work with Java 9+. try Java 8" />
        <exec executable="nice" failonerror="true">
            <arg value="findbugs"/>
            <arg value="-textui"/>
            <arg value="-projectName"/>
            <arg value="i2p"/>
            <arg value="-sortByClass"/>
            <arg value="-xml"/>
            <arg value="-output"/>
            <arg value="i2p.fba"/>
            <arg value="-auxclasspath"/>
            <arg value="build/commons-el.jar:build/jasper-runtime.jar:build/javax.servlet.jar:build/org.mortbay.jetty.jar:build/jrobin.jar:installer/lib/wrapper/all/wrapper.jar:apps/susidns/src/lib/standard.jar:apps/susidns/src/lib/jstl.jar"/>
            <arg value="-sourcepath"/>
            <arg value="apps/BOB/src/:apps/addressbook/java/src/:apps/desktopgui/src:apps/i2pcontrol/java:apps/i2psnark/java/src/:apps/i2ptunnel/java/src/:apps/imagegen/identicon/core/src/main/java:apps/imagegen/imagegen/webapp/src/main/java:apps/imagegen/zxing/core/src/main/java:apps/jetty/java/src:apps/jrobin/java/src:apps/ministreaming/java/src/:apps/routerconsole/java/src/:apps/sam/java/src/:apps/streaming/java/src/:apps/susidns/src/java/src/:apps/susimail/src/src/:apps/systray/java/src/:core/java/src/:router/java/src/:installer/java/src"/>
            <!-- start of the files to be analyzed -->
            <arg value="build/BOB.jar"/>
            <arg value="build/addressbook.jar"/>
            <arg value="build/i2p.jar"/>
            <arg value="build/i2psnark.jar"/>
            <arg value="build/i2psnark.war"/>
            <arg value="build/i2ptunnel.jar"/>
            <arg value="build/i2ptunnel.war"/>
            <arg value="build/imagegen.war"/>
            <arg value="build/jetty-i2p.jar"/>
            <arg value="build/jrobin.jar"/>
            <arg value="build/jsonrpc.war"/>
            <arg value="build/mstreaming.jar"/>
            <arg value="build/router.jar/"/>
            <arg value="build/desktopgui.jar"/>
            <arg value="build/routerconsole.jar"/>
            <arg value="build/routerconsole.war"/>
            <arg value="build/sam.jar"/>
            <arg value="build/streaming.jar"/>
            <arg value="build/susidns.war"/>
            <arg value="build/susimail.war"/>
            <arg value="build/systray.jar"/>
            <arg value="build/utility.jar"/>
        </exec>
        <echo message="Findbugs output stored in i2p.fba" />
        <echo message="Now run: findbugs i2p.fba" />
    </target>

    <!-- this is the same dependency as pkg, but with updater200 in the middle,
         since preppkg puts too much stuff in pkg-temp -->

    <!-- Release targets - pick one: with Jbigi, GeoIP, or neither -->

    <target name="release"          depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyRepack, updater200WithJetty, delete-j6-update, installer5-nowindows, delete-nonwindows, installer5-windows, -releaseit" />
    <target name="releaseWithJbigi" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyAndJbigiRepack, updater200WithJettyAndJbigi, delete-j6-update, installer5-nowindows, delete-nonwindows, installer5-windows, -releaseit" />
    <target name="releaseWithGeoIP" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyAndGeoIPRepack, updater200WithJettyAndGeoIP, delete-j6-update, installer5-nowindows, delete-nonwindows, installer5-windows, -releaseit" />

    <target name="-releaseit">
        <echo message="New version number is ${release.number}" />
        <copy file="i2pupdate.zip" tofile="i2pupdate_${release.number}.zip" />
        <copy file="i2pinstall_${full.version}.jar" tofile="i2pinstall_${release.number}.jar" />
        <copy file="i2pinstall_${full.version}_windows.exe" tofile="i2pinstall_${release.number}_windows.exe" />
        <!-- remove these, we don't build them anymore -->
        <delete file="i2pupdate.sud" />
        <delete file="i2pupdate.su2" />
        <!-- make this a lot easier by putting release.privkey.su3=/path/to/su3keystore.ks in override.properties -->

        <!-- now build and verify the packed su3 from the packed zip -->
        <su3sign infile="i2pupdate200.zip" sigtype="ROUTER" outfile="i2pupdate.su3" su3.ver="${release.number}" />
        <!-- this will use the monotonerc file in the current workspace -->
        <echo message="Checking out fresh copy into ../i2p-${release.number} for tarballing:" />
        <delete dir="../i2p-${release.number}" />
        <exec executable="mtn" failonerror="true">
            <arg value="co" />
            <!-- w: is the revision of the current workspace -->
            <arg value="-r" />
            <arg value="w:" />
            <arg value="../i2p-${release.number}/" />
        </exec>
        <exec executable="tar" failonerror="true">
            <arg value="cjf" />
            <arg value="i2psource_${release.number}.tar.bz2" />
            <arg value="-C" />
            <arg value=".." />
            <arg value="--exclude" />
            <arg value="i2p-${release.number}/_MTN*" />
            <arg value="i2p-${release.number}/" />
        </exec>
        <echo message="Sign the files:" />
        <input message="Enter GPG key ID (e.g. 0x12345678) for signing:" addproperty="release.gpg.keyid" />
        <fail message="You must enter a key ID." >
            <condition>
                <equals arg1="${release.gpg.keyid}" arg2=""/>
            </condition>
        </fail>

        <!-- the gpgsign macro sets the permission of signed files and the sigs themselves to 444 -->
      <!--
        <gpgsign file="i2pinstall_${release.number}_windows.exe" />
       -->
        <gpgsign file="i2pinstall_${release.number}.jar" />
        <gpgsign file="i2psource_${release.number}.tar.bz2" />
        <gpgsign file="i2pupdate_${release.number}.zip" />

        <chmod perm="444" type="file">
            <fileset dir="${basedir}">
                <include name="i2pupdate.su3" />
            </fileset>
        </chmod>
        <echo message="File sizes:" />
        <exec executable="ls" failonerror="true">
            <arg value="-l" />
          <!--
            <arg value="i2pinstall_${release.number}_windows.exe" />
           -->
            <arg value="i2pinstall_${release.number}.jar" />
            <arg value="i2psource_${release.number}.tar.bz2" />
            <arg value="i2pupdate_${release.number}.zip" />
            <arg value="i2pupdate.su3" />
          <!--
            <arg value="i2pinstall_${release.number}_windows.exe.sig" />
           -->
            <arg value="i2pinstall_${release.number}.jar.sig" />
            <arg value="i2psource_${release.number}.tar.bz2.sig" />
            <arg value="i2pupdate_${release.number}.zip.sig" />
        </exec>
        <echo message="   TBD    i2pinstall_${release.number}_windows.exe" />
        <echo message="   TBD    i2pinstall_${release.number}_windows.exe.sig" />
        <echo message="SHA256 sums:" />
      <!--
        <sha256sum file="i2pinstall_${release.number}_windows.exe" />
       -->
        <echo message="   TBD    i2pinstall_${release.number}_windows.exe" />
        <sha256sum file="i2pinstall_${release.number}.jar" />
        <sha256sum file="i2psource_${release.number}.tar.bz2" />
        <sha256sum file="i2pupdate_${release.number}.zip" />
        <sha256sum file="i2pupdate.su3" />
        <!-- make torrent files -->
        <copy file="i2pupdate.su3" tofile="i2pupdate-${release.number}.su3" />
        <mktorrent file="i2pupdate-${release.number}.su3" />
        <echo message="Don't forget to sign i2pinstall_${release.number}_windows.exe on Windows and then:" />
        <echo message="    ${gpg} -u ${release.gpg.keyid} -b i2pinstall_${release.number}_windows.exe" />
        <echo message="    sha256sum i2pinstall_${release.number}_windows.exe" />
        <echo message="Don't forget to mtn tag w: i2p-${release.number}" />
        <echo message="... and mtn cert t:i2p-${release.number} branch i2p.i2p.release" />
    </target>

    <!-- depends on buildCoreTest so that the router unit test javadocs can find the core unit test classes -->
    <target name="mavenCentral.deps" depends="buildRouter, buildStreaming, buildCoreTest">
        <ant dir="core/java/">
            <target name="javadocJar" />
            <target name="sourcesJar" />
        </ant>
        <ant dir="router/java/">
            <target name="javadocJar" />
            <target name="sourcesJar" />
        </ant>
        <ant dir="apps/ministreaming/java/">
            <target name="javadocJar" />
            <target name="sourcesJar" />
        </ant>
        <ant dir="apps/streaming/java/">
            <target name="javadocJar" />
            <target name="sourcesJar" />
        </ant>
        <ant dir="apps/jetty/">
            <target name="servletJar" />
            <target name="servletJavadocJar" />
            <target name="servletSourcesJar" />
        </ant>
    </target>

    <target name="mavenCentral" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, mavenCentral.deps">
        <mkdir dir="./pkg-mavencentral" />
        <!-- Libraries -->
        <copy file="build/i2p.jar" tofile="pkg-mavencentral/i2p-${release.number}.jar" />
        <copy file="build/router.jar" tofile="pkg-mavencentral/router-${release.number}.jar" />
        <copy file="build/mstreaming.jar" tofile="pkg-mavencentral/mstreaming-${release.number}.jar" />
        <copy file="build/streaming.jar" tofile="pkg-mavencentral/streaming-${release.number}.jar" />
        <copy file="apps/jetty/build/servlet-i2p-${release.number}.jar" todir="pkg-mavencentral/" />
        <!-- JavaDocs -->
        <copy file="core/java/build/i2p-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
        <copy file="router/java/build/router-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
        <copy file="apps/ministreaming/java/build/mstreaming-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
        <copy file="apps/streaming/java/build/streaming-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
        <copy file="apps/jetty/build/servlet-i2p-${release.number}-javadoc.jar" todir="pkg-mavencentral/" />
        <!-- Sources -->
        <copy file="core/java/build/i2p-${release.number}-sources.jar" todir="pkg-mavencentral/" />
        <copy file="router/java/build/router-${release.number}-sources.jar" todir="pkg-mavencentral/" />
        <copy file="apps/ministreaming/java/build/mstreaming-${release.number}-sources.jar" todir="pkg-mavencentral/" />
        <copy file="apps/streaming/java/build/streaming-${release.number}-sources.jar" todir="pkg-mavencentral/" />
        <copy file="apps/jetty/build/servlet-i2p-${release.number}-sources.jar" todir="pkg-mavencentral/" />
        <echo message="This requires the Maven Ant Tasks to be installed." />
        <echo message="If this fails, on Debian jessie or, Ubuntu trusty/xenial:" />
        <echo message="sudo apt-get install libmaven-ant-tasks-java" />
        <echo message="Sorry, not available on more recent distributions" />
        <!-- POMs -->
        <artifact:pom id="i2ppom" groupId="net.i2p" artifactId="i2p" version="${release.number}"
                name="I2P Core"
                description="The core I2P APIs"
                url="https://geti2p.net/">
            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/"/>
            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
                 url="git@github.com:i2p/i2p.i2p.git" />
        </artifact:pom>
        <artifact:pom id="routerpom" groupId="net.i2p" artifactId="router" version="${release.number}"
                name="I2P Router"
                description="The I2P router"
                url="https://geti2p.net/">
            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/"/>
            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
                 url="git@github.com:i2p/i2p.i2p.git" />
            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
        </artifact:pom>
        <artifact:pom id="mstreamingpom" groupId="net.i2p.client" artifactId="mstreaming" version="${release.number}"
                name="I2P Ministreaming"
                description="API, interfaces, and factory for a TCP-like set of sockets for communicating over I2P."
                url="https://geti2p.net/en/docs/api/streaming">
            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/" />
            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
                 url="git@github.com:i2p/i2p.i2p.git" />
            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
        </artifact:pom>
        <artifact:pom id="streamingpom" groupId="net.i2p.client" artifactId="streaming" version="${release.number}"
                name="I2P Streaming"
                description="Implementation of a TCP-like set of sockets for communicating over I2P."
                url="https://geti2p.net/en/docs/api/streaming">
            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/" />
            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
                 url="git@github.com:i2p/i2p.i2p.git" />
            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
            <dependency groupId="net.i2p.client" artifactId="mstreaming" version="${release.number}" />
        </artifact:pom>
        <artifact:pom id="servletpom" groupId="net.i2p" artifactId="servlet-i2p" version="${release.number}"
                name="I2P Servlet classes"
                description="Various servlet classes provided to plugins by Java I2P."
                url="https://geti2p.net/">
            <license name="Public Domain" url="http://en.wikipedia.org/wiki/Public_domain" />
            <developer name="zzz" organization="I2P" organizationUrl="https://geti2p.net/" />
            <developer name="str4d" email="str4d@i2pmail.org" organization="I2P" organizationUrl="https://geti2p.net/" />
            <scm connection="scm:git:git@github.com:i2p/i2p.i2p.git"
                 developerConnection="scm:git:git@github.com:i2p/i2p.i2p.git"
                 url="git@github.com:i2p/i2p.i2p.git" />
            <dependency groupId="net.i2p" artifactId="i2p" version="${release.number}" />
            <dependency groupId="org.apache.tomcat" artifactId="tomcat-servlet-api" version="8.0.33" />
        </artifact:pom>
        <artifact:writepom pomRefId="i2ppom" file="pkg-mavencentral/i2p-${release.number}.pom"/>
        <artifact:writepom pomRefId="routerpom" file="pkg-mavencentral/router-${release.number}.pom"/>
        <artifact:writepom pomRefId="mstreamingpom" file="pkg-mavencentral/mstreaming-${release.number}.pom" />
        <artifact:writepom pomRefId="streamingpom" file="pkg-mavencentral/streaming-${release.number}.pom" />
        <artifact:writepom pomRefId="servletpom" file="pkg-mavencentral/servlet-i2p-${release.number}.pom" />
        <!-- Signatures -->
        <echo message="Sign the files:" />
        <input message="Enter GPG key ID (e.g. 0x12345678) for signing:" addproperty="release.gpg.keyid" />
        <fail message="You must enter a key ID." >
            <condition>
                <equals arg1="${release.gpg.keyid}" arg2=""/>
            </condition>
        </fail>
        <!-- the gpgsign macro sets the permission of signed files and the sigs themselves to 444 -->
        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}.jar" />
        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}.pom" />
        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}-javadoc.jar" />
        <gpgsignasc file="pkg-mavencentral/i2p-${release.number}-sources.jar" />
        <gpgsignasc file="pkg-mavencentral/router-${release.number}.jar" />
        <gpgsignasc file="pkg-mavencentral/router-${release.number}.pom" />
        <gpgsignasc file="pkg-mavencentral/router-${release.number}-javadoc.jar" />
        <gpgsignasc file="pkg-mavencentral/router-${release.number}-sources.jar" />
        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}.jar" />
        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}.pom" />
        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}-javadoc.jar" />
        <gpgsignasc file="pkg-mavencentral/mstreaming-${release.number}-sources.jar" />
        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}.jar" />
        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}.pom" />
        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}-javadoc.jar" />
        <gpgsignasc file="pkg-mavencentral/streaming-${release.number}-sources.jar" />
        <gpgsignasc file="pkg-mavencentral/servlet-i2p-${release.number}.jar" />
        <gpgsignasc file="pkg-mavencentral/servlet-i2p-${release.number}.pom" />
        <gpgsignasc file="pkg-mavencentral/servlet-i2p-${release.number}-javadoc.jar" />
        <gpgsignasc file="pkg-mavencentral/servlet-i2p-${release.number}-sources.jar" />
        <!-- Bundle -->
        <jar destfile="mavencentral-i2p.jar">
            <fileset dir="./pkg-mavencentral">
                <include name="i2p-*" />
            </fileset>
        </jar>
        <jar destfile="mavencentral-router.jar">
            <fileset dir="./pkg-mavencentral">
                <include name="router-*" />
            </fileset>
        </jar>
        <jar destfile="mavencentral-mstreaming.jar">
            <fileset dir="./pkg-mavencentral">
                <include name="mstreaming-*" />
            </fileset>
        </jar>
        <jar destfile="mavencentral-streaming.jar">
            <fileset dir="./pkg-mavencentral">
                <include name="streaming-*" />
            </fileset>
        </jar>
        <jar destfile="mavencentral-servlet-i2p.jar">
            <fileset dir="./pkg-mavencentral">
                <include name="servlet-i2p-*" />
            </fileset>
        </jar>
        <echo message="Now upload mavencentral-*.jar to Maven Central." />
    </target>

    <target name="mavenLocal.deps" depends="buildRouter, buildStreaming">
        <ant dir="apps/jetty/">
            <target name="servletJar" />
        </ant>
    </target>

    <!--
      - See installer/resources/maven-dev-release.sh
      -->
    <target name="mavenLocal" depends="mavenLocal.deps">
        <delete dir="./pkg-mavencentral" />
        <mkdir dir="./pkg-mavencentral" />
        <!-- Libraries -->
        <copy file="build/i2p.jar" tofile="pkg-mavencentral/i2p-${release.number}.jar" />
        <copy file="build/router.jar" tofile="pkg-mavencentral/router-${release.number}.jar" />
        <copy file="build/mstreaming.jar" tofile="pkg-mavencentral/mstreaming-${release.number}.jar" />
        <copy file="build/streaming.jar" tofile="pkg-mavencentral/streaming-${release.number}.jar" />
        <copy file="apps/jetty/build/servlet-i2p-${release.number}.jar" todir="pkg-mavencentral/" />
    </target>


    <target name="debian" depends="debian-clean, debchange, debian-binary" />
    <target name="precise" depends="copy-precise, debian" />
    <target name="wheezy" depends="precise" />
    <target name="trusty" depends="copy-trusty, debian" />
    <target name="jessie" depends="trusty" />
    <target name="xenial" depends="copy-xenial, debian" />
    <target name="bionic" depends="copy-bionic, debian" />
    <target name="disco" depends="copy-disco, debian" />
    <target name="buster" depends="disco" />

    <target name="copy-precise">
        <copy todir="debian" overwrite="true">
            <fileset dir="debian-alt/precise/" />
        </copy>
    </target>
    <target name="copy-trusty">
        <copy todir="debian" overwrite="true">
            <fileset dir="debian-alt/trusty/" />
        </copy>
    </target>
    <target name="copy-xenial">
        <copy todir="debian" overwrite="true">
            <fileset dir="debian-alt/xenial/" />
        </copy>
    </target>
    <target name="copy-bionic">
        <copy todir="debian" overwrite="true">
            <fileset dir="debian-alt/bionic/" />
        </copy>
    </target>
    <target name="copy-disco">
        <copy todir="debian" overwrite="true">
            <fileset dir="debian-alt/disco/" />
        </copy>
    </target>

    <target name="getExtendedVersion" depends="buildProperties, trimMtnRev">
        <property name="MtnShortHash" value="unknown" />
        <condition property="Extended.Version" value="${full.version}-${MtnShortHash}">
            <not>
                <or>
                    <equals arg1="${MtnShortHash}" arg2="" />
                    <equals arg1="${MtnShortHash}" arg2="unknown" />
                </or>
            </not>
        </condition>
        <!-- if not set above we'll set it here -->
        <property name="Extended.Version" value="${full.version}" />
    </target>

    <target name="debchange" depends="getExtendedVersion" unless="noAutoDebchange">
        <echo message= "Debian version is ${Extended.Version}-1" />
        <exec executable="dch" failonerror="true">
            <arg value="-b" />
            <arg value="--check-dirname-level" />
            <arg value="0" />
            <arg value="-v" />
            <arg value="${Extended.Version}-1" />
            <arg value="Unofficial Debian package built using &quot;ant debian&quot;" />
        </exec>
    </target>

    <target name="debian-binary" depends="getExtendedVersion">
        <exec executable="fakeroot" failonerror="true">
            <arg value="debian/rules" />
            <arg value="patch" />
            <arg value="binary" />
            <arg value="clean" />
        </exec>
        <delete dir=".pc" />
        <move todir=".">
            <fileset dir=".." includes="libjbigi*${release.number}*.deb i2p*${release.number}*.deb" />
        </move>
        <echo message="" />
        <echo message="====================" />
        <echo message="Packages have been built and moved to ${basedir}" />
        <echo message="====================" />
    </target>

    <target name="debian-clean" depends="getExtendedVersion" >
        <exec executable="fakeroot" failonerror="true">
            <arg value="debian/rules" />
            <arg value="clean" />
        </exec>
        <delete dir="./.pc" />
    </target>

    <!-- buster, sid, bionic+ -->
    <target name="debian-tarball" depends="getExtendedVersion, failIfNoMtn">
        <!-- this will use the monotonerc file in the current workspace -->
        <property name="debian.tarball.name" value="i2p_${Extended.Version}.orig.tar.bz2" />
        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
        <delete dir="../i2p-${Extended.Version}" />
        <exec executable="mtn" failonerror="true">
            <arg value="co" />
            <!-- w: is the revision of the current workspace -->
            <arg value="-r" />
            <arg value="w:" />
            <arg value="../i2p-${Extended.Version}" />
        </exec>
        <delete includeemptydirs="true" quiet="false" failonerror="false">
            <fileset dir="../i2p-${Extended.Version}/debian-alt/" />
            <fileset dir="../i2p-${Extended.Version}/installer/" includes="*.xml" />
            <fileset dir="../i2p-${Extended.Version}/installer/c/" />
            <fileset dir="../i2p-${Extended.Version}/installer/doc/" />
            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
            <fileset dir="../i2p-${Extended.Version}/installer/resources" includes="checklist.md deletelist.txt install_* geoipv6-extras.csv makegeoip* po4a.config uninstall_* *.bat net.i2p.router.plist.template" />
            <fileset dir="../i2p-${Extended.Version}/installer/resources/Start I2P Router.app/" />
            <fileset dir="../i2p-${Extended.Version}/installer/resources/portable/" />
            <fileset dir="../i2p-${Extended.Version}/installer/resources/small/" />
            <fileset dir="../i2p-${Extended.Version}/Slackware" />
            <fileset dir="../i2p-${Extended.Version}/_MTN" />
            <fileset dir="../i2p-${Extended.Version}/.idea" />
            <fileset dir="../i2p-${Extended.Version}/.tx" />
            <file name="../i2p-${Extended.Version}/.mtn-ignore" />
            <fileset dir="../i2p-${Extended.Version}/" includes="Docker*" />
            <file name="../i2p-${Extended.Version}/Makefile.gcj" />
            <fileset dir="../i2p-${Extended.Version}/docs" />
            <fileset dir="../i2p-${Extended.Version}/launchers" />
            <file name="../i2p-${Extended.Version}/.travis.yml" />
            <file name="../i2p-${Extended.Version}/.gitignore" />
            <!-- gradle files -->
            <fileset dir="../i2p-${Extended.Version}/" includes="**/build.gradle" />
            <fileset dir="../i2p-${Extended.Version}/gradle" />
            <file name="../i2p-${Extended.Version}/gradlew" />
            <file name="../i2p-${Extended.Version}/gradlew.bat" />
            <file name="../i2p-${Extended.Version}/gradle.properties" />
            <file name="../i2p-${Extended.Version}/settings.gradle" />
            <!-- gettext-base -->
            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/gettext" />
            <!-- libgetopt-java -->
            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/getopt" />
            <!-- libjson-simple-java -->
            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/json" />
            <!-- libhttpclient-java and libhttpcore-java -->
          <!--
            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/apache/http" />
           -->
            <!-- geoip-database -->
            <file name="../i2p-${Extended.Version}/installer/resources/geoip.txt" />
            <file name="../i2p-${Extended.Version}/installer/resources/geoipv6.dat.gz" />
            <file name="../i2p-${Extended.Version}/installer/resources/GeoLite2-Country.mmdb.gz" />
            <!-- libjetty9-java -->
            <fileset dir="../i2p-${Extended.Version}/apps/jetty/jetty-distribution-${jetty.ver}" />
            <!-- libtomcat9-java -->
            <fileset dir="../i2p-${Extended.Version}/apps/jetty/apache-tomcat-${tomcat.ver}" />
            <!-- libjstl1.1-java or glassfish-javaee or libtaglibs-standard -->
            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/jstl.jar" />
            <!-- libjakarta-taglibs-standard-java or glassfish-javaee or libtaglibs-standard -->
            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/standard.jar" />
            <fileset dir="../i2p-${Extended.Version}/installer/resources/icons/flags" />
            <!-- anything added above, add in debian-release-tarball also -->
        </delete>
        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}">
                <include name="**/**" />
                <exclude name="debian/**"/>
                <exclude name="**/*.sh"/>
                <!-- anything added above, add in debian-release-tarball also -->
            </tarfileset>
            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}" filemode="755">
                <exclude name="debian/**" />
                <include name="**/*.sh" />
            </tarfileset>
        </tar>
    </target>

    <!-- same as debian-release-tarball but with bundled jetty
      -  We add a 'p' to the release name and tarball since the source package is different;
      -  Launchpad does not allow different source packages with the same name.
      -->
    <target name="precise-release-tarball" depends="getExtendedVersion, failIfNoMtn">
        <property name="debian.tarball.name" value="i2p_${release.number}p.orig.tar.bz2" />
        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
        <delete dir="../i2p-${Extended.Version}" />
        <exec executable="mtn" failonerror="true">
            <arg value="co" />
            <!-- w: is the revision of the current workspace -->
            <arg value="-r" />
            <arg value="w:" />
            <arg value="-b" />
            <arg value="i2p.i2p" />
            <arg value="../i2p-${Extended.Version}" />
        </exec>
        <delete includeemptydirs="true" quiet="false" failonerror="false">
            <fileset dir="../i2p-${Extended.Version}/debian-alt/" />
            <fileset dir="../i2p-${Extended.Version}/installer/" includes="*.xml" />
            <fileset dir="../i2p-${Extended.Version}/installer/c/" />
            <fileset dir="../i2p-${Extended.Version}/installer/doc/" />
            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
            <fileset dir="../i2p-${Extended.Version}/installer/resources" includes="checklist.md deletelist.txt install_* geoipv6-extras.csv makegeoip* po4a.config uninstall_* *.bat net.i2p.router.plist.template" />
            <fileset dir="../i2p-${Extended.Version}/installer/resources/Start I2P Router.app/" />
            <fileset dir="../i2p-${Extended.Version}/installer/resources/portable/" />
            <fileset dir="../i2p-${Extended.Version}/installer/resources/small/" />
            <fileset dir="../i2p-${Extended.Version}/Slackware" />
            <fileset dir="../i2p-${Extended.Version}/_MTN" />
            <fileset dir="../i2p-${Extended.Version}/.idea" />
            <fileset dir="../i2p-${Extended.Version}/.tx" />
            <file name="../i2p-${Extended.Version}/.mtn-ignore" />
            <fileset dir="../i2p-${Extended.Version}/" includes="Docker*" />
            <file name="../i2p-${Extended.Version}/Makefile.gcj" />
            <fileset dir="../i2p-${Extended.Version}/docs" />
            <fileset dir="../i2p-${Extended.Version}/launchers" />
            <file name="../i2p-${Extended.Version}/.travis.yml" />
            <file name="../i2p-${Extended.Version}/.gitignore" />
            <!-- gradle files -->
            <fileset dir="../i2p-${Extended.Version}/" includes="**/build.gradle" />
            <fileset dir="../i2p-${Extended.Version}/gradle" />
            <file name="../i2p-${Extended.Version}/gradlew" />
            <file name="../i2p-${Extended.Version}/gradlew.bat" />
            <file name="../i2p-${Extended.Version}/gradle.properties" />
            <file name="../i2p-${Extended.Version}/settings.gradle" />
            <!-- gettext-base -->
            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/gettext" />
            <!-- libgetopt-java -->
            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/getopt" />
            <!-- libhttpclient-java and libhttpcore-java -->
          <!--
            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/apache/http" />
           -->
            <!-- geoip-database -->
            <file name="../i2p-${Extended.Version}/installer/resources/geoip.txt" />
            <file name="../i2p-${Extended.Version}/installer/resources/geoipv6.dat.gz" />
            <file name="../i2p-${Extended.Version}/installer/resources/GeoLite2-Country.mmdb.gz" />
            <!-- libjetty9-java -->
          <!--
            <fileset dir="../i2p-${Extended.Version}/apps/jetty/jetty-distribution-${jetty.ver}" />
            <fileset dir="../i2p-${Extended.Version}/apps/jetty/apache-tomcat-${tomcat.ver}" />
           -->
            <!-- libjstl1.1-java or glassfish-javaee -->
          <!--
            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/jstl.jar" />
           -->
            <!-- libjakarta-taglibs-standard-java or glassfish-javaee -->
            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/standard.jar" />
            <!-- famfamfam-flag-png is in trusty but not precise, so leave them in the source package for both -->
            <!-- anything added above, add in debian-release-tarball also -->
        </delete>
        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}">
                <include name="**/**" />
                <exclude name="debian/**"/>
                <exclude name="**/*.sh"/>
                <!-- anything added above, add in debian-release-tarball also -->
            </tarfileset>
            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}" filemode="755">
                <exclude name="debian/**" />
                <include name="**/*.sh" />
            </tarfileset>
        </tar>
    </target>

    <!-- xenial/yakkety only -->
    <!-- same as debian-release-tarball but with bundled jstl.jar
         (there's no libtaglibs-standard-* packages)
      -  We add a 'x' to the release name and tarball since the source package is different;
      -  Launchpad does not allow different source packages with the same name.
      -->
    <target name="xenial-release-tarball" depends="getExtendedVersion, failIfNoMtn">
        <property name="debian.tarball.name" value="i2p_${release.number}x.orig.tar.bz2" />
        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
        <delete dir="../i2p-${Extended.Version}" />
        <exec executable="mtn" failonerror="true">
            <arg value="co" />
            <!-- w: is the revision of the current workspace -->
            <arg value="-r" />
            <arg value="w:" />
            <arg value="-b" />
            <arg value="i2p.i2p" />
            <arg value="../i2p-${Extended.Version}" />
        </exec>
        <delete includeemptydirs="true" quiet="false" failonerror="false">
            <fileset dir="../i2p-${Extended.Version}/debian-alt/" />
            <fileset dir="../i2p-${Extended.Version}/installer/" includes="*.xml" />
            <fileset dir="../i2p-${Extended.Version}/installer/c/" />
            <fileset dir="../i2p-${Extended.Version}/installer/doc/" />
            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
            <fileset dir="../i2p-${Extended.Version}/installer/resources" includes="checklist.md deletelist.txt install_* geoipv6-extras.csv makegeoip* po4a.config uninstall_* *.bat net.i2p.router.plist.template" />
            <fileset dir="../i2p-${Extended.Version}/installer/resources/Start I2P Router.app/" />
            <fileset dir="../i2p-${Extended.Version}/installer/resources/portable/" />
            <fileset dir="../i2p-${Extended.Version}/installer/resources/small/" />
            <fileset dir="../i2p-${Extended.Version}/Slackware" />
            <fileset dir="../i2p-${Extended.Version}/_MTN" />
            <fileset dir="../i2p-${Extended.Version}/.idea" />
            <fileset dir="../i2p-${Extended.Version}/.tx" />
            <file name="../i2p-${Extended.Version}/.mtn-ignore" />
            <fileset dir="../i2p-${Extended.Version}/" includes="Docker*" />
            <file name="../i2p-${Extended.Version}/Makefile.gcj" />
            <fileset dir="../i2p-${Extended.Version}/docs" />
            <fileset dir="../i2p-${Extended.Version}/launchers" />
            <file name="../i2p-${Extended.Version}/.travis.yml" />
            <file name="../i2p-${Extended.Version}/.gitignore" />
            <!-- gradle files -->
            <fileset dir="../i2p-${Extended.Version}/" includes="**/build.gradle" />
            <fileset dir="../i2p-${Extended.Version}/gradle" />
            <file name="../i2p-${Extended.Version}/gradlew" />
            <file name="../i2p-${Extended.Version}/gradlew.bat" />
            <file name="../i2p-${Extended.Version}/gradle.properties" />
            <file name="../i2p-${Extended.Version}/settings.gradle" />
            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/gettext" />
            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/getopt" />
            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/json" />
          <!--
            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/apache/http" />
           -->
            <file name="../i2p-${Extended.Version}/installer/resources/geoip.txt" />
            <file name="../i2p-${Extended.Version}/installer/resources/geoipv6.dat.gz" />
            <file name="../i2p-${Extended.Version}/installer/resources/GeoLite2-Country.mmdb.gz" />
            <fileset dir="../i2p-${Extended.Version}/apps/jetty/jetty-distribution-${jetty.ver}" />
            <fileset dir="../i2p-${Extended.Version}/apps/jetty/apache-tomcat-${tomcat.ver}" />
          <!--
            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/jstl.jar" />
           -->
            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/standard.jar" />
            <fileset dir="../i2p-${Extended.Version}/installer/resources/icons/flags" />
            <!-- anything added above, add in debian-tarball also -->
        </delete>
        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${release.number}">
                <include name="**/**" />
                <exclude name="debian/**"/>
                <exclude name="**/*.sh"/>
                <!-- anything added above, add in debian-tarball also -->
            </tarfileset>
            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${release.number}" filemode="755">
                <exclude name="debian/**" />
                <include name="**/*.sh" />
            </tarfileset>
        </tar>
    </target>

    <!-- buster, sid, bionic+ -->
    <!-- same as debian-tarball but with a release tar.bz2 file name and tar prefix -->
    <target name="debian-release-tarball" depends="getExtendedVersion, failIfNoMtn">
        <property name="debian.tarball.name" value="i2p_${release.number}.orig.tar.bz2" />
        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
        <delete dir="../i2p-${Extended.Version}" />
        <exec executable="mtn" failonerror="true">
            <arg value="co" />
            <!-- w: is the revision of the current workspace -->
            <arg value="-r" />
            <arg value="w:" />
            <arg value="-b" />
            <arg value="i2p.i2p" />
            <arg value="../i2p-${Extended.Version}" />
        </exec>
        <delete includeemptydirs="true" quiet="false" failonerror="false">
            <fileset dir="../i2p-${Extended.Version}/debian-alt/" />
            <fileset dir="../i2p-${Extended.Version}/installer/" includes="*.xml" />
            <fileset dir="../i2p-${Extended.Version}/installer/c/" />
            <fileset dir="../i2p-${Extended.Version}/installer/doc/" />
            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
            <fileset dir="../i2p-${Extended.Version}/installer/resources" includes="checklist.md deletelist.txt install_* geoipv6-extras.csv makegeoip* po4a.config uninstall_* *.bat net.i2p.router.plist.template" />
            <fileset dir="../i2p-${Extended.Version}/installer/resources/Start I2P Router.app/" />
            <fileset dir="../i2p-${Extended.Version}/installer/resources/portable/" />
            <fileset dir="../i2p-${Extended.Version}/installer/resources/small/" />
            <fileset dir="../i2p-${Extended.Version}/Slackware" />
            <fileset dir="../i2p-${Extended.Version}/_MTN" />
            <fileset dir="../i2p-${Extended.Version}/.idea" />
            <fileset dir="../i2p-${Extended.Version}/.tx" />
            <file name="../i2p-${Extended.Version}/.mtn-ignore" />
            <fileset dir="../i2p-${Extended.Version}/" includes="Docker*" />
            <file name="../i2p-${Extended.Version}/Makefile.gcj" />
            <fileset dir="../i2p-${Extended.Version}/docs" />
            <fileset dir="../i2p-${Extended.Version}/launchers" />
            <file name="../i2p-${Extended.Version}/.travis.yml" />
            <file name="../i2p-${Extended.Version}/.gitignore" />
            <!-- gradle files -->
            <fileset dir="../i2p-${Extended.Version}/" includes="**/build.gradle" />
            <fileset dir="../i2p-${Extended.Version}/gradle" />
            <file name="../i2p-${Extended.Version}/gradlew" />
            <file name="../i2p-${Extended.Version}/gradlew.bat" />
            <file name="../i2p-${Extended.Version}/gradle.properties" />
            <file name="../i2p-${Extended.Version}/settings.gradle" />
            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/gettext" />
            <fileset dir="../i2p-${Extended.Version}/core/java/src/gnu/getopt" />
            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/json" />
          <!--
            <fileset dir="../i2p-${Extended.Version}/core/java/src/org/apache/http" />
           -->
            <file name="../i2p-${Extended.Version}/installer/resources/geoip.txt" />
            <file name="../i2p-${Extended.Version}/installer/resources/geoipv6.dat.gz" />
            <file name="../i2p-${Extended.Version}/installer/resources/GeoLite2-Country.mmdb.gz" />
            <fileset dir="../i2p-${Extended.Version}/apps/jetty/jetty-distribution-${jetty.ver}" />
            <fileset dir="../i2p-${Extended.Version}/apps/jetty/apache-tomcat-${tomcat.ver}" />
            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/jstl.jar" />
            <file name="../i2p-${Extended.Version}/apps/susidns/src/lib/standard.jar" />
            <fileset dir="../i2p-${Extended.Version}/installer/resources/icons/flags" />
            <!-- anything added above, add in debian-tarball also -->
        </delete>
        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${release.number}">
                <include name="**/**" />
                <exclude name="debian/**"/>
                <exclude name="**/*.sh"/>
                <!-- anything added above, add in debian-tarball also -->
            </tarfileset>
            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${release.number}" filemode="755">
                <exclude name="debian/**" />
                <include name="**/*.sh" />
            </tarfileset>
        </tar>
    </target>

    <target name="debian-patch" depends="getExtendedVersion" >
        <exec executable="quilt" failonerror="true">
            <arg value="-a" />
            <arg value="push" />
        </exec>
        <echo message="====================" />
    </target>
    <target name="debian-unpatch" depends="buildProperties">
        <exec executable="quilt" failonerror="false">
            <arg value="-a" />
            <arg value="pop" />
        </exec>
    </target>

    <target name="debianrepo" depends="debian">
        <exec dir="debian" executable="./makerepo.sh" failonerror="true"/>
    </target>

<!-- the following are appened to help build barebone portable version,
     none of the above is modified for this purpose -->
	<target name = "pkg-portable-clean">
		<delete dir="build/" />
		<delete dir="pkg-temp/" />
		<delete>
			<fileset dir="." includes="portable-**.zip**" />
		</delete>
	</target>
<!-- build a portable archive -->

<!-- *0* Since we simply pack all files in folder "build/" into our archieve,
		we need to make sure its small, with NO redundent jars or wars.
		thus cleaning is required before each build-->
	<target name="buildSmallOnly" depends="pkg-portable-clean,buildSmall"/>

<!-- *1* preparing the jars by OS dependent de-bloating -->
	<target name="preppkg-portable-win32-jbigi" depends="buildSmallOnly, jbigi-windows-only" />

	<target name="preppkg-portable-linux-jbigi"  depends="buildSmallOnly, jbigi-linux-only" />

<!-- *2* os independent procedure  -->
	<target name="preppkg-portable-basic" >
		<mkdir dir="pkg-temp" />
			<!-- non OS dependent configurations only, dont add *nux/win stuff here -->
			<copy todir="pkg-temp">
				<fileset dir="installer/resources/portable/configs/" />
			</copy>
			<copy file="installer/resources/blocklist.txt" todir="pkg-temp/" />
			<copy file="installer/resources/hosts.txt" todir="pkg-temp/" />
			<copy file="installer/resources/readme.license.txt" todir="pkg-temp/" />
		<mkdir dir="pkg-temp/addressbook" />
			<copy file="apps/addressbook/subscriptions.txt" todir="pkg-temp/addressbook/" />
			<copy file="apps/addressbook/myhosts.txt"  todir="pkg-temp/addressbook/" />
			<!-- config.txt is in installer/resources/portable -->
		<mkdir dir="pkg-temp/docs" />
			<copy file="installer/resources/initialNews/initialNews.xml" tofile="pkg-temp/docs/news.xml" overwrite="true" />
			<copy file="installer/resources/readme/readme.html" tofile="pkg-temp/docs/readme.html" />
			<copy file="installer/resources/startconsole.html" todir="pkg-temp/docs/" />
			<copy file="installer/resources/start.ico" todir="pkg-temp/docs/" />
			<copy file="installer/resources/console.ico" todir="pkg-temp/docs/" />
			<!-- HTTP Header files, english only,
				if you need a different lang do it in a seperate target -->
			<copy todir="pkg-temp/docs/" >
				<fileset dir="installer/resources/proxy/"  includes="**-header.ht" />
			</copy>
			<!-- Theme light only -->
			<copy todir="pkg-temp/docs/themes/console/light/" overwrite="true" >
				<fileset dir="installer/resources/themes/console/light/" includes="**.css" />
			</copy>
			<copy file="installer/resources/themes/console/light/console_big.css" todir="portable/docs/themes/console/light/" />
			<copy todir="pkg-temp/docs/themes/console/images/" >
				<fileset dir="installer/resources/themes/console/images/" />
			</copy>
			<!-- FLAGs for language icon (not for ip)-->
			<copy todir="pkg-temp/docs/icons" >
				<fileset dir="installer/resources/icons" />
			</copy>
		<mkdir dir="pkg-temp/webapps" />
			<copy todir="pkg-temp/webapps/">
				<fileset dir="build/" includes="**.war" />
			</copy>
		<mkdir dir="pkg-temp/lib" />
			<copy todir ="pkg-temp/lib/" >
				<fileset dir="build/" includes="**.jar" />
			</copy>
			<!-- 3rd party jars from apps/  -->
				<!-- jrobin - without jobin , you lost graph and get a lot error entry in logs -->
			<copy file="build/jrobin.jar" tofile="pkg-temp/lib/jrobin.jar" />
	</target>
<!-- *3* os dependent procedure/commands -->
	<target name = "preppkg-portable-win32" depends="preppkg-portable-win32-jbigi,preppkg-portable-basic">
			<!--wrapper - dont even think about it. i2p cosumes appreantly more mem without it on win32-->
		<copy file="installer/lib/wrapper/win32/wrapper.dll" todir="pkg-temp/lib" />
		<copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
		<copy file="installer/lib/wrapper/win32/I2Psvc.exe" tofile="pkg-temp/i2psvc.ex_" />
			<!--  copy the unpack/start batchfiles -->
		<copy todir="pkg-temp">
			<fileset dir="installer/resources/portable/win32/" />
		</copy>
	</target>
<!-- *4* command for windows package -->
	<target name = "pkg-portable-win32"	depends="preppkg-portable-win32, pack200" >
		<!-- i need the portable\ folder in .zip so basedir is set to . -->
		<move file="pkg-temp" tofile="portable"/>
		<zip destfile="portable-win32.zip" basedir="." level="9" includes="portable\**" />
		<checksum file="portable-win32.zip" forceOverwrite="yes"/>
		<move file="portable" tofile="pkg-temp"/>
	</target>
</project>