summaryrefslogtreecommitdiffabout
path: root/doc/wydawca.texi
blob: 89509872f14f87d6dd69308d18b464e3293642d8 (plain)
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
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
\input texinfo @c -*-texinfo-*-
@smallbook
@c %**start of header
@setfilename wydawca.info
@settitle Wydawca
@c %**end of header
@setchapternewpage odd

@defcodeindex kw
@defcodeindex op
@syncodeindex fn cp
@syncodeindex vr cp
@syncodeindex ky cp
@syncodeindex pg cp
@syncodeindex tp cp
@syncodeindex kw cp
@syncodeindex op cp

@include macros.texi
@include version.texi
@include rendition.texi

@ifinfo
@direntry
* wydawca: (wydawca).       Automatic release submission daemon.
@end direntry
@end ifinfo

@copying
Published by the Free Software Foundation,
51 Franklin Street, Fifth Floor
Boston, MA 02110-1301, USA

Copyright @copyright{} 2007, 2009, 2010, 2011, 2012, 2013, 2014, 2015,
2017, 2019 Sergey Poznyakoff

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with no
Invariant Sections, no Front-Cover, and no Back-Cover texts.

A copy of the license is included in the section entitled ``GNU Free
Documentation License''.
@end copying

@titlepage
@title Wydawca Manual
@subtitle version @value{VERSION}, @value{UPDATED}
@author Sergey Poznyakoff.
@page
@vskip 0pt plus 1filll
@insertcopying
@end titlepage

@ifnothtml
@page
@summarycontents
@page
@end ifnothtml
@contents

@ifnottex
@node Top
@top Wydawca
This edition of the @cite{Wydawca Manual}, last updated @value{UPDATED},
documents Wydawca Version @value{VERSION}.
@end ifnottex

@menu
* Intro::                  What is Wydawca
* overview::               Operation Overview
* starting::               How to Invoke @command{wydawca}.
* configuring::            How to Configure @command{wydawca}.
* wydawca.rc::             Configuration file summary.
* invocation::             Invocation summary.

* Reporting Bugs::         How to Report a Bug.

Appendices

* Copying This Manual::    The GNU Free Documentation License.
* Concept Index::          Index of Concepts.

Here are some other nodes which are really inferiors of the ones
already listed, mentioned here so you can get to them in one step:

@detailmenu
 --- The Detailed Node Listing ---

Operation Overview

* operation modes::

How to Configure @command{wydawca}.

* Syntax::               Configuration file syntax.
* general::
* versions::
* user privileges::
* daemon::
* tcp-wrapper::
* locking::
* syslog::
* sql::
* dictionaries::
* directory setup::
* archivation::
* spool::
* verification::
* statistics::
* notification::

Configuration file syntax

* Comments::
* Pragmatic Comments::
* Statements::
* Preprocessor::

Dictionaries

* sql type::
* builtin type::
* external type::

SQL Dictionary

* project-owner-sql::
* project-uploader-sql::

Notification Mechanism

* modules::
* event notification::
* mod_mailutils:: Mail Notification
* mod_logstat:: Notification to syslog

@command{mod_mailutils}-- Mail Notification

* mailer::                      
* templates::                   
* statreports::
* mail-config:: @code{module-config} for @command{mod_mailutils}
* mod_mailutils example:: Example of @command{mod_mailutils} configuration

@end detailmenu
@end menu

@node Intro
@chapter Introduction to Wydawca
@cindex introduction
  Let's begin with a short synopsis. Suppose you run a developer's
site, such as e.g. @indicateurl{gnu.org}. You have two
@dfn{distribution @acronym{URL}s}: @indicateurl{ftp.gnu.org}, which
distributes stable versions of the software, and
@indicateurl{alpha.gnu.org}, which distributes alpha and pre-test
versions. Now, package maintainers need to have a way of uploading
their packages to one of these sites. This is done using the
@dfn{Automated FTP Upload} method, as described in
@ifnothtml
@ref{Automated FTP Uploads, Automated FTP Uploads, Automated FTP
Uploads, maintain, Information for maintainers of GNU software}.
@end ifnothtml
@ifhtml
@uref{http://www.gnu.org/prep/maintain/html_node/Automated-Upload-Procedure.html,
Automated Upload Procedure}.
@end ifhtml
@cindex upload site
@cindex source directory
@cindex directory, source
The following is a short summary of it: there is an @acronym{FTP}
@dfn{upload site}, which has two @dfn{source directories}, each one
corresponding to a certain distribution @acronym{URL}. For example,

@multitable @columnfractions 0.4 0.6
@headitem Source Directory @tab Distribution Site
@item @file{/incoming/ftp} @tab @indicateurl{ftp.gnu.org}
@item @file{/incoming/alpha} @tab @indicateurl{alpha.gnu.org}
@end multitable
@*

@cindex @acronym{PGP}
@cindex detached signature
@cindex signature, detached
  Now, if maintainer of the project @samp{foo} wishes to make a release
of the stable version @file{foo-1.0.tar.gz}, he first creates a detached
signature @file{foo-1.0.tar.gz.sig}. Then he creates a special
@dfn{directive} file, which contains information about where the
distributed tarball must be placed, and clear-signs it using his
@acronym{PGP} key, thus obtaining the file
@file{foo-1.0.tar.gz.directive.asc}. Finally, he uploads these three files
(a @dfn{triplet}) to the upload site, storing them into the directory
@file{/incoming/ftp}.

@cindex release submission daemon
  From now on, it is the responsibility of a @dfn{release submission daemon}
to scan the source directories, gather the triplets, verify them,
and to move any files that had  successfully passed verification to
their distribution sites.

  @command{Wydawca} is such a release submission daemon. It is able to
handle any number of @samp{source/destination} pairs (called
@dfn{spools}) in real time, and offers extensible logging and 
notification mechanisms, allowing both package maintainers and site
administrators to be immediately notified about any occurring problems.

  @command{Wydawca} supports upload directive versions 1.1@footnote{
@ifnothtml
@xref{FTP Upload Directive File - v1.1,
Standalone directives, Standalone directives,
maintain, Information for maintainers of GNU software}.
@end ifnothtml
@ifhtml
See @uref{http://www.gnu.org/prep/maintain/html_node/FTP-Upload-Directive-File-_002d-v1_002e1.html,
Standalone directives}.
@end ifhtml
} and 1.2@footnote{
@ifnothtml
@xref{FTP Upload Directive File - v1.2,
Standalone directives, Standalone directives,
maintain, Information for maintainers of GNU software}.
@end ifnothtml
@ifhtml
See @uref{http://www.gnu.org/prep/maintain/html_node/FTP-Upload-Directive-File-_002d-v1_002e2.html,
Standalone directives}.
@end ifhtml
}.

  The program is written entirely in @acronym{C}, is highly
effective and consumes little resources.

@node overview
@chapter Operation Overview
@cindex operation
@cindex overview
  Usually, @command{wydawca} is installed on the machine that receives
release uploads. It may be run either periodically as a cron-job, or
as a standalone daemon. It supposes that both upload and distribution
directories are accessible in the local file system hierarchy. If that
is not the case (e.g. if upload and distribution sites are handled by
different machines), one of them should be mounted using
@acronym{NFS}. Future versions will contain special provisions for
that case. 

@cindex spool
@cindex upload directory
@cindex directory, upload
@cindex source directory
@cindex directory, source
@cindex distribution directory
@cindex directory, distribution
@cindex destination directory
@cindex directory, destination
  A configuration file defines a set of @dfn{spools}, i.e. pairs of
upload and corresponding distribution directories. In
@command{wydawca} terminology, upload directories are also called
@dfn{source}, and distribution directories -- @dfn{destination}
directories. The configuration file supplies also the information 
necessary to access user and project databases.

  When started, @command{wydawca} scans each source directory and
prepares a list of files found there. Then, it compacts this list by
looking for @dfn{directive files} and re-arranging list members in
@dfn{triplets}. A @dfn{directive file} is a special file that must be
supplied with each upload and that contains instructions regarding the
placement of the uploaded files. A @dfn{triplet} is a standard
entity, consisting of three files: a clear-signed directive file, a
file to be distributed, and a detached signature of the latter.
In some special cases, a clear-signed directive file alone is valid.
This happens when it contains only @dfn{standalone directives}, as
described in
@ifnothtml
@ref{FTP Upload Directive File - v1.1,
Standalone directives, Standalone directives,
maintain, Information for maintainers of GNU software}.
@end ifnothtml
@ifhtml
@uref{http://www.gnu.org/prep/maintain/html_node/FTP-Upload-Directive-File-_002d-v1_002e1.html,
Standalone directives}.
@end ifhtml

@cindex triplet, incomplete
@cindex incomplete triplet
@cindex triplet, expired
@cindex expired triplet
  Each @dfn{incomplete} triplet, i.e. a triplet missing one or more
necessary files, is then verified by checking if the modification
date of its oldest file is older than a predefined amount of time
(@pxref{general, file-sweep-time}). If so, the triplet is considered
@dfn{expired}, and all its files are removed. This gives users the
possibility to restart interrupted or otherwise broken uploads later.

@cindex dictionary
@cindex @acronym{PGP}
  After completing these preliminary stages, @command{wydawca}
analyzes the directive file and extracts the project name
from it. Using this name as a key, it searches in the @dfn{project
dictionary} for a list of users authorized to make uploads for this
project. This list contains user names and their corresponding public
@acronym{PGP} keys. @command{Wydawca} tries to verify the directive
file using each @acronym{PGP} key from this list, until a matching
key is found, or the list in exhausted. In the latter case, the
triplet is rejected. Otherwise, the key and its owner are remembered
for the next step.

@cindex detached signature
@cindex detached signature
@cindex signature, detached
  In this step, the uploaded file and its detached signature
are verified. If they do not match the public key obtained in the
previous step, the triplet is rejected.

  Finally, directives from the directive file are executed. On
this stage of the processing, the uploaded files are actually moved to
their destination directories, requested symbolic links are created,
etc.

@menu
* operation modes::
@end menu

@node operation modes
@section Operation Modes
@cindex operation mode
  The program has two operation modes: @samp{cron mode} and
@samp{daemon mode}.

@cindex cron mode
  In @dfn{cron mode}, @command{wydawca} runs in foreground and
exits when it is done with processing all required spools. By default
it processes all configured spools, unless a subset of them is
specified in the command line. This is called @dfn{cron mode}, because
this is the usual way for @command{wydawca} to be used as a cron job.

@cindex daemon mode
  In @dfn{daemon mode}, @command{wydawca} detaches itself from
the controlling terminal and runs in the background. It watches for
the incoming uploads using one or both of the following methods.

@anchor{inotify}
@cindex inotify
  On modern GNU/Linux systems @command{wydawca} uses @dfn{inotify} API
(@pxref{monitoring file system events,,,inotify(7),inotify man page}),
which makes it possible to react on each upload immediately after a
complete triplet is uploaded and to clean up unfinished or incomplete
uploads. This is a preferred mode of operation.

@cindex TCPMUX notification
  On other systems, the daemon can be configured to listen on
a socket for upload notifications. This method can also be used
together with inotify, should the need be. This feature uses the
@acronym{TCPMUX}
protocol@footnote{@uref{http://www.rfc-editor.org/rfc/rfc1078.txt, RFC
1078}.} and operates as follows:

  After establishing connection, the remote party (the @dfn{client})
sends the spool tag followed by a CRLF pair. The server
scans its configuration for a spool that has the requested
@acronym{ID}. If no such spool is found, the server replies
with the string @samp{- Unknown service name}, followed by a CRLF pair
and closes the connection.

  If a matching spool is found, the server replies with @samp{+}
acknowledgment, immediately followed by an optional message of
explanation, and terminated with a CRLF. Upon receiving this
acknowledgment, the client sends the user name of the user who
did the upload. The following sample transaction illustrates
this:

@smallexample
C: stable
S: +OK. URL ftp://ftp.domain.net
C: smith
@end smallexample

  When the user name is received, the server schedules a @dfn{job}
for processing all triplets submitted by the given user to the
given spool.

@node starting
@chapter How to invoke @command{wydawca}.
@cindex invocation
@anchor{config-file}
@xopindex{config-file, described}
@sopindex{c, described}
  @command{Wydawca} gets all information it needs from its
@dfn{configuration file} (@pxref{wydawca.rc}). The default
configuration file is @file{@var{sysconfdir}/wydawca.rc}, but if it is
located elsewhere, you can specify its new location with the
@option{--config-file} (@option{-c}) command line option.

@anchor{lint}
@xopindex{lint, described}
@sopindex{t, described}
  If you wish to check your configuration file for syntax errors, use
@option{--lint} (@option{-t}) command line option. When given this
option, @command{wydawca} prints all diagnostics on its standard
error and exits with code 0 if the file is OK, or 1 otherwise.

@anchor{stderr}
@xopindex{stderr, described}
@sopindex{e, described}
@xopindex{syslog, described}
  Normally, @command{wydawca} attempts to detect automatically whether
it is run from an interactive console, and if so it prints its
diagnostics on the standard error. Otherwise, the diagnostics is
directed to the @command{syslog}, using the facility given in
the @code{syslog-facility} configuration file statement
(@pxref{syslog}). Two options are provided if you wish to disable this
autodetection: the option @option{--syslog} instructs the program to print
all diagnostics via @command{syslog}, and the option
@option{--stderr} (or @option{-e}) instructs it to print everything on
the standard error.

@xopindex{cron, described}
  The operation mode is configured in the configuration file. If the
latter configures daemon mode, you can still instruct
@command{wydawca} to run as a cron job by the @option{--cron} command
line option. This may be needed, for example, to schedule a daily
@command{wydawca} run when the main daemon instance is already
running.

@anchor{spool selection}
  Usually @command{wydawca} attempts to process all the configured
spools. You may instruct it to process only a subset of these
by using the following options:

@table @option
@xopindex{spool, described}
@item --spool=@var{tag}
@itemx -S @var{tag}
  Process only spool with the given tag.
@item --source=@var{dir}
@itemx -s @var{dir}
  Process only spool with @var{dir} as the source directory.
@end table

  Any number of these options may be supplied, e.g.:

@smallexample
$ wydawca --spool=ftp --spool=test --source=/home/ftp/test-upload
@end smallexample

  Any non-optional arguments appearing in the command line, are
treated as the uploaders' UIDs.  If present, only triplets uploaded by
these users will be processed.  Of course, such UIDs can be combined
with the @option{--spool} and @option{--source} options.

@anchor{debug}
@xopindex{debug, described}
@sopindex{d, described}
  The @option{--debug} (@option{-d}) option tells the program to increase its
debugging level by 1. The @dfn{debugging level} determines amount
of information the program reports when it runs. Default level is 0,
which means that only errors and other critical conditions are
reported. Raising it may be necessary when debugging new configurations. Each
@option{-d} option raises the level by one, so you can say
@command{wydawca -dd} to obtain level 2, for example. The maximum
debugging level (currently it is 4) prints an impractically big
amount of information, and is useful mainly for @command{wydawca}
developers.

@anchor{dry-run}
@xopindex{dry-run, described}
@sopindex{n, described}
  Yet another debugging facility is the @option{--dry-run}
(@option{-n}) option. It instructs @command{wydawca} to avoid doing any
modifications to the disk contents, and to print a verbose description
of any actions it would have taken. It sets the debugging level to 1
and directs the diagnostics output to the standard error, as if
@option{--debug --stderr} options were given. You can raise
debugging level further by supplying additional @option{--debug}
options. The @option{--dry-run} option is useful when testing new
configurations, for example:

@smallexample
$ wydawca -c new.cfg --dry-run
@end smallexample

@xopindex{help, described}
@sopindex{h, described}
@xopindex{version, described}
@sopindex{v, described}
  In addition, the two usual informational options are available as well:
@option{--help} (@option{-h}) prints a short usage summary, and
@option{--version} (@option{-v}) prints program version number.

@node configuring
@chapter How to Configure @command{wydawca}.
  Upon startup, @command{wydawca} reads its settings from the
@dfn{configuration file} @file{wydawca.rc}. By default it is located
in @var{$sysconfidr} (i.e., in most cases @file{/usr/local/etc}, or
@file{/etc}), but an alternative location may be specified using
@option{--config-file} command line option (@pxref{starting, config-file}).

  If any errors are encountered in the configuration file, the program
reports them on its error output and exits with a non-zero status.

@xopindex{lint, introduced}
  To test the configuration file without starting the server use
@option{--lint} (@option{-t}) command line option. It causes
@command{wydawca} to check configuration file for syntax errors and
other inconsistencies. If no errors were detected, the program exits
with code 0. Otherwise, the exit code is 78.

  Using this option together with @option{-d} (@option{--debug}),
causes @command{wydawca} to produce a dump of the configuration parse
tree. Using the @option{-d} option twice prefixes each statement in
the dump with the file location where it appeared.

@sopindex{E, introduced}
@xopindex{no-preprocessor, introduced}
  Before parsing, configuration file is preprocessed using
@command{m4} (@pxref{Preprocessor}). To see the preprocessed
configuration without actually parsing it, use @option{-E} command
line option. To avoid preprocessing it, use
@option{--no-preprocessor} option.

@xopindex{config-help, introduced}
  The rest of this section describes the configuration file syntax in
detail. You can receive a concise summary of all configuration
directives any time by running @command{wydawca --config-help}.

@menu
* Syntax::               Configuration file syntax.
* general::
* versions::
* user privileges::
* daemon::
* tcp-wrapper::
* locking::
* syslog::
* sql::
* dictionaries::
* directory setup::
* archivation::
* spool::
* verification::
* statistics::
* notification::
@end menu

@node Syntax
@section Configuration file syntax

  Wydawca configuration file consists of statements and comments.

  There are three classes of lexical tokens: keywords, values, and
separators. Blanks, tabs, newlines and comments, collectively called
@dfn{white space} are ignored except as they serve to separate
tokens. Some white space is required to separate otherwise adjacent 
keywords and values.

@menu
* Comments::
* Pragmatic Comments::
* Statements::
* Preprocessor::
@end menu

@node Comments
@subsection Comments
@cindex Comments in a configuration file
@cindex single-line comments
  @dfn{Comments} may appear anywhere where white space may appear in the
configuration file. There are two kinds of comments:
single-line and multi-line comments. @dfn{Single-line} comments start
with @samp{#} or @samp{//} and continue to the end of the line:

@smallexample
# This is a comment
// This too is a comment
@end smallexample

@cindex multi-line comments
  @dfn{Multi-line} or @dfn{C-style} comments start with the two
characters @samp{/*} (slash, star) and continue until the first
occurrence of @samp{*/} (star, slash).

  Multi-line comments cannot be nested. However, single-line comments
may well appear within multi-line ones.

@node Pragmatic Comments
@subsection Pragmatic Comments
@cindex comments, pragmatic
@cindex pragmatic comments
  Pragmatic comments are similar to usual single-line comments,
except that they cause some changes in the way the configuration is
parsed. Pragmatic comments begin with a @samp{#} sign and end with the
next physical newline character. Wydawca version @value{VERSION},
understands the following pragmatic comments:

@table @code
@kwindex #include
@item #include <@var{file}>
@itemx #include @var{file}
Include the contents of the file @var{file}. If @var{file} is an
absolute file name, both forms are equivalent. Otherwise, the form
with angle brackets searches for the file in the @dfn{include 
search path}, while the second one looks for it in the current working
directory first, and, if not found there, in the include search
path.

The default include search path is:

@enumerate 1
@item @file{@var{prefix}/share/wydawca/@value{VERSION}/include}
@item @file{@var{prefix}/share/wydawca/include}
@end enumerate

@noindent
where @var{prefix} is the installation prefix.

  New directories can be appended in front of it using @option{-I}
(@option{--include-directory}) command line option
(@pxref{Preprocessor, include-directory}).  

@kwindex #include_once
@item #include_once <@var{file}>
@itemx #include_once @var{file}
  Same as @code{#include}, except that, if the @var{file} has already
been included, it will not be included again.

@kwindex #line
@item #line @var{num}
@itemx #line @var{num} "@var{file}"
  This line causes @command{wydawca} to believe, for purposes of error
diagnostics, that the line number of the next source line is given by
@var{num} and the current input file is named by @var{file}.
If the latter is absent, the remembered file name does not change.

@item # @var{num} "@var{file}"
  This is a special form of @code{#line} statement, understood for
compatibility with the @sc{c} preprocessor.
@end table

  In fact, these statements provide a rudimentary preprocessing
features. For more sophisticated ways to modify configuration before
parsing, see @ref{Preprocessor}.

@node Statements
@subsection Statements
@cindex statements, configuration file
@cindex configuration file statements
@cindex statement, simple
@cindex simple statements
  A @dfn{simple statement} consists of a keyword and value
separated by any amount of whitespace. Simple statement is terminated
with a semicolon (@samp{;}).

  Examples of simple statements:

@smallexample
daemon yes;
pidfile /var/run/wydawca.pid;
@end smallexample

  A @dfn{keyword} begins with a letter and may contain letters,
decimal digits, underscores (@samp{_}) and dashes (@samp{-}).
Examples of keywords are: @samp{group}, @samp{file-sweep-time}.

  A @dfn{value} can be one of the following:

@table @asis
@item number
  A number is a sequence of decimal digits.

@item boolean
@cindex boolean value
  A boolean value is one of the following: @samp{yes}, @samp{true},
@samp{t} or @samp{1}, meaning @dfn{true}, and @samp{no},
@samp{false}, @samp{nil}, @samp{0} meaning @dfn{false}.
  
@item unquoted string
@cindex string, unquoted
  An unquoted string may contain letters, digits, and any of the
following characters: @samp{_}, @samp{-}, @samp{.}, @samp{/},
@samp{@@}, @samp{*}, @samp{:}.

@item quoted string
@cindex quoted string
@cindex string, quoted
@cindex escape sequence
  A quoted string is any sequence of characters enclosed in
double-quotes (@samp{"}). A backslash appearing within a quoted
string introduces an @dfn{escape sequence}, which is replaced
with a single character according to the following rules:

@float Table, backslash-interpretation
@caption{Backslash escapes}
@multitable @columnfractions 0.30 .5
@item Sequence @tab Replaced with
@item \a @tab Audible bell character (@acronym{ASCII} 7)
@item \b @tab Backspace character (@acronym{ASCII} 8)
@item \f @tab Form-feed character (@acronym{ASCII} 12)
@item \n @tab Newline character (@acronym{ASCII} 10)
@item \r @tab Carriage return character (@acronym{ASCII} 13)
@item \t @tab Horizontal tabulation character (@acronym{ASCII} 9)
@item \v @tab Vertical tabulation character (@acronym{ASCII} 11)
@item \\ @tab A single backslash (@samp{\})
@item \" @tab A double-quote.
@end multitable
@end float

  In addition, the sequence @samp{\@var{newline}} is removed from
the string. This allows to split long strings over several
physical lines, e.g.:

@smallexample
@group
"a long string may be\
 split over several lines"
@end group
@end smallexample

  If the character following a backslash is not one of those specified
above, the backslash is ignored and a warning is issued.

  Two or more adjacent quoted strings are concatenated, which gives
another way to split long strings over several lines to improve
readability. The following fragment produces the same result as the
example above:

@smallexample
@group
"a long string may be"
" split over several lines"
@end group
@end smallexample

@anchor{variable expansion}
@cindex variable expansion
@cindex variables
Depending on the context, the quoted string may be subject to
@dfn{variable expansion}.

During variable expansion, references to variables
in the string are replaced with their actual values.  A variable
reference has two basic forms:

@example
  $@var{v}
  $@{@var{v}@}
@end example

@noindent
where @var{v} is the variable name.  The notation in curly braces
serves several purposes.  First, it should be used if the variable
reference is immediately followed by an alphanumeric symbol, which
will otherwise be considered part of it (as in @samp{$@{home@}dir}).
Secondly, this form allows for specifying the action to take if the
variable is undefined or expands to an empty value.

The following special forms are recognized:

@table @asis
@item $@{@var{variable}:-@var{word}@}
@dfn{Use Default Values}.  If @var{variable} is unset or null, the expansion
of @var{word} is  substituted.  Otherwise, the value of @var{variable} is
substituted.

@item $@{@var{variable}:=@var{word}@}
@dfn{Assign Default Values}.  If @var{variable} is unset or null, the
expansion  of @var{word} is assigned to variable.  The value of
@var{variable} is then substituted.

The assigned value remains in effet during expansion of the current string.

@item $@{@var{variable}:?@var{word}@}
@dfn{Display Error if Null or Unset}.  If @var{variable} is null or unset,
the expansion of @var{word} (or a message to that effect if @var{word} is
not present) is output to the current logging channel.  Otherwise, the
value of @var{variable} is substituted.

@item $@{@var{variable}:+@var{word}@}
@dfn{Use Alternate Value}.  If @var{variable} is null or unset, nothing is
substituted, otherwise the expansion of @var{word} is substituted.
@end table

These constructs test for a variable that is unset or null.  Omitting
the colon results in a test only for a variable that is unset.

@anchor{handling of undefined variables}
@cindex expansion of undefined variables
@cindex undefined variable, expansion
If a string contains a reference to an undefined variable,
@command{wydawca} will report an error and abort. To
gracefully handle such cases, use the @dfn{default value construct},
defined above.

@FIXME{Implement the expand-undefined setting, similar to the one in
rush}.

@anchor{here-document}
@item Here-document
@cindex here-document
  A @dfn{here-document} is a special construct that allows to introduce
strings of text containing embedded newlines.  

  The @code{<<@var{word}} construct instructs the parser to read all
the following lines up to the line containing only @var{word}, with
possible trailing blanks. Any lines thus read are concatenated
together into a single string. For example:

@smallexample
@group
<<EOT
A multiline
string
EOT
@end group
@end smallexample

  Body of a here-document is interpreted the same way as
double-quoted string, unless @var{word} is preceded by a backslash
(e.g. @samp{<<\EOT}) or enclosed in double-quotes, in which case
the text is read as is, without interpretation of escape sequences.

  If @var{word} is prefixed with @code{-} (a dash), then all leading
tab characters are stripped from input lines and the line containing
@var{word}. Furthermore, if @code{-} is followed by a single space,
all leading whitespace is stripped from them. This allows to indent
here-documents in a natural fashion. For example:

@smallexample
@group
<<- TEXT
    All leading whitespace will be
    ignored when reading these lines.
TEXT
@end group
@end smallexample

  It is important that the terminating delimiter be the only token on
its line. The only exception to this rule is allowed if a
here-document appears as the last element of a statement. In this
case a semicolon can be placed on the same line with its terminating 
delimiter, as in: 

@smallexample
help-text <<-EOT
        A sample help text.
EOT;
@end smallexample

@item list
@cindex list
  A @dfn{list} is a comma-separated list of values. Lists are
enclosed in parentheses. The following example shows a statement
whose value is a list of strings:

@smallexample
alias (test,null);
@end smallexample

  In any case where a list is appropriate, a single value is allowed
without being a member of a list: it is equivalent to a list with a
single member. This means that, e.g.

@smallexample
alias test;
@end smallexample

@noindent
is equivalent to

@smallexample
alias (test);
@end smallexample

@anchor{time interval specification}
@item time interval specification
@cindex Time Interval Specification
  The @dfn{time interval specification} is a string that defines an
interval, much the same way we do this in English: it consists of one
or more pairs @samp{number}-@samp{time unit}. For example, the
following are valid interval specifications:

@smallexample
@group
"1 hour"
"2 hours 35 seconds"
"1 year 7 months 2 weeks 2 days 11 hours 12 seconds"
@end group
@end smallexample

@noindent
The pairs can occur in any order, however unusual it may sound to a
human ear, e.g. @samp{2 days 1 year}. If the @samp{time unit} is
omitted, seconds are supposed.

@end table

@cindex statement, block
@cindex block statement
  A @dfn{block statement} introduces a logical group of 
statements. It consists of a keyword, followed by an optional value,
and a sequence of statements enclosed in curly braces, as shown in
the example below:

@smallexample
@group
spool download @{
  source /home/ftp/incoming/ftp;
  destination /home/ftp/pub;
@}
@end group
@end smallexample

  The closing curly brace may be followed by a semicolon, although
this is not required.

@node Preprocessor
@subsection Preprocessor
@cindex preprocessor
@cindex m4
  Before parsing its configuration file, @command{wydawca} preprocesses
it. The built-in preprocessor handles only file inclusion
and @code{#line} statements (@pxref{Pragmatic Comments}), while the
rest of traditional preprocessing facilities, such as macro expansion,
is supported via @command{m4}, which is used as an external preprocessor. 

  The detailed description of @command{m4} facilities lies far beyond
the scope of this document. You will find a complete user manual in
@ifnothtml
@ref{Top, GNU M4 manual, GNU M4, m4, GNU M4 macro processor}.
@end ifnothtml
@ifhtml
@uref{http://www.gnu.org/software/m4/manual}.
@end ifhtml
For the rest of this subsection we assume the reader is sufficiently
acquainted with @command{m4} macro processor.

@cindex @file{pp-setup}
  The external preprocessor is invoked with @option{-s} flag, which
instructs it to include line synchronization information in its
output. This information is then used by the parser to display meaningful
diagnostic. An initial set of macro definitions is supplied by the 
@file{pp-setup} file, located in
@file{@var{$prefix}/share/wydawca/@var{version}/include} directory (where
@var{version} means the version of Wydawca package).

  The default @file{pp-setup} file renames all @command{m4} built-in
macro names so they all start with the prefix @samp{m4_}. This
is similar to GNU m4 @option{--prefix-builtin} options, but has an
advantage that it works with non-GNU @command{m4} implementations as
well.

@sopindex{E, described}
  To examine the preprocessed configuration, use the @option{-E}
option.  The output from @command{m4} will be printed on the standard
output and the program will terminate.

  Additional control over the preprocessor is provided via the
following command line options:

@table @option
@xopindex{define, introduced}
@sopindex{D, introduced}
@item --define=@var{name}[=@var{value}]
@itemx -D@var{name}[=@var{value}]
  Define the preprocessor symbol @var{name} as having @var{value}, or
empty.

@xopindex{include-directory, introduced}
@sopindex{I, introduced}
@item --include-directory=@var{dir}
@itemx -I@var{dir}
  Add @var{dir} to the list of directories searched for preprocessor
include files.

@xopindex{no-preprocessor, defined}
@item --no-preprocessor
  Disable preprocessor.

@xopindex{preprocessor, defined}
@item --preprocessor=@var{command}
Use @var{command} instead of the default preprocessor.
@end table

@node general
@section General Settings

@deffn {Config} foreground bool
If @var{bool} is @samp{yes}, run in foreground. @xref{invocation,
foreground}.
@end deffn

@deffn {Config} single-process bool
Configure single process mode. Normally @command{wydawca}
spawns subprocesses for handling incoming connections and spool jobs.
This is disabled if @var{bool} is @samp{yes} (a so-called
@dfn{single-processs mode}). This mode is designed for debugging
purposes. Do not use it in production environments, because it
severely impairs performance.
@end deffn

@deffn {Config} umask value
Set the default umask. The @var{value} argument must be an octal number.
@end deffn

@deffn {Config} file-sweep-time time
Consider triplet expired if its oldest file was created more than
@var{time} seconds ago. @xref{time interval specification}, for the
syntax of @var{time}.

This parameter may also be set for each spool
individually. @xref{spool, file-sweep-time}.
@end deffn

@anchor{gpg-homedir}
@deffn {Config} gpg-homedir dir
Set default @acronym{GPG} home directory. The keys for signing
outgoing messages are looked up in this directory. @xref{statreports,
gpg-sign}, and @ref{event notification, gpg-sign}.
@end deffn

@node versions
@section Upload Directive Versions
At the time of this writing, FSF has published three versions of the
upload directives, numbered 1.0 through 1.2. The version 1.0 is
considered obsolete and was withdrawn in 2006. The only difference
between versions 1.1 and 1.2 is in handling of files that existed
prior to upload. The version 1.1 implied automatic archivation of the
existing files and their replacement with the newly uploaded versions.
The version 1.2 introduces a new keyword (@samp{replace}) for that
purpose, which determines its further actions.

For a detailed information about version 1.1, see
@ifnothtml
@xref{FTP Upload Directive File - v1.1,
Standalone directives, Standalone directives,
maintain, Information for maintainers of GNU software}.
@end ifnothtml
@ifhtml
@uref{http://www.gnu.org/prep/maintain/html_node/FTP-Upload-Directive-File-_002d-v1_002e1.html,
Standalone directives}.
@end ifhtml

The version 1.2 and its differences from 1.1 are discussed in
@ifnothtml
@xref{FTP Upload Directive File - v1.2,
Standalone directives, Standalone directives,
maintain, Information for maintainers of GNU software}.
@end ifnothtml
@ifhtml
@uref{http://www.gnu.org/prep/maintain/html_node/FTP-Upload-Directive-File-_002d-v1_002e2.html,
Standalone directives}.
@end ifhtml

By default, @command{wydawca} supports both versions. The supported range of
versions can be abridged using the following configuration statements:

@deffn {Config} min-version vn
Sets minimal allowed directive file version. The @var{vn} argument
must have the form @samp{@var{major}.@var{minor}} and can not be less
than @samp{1.1}.
@end deffn

@deffn {Config} max-version vn
Sets maximal allowed directive file version.
@end deffn

For example, the following statements configure @command{wydawca} to
accept only directive files of version 1.2:

@example
min-version 1.2;
max-version 1.2;
@end example

@node user privileges
@section User Privileges

@command{Wydawca} refuses to run with the root privileges. You
should configure its user privileges by using @code{user} and,
optionally, @code{group} statements in its configuration file:

@deffn {Config} user name
Run with UID and GID of the user @var{name}.
@end deffn

@deffn {Config} group list
Retain the supplementary groups from the @var{list}. The latter
must contain group names. For example:

@smallexample
group (nogroup, ftp);
@end smallexample
@end deffn

@node daemon
@section Daemon Configuration

  Statements in this section configure the daemon mode.

@deffn {Config} daemon bool
Enable daemon mode.
@end deffn

@deffn {Config} inotify bool
Enables or disables the @dfn{inotify} watcher.  By default, inotify is
always enabled on GNU/Linux systems (unless disabled at the configure
time).  It can also be configured for each spool individually
(@xref{spool, inotify}.  @xref{inotify}, for a detailed description of
this feature.
@end deffn

@deffn {Config} listen url
Define a socket to listen on. Allowed values for @var{url}
are:

@table @asis
@findex /etc/services
@item inet://@var{ip}:@var{port}
Listen on IPv4@footnote{Support for IPv6 will be added in future
versions.}. address @var{ip}. @var{Ip} may be given either in
a dotted quad notation or as a symbolic host name. @var{Port} is
either a decimal port name, or a service name from @file{/etc/services}.

@item local://@var{file}
@itemx file://@var{file}
@itemx unix://@var{file}
Listen on the @acronym{UNIX} socket file @var{file}, which is either
an absolute or relative file name.
@end table
@end deffn

@deffn {Config} all-spools name
Declare a special service name, which will be treated as a request to
process all spools.
@end deffn

@deffn {Config} wakeup-interval time
Specifies the wake-up interval for the daemon. If no connections
are requested during @var{time}, the server will wake up
and sweep all the configured spools. It is useful for periodical
removal of expired triplets. See also @code{file-sweep-time}
statement (@pxref{general, file-sweep-time}).

@xref{time interval specification}, for the syntax of @var{time}.
@end deffn

@deffn {Config} pidfile file
Store master process @acronym{PID} in @var{file}. Default pidfile
location is @file{@var{localstatedir}/run/wydawca.pid}.
@end deffn

@node tcp-wrapper
@section TCP Wrappers

Access to the socket specified in @code{listen} statement is
controlled by the @code{tcp-wrapper} block statement: 

@deffn {Config} tcp-wrapper @{ @dots{} @}
@smallexample
tcp-wrapper @{
  enable @var{arg:@i{boolean}};
  daemon @var{name:@i{string}};
  allow-table @var{file:@i{string}};
  deny-table @var{file:@i{string}};
  allow-syslog-priority @var{prio:@i{string}};
  deny-syslog-priority @var{prio:@i{string}};
@}
@end smallexample
@end deffn

This statement is available only if @command{wydawca} was compiled
with support for TCP wrappers.

@deffn {Config: tcp-wrapper} enable bool
Enable or disable the use of TCP wrappers.
@end deffn

@deffn {Config: tcp-wrapper} daemon name
Set the @dfn{daemon name}. It is the name before the colon in
the access control file, that marks the line controlling access to
@command{wydawca}. The default is @samp{wydawca}.
@end deffn

@findex /etc/hosts.allow
@deffn {Config: tcp-wrapper} allow-table file
File name of the positive access control file. By default
@file{/etc/hosts.allow}.
@end deffn

@deffn {Config: tcp-wrapper} deny-table file
File name of the negative access control file. By default
@file{/etc/hosts.deny}.
@end deffn

@deffn {Config: tcp-wrapper} allow-syslog-priority prio
Log allowed accesses via the given @command{syslog} priority.
@end deffn

@deffn {Config: tcp-wrapper} deny-syslog-priority prio
Log denied accesses via the given @command{syslog} priority.
@end deffn

Allowed values for @var{prio} in the @samp{allow-syslog-priority}
and @samp{deny-syslog-priority} statements are: @samp{emerg},
@samp{alert}, @samp{crit}, @samp{err}, @samp{warning}, @samp{notice},
@samp{info}, and @samp{debug}.

@node locking
@section Locking Configuration
  To avoid a possibility of two @command{wydawca} instances handling
the same triplet, @command{wydawca} @dfn{locks} the spool before
processing it. This is done by creating a @dfn{lock file}. The
parameters of the locking subsystem are configured via the
@code{locking} statement:

@deffn {Config} locking @{ @dots{} @}
@smallexample
locking @{
  enable @var{arg:@i{boolean}};
  directory @var{dir:@i{string}};
  expire-time @var{time:@i{interval}};
  timeout @var{time:@i{interval}};
@}
@end smallexample
@end deffn

@deffn {Config: locking} enable bool
Enable or disable locking. By default it is enabled.
@end deffn

@deffn {Config: locking} directory dir
Sets directory for lock files. Make sure @var{dir} is writable
for the user (or group) @command{wydawca} runs at (@pxref{user
privileges}.

The default directory is @file{@var{localstatedir}/@/lock/@/wydawca}.
@end deffn

@deffn {Config: locking} expire-time time
Sets expiration interval for lock files. An existing lock file
older than @var{time} is considered stale and removed.

@xref{time interval specification}, for the syntax of @var{time}.
@end deffn

@deffn {Config: locking} timeout time
Timeout for acquiring locks. If a lock file cannot be acquired during
this time, @command{wydawca} reports error and exits.

@xref{time interval specification}, for the syntax of @var{time}.
@end deffn

@node syslog
@section Syslog Configuration Directives
@cindex syslog, configuration

Unless told otherwise, @command{wydawca} uses @code{syslog} to print
its diagnostic messages. By default, the program uses the
@samp{local1} facility. The @code{syslog} statement allows to change that:

@deffn {Config} syslog @{ ... @}
@smallexample
syslog @{
  facility local1;
  tag wydawca;
  print-priority yes;
@}
@end smallexample
@end deffn


@deffn {Config: syslog} facility name
@kwindex authpriv@r{, syslog facility}
@kwindex cron@r{, syslog facility}
@kwindex daemon@r{, syslog facility}
@kwindex ftp@r{, syslog facility}
@kwindex local0 @r{through} local7@r{, syslog facilities}
@kwindex mail@r{, syslog facility}
  Configures the syslog facility to use. Allowed values are:
@samp{auth}, @samp{authpriv}, @samp{cron}, @samp{daemon}, @samp{ftp},
@samp{local0} through @samp{local7}, and @samp{mail}. These names are
case-insensitive and may be optionally prefixed with @samp{log_}
(case-insensitive as well). 
@end deffn

@deffn {Config: syslog} tag string
@cindex syslog tag, configuring
  This statement sets the @dfn{syslog tag}, a string
identifying each message issued by the program. By default, the
name of the program (@samp{wydawca}) is used.
@end deffn

@deffn {Config: syslog} print-priority bool
@cindex syslog priority, printing in diagnostics
  In addition to priority segregation, provided by @command{syslog},
you can instruct @command{wydawca} to prefix each syslog message with
its priority. To do so, set:

@smallexample
print-priority yes;
@end smallexample
@end deffn

@node sql
@section @acronym{SQL} Databases
@cindex database, @acronym{SQL}
@cindex @acronym{SQL} databases
@cindex @command{MySQL} databases
@cindex database, @command{MySQL}

Several statements in configuration file may need to access an
@acronym{SQL} database. @command{Wydawca} is able to use any number of
databases simultaneously, the only restriction being that they must be
@command{MySQL} databases (this restriction will be removed in future
releases).

  A database is defined using @code{sql} block statement:

@deffn {Config} sql @var{id} @{ ... @}
@smallexample
@group
sql @var{id} @{
  config-file @var{file};
  config-group @var{group};
  host @var{hostname};
  database @var{dbname};
  user @var{username};
  password @var{string};
  ssl-ca @var{string};
@}
@end group
@end smallexample

  Here, @var{id} is a string uniquely identifying this
database. It is used by other configuration statements (e.g. by
dictionaries, see the next section) to refer to this
database. 
@end deffn

@deffn {Config: sql} config-file @var{name}
  Set the name of the @acronym{SQL} configuration file to read.
@end deffn

@deffn {Config: sql} config-group @var{name}
  Set the name of the group in the @acronym{SQL} configuration file,
from where to read configuration options.
@end deffn

  The statements above allow to keep all security-sensitive
information, such as @acronym{SQL} username and password, in an
external configuration file and thus to relax permission requirements
for @file{wydawca.rc}. The exact format of such external configuration
file depends on the flavor of @acronym{SQL} @acronym{DBMS} in use.
As of version @value{VERSION} @command{wydawca} supports only
@samp{MySQL}, so the configuration file is what is called @dfn{option
file} in @samp{MySQL} parlance
@ifhtml
(see @uref{http://dev.mysql.com/doc/refman/5.0/en/option-files.html,
option files}).
@end ifhtml
@ifnothtml
(@pxref{option-files, Using Option Files,,mysql,MySQL Manual}).
@end ifnothtml

  For example, suppose your @file{wydawca.rc} contains the following:

@smallexample
sql default @{
  config-file /etc/wydawca.mysql;
  config-group wydawca;
@}
@end smallexample

@noindent
  Then, the @file{/etc/wydawca.mysql} would contain the actual
parameters for accessing the database, e.g.:

@smallexample
[wydawca]
socket = /var/db/mysql.sock
database = savane
user = savane
pass = guessme
@end smallexample

  Another way to specify database credentials is by using the
statements described below. If you prefer this way, you will have to
tighten the permissions of @file{wydawca.rc} so that no third person
could see the @acronym{SQL} password. The recommended permissions are
@samp{0600}.

@deffn {Config: sql} host @var{hostname}[:@var{port-or-socket}]
  Set the hostname or @acronym{IP} address of the host running the
database. Optional @var{port-or-socket} specifies port number (for
@acronym{TCP} connections) or socket name (for @acronym{UNIX} sockets)
to use. In the latter case, the @var{hostname} and the colon may be
omitted. If, however, it is present, it must be @samp{localhost}.
@end deffn

@deffn {Config: sql} database name
Specifies the database name.
@end deffn

@deffn {Config: sql} user name
Sets the database user name.
@end deffn

@deffn {Config: sql} password string
Sets the password for accessing the database.
@end deffn

@deffn {Config: sql} ssl-ca file
Sets the pathname to the certificate authority file, if you
wish to use a secure connection to the server via SSL.
@end deffn

@noindent
  An example @code{sql} statement follows:

@smallexample
@group
sql default @{
  host project.database.com:3306;
  database savane;
  user root;
  password guessme;
@}
@end group
@end smallexample

  It is possible to combine both methods, e.g.:

@smallexample
@group
sql default @{
  config-file /etc/wydawca.sql;
  host project.database.com:3306;
  database savane;
@}
@end group
@end smallexample

  Then, @command{wydawca} will attempt to obtain the missing
information (username and password, in this case) from the
@file{/etc/wydawca.sql} file.

@node dictionaries
@section Dictionaries
@cindex dictionaries
@cindex @acronym{PGP} key
  A @dfn{dictionary} defines the ways to retrieve user information
necessary to verify the submission. This information can be, for
example, the user's @acronym{PGP} key or his permissions on a project.

  A dictionary is defined in configuration file using the
following syntax:

@deffn {Config} dictionary @{ @dots{} @}
@smallexample
dictionary @var{dict-id} @{
  type @var{type};
  query @var{string};
  params (@var{param1},@var{param2},@dots{});
@}
@end smallexample
@end deffn

  The @code{dictionary} statement can appear either in the global scope of
the configuration file, or inside a @code{spool} statement
(@pxref{spool}). Global definitions affect all directory
pairs in the configuration file, and ones inside a @code{directory}
statement override them for that particular spool.

There are two dictionaries, identified by the value of
@var{dict-id} tag:

@table @asis
@kwindex project-owner
@item project-owner
  Keeps email addresses and real names of administrators (or
@dfn{owners}) of a project. It may return any number of rows, each one
consisting of two columns: an email address and a user name, in this
order.

@kwindex project-uploader
@item project-uploader
  Keeps system user names, real names, emails and GPG keys of
the users that are allowed to make uploads for the project.
@end table

The sub-statements of @code{dictionary} are:

@deffn {Config: dictionary} type name
Defines the type of this dictionary. @var{Name} is one of the following:

@table @asis
@kwindex builtin
@item builtin
  The data are supplied in the configuration file.

@kwindex sql
@item sql
  Retrieve data from an @acronym{SQL} database. Currently only
@command{MySQL} is supported.

@kwindex external
@item external
  Retrieve data using an external program. This dictionary type is
reserved for future use.
@end table

See below for a detailed description of these dictionary types.
@end deffn

@anchor{query}
@deffn {Config: dictionary} query string
Sets the query used for retrieving the data. The @var{string} is
subject to variable expansion (@pxref{variable expansion}). The
following variables are defined in this context:

@table @code
@kwindex project
@item project
  The system name of the project for which the triplet is
submitted. It is defined as the value of directive
@code{directory}, or, in case this value contains slashes, the
shortest initial prefix of that value, not containing slashes.

@kwindex spool
@item spool
  The name of the distribution spool where this upload originates
(@pxref{spool}).

@kwindex url
@item url
  The @acronym{URL} of the spool, as set in the @code{url} statement
of the @code{spool} block (@pxref{spool, url}).

@kwindex dir
@item dir
Directory (relative to the project distribution root) where the
files are going to be uploaded.

@kwindex dest_dir
@item dest_dir
Spool destination directory (@pxref{spool, destination}).

@kwindex source_dir
@item source_dir
Spool source directory (@pxref{spool, source}).

@kwindex user
@item user
@itemx user:name
  The system name of the user that submitted the triplet. This is
defined only for @samp{project-owner} dictionaries.

@kwindex comment
@item comment
The value of the @samp{comment} field from the directive file.
@end table
@end deffn

@deffn {Config: dictionary} params (param1, param2, @dots{})
Supplies additional parameters.
@end deffn

@menu
* sql type::
* builtin type::
* external type::
@end menu

@node sql type
@subsection SQL Dictionary
@cindex sql dictionary
Dictionaries of @samp{sql} type retrieve information from an
@acronym{SQL} database (as of version @value{VERSION}, only
@samp{MySQL} databases are supported).

The @code{query} statement supplies the @acronym{SQL} query to
execute. Normally, it should be a @code{SELECT} query.

The @code{params} statement must supply a single parameter --
the identifier of one of the preceding @code{sql} blocks (@pxref{sql}),
which determines database name and user credentials needed to access it.

@cindex Savane
  The following sub-nodes contain sample definitions for the 
@code{sql} dictionaries. They are based on the database structure used in
@uref{http://gna.org/projects/savane, @command{Savane} system}.

@menu
* project-owner-sql::
* project-uploader-sql::
@end menu

@node project-owner-sql
@subsubsection Project-owner: an SQL Implementation
@cindex project-owner
  Retrieve email addresses and real names of administrators (or
@dfn{owners}) of a project. It may return any number of rows, each one
consisting of two columns: an email address and a user name, in this order.

@smallexample
dictionary project-owner @{
  type sql;
  params (default);
  query   "SELECT user.email, user.realname "
          "FROM user,user_group,groups "
          "WHERE user_group.user_id=user.user_id "
          "AND user_group.group_id=groups.group_id "
          "AND user_group.admin_flags = 'A' "
          "AND groups.unix_group_name = '$@{project@}'";
@}
@end smallexample

@node project-uploader-sql
@subsubsection Project-uploader: an SQL Implementation
@cindex project-uploader-sql

  This dictionary assumes that the @samp{user} table has a special
column, @samp{upload_flags}, whose value is @samp{Y} for those users
who can do uploads for this project:

@smallexample
dictionary project-uploader @{
  type sql;
  params (default);
  query   "SELECT user.email, user.realname "
          "FROM user,user_group,groups "
          "WHERE user_group.user_id=user.user_id "
          "AND user_group.group_id=groups.group_id "
          "AND user_group.upload_flags = 'Y' "
          "AND groups.unix_group_name = '$@{project@}'";
@}
@end smallexample

@node builtin type
@subsection Built-in Dictionary
@cindex builtin dictionary

  @dfn{Builtin dictionaries} are small dictionaries that keep all data
in their @code{params} list. They are designed mainly for testing
purposes.

  Look ups in builtin dictionaries are performed as follows:
The @code{query} value is expanded (@pxref{query}). The resulting
value is used as a @dfn{key} for lookup in @code{params} list.
The list scanned as follows:

@enumerate 1
@item INIT

Let @var{i} be the index of the current element in @code{params}.
Set @var{i} to 0.

@item GETEL

Get the @var{i}th element.

@item

If it begins with a slash, interpret it as @dfn{comparison type
indicator}. Its possible values are:

@table @asis
@item /exact
Exact comparison. The key must be exactly equivalent to the
dictionary field.

@item /fnmatch
Dictionary field is treated as an @dfn{fnmatch globbing
pattern}. @xref{globbing pattern,,,glob(7),glob man page}.

@item /regex
Dictionary field is treated as a regular expression.
Unless configured otherwise by flags (see below), @acronym{POSIX}
extended regular expressions are used (@pxref{Extended
regexps, Extended regular expressions, Extended regular expressions,
sed, GNU sed}).
@end table

If that word ends with a comma, the characters following it
are @dfn{flags}, defining the type of matching. Allowed flags
are:

@multitable @columnfractions 0.2 0.8
@headitem Flag @tab Meaning
@item i        @tab Ignore case
@item b        @tab Use basic regular expressions
@end multitable

  For example, the string @samp{/exact,i} specifies case-insensitive
exact comparison, the string @samp{/regex,bi} specifies
case-insensitive basic regular expression matching, etc.

  Go to step @samp{INCR}.

@item COMP

Compare the element with the key, using currently selected comparison
method.

@item

If the element matches the key, add elements @code{@var{i}+1}
through @code{@var{i}+@var{n}} to the result set. The value for
@var{n} is selected as follows:

@multitable @columnfractions 0.8 0.2
@headitem Dictionary @tab @var{n}
@item project-owner    @tab 2
@item project-uploader @tab 4
@end multitable

@item

Set @code{@var{i} = @var{i} + @var{n}}

@item INCR

Set @code{@var{i} = @var{i} + 1}.

@item LOOP

If @var{i} is greater than the number of elements in @code{param},
then stop. Otherwise, go to step @samp{GETEL}.
@end enumerate

  For example, the following defines the @samp{project-owner}
dictionary, containing data for projects @samp{foo} and @samp{bar}:  

@smallexample
@group
dictionary project-owner @{
  type builtin;
  query "$@{project@}";
  params ("/exact",
          "foo", "foo-owner@@domain.net", "Foo Admin",
          "bar", "smith@@other.net", "John Smith");
@}
@end group
@end smallexample


@node external type
@subsection External Dictionary
@cindex external dictionary

As of version @value{VERSION} this dictionary is not yet
implemented.

@node directory setup
@section Directory Setup

@command{Wydawca} operates on three kinds of directories: spool source
directories (@pxref{spool, source}), destination directories
(@pxref{spool, destination}) and archive directories
(@pxref{archivation}). By default, @command{wydawca} assumes that all
directories specified in its configuration file already exist and have
proper ownership and modes. It will abort if it is not so.

You can configure @command{wydawca} to create these directories as
needed, and to set up their ownership and modes automatically.

@deffn {Config} create-directories bool
If set to @samp{yes}, this statement instructs @command{wydawca} to
create any missing directories.
@end deffn

@deffn {Config} directory-mode mode
Specifies the mode for created directories (in octal).  If the
directory already exists, its mode will be checked and if necessary
changed to @var{mode}.

This statement is overridden by per-directory statements:
@code{source-mode} and @code{destination-mode} statements in
@code{spool} block (@pxref{spool}) and @code{directory-mode} statement
in @code{archive} block (@pxref{archivation}).
@end deffn

@deffn {Config} directory-owner uid gid
Configures owner user and group IDs for source, destination and
archive directories.

The @var{uid} argument is either a numeric UID prefixed with a plus
sign, or a symbolic user name, which will be converted to the numeric
UID using the system user database.  If a number without the @samp{+}
prefix is supplied, it will first be looked in the password database
as the user name, and, if no such user is found, it will be used as
the numeric UID.

The same holds for the @var{gid} argument.

This statement is overridden by per-directory statements:
@code{source-owner} and @code{destination-owner} statements in
@code{spool} block (@pxref{spool}) and @code{directory-owner} statement
in @code{archive} block (@pxref{archivation}).
@end deffn

Notice, that both @code{directory-mode} and @code{directory-owner}
apply only to the last component of the created directory
(@samp{basename}).  Any intermediate directories are created with
default mode and ownership.

@node archivation
@section Archivation
@cindex archivation, defined
There may be cases when project maintainers need to overwrite
existing distributed files with another ones, having the same names.
(Note, however, that this practice is not encouraged). In that case,
@command{wydawca} needs to first @dfn{archive} the already existing
file, and then put the new one in its place. Moreover, the directive
file format allows maintainers to explicitly require archivation of
their existing files.

@cindex archivation methods
@kwindex archive
  @code{Wydawca} supports two basic archivation methods: to a
@command{tar} file, and to a separate directory. The method to be used
is configured using @code{archive} statement. This statement can
appear either in the global scope, in which case it affects all
spools, or within a @code{spool} block (@pxref{spool}),
where it affects only the given spool. 

@deffn {Config} archive type
@smallexample
archive @var{type} @{
  # Name of archive file or directory
  name @var{file-or-dir};

  # Define backup type
  backup @var{type};

  # mode for the archive directory
  directory-mode @var{mode};

  # owner user and group for the archive directory
  directory-owner @var{uid} @var{gid};
@}
@end smallexample

  The @var{type} argument specifies the archivation type:

@table @asis
@kwindex none@r{, archivation}
@item none
  Disable archivation.

@kwindex tar@r{, archivation}
@item tar
  Add to a @command{tar} archive.

@kwindex directory@r{, archivation}
@item directory
  Store file in a separate directory.
@end table
@end deffn

@deffn {Config: archive} name file-or-dir
  Specify the name of the tar archive (if type @samp{tar} is used) or
destination directory (if type @samp{directroy} is used).
@end deffn

  If the archivation type @asis{tar} is used, the @code{name}
statement sets the full name of the tar archive to use, e.g.: 

@smallexample
archive tar @{
  name /var/spool/uploads/archive.tar;
@}  
@end smallexample

  The file being archived is appended to the archive using
@command{tar -r} (@pxref{appending files, Appending Files to an
Archive, Appending Files to an Archive, tar, @acronym{GNU} tar: an
archiver tool}). Any archived instance can subsequently be retrieved
using GNU tar @option{--occurrence} option (@pxref{multiple, Multiple
Files with the Same Name, Multiple Files with the Same Name, tar,
@acronym{GNU} tar: an archiver tool}).

@deffn {Config} tar-program name
  By default, @code{wydawca} will search for @command{tar} binary in
your search path. If you wish to use a particular binary, you may
specify its full file name using @code{tar-program} statement.
@end deffn

  The @samp{directory} archivation type means that archive copies will
be stored in a directory specified by the @code{name} statement.
If it begins with a slash (i.e. represents an absolute
file name), an exact copy of the distribution directory hierarchy will
be created under it. For example, given this configuration:

@smallexample
archive directory @{
  name /var/backups/gnu;
@}  
@end smallexample

@noindent
all files from @file{/home/@/ftp/@/gnu/@/tar} will be archived in
@file{/var/@/backups/@/gnu/@/tar}, and files from
@file{/home/@/ftp/@/gnu/@/tar/@/old}
will be archived in @file{/var/@/backups/@/gnu/@/tar/@/old}, etc.

  If the directory name does not begin with a slash, it will be created
under the corresponding distribution directory. For example,
the following archivation settings:

@smallexample
archive directory @{
  name .archive;
@}  
@end smallexample

@noindent
mean that files from @file{/home/@/ftp/@/gnu/@/tar} will be archived in the
directory @file{/home/@/ftp/@/gnu/@/tar/@/.archive}, files from
@file{/home/@/ftp/@/gnu/@/tar/@/old} --- in
@file{/home/@/ftp/@/gnu/@/tar/@/.archive/@/old}, etc.

@deffn {Config: archive} backup type
@anchor{backup-methods}
@vindex version-control @r{Emacs variable}
   When using the @samp{directory} archivation type, it may happen that the
archive file with the same name as the one about to be created already
exists. This statement specifies how to handle the existing copy, in
other words, how to @dfn{backup} it. The @var{type} argument
corresponds to the @samp{version-control} Emacs variable. The
following table describes its possible values:

@table @samp
@item t
@itemx numbered
@kwindex t@r{, backup method}
@kwindex numbered@r{, backup method}
Always make numbered backups.

@item nil
@itemx existing
@kwindex nil@r{, backup method}
@kwindex existing@r{, backup method}
Make numbered backups of files that already have them, and simple backups
of the others.

@item never
@itemx simple
@kwindex never@r{, backup method}
@kwindex simple@r{, backup method}
Always make simple backups.

@end table

  If no backup method is given, @samp{existing} is assumed
@end deffn

@deffn {Config: archive} directory-mode mode
Sets directory mode for creating the directory (octal).  If the
directory already exists, its mode will be checked and if necessary
changed to @var{mode}.

This statement overrides the global @code{directory-mode} statement
(@pxref{directory setup}).
@end deffn

@deffn {Config} directory-owner uid gid
Configures owner user and group IDs for created archive directories.
If the archive directory already exists, its ownership will be checked
and if necessary reverted to @var{uid}:@var{gid}.

@xref{directory setup, directory-owner}, for a discussion of the
syntax for @var{uid} and @var{gid}.

This statement overrides the global @code{directory-mode} statement
(@pxref{directory setup}).
@end deffn

@cindex implicit signature archivation
@cindex signature files, archivation
  Signature files (i.e. the ones ending with @samp{.sig}) are usually
located in the same directory as the files they sign. To enforce this
rule, @command{wydawca} implements @dfn{implicit signature
archivation} facility. It works as follows. When archivation of
@var{file} is requested by @code{archive: @var{file}} statement in the
directive file (@pxref{FTP Upload Directive File - v1.1, Standalone
directives,, maintain.info, Information For Maintainers of GNU Software}),
@command{wydawca} also checks if the file named @file{@var{file}.sig}
exists. If so, it is archived along with @file{@var{file}}.

@deffn {Config} archive-signatures bool
  If implicit signature archivation is not needed, use
the @code{archive-signatures} statement to disable it, e.g.:

@smallexample
archive-signatures no;
@end smallexample
@end deffn

@node spool
@section Distribution Spool
@cindex distribution spool
@cindex defining source and distribution directories
@cindex distribution directory, defining
@cindex source directory, defining
  A @dfn{distribution spool} defines the location of the source directory
and the corresponding distribution (or @dfn{destination})
directory. It may also set archivation type, various dictionaries and
notifications for that directory, thus overriding the global settings.

The @code{spool} block statement defines a distribution spool:

@deffn {Config} spool tag @{ @dots{} @}
@smallexample
spool @var{tag} @{
  url @var{url};
  alias (@var{aliases});
  inotify @var{bool};
  source @var{dir};
  source-mode @var{mode};
  source-owner @var{uid} @var{gid};
  destination @var{dir};
  destination-mode @var{mode};
  destination-owner @var{uid} @var{gid};
  file-sweep-time @var{interval};
  dictionary @{ @dots{} @}
  archive @{ @dots{} @}
  notify-event @{ @dots{} @}
@}
@end smallexample

The @var{tag} argument defines a unique identifier for this spool. It
will be used in log messages, timers (@pxref{spool-timers}) and is
available for variable expansion (@pxref{variable expansion}) as the
@samp{$spool} variable.
@end deffn

@deffn {Config: spool} alias list
Defines a list of @dfn{aliases}, i.e. alternative tag names for this
spool.
@end deffn

@deffn {Config: spool} inotify bool
Enables or disables the @dfn{inotify} watcher for this spool.  By
default, inotify is always enabled on GNU/Linux systems (unless
disabled at the configure time).  @xref{inotify}, for a detailed
description of this feature.
@end deffn

@deffn {Config: spool} url string
Defines download @acronym{URL}, associated with this spool. Its value
may be used as the variable @samp{$url} in mail notifications.
@end deffn

@deffn {Config: spool} source dir
Specifies the location of the source directory.
@end deffn

@deffn {Config: archive} source-mode mode
Sets directory mode for creating the source directory (octal).  If the
directory already exists, its mode will be checked and if necessary
changed to @var{mode}.

This statement overrides the global @code{directory-mode} statement
(@pxref{directory setup}).
@end deffn

@deffn {Config} source-owner uid gid
Configures owner user and group IDs for the source directory.
If the directory already exists, its ownership will be checked
and if necessary reverted to @var{uid}:@var{gid}.

@xref{directory setup, directory-owner}, for a discussion of the
syntax for @var{uid} and @var{gid}.

This statement overrides the global @code{directory-mode} statement
(@pxref{directory setup}).
@end deffn

@deffn {Config: spool} destination dir
Specifies the type and location of the destination directory. The
@var{dir} argument must be either an absolute name of a directory on
the local file system, or a special @acronym{URL}. @command{Wydawca}
version @value{VERSION} supports two destination @acronym{URL}
schemes:

@table @asis
@item file://@var{dir-name}
@itemx dir://@var{dir-name}
Equivalent to @var{dir-name} alone. Defines a destination directory
located on the local file system.

@item null:
Defines a @dfn{null upload spool}. Null spools implement all tests
described in @ref{overview}, but do not do any actual copying. The
uploaded files are simply removed after checks are over. Null spools
are useful mainly for diagnostic purposes.
@end table
@end deffn

The following two statements apply only if the destination is a local
directory (@samp{file://} or @samp{dir://} URL scheme):

@deffn {Config: archive} destination-mode mode
Sets directory mode for creating the destination directory (octal).
If the directory already exists, its mode will be checked and if
necessary changed to @var{mode}.

This statement overrides the global @code{directory-mode} statement
(@pxref{directory setup}).
@end deffn

@deffn {Config} destination-owner uid gid
Configures owner user and group IDs for the destination directory.
If the directory already exists, its ownership will be checked
and if necessary reverted to @var{uid}:@var{gid}.

@xref{directory setup, directory-owner}, for a discussion of the
syntax for @var{uid} and @var{gid}.

This statement overrides the global @code{directory-mode} statement
(@pxref{directory setup}).
@end deffn

The following statements, if present, override the corresponding global
definitions for this spool.

@deffn {Config: spool} archive @{ @dots{} @}
Configure spool-specific archivation. @xref{archivation}, for its
description.
@end deffn

@deffn {Config: spool} dictionary tag @{ @dots{} @}
Configure spool-specific dictionary. @xref{dictionaries}, for a
detailed discussion of this statement.
@end deffn

@deffn {Config: spool} file-sweep-time time
Set expiration time for triplets in this spool. A triplet is
considered expired if its oldest file was created more than
@var{time} seconds ago. This statement overrides the global
@samp{file-sweep-time} setting (@pxref{general, file-sweep-time}).
@end deffn

@deffn {Config: spool} notify-event @{ @dots{} @}
Configure spool-specific event notification. @xref{notification},
for a detailed discussion of this statement.
@end deffn

  The @code{source} and @code{destination} statements are mandatory.

  For example, the following definition says that valid uploads to
@file{/home/ftp/incoming/ftp} should be transferred to @file{/home/ftp/gnu}:

@smallexample
@group
spool ftp @{
 url ftp://ftp.gnu.org.ua;
 source /home/ftp/incoming/ftp;
 destination /home/ftp/gnu;
@}
@end group
@end smallexample

@noindent
This spool defines no particular archivation type, dictionary or
notifications, so it will inherit these settings from the global
configuration.

  The following example shows the same spool, that additionally sets
its own archivation method: 

@smallexample
@group
spool ftp @{
 url ftp://ftp.gnu.org.ua;
 source /home/ftp/incoming/ftp;
 destination /home/ftp/gnu;
 archive directory @{
   name .archive;
   backup numbered;
 @}
@}
@end group
@end smallexample

@node verification
@section Distribution Verification
@cindex verification
@cindex distribution verification

After the submission has been verified, @command{wydawca} may also run
an additional check to verify whether the main file (normally,
a tarball) is OK to be distributed. To set up such @dfn{distribution
verification}, add the following statement either in the global scope,
or within a @samp{spool} declaration:

@deffn {Config} check-script @var{text}
@deffnx {Config:spool} check-script @var{text}
Define the distribution verification script. The @var{text} must
be a valid @file{sh} program. It is executed without arguments,
in a temporary directory which contains a copy of the main
distribution file. The script can refer to the following environment
variables:

@defvr {Check Environment} WYDAWCA_SPOOL
Spool tag.
@end defvr

@defvr {Check Environment} WYDAWCA_SOURCE
Spool source directory, as set by the @code{source} statement
(@pxref{spool,,tag}).
@end defvr

@defvr {Check Environment} WYDAWCA_DEST
Spool destination directory (@pxref{spool,,destination}).
@end defvr

@defvr {Check Environment} WYDAWCA_URL
Spool @acronym{URL} (@pxref{spool,,url}).
@end defvr

@defvr {Check Environment} WYDAWCA_TRIPLET_BASE
Base name of the triplet.
@end defvr

@defvr {Check Environment} WYDAWCA_DIST_FILE
File name of the main distribution file.
@end defvr

Apart from these, the script inherits @command{wydawca} environment.

The submission is accepted only if the script returns 0. Otherwise,
it is rejected and the @samp{check-failure} event (@pxref{event
notification}) is generated.

In case of non-zero return, the script may return additional
diagnostics on the standard output. This diagnostics will be
available for use in notification messages via the @samp{$check:diagn}
variable.

Additionally, the actual return code of the script, in decimal, is
available in the @samp{$check:result} variable. If the script
terminates on a signal, the value of this variable is
@samp{SIG+@var{n}}, where @var{n} is the signal number.
@end deffn

  If both global and spool @samp{check-script}s are defined,
@command{wydawca} executes both scripts as if they were connected
by a logical @samp{&&}, i.e. per-spool script is executed only if
the global one returned success (@samp{0}). The submission is accepted
only if both scripts returned @samp{0}.

  Since the script usually contains several lines, the
@samp{config-script} value is usually supplied using a here-document
construct (@pxref{here-document}).

  The following example illustrates the use of @samp{config-script} to
catch possible security holes in the distributed @file{Makefile.in}
files@footnote{See
@uref{http://article.gmane.org/gmane.comp.sysutils.autotools.announce/131}.}

@smallexample
  check-script <<EOT
case $@{WYDAWCA_DIST_FILE@} in
*.tar|*.tar.*)
  if tar -xOf $@{WYDAWCA_DIST_FILE@} --occurrence=1 \
      --wildcards --no-wildcards-match-slash '*/Makefile.in' | \
      grep -q 'perm -777'; then
    fmt <<_EOF_
The top-level Makefile.in in $@{WYDAWCA_DIST_FILE@} changes mode of
all the directories below the build tree to 777 before creating
the tarball. This constitutes a security hole (see CVE-2009-4029[1],
for more details).

Please, rebuild the package using a newer Automake (at least v. 1.11.1)
and resubmit.
_EOF_
    cat <<_EOF_
--
[1] http://article.gmane.org/gmane.comp.sysutils.autotools.announce/131
_EOF_
    exit 1
  fi
  ;;
*)
  ;;
esac

exit 0
EOT;
@end smallexample

@node statistics
@section Statistics
@cindex statistics
At the end of the run, @command{wydawca} can print a detailed
statistics of its execution on the diagnostic channel @samp{info}.
The statistics is printed only if at least one of its items is not zero.
The following example illustrates what you might get if you configured
full statistics output:

@smallexample
errors: 0
warnings: 2
bad signatures: 0
access violation attempts: 0
complete triplets: 6
incomplete triplets: 2
bad triplets: 0
expired triplets: 0
triplet successes: 6
files uploaded: 12
files archived: 2
symlinks created: 0
symlinks removed: 0
@end smallexample

  Each item in this statistics is configurable, and a
unique configuration keyword is associated with it. The statistics
items and their corresponding keywords are described in the table
below:

@table @code
@kwindex errors@r{, statistics}
@item errors
Any error that occurred during the run.

@kwindex warnings@r{, statistics}
@item warnings
Any warning condition occurred during the run.

@kwindex bad-signatures@r{, statistics}
@item bad-signatures
@cindex @acronym{PGP} signature
A @acronym{PGP} signature not matches the public key for the user that
issued it.

@kwindex access-violations@r{, statistics}
@item access-violations
A user is attempting to upload files for some project, but it is not
authorized to do so.

@kwindex complete-triplets@r{, statistics}
@item complete-triplets
A complete triplet is registered.

@kwindex incomplete-triplets@r{, statistics}
@item incomplete-triplets
An incomplete triplet is registered, i.e. such that misses one or more
of its files. Notice, that a directive file alone is counted as a
complete triplet, provided that its signature verifies correctly and
that it does not contain @code{file} directive.

@kwindex bad-triplets@r{, statistics}
@item bad-triplets
A triplet contains files owned by different users.

@kwindex expired-triplets@r{, statistics}
@item expired_triplets
A triplet has expired.

@kwindex triplet-success@r{, statistics}
@item triplet_success
A triplet is processed successfully

@kwindex uploads@r{, statistics}
@item uploads
An upload is processed successfully. An upload is defined as a move of
a file and its detached signature from the source to the destination directory.

@kwindex archives@r{, statistics}
@item archives
An archivation is performed

@kwindex symlinks@r{, statistics}
@item symlinks
A symlink is created.

@kwindex rmsymlinks@r{, statistics}
@item rmsymlinks
A symlink is removed.
@end table

There are two ways to enable the statistics logging.  The
@dfn{built-in} statistics output is enabled using the
@code{statistics} keyword.

@deffn {Config} statistics list
  The amount of information included in the statistics summary is
configured using the @code{statistics} statement. This statement takes
a list of arguments, each one being one of the keywords, described
above. For example, the following statement causes only the
information about errors and warnings to be printed:

@smallexample
statistics (errors, warnings);
@end smallexample

@noindent
The output produced looks like:

@smallexample
errors: 0
warnings: 2
@end smallexample

@kwindex none@r{, statistics}
  A special keyword @samp{none} can be used to suppress this output
altogether (which is the default), as in

@smallexample
statistics none;
@end smallexample

@kwindex all@r{, statistics}
  Another special keyword is @samp{all}. It enables full statistics
output. This keyword may also be followed by any number of statistics
keywords, which are in this case @emph{excluded} from the
summary. For example, to output all statistics, except errors and
warnings one would set:

@smallexample
statistics (all, errors, warnings);
@end smallexample
@end deffn

More elaborate output can be produced using the @code{mod_logstat}
loadable module.  @xref{mod_logstat}, for a detailed discussion.

@node notification
@section Notification Mechanism
@cindex notification
While running, @command{wydawca} keeps track of certain events
occurring, such as, for example, broken @acronym{PGP} signatures or
file uploads attempted by unauthorized users. It can issue
notifications about such events using the supplied loadable modules.

Configuration of notifications consists of two parts.  First the
required loadable module must be loaded and configured.  Then,
configure the notification itself.

@menu
* modules::
* event notification::
* mod_mailutils:: Mail Notification
* mod_logstat:: Notification to syslog
@end menu

@node modules
@subsection modules

A @dfn{loadable module} is a piece of software that provides
notification mechanism for @command{wydawca}.  It is built as a UNIX
dynamically loaded library and placed in one of the preconfigured
directories which constitute a @dfn{library load path}. To load a
module, the following statement is used:

@deffn {Config} module @var{name} @var{file}
Load the module @var{name} from @var{file}. Other places of the
configuration file can refer to the module as @var{name}.

The @var{file} argument is a file name of the module (normally, a
@samp{file.so} or @samp{file.la} file).
@end deffn

Unless @var{file} in the @samp{module} statement it is an absolute
file name, it will be searched in the library load path, which is
defined as:

@anchor{library search path}
@enumerate 1
@item
Optional @dfn{prefix} search directories specified by the
@samp{module-prepend-load-path} directive (see below).

@item
@command{Wydawca} module directory: @samp{@var{$prefix}/lib/wydawca}.

@item 
Additional search directories specified by the @command{module-load-path}
directive (see below).

@item
The value of the environment variable @env{LTDL_LIBRARY_PATH}.

@item
The system dependent library search path (e.g. on GNU/Linux it is
defined by the file @file{/etc/ld.so.conf} and the environment variable
@env{LD_LIBRARY_PATH}).
@end enumerate

The value of @env{LTDL_LIBRARY_PATH} and @env{LD_LIBRARY_PATH} must be a
colon-separated list of absolute directory names, for example
@samp{/usr/lib/mypkg:/lib/foo}.

In any of these directories, @command{wydawca} first attempts to find
and load the given filename. If this fails, it tries to append the following
suffixes to it:

@enumerate 1
@item the libtool archive suffix: @samp{.la}

@item the suffix used for native dynamic libraries on the host platform,
e.g., @samp{.so}, @samp{.sl}, etc.
@end enumerate

The statements that modify the module search path are:

@deffn {Config} module-load-path @var{list}
This directive adds the directories listed in its argument to the
module load path.  Example:

@example
module-load-path (/usr/lib/wydawca,/usr/local/wydawca/lib);
@end example
@end deffn

@deffn {Config} module-prepend-load-path @var{list}
Same as above, but the directories from @var{list} are added to the
beginning of the module search list, rather than to its end.  The
order of directories in @var{list} is preserved in both cases.
@end deffn

Once loaded, the module can be initialized.  This is done by the
following block statement:

@deffn {Config} module-init @var{name} @{ ... @}
Initialize the module identified by @var{name}. The module must have
been previously loaded using the @samp{module} statement, as described
above. The statements between curly braces are module-specific
configuration statements. See the module descriptions below for a
detailed discussion of these.
@end deffn

@xopindex{module-help, introduced}
To list module-specific configuration directives with a short usage
instructions, use the @option{--module-help} statement:

@smallexample
wydawca --module-help=@var{file}
@end smallexample

@noindent
If the @var{file} argument is the base module name
(e.g. @samp{mod_mailutils}), it will be looked in the default 
library load path (@pxref{library search path}).  If it contains
directory components, the @var{file} will be loaded from the specified
directory.

@node event notification
@subsection Event Notification

  A number of @dfn{events} are tracked during the execution. Any of
them can be used to trigger the notification mechanism.  It is
configured using the following statement:

@deffn {Config} notify-event @{ ... @}
@smallexample
@group
notify-event @{
    # Event on which to notify
    event @var{eid};

    # Name of the module to invoke on event
    module @var{modname};

    # Module-specific configuration data
    module-config @{
        ...
    @}
@}
@end group
@end smallexample
@end deffn

@deffn {notify-event} event @var{eid}
Trigger the notification when the event identified by @var{eid}
occurs.  The identified @var{eid} is one of the following:

@table @asis
@kwindex success
@item success
  Successful upload.

@kwindex bad-ownership
@item bad-ownership
  An unauthorized user attempted to upload files for their project.

@kwindex bad-directive-signature
@item bad-directive-signature
  The directive signature does not match the public key of the
uploader.

@kwindex bad-detached-signature
@item bad-detached-signature
  The detached signature does not match the public key of the
uploader.

@kwindex check-failure
@item check-failure
  Distribution verification failed. @xref{verification}, for a
detailed description.

@kwindex finish
@item finish
  This event is reported at the end of the wydawca job, when all
spools have been processed.  It is normally used to produce final
statistic reports.  @xref{statreports}, for an example.
See also @ref{mod_logstat}.
@end table
@end deffn

@deffn {notify-event} module @var{modname}
Identify the module responsible for the notification.  The
@var{modname} argument must have been previously initialized in a
@code{module} statement (@pxref{modules}).
@end deffn

@deffn {notify-event} module-config @{ ... @}
This block provides module-specific configuration for @var{modname}.
Its content depends on the module used for notification.  The version
@value{VERSION} of @command{wydawca} is shipped with two notification
modules: @code{mod_mailutils} for notifications via electronic mail,
and @code{mod_logstat} for logging the information via @code{syslog}.
These modules are described in detail later.
@end deffn

@node mod_mailutils
@subsection @command{mod_mailutils}-- Mail Notification
@cindex mail notification

Mail notification is configured using the @command{mod_mailutils}
module.  To load the module, add the following statement:

@example
@group
module mailutils mod_mailutils.so;
@end group
@end example

The @code{module-init} section can contain the following statements:

@deffn {mod_mailutils} from-address address
Set sender address for outgoing mails. E.g.:

@smallexample
from-address ftp-uploads@@gnu.org.ua;
@end smallexample
@end deffn

It is not strictly necessary to specify the sender address. In the
absence of @code{from-address} statement, the sender email will be
constructed from the name of the user @command{wydawca} runs as
(@pxref{user privileges}) and the full domain name of the machine it
runs at. 

@deffn {mod_mailutils} admin-address email
Sets the admin email address or addresses. The statistics
notifications and any notifications configured to be sent to admins
will be forwarded to this address. The @var{email} argument is either
a @acronym{RFC} 822 email address, or a list of such addresses. For
example, the following statement configures a single admin address:

@smallexample
admin-address root@@gnu.org.ua;
@end smallexample

The example below illustrates how to configure multiple addresses:

@smallexample
admin-address "root@@gnu.org.ua,ftp-adm@@gnu.org.ua";
@end smallexample

Yet another way to configure them is:

@smallexample
admin-address (root@@gnu.org.ua, ftp-adm@@gnu.org.ua);
@end smallexample
@end deffn

@menu
* mailer::                      
* templates::                   
* statreports::
* mail-config:: @code{module-config} for @command{mod_mailutils}
* mod_mailutils example:: Example of @command{mod_mailutils} configuration
@end menu

@node mailer
@subsubsection Mailer
@cindex mailer
To send messages, @command{mod_mailutils} uses a special logical entity
called a @dfn{mailer}. It is set in the @code{module-init} block using
the @code{mailer} keyword.

@deffn {mod_mailutils} mailer url
Set mailer @acronym{URL}.
@end deffn

@cindex @acronym{URL}, mailer
@cindex mailer @acronym{URL}
  A mailer @acronym{URL} consists of a scheme specification, followed
by @samp{://} separator and additional data. The @acronym{URL}s
supported by Wydawca version @value{VERSION} are described in the
table below. As usual, square brackets indicate optional parts:

@table @asis
@item smtp://@var{host}[:@var{port}]
Use an SMTP server on @var{host} to relay messages. The @var{host} part is
either an IP address in dotted-quad notation or as a symbolic host
name. In the latter case, DNS system is be used to resolve
it. Optional @var{port} specifies port number or symbolic name (as
defined in @file{/etc/services}). It defaults to 25. For example:

@smallexample
mailer smtp://remote.server.net:24;
@end smallexample

@item sendmail://@var{progname}
Use sendmail-compatible program
@var{progname}. @dfn{Sendmail-compatible} means that the program must
be able to read an RFC-822 message from its standard input and must
support the following command line options: 

@table @option
@item -oi
Do not treat @samp{.} as message terminator.

@item -f @var{addr}
Use @var{addr} as the sender address.

@item -t
Get recipient addresses from the message.
@end table

Example:

@smallexample
mailer sendmail:///usr/sbin/exim;
@end smallexample

@item sendmail:
This is a special form of the @samp{sendmail} mailer. It uses the
@command{sendmail} binary from the @code{_PATH_SENDMAIL} macro in your
@file{/usr/include/paths.h}. It is the default mailer.

@item prog://@var{progname}?@var{query}
A @dfn{prog} mailer. This is a generalization of @samp{sendmail}
mailer that allows to use arbitrary external programs as mailers.

The full file name of the program is given in @var{progname} part.
The @var{query} part is a list of arguments, separated by @samp{&}
signs. Arguments may contain the following macro-substitutions:

@table @samp
@item $@{sender@}
Expands to the sender email address.

@item $@{rcpt@}
Expands to the recipient email addresses.

The program @var{progname} must read an RFC-822 message from its
standard input.

An example of @samp{prog} mailer definition:

@smallexample
mailer "prog:///bin/nullmail?localhost&-F$@{sender@}&$@{rcpt@}
@end smallexample

When sending a mail, @command{wydawca} will invoke:

@smallexample
/bin/nullmail localhost -F@var{sender} @var{rcpt}
@end smallexample

@noindent
where @var{sender} means the sender address, and @var{rcpt} stands for
the recipient email address.

@item | @var{prog} @var{args..}
Equivalent to the @samp{prog} mailer, described above, but written in
a more natural fashion. In this notation, the example definition above
becomes:

@smallexample
mailer "|/bin/nullmail localhost -F$@{sender@} $@{rcpt@}"
@end smallexample

@end table
@end table

@node templates
@subsubsection Message Templates
@cindex templates, notification messages
@cindex notification message template
@cindex message template
Each notification message is build from a message template, by
expanding variables (@pxref{variable expansion}) within it.
The message text may be specified either in place within the
configuration directive it belongs to (@pxref{notification}), or
defined by @code{define-message} statement.

@deffn {mod_mailutils} define-message name text
Define message @var{name} to be @var{text}. This message can be
referred to from other configuration statements by @code{@@@var{name}}
notation.
@end deffn

The message text must be formatted as a valid RFC-822 message, i.e. it
must consist of two parts, message headers and body, separated by a
single empty line. Therefore @var{text} is usually a
@dfn{here-document} construct (@pxref{here-document}). For example:

@smallexample
define-message my-message <<EOT
From: Wydawca
Subject: test

This is a test message.
EOT;
@end smallexample

If you do not wish to supply any headers (which is unlikely, because a
mail should at least have a @code{Subject} header), simply begin the
message text with an empty line, like this:

@smallexample
define-message my-message <<EOT

This is a test message.
EOT;
@end smallexample

@node statreports
@subsubsection Statistic Reports

@deffn {mod_mailutils} mail-statistics @{ @dots{} @}
The @code{mail-statistics} statement in the @code{module-init} section
for @command{mod_mailutils} configures the statistic reports
sent to the system administrator.

@smallexample
mail-statistics @{
  message @var{text-or-id};
  statistics @var{item-list};
  gpg-sign @var{key};
@}
@end smallexample

To arrange for sending the reports, the configuration must contain the
following statement:

@smallexample
notify-event @{
  event finish;
  module mailutils;
@}
@end smallexample
@end deffn

@deffn {mail-statistics} message text-or-id
Define the message text. The argument is either the message text
template, or a reference to a template previously defined by a
@code{define-message} (@pxref{templates}). The reference syntax is:

@smallexample
message @@@var{name};
@end smallexample

@noindent
where @var{name} is the message name as used in @code{define-message}.
@end deffn

@deffn {mail-statistics} statistics item-list
The argument is a list of statistics keywords as described in
@ref{statistics}. A report will be sent only if statistics
counters for at least one of the requested categories are not
zero. For example, the following statement requires sending
notifications only if there occurred any errors or access violation
attempts, or any bad signature was uploaded:

@smallexample
statistics (errors, access-violations, bad-signatures);
@end smallexample
@end deffn

@deffn {mail-statistics} gpg-sign key
If this statement is present, the message will be signed using
the supplied @acronym{GPG} @var{key}. The key is looked up in
the @acronym{GPG} home directory (@pxref{gpg-homedir}).
@end deffn

The statistics message is sent to addresses configured by
@code{admin-address} statement (@pxref{mod_mailutils, admin-address}).

@cindex variables in admin notifications
The variables available for use in statistics reports are:

@anchor{statistics variables}
@multitable @columnfractions 0.30 0.70
@headitem Variable @tab Replaced with
@kwindex date
@item date @tab Current date and time in the current locale.
@kwindex stat:errors
@item stat:errors @tab Number of errors detected.
@kwindex stat:warnings
@item stat:warnings @tab Number of warnings reported.
@kwindex stat:bad_signatures
@item stat:bad_signatures @tab Number of bad signatures detected.
@kwindex stat:access_violations
@item stat:access_violations @tab Number of access violation attempts.
@kwindex stat:complete_triplets
@item stat:complete_triplets @tab Number of complete triplets
processed.
@kwindex stat:incomplete_triplets
@item stat:incomplete_triplets @tab Number of incomplete triplets left
 in the source directory.
@kwindex stat:bad_triplets
@item stat:bad_triplets @tab Number of bad triplets seen.
@kwindex stat:expired_triplets
@item stat:expired_triplets @tab Number of expired triplets.
@kwindex stat:triplet_success
@item stat:triplet_success @tab Number of successfully processed
triplets.
@kwindex stat:uploads
@item stat:uploads @tab Number of successful uploads.
@kwindex stat:archives
@item stat:archives @tab Number of archivations performed.
@kwindex stat:symlinks
@item stat:symlinks @tab Number of symbolic links created.
@kwindex stat:rmsymlinks
@item stat:rmsymlinks @tab Number of symbolic links removed.
@kwindex stat:check-failures
@item stat:check_failures @tab Number of verification failures
(@pxref{verification}).
@end multitable

@anchor{spool-timers}
@cindex timers
  The following special variables, called @dfn{timers}, are
replaced with the real or @acronym{CPU} time (in seconds)
used while processing a certain task:

@multitable @columnfractions 0.30 0.70
@kwindex timer:wydawca:real
@item timer:wydawca:real @tab Real time spent in @command{wydawca}
main code.
@kwindex timer:wydawca:system
@item timer:wydawca:system @tab System @acronym{CPU} time spent in
@command{wydawca} main code.
@kwindex timer:wydawca:user
@item timer:wydawca:user @tab User @acronym{CPU} time spent in
@command{wydawca} main code.
@kwindex timer:@var{tag}:real
@item timer:@var{tag}:real @tab Real time spent processing the
@var{tag} spool.
@kwindex timer:@var{tag}:system
@item timer:@var{tag}:system @tab System @acronym{CPU} time spent
processing the @var{tag} spool.
@kwindex timer:@var{tag}:user
@item timer:@var{tag}:user @tab User @acronym{CPU} time spent
processing the @var{tag} spool.
@end multitable

  An example definition of the admin notification template follows:

@smallexample
mail-statistics @{
  statistics (errors,warnings,bad_signatures,
              access_violations);
  message <<EOT
Subject: Wydawca stats

This is to notify you that my run on $@{date@}
caused the following results:

errors ............................. $@{stat:errors@}
warning ............................ $@{stat:warnings@}
bad signatures ..................... $@{stat:bad_signatures@}
access violation attempts .......... $@{stat:access_violations@}

Timings:
Real ............................... $@{timer:wydawca:real@} \
($@{timer:releases:real@} + \
$@{timer:alpha:real@} + \
$@{timer:test:real@})
System ............................. $@{timer:wydawca:system@} \
($@{timer:releases:system@} + \
$@{timer:alpha:system@} + \
$@{timer:test:system@})
User ............................... $@{timer:wydawca:user@} \
($@{timer:releases:user@} + \
$@{timer:alpha:user@} + \
$@{timer:test:user@})

Regards,
Wydawca
EOT;
@}
@end smallexample

@node mail-config
@subsubsection @code{module-config} for @command{mod_mailutils}

When @command{mod_mailutils} is used in the @command{notify-event}
block, the following statements can be used in @code{module-config}
to configure it:

@smallexample
@group
notify-event @{
    module mailutils;
    # module configuration
    module-config @{
        # Notify this recipient
        recipient @var{who};

        # Sign message with this key
        gpg-sign @var{key};

        # Text of the notification or identifier of a defined message
        # template
        message @var{text-or-id};
    @}
@}
@end group
@end smallexample

@deffn {mod_mailutils config} recipient who
Determines who should receive the notification. The following values
for @var{who} are allowed: 

@table @code
@kwindex read
@kwindex message
@item read
@itemx message
Read recipients from the @samp{To}, @samp{Cc} and @samp{Bcc} headers
of the message.

@kwindex admin
@item admin
The system administrator, as defined in @code{admin-address} statement
(@pxref{notification, admin-address}).

@kwindex owner
@item owner
Administrators of the project for which the files where
uploaded. Their addresses are retrieved from the @samp{project-owner}
dictionary (@pxref{dictionaries}).

@kwindex user
@item user
User name of the user who uploaded files. 
@end table
@end deffn

@deffn {Config: notify-event} gpg-sign key
If this statement is present, the message will be signed using
the supplied @acronym{GPG} @var{key}. The key is looked up in
the @acronym{GPG} home directory (@pxref{gpg-homedir}).
@end deffn

@deffn {mod_mailutils config} message text-or-id
Define the message text. The argument is either the message text
template, or a reference to a template previously defined by a
@code{define-message} (@pxref{templates}).
@end deffn

  The following macro-variables are expanded in the message texts:
@multitable @columnfractions 0.30 0.70
@headitem Variable @tab Replaced with
@kwindex project
@item project   @tab Project system name.
@kwindex url
@item url       @tab @acronym{URL} of the distribution site.
@kwindex spool
@item spool     @tab Name of the spool (@pxref{spool}).
@kwindex dir
@item dir       @tab Directory (relative to the project distribution
root) where the files where uploaded.
@kwindex dest_dir
@item dest-dir  @tab Value of the @code{destination} keyword.
@kwindex source_dir
@item source-dir @tab Value of the @code{source} keyword.
@kwindex triplet:dist
@item triplet:dist    @tab File name of the main distribution file.
@kwindex triplet:sig
@item triplet:sig     @tab File name of the detached signature file.
@kwindex triplet:dir
@item triplet:dir     @tab File name of the directive file.
@kwindex triplet:ls:full
@item triplet:ls:full @tab A full listing of the uploaded
triplet@footnote{It is equivalent to: 
@smallexample
@group
$@{triplet:ls:dist@}
$@{triplet:ls:sig@}
$@{triplet:ls:dir@}
@end group
@end smallexample
}.
@kwindex triplet:ls:upload
@item triplet:ls:upload  @tab Listing of the uploaded files (see below).
@kwindex triplet:dist
@item triplet:ls:dist @tab Listing of the main distribution file (see below).
@kwindex triplet:ls:sig
@item triplet:ls:sig  @tab Listing of the detached signature file (see below).
@kwindex triplet:ls:dir
@item triplet:ls:dir  @tab Listing of the directive file (see below).
@kwindex user  
@item user            @tab System name of the user who uploaded the triplet. 
@kwindex user:name
@item user:name       @tab System name of the user who uploaded the triplet.
@kwindex user:real_name
@item user:real-name  @tab Real name of the user who uploaded the triplet.
@kwindex user:email
@item user:email      @tab Email of the user who uploaded the triplet.
@kwindex email:admin
@item email:admin     @tab Full@footnote{@dfn{Full} here means
an email address with eventual personal part}. email address of the systems
administrator, as set by the @samp{admin-address}
(@pxref{notification,,admin-address}).
@kwindex email:owner
@item email:owner     @tab Full email address of the project
administrator (@dfn{owner}).
@kwindex email:user
@item email:user      @tab Full email address of the user who did
the upload. Not to be confused with @samp{user:email}.
@anchor{check-result}
@kwindex check:result
@item check:result    @tab Code returned by external checker, in
decimal. @xref{verification,,check-result}, for a detailed description.
@kwindex check:diagn
@item check:diagn     @tab Diagnostics text returned by external
checker. @xref{verification}, for a detailed description.
@end multitable

@cindex timers
  The following @dfn{timers} (@pxref{spool-timers}) are defined:
  
@multitable @columnfractions 0.30 0.70
@headitem Variable @tab Replaced with
@kwindex timer:wydawca:real
@item timer:wydawca:real   @tab Real time spent in @command{wydawca}
main code. 
@kwindex timer:wydawca:system
@item timer:wydawca:system @tab System @acronym{CPU} time spent in
@command{wydawca} main code. 
@kwindex timer:wydawca:user
@item timer:wydawca:user   @tab User @acronym{CPU} time spent in
@command{wydawca} main code.
@kwindex timer:triplet:real
@item timer:triplet:real   @tab Real time spent processing this triplet.
@kwindex timer:triplet:system
@item timer:triplet:system @tab System @acronym{CPU} time spent
processing this triplet.
@kwindex timer:triplet:user
@item timer:triplet:user   @tab User @acronym{CPU} time spent
processing this triplet.
@kwindex timer:spool:real 
@item timer:spool:real     @tab Real time spent while processing this
spool.
@kwindex timer:spool:system
@item timer:spool:system   @tab System @acronym{CPU} time spent while
processing this spool.
@kwindex timer:spool:user
@item timer:spool:user     @tab User @acronym{CPU} time spent while
processing this spool.
@end multitable

@anchor{listings}
@cindex listing, triplet
@cindex triplet listing
  @dfn{Listings} referred to in the table above, are similar to those
produced by the @code{ls} command, and include information
on file permissions, ownership, size and modification date. For
example, here is a possible @code{$@{triplet:ls:full@}} listing:

@smallexample
-rw-r--r-- gray users 2707278 2007-09-06 22:14:35 tar-1.18.tar.gz
-rw-r--r-- gray users     189 2007-09-06 22:14:35 tar-1.18.tar.gz.sig
-rw-r--r-- gray user       62 2007-09-06 22:14:35 tar-1.18.tar.gz.directive.asc
@end smallexample

  The example in the following subsection shows how to configure
success notification for the user.

@node mod_mailutils example
@subsubsection Example of mod_mailutils configuration

This subsection provides a complete example for
@command{mod_mailutils} configuration.

@example
module mailutils mod_mailutils.la;

module-init mailutils @{
    admin-address "root@@example.net";
    from-address "wydawca@@example.net";
    mailer "sendmail:";

    mail-statistics @{
        statistics all;
        message <<- EOT
    Subject: upload statistics

    This is to notify you that the run of wydawca on $@{date@}
    caused the following results:

    errors ............................. $@{stat:errors@}
    warning ............................ $@{stat:warnings@}
    bad signatures ..................... $@{stat:bad_signatures@}
    access violation attempts .......... $@{stat:access_violations@}
    complete triplets .................. $@{stat:complete_triplets@}
    incomplete triplets ................ $@{stat:incomplete_triplets@}
    bad triplets ....................... $@{stat:bad_triplets@}
    expired triplets ................... $@{stat:expired_triplets@}
    triplet successes .................. $@{stat:triplet_success@}
    files uploaded ..................... $@{stat:uploads@}
    files archived ..................... $@{stat:archives@}
    symlinks created ................... $@{stat:symlinks@}
    symlinks removed ................... $@{stat:rmsymlinks@}
    verification failures .............. $@{stat:check_failures@}

    Timings:

    Real ............................... $@{timer:wydawca:real@} \
    ($@{timer:releases:real@} + \
    $@{timer:alpha:real@} + \
    $@{timer:test:real@})
    System ............................. $@{timer:wydawca:system@} \
    ($@{timer:releases:system@} + \
    $@{timer:alpha:system@} + \
    $@{timer:test:system@})
    User ............................... $@{timer:wydawca:user@} \
    ($@{timer:releases:user@} + \
    $@{timer:alpha:user@} + \
    $@{timer:test:user@})

    Regards,
    Wydawca
    EOT;
    @}
@}

notify-event @{
    event finish;
    module mailutils;
@}

notify-event @{
    event success;
    module mailutils;
    module-config @{
        recipient user;
        message <<- EOT
           Subject: Upload of $@{project@} successful

           Upload of $@{project@} to $@{url@}/$@{dir@} finished successfully.
           Files uploaded:

           $@{triplet:ls:upload@}

           Resource usage: $@{timer:triplet:real@}/$@{timer:wydawca:real@}r \
           $@{timer:triplet:user@}/$@{timer:wydawca:user@}u \
           $@{timer:triplet:system@}/$@{timer:wydawca:system@}s

           Regards,
           Wydawca
           The Project Submission Robot
        EOT;
    @}        
@}
@end example

For the sake of brevity, this example defines only two
@code{notify-event} statements.  More statements for others events can
be added as needed.

@node mod_logstat
@subsection @command{mod_logstat} -- statistics logging

The module @command{mod_logstat} logs the supplied message text at the
end of the run.

The simplest configuration for this module is:

@smallexample
@group
module logstat mod_logstat.so;

notify-event @{
  event finish;
  module logstat;
@}
@end group
@end smallexample

This will produce on the default logging channel the detailed
statistics, as discussed in @ref{statistics}.

There is no specific @code{module-init} statements.  The module should
be called from @code{notify-event} block on the @samp{finish} event.
The module's @code{module-config} statement can contain the following
statements:

@deffn {mod_logstat config} statistics list
Configures what statistics items should be included in the output.
@xref{statistics}, for a detailed discussion of @var{list}.

This statement is ignored if the @code{message} statement is present.
@end deffn

@deffn {mod_logstat config} message text
Specifies the message to be logged.  The @var{text} argument can
contain references to statistics variables (@pxref{statistics
variables}).
@end deffn

If no @code{message} statement is present, the following default is
assumed:

@example
@group
message <<EOT
errors: $@{stat:errors@}
warnings: $@{stat:warnings@}
bad signatures: $@{stat:bad_signatures@}
access violation attempts: $@{stat:access_violations@}
complete triplets: $@{stat:complete_triplets@}
incomplete triplets: $@{stat:incomplete_triplets@}
bad triplets: $@{stat:bad_triplets@}
expired triplets: $@{stat:expired_triplets@}
triplet successes: $@{stat:triplet_success@}
files uploaded: $@{stat:uploads@}
files archived: $@{stat:archives@}
symlinks created: $@{stat:symlinks@}
symlinks removed: $@{stat:rmsymlinks@}
check failures: $@{stat:check_failures@}
EOT;
@end group
@end example

@node wydawca.rc
@chapter @command{Wydawca} configuration file.
@cindex configuration statements, reference
  This chapter summarizes the configuration statements. For each
statement, a reference to its detailed description is provided.

@smallexample
# @r{Enable daemon mode.}
# @xref{daemon}.
daemon @var{arg:@i{boolean}};

# @r{Start in foreground even in daemon mode.}
# @xref{general, foreground}.
foreground @var{arg:@i{boolean}};

# @r{Do not spawn subprocesses.}
# @xref{general, single-process}.
single-process @var{arg:@i{boolean}};

# @r{Set wake-up interval.}
# @xref{general, wakeup-interval}.
wakeup-interval @var{time:@i{string}};

# @r{Set pid file name.}
# @xref{general, pidfile}.
pidfile @var{file:@i{string}};

# @r{Run with UID and GID of this user.}
# @xref{user privileges}.
user @var{name:@i{string}};

# @r{Retain these supplementary groups:}
# @xref{user privileges}.
group @var{arg:@i{list of string}};

# @r{Configure locking}
# @xref{locking}.
locking @{
  # @r{Enable or disable locking.}
  enable @var{arg:@i{boolean}};

  # @r{Set directory for lock files.}
  directory @var{dir:@i{string}};

  # @r{Define lock expiration interval.}
  expire-time @var{time:@i{interval}};

  # @r{Locking timeout.}
  timeout @var{time:@i{interval}};
@}

# @r{Listen on this address.}
# @xref{daemon, listen}.
listen @var{socket:@i{sock-addr}};

# @r{Configure TCP wrappers.}
# @xref{tcp-wrapper}.
tcp-wrapper @{
  # @r{Enable TCP wrapper access control. Default is @samp{yes}}.
  enable @var{arg:@i{boolean}};

  # @r{Set daemon name for TCP wrapper lookups. Default is program name.}
  daemon @var{name:@i{string}};

  # @r{Use @var{file} for positive client address access control.}
  # @r{(default: @file{/etc/hosts.allow}).}
  allow-table @var{file:@i{string}};

  # @r{Use @var{file} for negative client address access control.}
  # @r{(default: @file{/etc/hosts.deny}).}
  deny-table @var{file:@i{string}};

  # @r{Log host allows at this syslog priority.}
  allow-syslog-priority @var{prio:@i{string}};

  # @r{Log host denies at this syslog priority.}
  deny-syslog-priority @var{prio:@i{string}};
@}

# @r{Load module}
# @xref{modules}.
module @var{name:@i{string}} @var{file:@i{string}};

# @r{Initialize the loaded module}
# @xref{modules,module-init}.
module-init @var{name} @{
  # @r{One or more module-specific statements}
  ...
@}  

# @r{Load mailutils module}
# @xref{mod_mailutils}.
module mailutils mod_mailutils.so;

# @r{mod_mailutils initialization}
module-init mailutils @{
  # @r{Set mailer URL.}
  # @xref{mailer}.
  mailer @var{url:@i{string}};

  # @r{Set admin email address.}
  # @xref{mod_mailutils, admin-address}.
  admin-address @var{email:@i{string}};

  # @r{Set sender email address.}
  # @xref{mod_mailutils, from-address}.
  from-address @var{email:@i{string}};

  # @r{Send statistics report.}
  # @xref{statreports}.
  mail-statistics @{
    # @r{Message text.}
    message @var{text:@i{string}};

    # @r{Send mail if one or more of these items are set.}
    statistics @var{items:@i{string}};

    # @r{Sign message with this key.}
    gpg-sign @var{key:@i{string}};
  @}
@}

# @r{Configure notification.}
# @xref{notification}.
notify-event @{
  # @r{Event on which to notify.}
  event @var{ev-id:@i{string}};

  # Name of the module to invoke on event
  module @var{modname:@i{string}};
  
  # Module-specific configuration data
  module-config @{
      ...
  @}

  # Configuration for mod_mailutils
  # @xref{mail-config}.
  module-config @{
    # Notify this recipient
    # @xref{mail-config, recipient}.
    recipient @var{who:@i{string}};

    # Sign message with this key
    # @xref{mail-config, gpg-sign}.
    gpg-sign @var{key:@i{string}};

    # Text of the notification or identifier of a defined message
    # template
    # @xref{mail-config, message}.
    message @var{text-or-id:@i{string}};
  @}  
@}

# @r{Define file sweep time.}
# @xref{general, file-sweep-time}.
file-sweep-time @var{time:@i{int9erval}};

# @r{Set tar invocation command line.}
# @xref{archivation, tar-program}.
tar-program @var{prog:@i{string}};

# @r{Set umask.}
# @xref{general, umask}.
umask @var{mask:@i{octal}};

# @r{Control implicit signature archivation}.
# @xref{archivation, archive-signatures}.
archive-signatures @var{arg:@i{boolean}};

# @r{Print these stats at the end of each run.}
# @xref{statistics}.
statistics @var{items:@i{string}};

# @r{Service names that request scanning all spools.}
# @xref{daemon, all-spools}.
all-spools @var{arg:@i{list of string}};

# @r{GPG home directory}.
# @xref{gpg-homedir}.
gpg-homedir @var{arg:@i{string}};

# @r{Define SQL database}.
# @xref{sql}.
sql @var{id:@i{string}} @{
  # @r{Set the name of the configuration file to read.}
  config-file @var{name:@i{string}};
  # @r{Set the name of the configuration file group to use.}
  config-group @var{name:@i{string}};
  
  # @r{Set SQL server hostname or IP address.}
  host @var{host:@i{string}};

  # @r{Set database name.}
  database @var{dbname:@i{string}};

  # @r{Set SQL user name.}
  user @var{name:@i{string}};

  # @r{Set SQL user password.}
  password @var{arg:@i{string}};

  # @r{File name of the Certificate Authority (CA) certificate.}
  ssl-ca @var{file:@i{string}};
@}

# @r{Configure syslog logging.}
# @xref{syslog}.
syslog @{
  # @r{Set syslog facility.}
  facility @var{name:@i{string}};

  # @r{Tag syslog messages with this string.}
  tag @var{string:@i{string}};

  # @r{Prefix each message with its priority.}
  print-priority @var{arg:@i{boolean}};
@}

# @r{Define message text.}
# @xref{templates}.
define-message @var{ident:@i{string}} @var{text:@i{string}};

# @r{Create missing directories.}
# @xref{directory setup}.
create-directories @var{arg:@i{boolean}};

# @r{Mode for created directories.}
# @xref{directory setup}.
directory-mode @var{mode}:@i{octal};

# @r{Owner user and group for created directory.}
# @xref{directory setup}.
directory-owner @var{uid:@i{string}} @var{gid:@i{string}};

# @r{Set up archivation.}
# @xref{archivation}.
archive @var{type:@i{string}} @{
  # @r{Name of archive file or directory.}
  name @var{file-or-dir:@i{string}};

  # @r{Define backup type.}
  # @xref{backup-methods}.
  backup @var{type:@i{string}};

  # @r{Mode for the archive directory.}
  # @xref{archivation, directory-mode}.
  directory-mode @var{mode:@i{octal}};

  # @r{Owner user and group for the archive directory.}
  directory-owner @var{uid:@i{string}} @var{gid:@i{string}};
@}

# @r{Define data dictionary.}
# @xref{dictionaries}.
dictionary @var{ident:@i{string}} @{
  # @r{Dictionary type}.
  type @var{type:@i{string}};

  # @r{Query template.}
  query @var{string:@i{string}};

  # @r{Set dictionary parameters.}
  params @var{arg:@i{list of string}};
@}

# @r{Define distribution spool.}
# @xref{spool}.
spool @var{tag:@i{string}} @{
  # @r{URL corresponding to this spool.}
  url @var{arg:@i{string}};

  # @r{Aliases.}
  alias @var{arg:@i{list of string}};

  # @r{Source directory.}
  source @var{dir:@i{string}};

  # @r{Mode for the source directory.}
  # @xref{spool, source-mode}.
  # @xref{directory setup}.
  source-mode @var{mode:@i{octal}};

  # @r{Owner user and group for the source directory.}
  # @xref{spool, source-owner}.
  # @xref{directory setup}.
  source-owner @var{uid:@i{string}} @var{gid:@i{string}};

  # @r{Destination directory.}
  destination @var{dir:@i{string}};

  # @r{Mode for the destination directory.}
  # @xref{spool, destination-mode}.
  # @xref{directory setup}.
  destination-mode @var{mode:@i{octal}};

  # @r{Owner user and group for the destination directory.}
  # @xref{spool, destination-owner}.
  # @xref{directory setup}.
  destination-owner @var{uid:@i{string}} @var{gid:@i{string}};

  # @r{Define file sweep time.}
  file-sweep-time @var{time:@i{interval}};

  # @r{Define data dictionary.}
  # @r{See above}.
  dictionary @var{ident:@i{string}} @{ @dots{} @}
  
  # @r{Set up archivation}.
  archive @var{type:@i{string}} @{ @dots{} @}

  # @r{Configure notification}.
  notify-event @{ @dots{} @}
@}

@end smallexample

@node invocation
@chapter @command{Wydawca} invocation summary.
@cindex invocation
@cindex command line options
This chapter presents a short reference of all @command{wydawca}
command line options.  The entries are sorted alphabetically by their
long option name.  Where no long option exists, short option
is used instead.

@table @option
@opsummary{config-file}
@sopindex{c, summary}
@item --config-file=@var{file}
@itemx -c @var{file}
Use @var{file} instead of the default configuration file.

@xref{config-file, The @option{--config-file} option}.

@opsummary{config-help}
@item --config-help
Display a concise summary of the available configuration directives.
This does not include statements specific for particular loadable
modules.  To display these, use the @option{--module-help} option
(@pxref{modules, --module-help}).

@opsummary{cron}
@item --cron
Run in cron mode. @xref{starting,, cron}.

@xref{stderr, The @option{--syslog} option}.

@opsummary{debug}
@sopindex{d, summary}
@item --debug
@itemx -d
Increase debugging level by 1.

@xref{debug, The @option{--debug} option}.

@opsummary{define}
@sopindex{D, summary}
@item --define=@var{name}[=@var{value}]
@itemx -D @var{name}[=@var{value}]
  Define the preprocessor symbol @var{name} as having @var{value}, or
empty. @xref{Preprocessor}.

@opsummary{dump-grammar-trace}
@item --dump-grammar-trace
Dump configuration grammar traces. This is useful for debugging
@command{wydawca} configuration file parser.

@opsummary{dump-lex-trace}
@item --dump-lex-trace
Dump lexical analyzer traces. This is useful for debugging
@command{wydawca} configuration file parser.

@opsummary{dry-run}
@sopindex{n, summary}
@item --dry-run
@itemx -n
@dfn{Dry-run mode}: do nothing, print almost everything. This option
implies @option{--debug --stderr}.

@xref{dry-run, The dry-run mode}.

@anchor{-E}
@sopindex{E, summary}
@item -E
Dump the preprocessed configuration to stdout and exit.
@pxref{Preprocessor}.

@opsummary{force}
@item --force
Force start-up, even if if the PID file already exists.

@opsummary{foreground}
@item --foreground
Remain in the foreground. This is mostly for debugging
@command{wydawca}.

@opsummary{help}
@sopindex{h, summary}
@item --help
@itemx -h
Print a concise usage summary and exit.

@opsummary{include-directory}
@sopindex{I, summary}
@item --include-directory=@var{dir}
@itemx -I @var{dir}
Add @var{dir} to include search path.

@xref{Pragmatic Comments, #include}. @xref{Preprocessor}.

@opsummary{lint}
@sopindex{t, summary}
@item --lint
@itemx -t
Parse configuration file, report any errors on the standard error and
exit with code 0, if the syntax is OK, and with code 1 otherwise.

@xref{lint, The @option{--lint} option}.

@opsummary{module-help}
@item --module-help=@var{file}
Loads module @var{file} (@pxref{modules}) and displays help about its
configuration.  If @var{file} is an absolute or relative pathname,
it will be loaded as is.  Otherwise, @command{wydawca} will search for
module @var{file} in its default library load path (@pxref{library
search path}).

@opsummary{no-preprocessor}
@item --no-preprocessor
Disable preprocessor. @pxref{Preprocessor}.

@opsummary{preprocessor}
@item --preprocessor=@var{command}
Use @var{command} instead of the default preprocessor. @pxref{Preprocessor}.

@opsummary{single-process}
@item --single-process
Serialize job invocations by not forking subprocesses for each job.
@emph{Do not use this option in production environment}.

@opsummary{source}
@sopindex{s, summary}
@item --source=@var{name}
@itemx -s @var{name}
Process only the spool with the given source name. This option
may be given multiple times, to select several spools by their
source names.

@opsummary{spool}
@sopindex{S, summary}
@item --spool=@var{tag}
@itemx -S @var{tag}
Process only spool with the given tag. This option
may be given multiple times, to select several spools by their
tag names.

@opsummary{stderr}
@sopindex{e, summary}
@item --stderr
@itemx -e
Log to the standard error.

@xref{stderr, The @option{--stderr} option}.

@opsummary{syslog}
@item --syslog
Log all diagnostics to syslog.

@xref{stderr, The @option{--syslog} option}.

@opsummary{version}
@sopindex{V, summary}
@item --version
@itemx -V
Print the program version and exit.
@end table

@node Reporting Bugs
@chapter How to Report a Bug

  Email bug reports to @email{bug-wydawca@@gnu.org.ua}.

  As the purpose of bug reporting is to improve software, please be
sure to include a detailed information when reporting a bug. The minimum
information needed is:

@itemize @bullet
@item Program version you use (see the output of @command{wydawca --version}.
@item A description of the bug.
@item Conditions under which the bug appears.
@item It is often helpful to send the contents of @file{config.log}
file along with your bug report. This file is created after running
@command{./configure} in @command{wydawca} source root directory.
@end itemize

@node Copying This Manual
@appendix GNU Free Documentation License
@include fdl.texi

@node Concept Index
@comment node-name,  next,  previous,  up
@unnumbered Concept Index

This is a general index of all issues discussed in this manual

@printindex cp

@bye

Return to:

Send suggestions and report system problems to the System administrator.