aboutsummaryrefslogtreecommitdiff
path: root/doc/wydawca.texi
blob: 5e00dcf6b872c6046f2b61efe13d674766df21ad (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
\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 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, with the Front-Cover texts being ``A GNU Manual'',
and with the Back-Cover Texts as in (a) below. A copy of the license
is included in the section entitled ``GNU Free Documentation License''.

(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
this GNU Manual, like GNU software. Copies published by the Free
Software Foundation raise funds for GNU development.''
@end copying

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

@page
@summarycontents
@page
@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 ---

How to Configure @command{wydawca}.

* Syntax::               Configuration file syntax.
* syslog::
* sql::
* access methods::
* archivation::
* spool::
* statistics::
* notification::

Configuration file syntax

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

Access Methods

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

SQL Access Methods

* gpg-key-sql::
* project-owner-sql::
* user-data-sql::
* verify-user-sql::

Mail Notification

* mailer::                      
* templates::                   
* statreports::                 
* event notification::          

@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, like, e.g. @indicateurl{gnu.org}. You have at least 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 should have a way of uploading
their packages to one of these sites. The currently accepted scheme
is 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.4
@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 the 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, that contains information about where the
distributed tarball must be placed, and clear-signs it using his
@acronym{PGP} key, thus obtaining 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}, offers an extensible logging and mail notification
mechanism, allowing both package maintainers and site administrators
to be immediately notified about any occurring problems.

  @command{Wydawca} supports version 1.1 of directory file, 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

  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 file also supplies all 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 directive 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,
namely 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

  Each @dfn{incomplete} triplet, i.e. such that misses 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
(@FIXME-pxref{file-sweep-time}), and if so, all files from this triplet are
removed (an @dfn{expired triplet}). This gives users the possibility
to restart interrupted or otherwise broken uploads later.

  Then, the utility ensures that each of the remaining triplets is
created by a single person. Any triplets that do not are immediately
removed.

@cindex @acronym{PGP}
@cindex detached signature
@cindex signature, detached
  Then, @acronym{PGP} signatures of directive files and any detached
signatures (if available) are verified. If they do not match public
keys of the user who uploaded the triplet, such a triplet is
discarded.

  Finally, the directives from each 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.

@node starting
@chapter How to invoke @command{wydawca}.
@cindex invocation
@anchor{config-file}
@xopindex{config-file, described}
@sopindex{c, described}
@UNREVISED{}
  @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}, and the facility to use is gotten from 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 using @command{syslog}, and the option
@option{--stderr} (or @option{-e}) instructs it to print everything on
the standard error.

@xopindex{cron, described}
  Usually you will run @command{wydawca} as a cron job. In that case,
it seldom needs any additional arguments, but we suggest to use
@option{--cron} command line option anyway.

@anchor{debug}
@xopindex{debug, described}
@sopindex{d, described}
  The @option{--debug} (@option{-d}) tells the program to increase its
debugging level by 1. @dfn{Debugging level} determines the amount
of information the program reports when it runs. By default it is 0,
meaning to report only errors and other critical conditions. 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 is 4, which prints an impractically big
amount of information, which 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, but to verbosely print any actions
it would have taken. Its set the debugging level to 1 and directs the
diagnostics output to the standard error, as if @option{--debug
--stderr} options have been 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} command line option (@FIXME-pxref{--config}).

  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 and to exit with status 0 if no errors were
detected, and withs status 1 otherwise. 

@opindex -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.
* syslog::
* sql::
* access methods::
* archivation::
* spool::
* 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-dir}) command line option (@FIXME-pxref{--include-dir}).  

@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{meta-interpretation}
Depending on the context, the contents of a quoted string may be
subject to @dfn{meta-variable interpretation}. During this process,
any sequence

@smallexample
$@{@var{var}@}
@end smallexample

@noindent
where @var{var} is the name of a defined meta-variable, is replaced with
the value of the variable. This sequence is called @dfn{meta-
reference}. For example, if the meta-variable @samp{user} has the
value @samp{smith}, then the string 

@smallexample
"where user = '$@{user@}'"
@end smallexample

@noindent
becomes

@smallexample
"where user = 'smith'"
@end smallexample

If the name of the variable consists of a single character, the curly
braces around it may be omitted. Thus, @code{$@{u@}} and @code{$u} are
equivalent.

If @var{var} is not defined, the meta-reference is left unchanged.

To insert a literal @samp{$} character in a string that is subject to
meta-variable interpretation, duplicate it: @samp{$$}.

The exact set of defined meta-variables and their values depend on the
context and are discussed in detail below.

@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
@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.  

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

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:

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

@deffn {Configuration} facility @var{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 {Configuration} tag @var{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 {Configuration} print-priority @var{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).

@kwindex sql
  A database is defined using @code{sql} block statement. It has the
following syntax:

@smallexample
@group
sql @var{id} @{
  host @var{hostname};
  database @var{dbname};
  user @var{username};
  password @var{string};
@}
@end group
@end smallexample

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

@deffn {Configuration} 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}.
@FIXME-xref{sql-host}, for more information and examples.
@end deffn

@deffn {Configuration} database @var{name}
Specifies the database name.
@end deffn

@deffn {Configuration} user @var{name}
Sets the database user name.
@end deffn

@deffn {Configuration} password @var{string}
Sets the password for accessing the database.
@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

@node access methods
@section Access Methods
@cindex Access method
@cindex @acronym{PGP} key
@UNREVISED
An @dfn{access method} defines the ways to retrieve user information
needed to verify the submission. This information can be, for example,
the user's @acronym{PGP} key or his permissions on a project.

  Access methods are defined in configuration file using the
following syntax:

@smallexample
access-method @var{method-name} @{
  type @var{type};
  query @var{string};
  params (@var{param1},@var{param2},...);
@}
@end smallexample

  Access method statements 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 directory pair.

There are four access methods, identified by the value of
@var{method-name} tag:

@table @asis
@kwindex gpg-key
@item gpg-key
Retrieve the public @acronym{PGP} key of a user. This method must
return exactly one string.

@kwindex project-owner
@item 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.

@kwindex user-data
@item user-data
  Return email address and real name of a user. This method must
return one tuple, consisting of two columns: an email address and a user
name, in this order.

@kwindex verify-user
@item verify-user
  Verify if a user is allowed to make uploads for a certain project. This
method must return the system name of the user if he is allowed to
make uploads.
@end table

The sub-statements of @code{access-method} are:

@deffn {Configuration} type @var{name}
Defines the type of this method. @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 method is reserved for
future use.
@end table

See below for a detailed description of these access methods.
@end deffn

@deffn {Configuration} query @var{string}
Sets the query used for retrieving the data. The @var{string} is
subject to meta-variable interpretation (@pxref{meta-interpretation}). The
following meta-variables are defined:

@table @code
@kwindex u
@kwindex user
@item u
@itemx user
@itemx user:name
  The system name of the user that submitted the triplet.

@kwindex p
@kwindex project
@item p
@itemx 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.

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

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

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

@item dest-dir
Spool destination directory (@pxref{spool, destination}).

@item source-dir
Spool source directory (@pxref{spool, source}).
@end table
@end deffn

@deffn {Configuration} params (@var{param1}, @var{param2}, ...)
Supplies additional parameters for the method.
@end deffn

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

@node sql type
@subsection SQL Access Methods
@cindex sql access type
Access methods having the type @samp{sql} 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 --
an 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 of all four
access methods using the @code{sql} type. They are based
on the database structure used in
@uref{http://gna.org/projects/savane, @command{Savane} system}.

@menu
* gpg-key-sql::
* project-owner-sql::
* user-data-sql::
* verify-user-sql::
@end menu

@node gpg-key-sql
@subsubsection Gpg-key: an SQL Implementation
@cindex gpg-key
  Retrieve the public @acronym{PGP} key of a user. This method must
return exactly one string.

@smallexample
access-method gpg-key @{
  type sql;
  params (default);
  query "SELECT gpg_key FROM user WHERE user_name='$@{user@}'";
@}
@end smallexample

@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
access-method 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 user-data-sql
@subsubsection User-data-sql: an SQL Implementation
@cindex user-data
  Return email address and real name of a user. This method must
return one tuple, consisting of two columns: an email address and a user
name, in this order.

@smallexample
access-method user-data @{
  type sql;
  params (default);
  query  "SELECT email, realname FROM user WHERE user_name='$@{user@}'";
@}
@end smallexample

@node verify-user-sql
@subsubsection Verify-user-sql: an SQL Implementation
@cindex verify-user-sql

@smallexample
access-method verify-user @{
  type sql;
  params (default);
  query   "SELECT user.user_name "
          "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@}' "
          "AND user.user_name='$@{user@}'";
@}
@end smallexample

@node builtin type
@subsection Built-in access methods
@cindex builtin access type
@WRITEME

@node external type
@subsection External access methods
@cindex external access type

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

@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, hovewer, 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. 

@kwindex archive
@smallexample
archive @var{type} @{
  name @var{file-or-dir};
  backup @var{type};
@}
@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

@deffn {Configuration} name @var{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}).

  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.

  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 {Configuration} backup @var{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, 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

@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}}.

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

@smallexample
archive-signatures no;
@end smallexample

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

Distribution spool is defined in the configuration file by the
@code{spool} block statement:

@smallexample
spool @var{tag} @{
  url @var{url};
  alias (@var{aliases});
  source @var{dir};
  destination @var{dir};
  file-sweep-time @var{interval};
  access-method @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 (@FIXME-pxref{timers}) and in
meta-variable interpretation (@pxref{meta-interpretation}).

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

@deffn {Configuration} source @var{dir}
Specifies the location of the source directory.
@end deffn

@deffn {Configuration} destination @var{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 run 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 @code{source} and @code{destination} statements are mandatory.

  A @code{spool} block may also contain an @code{archive} statement
(@pxref{archivation}), access method definitions (@pxref{access
methods}) and notification statements (@pxref{notification}). Any of
these statements, if present, override corresponding global definition
for this spool.

  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, access method 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 statistics
@section Statistics
@cindex statistics
At the end of the run, @command{wydawca} prints 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

@kwindex statistics
  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

@node notification
@section Mail Notification
@cindex mail 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. The utility can notify,
via email, project administrators about any of those events that
concern their projects. Additionally, the system administrator can
choose to obtain via email the execution statistics, described in the
previous section.

  The sender email address for these notifications is set using the
@code{from-address} statement.

@deffn {Configuration} from-address @var{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
(@FIXME-pxref{user privs}) and the full domain name of the machine it
runs at. 

@deffn {Configuration} admin-address @var{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::                 
* event notification::          
@end menu

@node mailer
@subsection Mailer
@cindex mailer
To send messages, @command{wydawca} uses a special logical entity
called a @dfn{mailer}. It is set in the configuration file using
@code{mailer} keyword.

@deffn {Configuration} mailer @var{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
@subsection Message Templates
@cindex templates, notification messages
@cindex notification message template
@cindex message template
Each notification message is build from a message template, by
expanding meta-variables (@pxref{meta-interpretation}) within it.
The message text may be specified either in place within the
configuration directive it belongs to (@FIXME-pxref{notification}), or
defined by @code{define-message} statement.

@deffn {Configuration} define-message @var{name} @var{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
@subsection Statistic Reports
@kwindex mail-statistics
@UNREVISED
Sending statistic reports to the system administrator is configured by
@code{mail-statistics} statement.

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

@deffn {Configuration} message @var{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 {Configuration} statistics @var{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 (stat-msg, errors, access-violations, bad-signatures);
@end smallexample
@end deffn

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

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

@multitable @columnfractions 0.50 0.50
@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.
@end multitable

@FIXME{timers: @code{timer:@var{id}:user} }

  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@}

Regards,
Wydawca
@}
@end smallexample

@node event notification
@subsection Event Notification
@cindex event notification
@UNREVISED
A number of @dfn{events} are tracked during the execution. Any of
them can be used to trigger an email notification of any party
concerned: the system administrator, project administrators, or
the user that initiated the upload. These notifications are configured
using the @code{notify-event} statement:

@kwindex notify-event
@smallexample
notify-event @{
  event @var{ev-id};
  recipient @var{who};
  message @var{text-or-id};
@}
@end smallexample

@deffn {Configuration} event @var{ev-id}
Send notification when the event @var{ev-id} occurs. The following
table describes the available @var{ev-id}s:

@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.
@end table
@end deffn

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

@table @code
@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 using the @samp{project-owner}
access method (@pxref{access methods}).

@kwindex user
@item user
The user who uploaded files. The user address is returned by
@samp{user-data} access method (@pxref{access methods}).
@end table
@end deffn

  For example, the following two statements instruct @command{wydawca}
to email notifications about any @code{bad-directive-signature} event to
project administrators and to the user who did the upload, using two
different templates:

@smallexample
notify-event @{
  event bad-directive-signature;
  recipient user;
  message @@usermsg;
@}

notify-event @{
  event bad-directive-signature;
  recipient owner;
  message @@ownermsg;
@}
@end smallexample

  The following macro-variables may be used in templates for these
notifications:

@table @code
@kwindex project
@item project
Project system name.

@kwindex url
@item url
@acronym{URL} of the distribution site.

@kwindex spool
@item spool
Name of the spool (@pxref{spool}).

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

@kwindex dest-dir
@item dest-dir
Value of the @code{destination} keyword.

@kwindex source-dir
@item source-dir
Value of the @code{source} keyword.

@kwindex triplet:full
@item triplet:full
A full listing of the uploaded triplet. It is equivalent to:

@smallexample
@group
%@{triplet:dist@}
%@{triplet:sig@}
%@{triplet:dir@}
@end group
@end smallexample

See below for an example.

@kwindex triplet:upload
@item triplet:upload
Listing of the uploaded files (see below).

@kwindex triplet:dist
@item triplet:dist
Listing of the main distribution file (see below).

@kwindex triplet:sig
@item triplet:sig
Listing of the detached signature file (see below).

@kwindex triplet:dir
@item triplet:dir
Listing of the directive file (see below).

@kwindex user
@kwindex user:name
@item user
@itemx user:name
System name of the user who uploaded the triplet.

@kwindex user:real-name
@item user:real-name
Real name of the user who uploaded the triplet.

@kwindex user:email
@item user:email
Email of the user who uploaded the triplet.

@item timer:wydawca:real
@FIXME
@item timer:wydawca:system
@FIXME
@item timer:wydawca:user
@FIXME
@item timer:triplet:real
@FIXME
@item timer:triplet:system
@FIXME
@item tumer:triplet:user
@FIXME
@item timer:spool:real
@FIXME
@item timer:spool:system
@FIXME
@item tumer:spool:user
@FIXME
@end table

  @dfn{Listings} referred to in the table above, are similar to those
produced by @code{ls} command, and include information
on file permissions, ownership, size and modification date. For
example, here is a possible @code{%@{triplet: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 following example shows how to configure success notification
for the user:

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

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

$@{triplet: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 smallexample

@node wydawca.rc
@chapter @command{Wydawca} configuration file.
@cindex configuration statements, reference
@WRITEME

@smallexample
# Configuration file structure for wydawca.
# For more information, use `info wydawca configuration'.

# Enable daemon mode
daemon @var{arg:@i{<boolean>}};

# Start in foreground even in daemon mode
foreground @var{arg:@i{<boolean>}};

# Do not spawn subprocesses
single-process @var{arg:@i{<boolean>}};

# Set wake-up interval
wakeup-interval @var{time:@i{<string>}};

# Set pid file name
pidfile @var{file:@i{<string>}};

# Run with UID and GID of this user
user @var{name:@i{<string>}};

# Retain these supplementary groups
group @var{arg:@i{<list of string>}};

# Configure locking
locking @{
  # Enable or disable locking
  enable @var{arg:@i{<boolean>}};

  # Set directory for lock files
  directory @var{dir:@i{<string>}};

  # Define lock expiration interval
  expire-time @var{interval:@i{<string>}};

  # Number of times to retry locking
  retry-attempts @var{n:@i{<number>}};

  # Delay between locking attempts
  retry-interval @var{interval:@i{<string>}};
@}
                    
# Listen on this address
listen @var{socket:@i{<sock-addr>}};

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

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

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

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

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

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

# Set mailer URL
mailer @var{url:@i{<string>}};

# Set admin email address
admin-address @var{email:@i{<string>}};

# Set sender email address
from-address @var{email:@i{<string>}};

# Define file sweep time
file-sweep-time @var{interval:@i{<string>}};

# Set tar invocation command line
tar-program @var{prog:@i{<string>}};

# Set umask
umask @var{mask:@i{<octal>}};

# Print these stats at the end of run
statistics @var{items:@i{<string>}};

# Define SQL database
sql @var{id:@i{<string>}} @{
  # Set SQL server hostname or IP address
  host @var{host:@i{<string>}};

  # Set database name
  database @var{dbname:@i{<string>}};

  # Set SQL user name
  user @var{name:@i{<string>}};

  # Set SQL user password
  password @var{arg:@i{<string>}};
@}

# Configure syslog logging
syslog @{
  # Set syslog facility. Arg is one of the following: user, daemon, auth,
  # authpriv, mail, cron, local0 through local7 (case-insensitive), or a
  # facility number.
  facility @var{name:@i{<string>}};

  # Tag syslog messages with this string
  tag @var{string:@i{<string>}};

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

# Define message text
define-message @var{ident:@i{<string>}} @var{text:@i{<string>}};

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

  # Define backup type
  backup @var{type:@i{<string>}};
@}

# Send statistics
mail-statistics @{
  # Message text
  message @var{text:@i{<string>}};

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

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

  # Notify this recipient
  recipient @var{who:@i{<string>}};

  # Text of the notification or identifier of a defined message template
  message @var{text-or-id:@i{<string>}};
@}

# Define access method
access-method @var{ident} @{
  # Method type
  type @var{type:@i{<string>}};

  # Query template
  query @var{string:@i{<string>}};

  # Set method parameters
  params @var{arg:@i{<list of string>}};
@}

# Define distribution spool
spool @var{tag:@i{<string>}} @{
  # URL corresponding to this spool
  url @var{arg:@i{<string>}};

  # Aliases
  alias @var{arg:@i{<list of string>}};

  # Source directory
  source @var{dir:@i{<string>}};

  # Destination directory
  destination @var{dir:@i{<string>}};

  # Define file sweep time
  file-sweep-time @var{interval:@i{<string>}};

  # Define access method
  access-method @var{ident} @{
    # Method type
    type @var{type:@i{<string>}};

    # Query template
    query @var{string:@i{<string>}};

    # Set method parameters
    params @var{arg:@i{<list of string>}};
  @}

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

    # Define backup type
    backup @var{type:@i{<string>}};
  @}

  # Control implicit signature archivation
  archive-signatures @var{arg:@i{<boolean>}};

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

    # Notify this recipient
    recipient @var{who:@i{<string>}};

    # Text of the notification or identifier of a defined message template
    message @var{text-or-id:@i{<string>}};
  @}
@}

# Service names that request scanning all spools
all-spools @var{arg:@i{<list of string>}};

@end smallexample

@node invocation
@chapter @command{Wydawca} invocation summary.
@cindex invocation
@cindex command line options
@UNREVISED
This chapter presents a short reference of all @command{wydawca}
command line options, in alphabetical order.

@table @option
@opsummary{config-file}
@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{cron}
@opsummary{syslog}
@item --cron
@itemx --syslog
Log all diagnostics to syslog.

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

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

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

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

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

@opsummary{stderr}
@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}.

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

@xref{Pragmatic Comments, #include}.

@opsummary{lint}
@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{help}
@item --help
@itemx -h
Print a concise usage summary and exit.

@opsummary{version}
@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
@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.