summaryrefslogtreecommitdiffabout
path: root/doc/wydawca.texi
blob: b313e4f39154c500a4e64d5e0eb7be8c79e30a6c (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
\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 project upload 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 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

@node Top, Intro, (dir), (dir)

@ifinfo
@chapter Wydawca
This edition of the @cite{Wydawca Manual}, last updated @value{UPDATED},
documents Wydawca Version @value{VERSION}.
@end ifinfo

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

* include::
* syslog::
* sql::
* access methods::
* archivation::
* directory pairs::
* statistics::
* notification::

Mail Notification

* mailer::
* admin notification::
* user notification::

@end detailmenu
@end menu

@node Intro, overview, Top, Top
@chapter Introduction to Wydawca
@UNREVISED{}
  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
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

  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 creates a detached
signature @file{foo-1.0.tar.gz.sig}, using his PGP key, the creates a
special @dfn{directive} file, that contain some information needed bt
the server, and clearsigns it, obtaining this way the file
@file{foo-1.0.tar.gz.directive.asc}. Then he uploads these three files
(a @dfn{triplet}) to the upload site, storing them into the directory
@file{/incoming/ftp}.

  From now on it is the responsibility of an @dfn{automated upload
daemon}, to scan the source directories, to gather the triplets,
verify them, and to move the files to distribution sites, if they had
passed the verification successfully.

  @command{Wydawca} is such an automated upload daemon. It is able to
handle any number of @samp{source/destination} pairs, offers an
extensible logging and mail notification mechanism, allowing both
package maintainers and site administrators to be immediately notified
about any occurring problems.

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

@node overview, starting, Intro, Top
@chapter Operation Overview
@UNREVISED{}

@node starting, configuring, overview, Top
@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 it
diagnostics to 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. Currently, its effect is
the same as @option{--syslog}, but it may change in the future.

@anchor{debug}
@xopindex{debug, described}
@sopindex{d, described}
  The @option{--debug} (@option{-d}) tells the program to inrease its
debugging level by 1. The @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 impractically many
information and is useful primarily 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} no to do any
modifications to the disk contents, but to verbosely print them. It
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}
  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, wydawca.rc, starting, Top
@chapter How to Configure @command{wydawca}.
  The @command{wydawca} configuration file has a simple line-oriented
syntax. Empty lines are ignored. Comments are introduced by a pound
sign (@samp{#}): everything starting from the first occurrence of
@samp{#} up to the end of line is ignored. Non-empty non-comment lines
contain configuration statements.

  A @dfn{configuration statement} consists of a @dfn{command word}
optionally followed by one or more @dfn{arguments}, separated by any
amount of whitespace. There are @samp{simple} and @samp{compound}
configuration statements. @dfn{Simple statements} occupy a single
line, for example:

@smallexample
syslog-print-priority yes
@end smallexample

If a simple statement is so long that it is inconvenient to keep it on
a single line, it can be split over several lines by ending each line
except the last one with a backslash character (@samp{\}). Notice,
that the backslash character must immediately precede the terminating
newline. For example, this is a single statement split over several lines:

@smallexample
@group
user-data sql default   SELECT realname, email \
                          FROM user \
                         WHERE user_name='%@{user@}'
@end group
@end smallexample


A @dfn{compound statement} begins with a simple statement, occupies
several lines, and ends with @code{end} statement, appearing on a line
by itself. Within a compound statement any number of another
statements (both simple and compound) may appear).

@cindex scope of a statement
When a statement appears outside of any block statement, we say that
@dfn{it appears at the top level} or @dfn{its scope is global}. When
it appears within a block statement, we say that @dfn{it has block
scope}. 

  This subsection will guide you through the @command{wydawca}
configuration on step-by-step basis.

@menu
* include::
* syslog::
* sql::
* access methods::
* archivation::
* directory pairs::
* statistics::
* notification::
@end menu

@node include
@section Include Statement
@cindex inclusion, configuration file
@kwindex include
  You can request inclusion of any file into your configuration file
using @code{include} statement. As its argument give it the name of
file to be included. For example: 

@smallexample
include /etc/wydawca/msg
@end smallexample

  The effect of the above statement is that the contents of file
@file{/etc/wydawca/msg} is read and processed as if it were here,
instead of the @code{include} statement.

  The include statement is especially useful if you wish to avoid
keeping large static blocks of text in your configuration file, to
make it more readable. An example of such large blocks of text are
templates for notification messages (@pxref{notification}).

@cindex inclusion directory
@cindex default inclusion directory
  Argument to the @code{include} statement may also be a relative
file name (i.e. one not beginning with @samp{/}).  In this case,
@command{wydawca} will look for that file in the @dfn{inclusion
directory}. By default, the inclusion directory is your system
configuration directory. So, for example, in the default
configuration, the following two statements are equivalent:

@smallexample
include message/stat
include /usr/local/etc/message/stat
@end smallexample

@xopindex{include-directory, described}
@sopindex{I, described}
  The value of the inclusion directory can be changed at run time,
using the @option{--include-directory} (@option{-I}) command line
option. This option takes an @emph{optional} argument, which means
that if the argument is supplied, it must follow the short form of the
option immediately, without any intervening whitespace, as in
@option{-I/var/inc}. Similarly, when the long option form is used, the
argument must be separated from it by a single equals sign, as in
@option{--include-directory=/var/inc}.

  If an argument is given, this option instructs @command{wydawca} to
use it as the inclusion path. Otherwise, if argument is omitted,
the include directory is defined as the directory part of the full
file name of the configuration file. This form might be useful when
debugging new configurations. For example, the following invocation
runs @command{wydawca} in dry run mode, using configuration file
@file{./test.rc}, and looking for include files in the current working
directory: 

@smallexample
$ wydawca --config ./test.rc -I --dry-run
@end smallexample

  Please notice, that unlike many other programs (e.g. @command{cc} or
@command{make}), @command{wydawca} allows only one value of the
inclusion directory: inclusion paths are not supported. If the command
line contains several @option{-I} options, only the last of them takes
effect.

@node syslog
@section Syslog Configuration Directives
@cindex syslog, configuration
@kwindex syslog-facility
  Syslog is the default diagnostics channel for @command{wydawca}. By
default, the program uses facility @samp{local1}. To change this, use
@code{syslog-facility} statement:

@smallexample
syslog-facility local2
@end smallexample

@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}
  It takes a single argument, denoting the 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_}. The default is @samp{local1}.

@kwindex syslog-tag
@cindex syslog tag, configuring
  Another thing you may wish to tune is @dfn{syslog tag}, a string
identifying each message issued by the program. By default it is a
string @samp{wydawca}. To change it, use @code{syslog-tag} statement:

@smallexample
syslog-tag wydawca
@end smallexample

@kwindex syslog-print-priority
@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
syslog-print-priority yes
@end smallexample

@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
@acronym{SQL} database. @command{Wydawca} can 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{identifier}
  @var{statements}
end
@end group
@end smallexample

  Here, the @var{identifier} 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. The
@var{statements} is a set of statements determining access to the
database. Allowed statements are:

@table @code
@kwindex host
@item host @var{hostname}[:@var{port-or-socket}]
  Set the hostname or @acronym{IP} address of the host running the
database. The 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}.
@xref{sql-host}, for more information and examples.

@kwindex database
@item database @var{name}
Specifies the database name.

@kwindex user
@item user @var{name}
Specifies the database user name.

@kwindex password
@item password @var{string}
Specifies password for accessing the database.
@end table

  An example @code{sql} statement follows:

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

@node access methods
@section Access Methods
@cindex Access method
  An @dfn{access method} defines how @command{wydawca} can access some
piece of information it needs while verifying the submission. This
information can be, for example, the user's @acronym{PGP} key or his
permissions on a project.

  @command{Wydawca} understands three access methods, only one of them
being implemented right now. These methods are summarized in the table
below:

@table @asis
@kwindex builtin@r{, access method type}
@item builtin
  This method is reserved for future use.

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

@kwindex external@r{, access method type}
@item external
  Retrieve data using an external program. This method is reserved for
future use.  
@end table

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

@smallexample
@var{method-name} @var{type} @var{param1} @var{param2}
@end smallexample

@noindent
where @var{method-name} is the predefined name of the access method,
@var{type} is its type and @var{param1} and @var{param2} are
@dfn{parameters}, that describe the method.

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

  There are four predefined methods, which are described later in this
section. The @var{type} must currently always be @samp{sql}. The
@var{param1} is the identifier of one of the preceding @code{sql} blocks
(@pxref{sql}), which determines database name and user
credentials needed to access it. The @var{param2} is an @acronym{SQL}
statement that should be issued to obtain the requested data. A set of
@dfn{meta-variables} is available for use in @var{param2}. These
variables allow to supply to the query such additional information
that is available only at run-time. To use a meta-variable in a
query, it is preceded by a percent sign.  If its name consists of
several letters, it must be surrounded by curly braces. For example,
following are two valid uses of macro-variables: @code{%u} and
@code{%@{user@}}, the first of them expands macro variable @samp{u},
and the second one expands the variable @samp{user}. Undefined
variables are not expanded, but are left in the query intact.

  The variables defined for use in access methods are:

@table @code
@kwindex u
@kwindex user
@item u
@itemx user
  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.
@end table

@cindex Savane
  The rest of this section describes the access methods (referred to
by @var{method-name} in the syntax above) used by
@command{wydawca}. They are illustrated by example definitions, based
on the database structure used in
@uref{http://gna.org/projects/savane, @command{Savane} system}. 
  
@deffn {Access Method} gpg-key
  Retrieve the public @acronym{PGP} key of a user. This method must
return exactly one string.

  The sample definition is:
  
@smallexample
gpg-key sql default SELECT gpg_key \
                      FROM user \
                     WHERE user_name='%@{user@}'
@end smallexample
@end deffn
  
@deffn {Access Method} 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: email address and user name, in this order. 

@smallexample
@group
project-owner sql default 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 group
@end smallexample
@end deffn

@deffn {Access Method} user-data
  Return email address and real name of a user. This method must
return one tuple, consisting of two columns: email address and user
name, in this order. 

@smallexample
@group
user-data sql default SELECT email, realname \
                        FROM user \
                       WHERE user_name='%@{user@}'
@end group
@end smallexample
@end deffn
  
@deffn {Access Method} 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.

  The following definition allows uploads only to project
administrators:
  
@smallexample
@group  
verify-user sql default 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 group
@end smallexample
@end deffn

@node archivation
@section Archivation
@cindex archivation, defined
  Project maintainers may upload files having the same names as
the ones uploaded earlier. Although this practice is not encouraged,
it still can happen. 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
explicitely 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
directory pairs, or within a @code{directory} block (@pxref{directory
pairs}), where it affects only the given directory pair. 

  This statement takes several arguments. The first argument specifies
the archivation type: 

@table @asis
@kwindex none@r{, archivation}
@item none
  Disable archivation.
  
@kwindex tar@r{, archivation}
@item tar
  Use @command{tar} archive.
  
@kwindex directory@r{, archivation}
@item directory
  Use separate directory or directory hierarchy.
@end table

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

@smallexample
archive tar /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 archivation type @samp{directory} means that archive copies will
be stored in a directory specified by the second argument to
@code{archive}. 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 /var/backups/gnu 
@end smallexample

@noindent
all files from @file{/home/@/ftp/@/gnu/@/tar} will be archived in
@file{/var/@/backups/@/gnu/@/tar}, 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 located
immediately under the corresponding distribution directory. Following
our example, the following @code{directory} settings:

@smallexample
archive directory .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. 

@anchor{backup-methods}
@vindex version-control @r{Emacs variable}
   With 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. In this case the third argument to @code{archive} specifies
how to handle the existing copy, in other words, how to @dfn{backup}
it. This argument corresponds to the Emacs variable @samp{version-control},
and it accepts the same values as in Emacs. The following table
describes them:

@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

@vindex VERSION_CONTROL
  If backup method is not given, the value of the @env{VERSION_CONTROL} 
environment variable will be used.  And if @env{VERSION_CONTROL} is
not set, the @samp{existing} is used by default.

@node directory pairs
@section directory pairs
@cindex directory pair
@kwindex directory
@cindex defining source and distribution directories
@cindex distribution directory, defining
@cindex source directory, defining
@kwindex source
@kwindex destination
  A @dfn{directory pair} definition is a core of @command{wydawca}
configuration. It defines the location of the source directory and its
corresponding distribution directory. It may also set the archivation
type being used for that directory and various access methods, thus
overriding the global settings. The directory pair definition begins with
the @code{directory} keyword, optionally followed by the @acronym{URL}
of the distribution directory. This @acronym{URL}, if specified, is
then used in diagnostic messages regarding this directory
pair. Following the @code{directory} keyword is a list of statements
describing the pair. At least two statements are required:
@code{source}, specifying the location of the source directory and
@code{destination}, which specifies the location of destination (or
distribution) directory. Apart from these obligatory statements, the
@code{directory} block may contain @code{archive} statement
(@pxref{archivation}) and access method definitions (@pxref{access
methods}). If any of these statements is present, it override the
corresponding global definition only for this directory pair. The
@code{directory} statement ends with the @code{end} keyword on a
separate line.  

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

@smallexample
@group
directory ftp://ftp.gnu.org.ua
 source /home/ftp/incoming/ftp
 destination /home/ftp/gnu
end
@end group
@end smallexample

  This directory pair will be using archivation type and access methods
defined globally.

  The following example shows the same directory pair block, that additionally
overriding the archivation method:

@smallexample
@group
directory ftp://ftp.gnu.org.ua
 source /home/ftp/incoming/ftp
 destination /home/ftp/gnu
 archive directory .archive
end
@end group
@end smallexample

  The distribution directory is implicitly supposed to be located on
the same machine as the upload directory. If they are located on
different machines, one of the directories can be mounted using
@acronym{NFS}. The future versions will contain special provisions for
such case.

@node statistics
@section Statistics
@UNREVISED{}

  At the end of the run, @command{wydawca} can print the detailed
statistics of its execution on the diagnostic channel @samp{info}.
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 conditions occurred during the run.

@kwindex bad-signatures@r{, statistics}
@item bad-signatures
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
authorised 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 executed successfully. An upload is defined as a
successful 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 symlinks 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. It takes arbitrary
number 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

  It will produce the following output:

@smallexample
errors: 0
warnings: 2
@end smallexample

@kwindex none@r{, statistics}
  The 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}, that enables all 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
@UNREVISED{}
@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.

@kwindex from-address
  The sender email for these notifications can be set using the
@code{from-address} statement, e.g.:

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

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

@menu
* mailer::
* templates::
* admin notification::
* user notification::
@end menu

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

@smallexample
mailer @var{url}
@end smallexample

@cindex @acronym{URL}, mailer
@cindex mailer @acronym{URL}
  A mailer @acronym{URL} begins with a protocol specification.
Two protocol specifications are currently supported: @samp{sendmail}
and @samp{smtp}.  The former means to use a 
@command{sendmail}-compatible program to send mails.  Such a program
must be able to read mail from its standard input and must support the
following options:

@table @option
@item -oi
Do not treat '.' as message terminator.

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

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

These conditions are met by most existing @acronym{MTA} programs, such
as @command{exim} or @command{postfix} (to say nothing of
@command{sendmail} itself).

Following the protocol specification is the @dfn{mailer location}, which
is separated from it with a colon.  For the @samp{sendmail} protocol,
the mailer location sets the full file name of the sendmail-compatible
@acronym{MTA} binary, for example:

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

A special form of a sendmail @acronym{URL}, consisting of protocol
specification only (@samp{sendmail:}) is also allowed.  It means
``use the sendmail binary from the @code{_PATH_SENDMAIL}
macro in your @file{/usr/include/paths.h} file''.  This is the default
mailer. 

The @samp{smtp} protocol means to use an @acronym{SMTP} server directly.
In this case, the mailer location consists of two slashes,
followed by the @acronym{IP} address or host name of the @acronym{SMTP}
server, and, optionally, the port number.  If the port number is
present, it is separated from the rest of @acronym{URL} by a colon.
For example: 

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

@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 any occurrances of @samp{%@{@var{name}@}} within it with the value
of macro-variable @var{name}. The sets of defined macro-variables
depend on the type of the notification and are described below.

@kwindex define-message
  Message templates are defined using @code{define-message}
statement. Its syntax is as follows:

@smallexample
define-message @var{id} [-]@var{delimiter}
@var{lines}
@var{delimiter}
@end smallexample

  The @var{id} is a symbolic identifier used to refer to this message
in another configuration statements, @var{delimiter} is a delimiter
used to mark the end of the message template, and @var{lines} are any
number of lines that form the message template. If @var{delimiter} is
prefixed by a minus sign, any leading whitespace will be removed from
each template line, thus allowing to indent it in a natural
way. Furthermore, the @var{delimiter} itself is optional. If it is
omitted, the string @samp{end} is used to delimit the message.
The following example illustrates the simplest way to define a message
template:

@smallexample
define-message my-message
Subject: test

This is a test message.
end
@end smallexample

  Following is the same message template, but indented in a more
natural way. @samp{EOT} is used as a message delimiter:

@smallexample
define-message my-message -EOT
  Subject: test

  This is a test message.
EOT
@end smallexample

  It is important to notice, that the message template must supply
both @acronym{RFC} 822 headers, and message body, so it must always
consist of two parts, separated by a single empty line. 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 admin notification
@subsection Admin Notification
@kwindex mail-admin-stat
  Sending notifications to the system administrator is enabled by
@code{mail-admin-stat} statement. It takes two or more arguments.
The first argument supplies the identifier of a message template,
which should be previously defined by a @code{define-message}.
The rest of arguments is a list of statistics keywords as described in
@ref{statistics}. The notification 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 ocurred any errors or access violation
attempts, or any bad signature was uploaded: 

@smallexample
mail-admin-stat stat-msg errors access-violations bad-signatures
@end smallexample

@kwindex
  The recipient address for these notifications is set using
@code{admin-address} statement. Its argument is either a single
@acronym{RFC} 822 email address, or a comma-separated list of such
addresses, e.g.:

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

@cindex meta-variables in admin notifications
The meta-variables available for use in admin notifications 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

  An example definition of the admin notification template follows:

@smallexample
define-message stat-msg
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        
@end smallexample

@node user notification
@subsection User Notification
@UNREVISED{}
@cindex mail notification, project admin
  Project administrators can be notified via email about any of the
following events:

@table @code
@kwindex success
@item success
  Successfull 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

@node wydawca.rc, invocation, configuring, Top
@chapter @command{Wydawca} configuration file.
@cindex configuration statements, reference
  This chapter contains a concise reference list of all configuration
file statements.

@deffn {Wydawca Statement} archive @var{type} @var{archive-name} @
       [@var{backup-method}]
Defines archivation and backup methods for the destination
directory. @xref{archivation}, for a detailed discussion. The
@var{type} specifies the archivation type:

@table @asis
@item tar
The @var{archive-name} is a full file name of the @command{tar}
archive used for archivation. Files being archived are appended to
that archive using @command{tar -r} command (@pxref{appending files,
Appending Files to an Archive, Appending Files to an Archive, tar,
@acronym{GNU} tar: an archiver tool}). The default file name of the
@command{tar} binary is set by @code{tar-program} statement.

@item directory
The @var{archive-name} specifies a directory name where to store
archive copies. If it is a relative pathname, this directory will be
created under the @code{destination} directory. If it is absolute file
name, the archive name directory will be constructed for each triplet
using the following rule:

@smallexample
@var{archive-name}/@var{dir}
@end smallexample

@noindent
where @var{dir} is the value of @code{directory} directive from the
triplet file.

@vindex VERSION_CONTROL
@cindex backups
For @samp{directive} archivation type, the optional @var{backup-method}
parameter specifies how to back up an existing archive whose name
coincides with the one @command{wydawca} is about to create. If 
@var{backup-method} is not specified, the value of the @env{VERSION_CONTROL}
environment variable will be used.  And if @env{VERSION_CONTROL} is not set,
the @samp{existing} method (see below) is used by default.

@vindex version-control @r{Emacs variable}
This option corresponds to the Emacs variable @samp{version-control};
the same values for @var{backup-method} are accepted as in Emacs.  This option
also allows more descriptive names.  The valid @var{method}s are:

@table @samp
@item t
@itemx numbered
Always make numbered backups.

@item nil
@itemx existing
Make numbered backups of files that already have them, simple backups.
of the others.

@item never
@itemx simple
Always make simple backups.

@end table
@end table

@end deffn

@deffn {Wydawca Statement} syslog-facility @var{facility}
Output diagnostics to the given syslog facility.  The @var{facility} 
may be one of the following: @samp{USER}, @samp{DAEMON}, @samp{AUTH},
@samp{AUTHPRIV}, @samp{LOCAL0} through @samp{LOCAL7}, and @samp{MAIL}.
The string matching is case insensitive.  Optionally, @samp{LOG_}
prefix may be prepended to @var{facility}.    
@end deffn

@deffn {Wydawca Statement} syslog-tag @var{tag}
Mark @command{wydawca} diagnostics with the given syslog tag.  By
default the string @samp{wydawca} is used.
@end deffn

@deffn {Wydawca Statement} syslog-print-priority @var{bool}
Begin each diagnostic message with its priority.
@end deffn

@deffn {Wydawca Statement} statistics @var{stat-list}
Print usage statistics at the end of the run.  These data are output
at @samp{info} priority.  The @var{stat-list} is a white-space
separated list of items that specify what statistics data are to be
printed. The valid items of @var{stat-list} are:

@table @option
@item archives
Number of files successfully archived.

@item bad_triplets
Number of bad triplets detected.

@item complete_triplets
Number of complete triplets.

@item errors
Number of errors during the run.

@item expired_triplets
Number of expired triplets.

@item incomplete_triplets
Number of incomplete triplets.

@item rmsymlinks
Number of symlinks successfully removed.

@item symlinks
Number of symlinks successfully created.

@item triplet_success
Number of triplets successfully processed.

@item uploads
Number of successful uploads.

@item warnings
Number of warnings.
@end table

  Two special keywords are also recognized:

@table @option
@item all
Print all information.

@item none
Do not print any statistics.
@end table

  These keywords must be the very first items in @var{stat-list}.
When followed by another keywords, these special keywords modify list
handling as follows:

@table @option
@item all
The sense of all subsequent items is inverted. For example, to print
everything, except the number of warnings and errors, one would use:

@smallexample
statistics all errors warning
@end smallexample

@item none
Is ignored.
@end table
@end deffn

@deffn {Wydawca Statement} file-sweep-time @var{interval}
Sets the amount of time after which any unprocessed file will be
removed.

  The @var{interval} is a string that defines a time 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 deffn

@deffn {Wydawca Statement} umask @var{value}
Sets the umask to be used.  The @var{value} must be octal.
@end deffn

@deffn {Wydawca Statement} tar-command @var{string}
Sets the file name of the @command{tar} utility. If @var{string} is
not an absolute file name, it will be searched in @env{PATH}.
@end deffn

@deffn {Wydawca Block Statement} sql @var{identifier}
This statement begins a MySQL database definition. It may contain 
several substatements, defining how to access the database. The
statement ends with the @code{end} keyword on a line by itself.

@xref{sql}, for more information.

The @var{identifier} is the symbolic name that can be used in
subsequent configuration statements to refer to this @acronym{SQL}
database.

@smallexample
sql default
  host localhost:/tmp/mysql.sock
  database savane
  user savane
  password guessme
end
@end smallexample

The following statements are recognized within the @code{sql} block:

@anchor{sql-host}
@deffn {Wydawca Statement} host @var{hostname}[:@var{port-or-socket}]
Hostname where the database is running. The @var{hostname} is either
a symbolic hostname of the machine, or its IP address in usual
@samp{dotted-quad} notation.

The 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} may be omitted. If,
however, it is present, it must be @samp{localhost}.

Examples:

@smallexample
host 10.10.10.1
host sql.server.com
host sql.server.com:3100
host localhost:/tmp/mysql.sock
host /tmp/mysql.sock
@end smallexample
@end deffn

@deffn {Wydawca Statement} database @var{string}
Specifies the database name.
@end deffn

@deffn {Wydawca Statement} user @var{string}
Specifies the database user name.
@end deffn

@deffn {Wydawca Statement} password @var{string}
Specifies the password.
@end deffn
@end deffn

@deffn {Wydawca Block Statement} directory
Defines a directory pair. The syntax is:

@smallexample
@group
directory [@var{url}]
  source @var{name}
  destination @var{name}
  [@var{statements}]
end
@end group
@end smallexample
  
@noindent
where optional @var{url} specifies the @acronym{URL} of the
distribution site defined by this directory (for diagnostic purposes),
@code{source} and @code{destination} are two obligatory statements,
defining source and distribution directories, and @var{statements} are
any optional archive and/or access method definitions, overriding the
global ones for this directory pair.
  
@xref{directory pairs}, for more information.

The following statements must be present in a @code{directory} block:

@deffn {Wydawca Statement} source @var{dirname}
Sets source directory name. The @var{dirname} must be an absolute file
name.
@end deffn

@deffn {Wydawca Statement} destination @var{dirname}
Sets source directory name. The @var{dirname} must be an absolute file
name.
@end deffn
@end deffn

@deffn {Wydawca Statement} gpg-key @var{type} @var{id} @var{command}
Defines an access method for retrieving user's public @acronym{PGP}
key.

@xref{access methods}, for a detailed description.
@end deffn

@deffn {Wydawca Statement} project-owner @var{type} @var{id} @var{command}
Defines an access method for retrieving email addresses and real names
of administrators (@dfn{owners}) of a project.

@xref{access methods}, for a detailed description.
@end deffn

@deffn {Wydawca Statement} verify-user @var{type} @var{id} @var{command}
Defines an access method for verifying if the user is allowed to make
uploads for a certain project.

@xref{access methods}, for a detailed description.
@end deffn

@deffn {Wydawca Statement} user-data @var{type} @var{id} @var{command}
Defines an access method for retrieving email address and real name of
a user.

@xref{access methods}, for a detailed description.
@end deffn

@deffn {Wydawca Statement} admin-address @var{email}
Sets email address or addresses to send administrator notification to.

@xref{admin notification}.
@end deffn

@deffn {Wydawca Statement} from-address @var{email}
Sets the sender address for mail notifications.

@xref{notification}, for more information on this statement.
@end deffn

@deffn {Wydawca Statement} mail-admin-stat @var{msg-id} @var{condition-list} 
Defines statistics categories that trigger administrator
notifications.

@xref{admin notification}.
@end deffn

@deffn {Wydawca Statement} define-message
Define a message template. The full syntax is:

@smallexample
define-message @var{id} [[-]@var{delimiter}]
@var{lines}
@var{delimiter}
@end smallexample

 The @var{id} supplies the template identifier, @var{lines} gives
message headers and body, separated by a newline. If @var{delimiter}
is prefixed by @samp{-}, any leading whitespace is removed from the
template lines. If @var{delimiter} is not given, @samp{end} is
assumed.

@xref{templates}, for more information on message templates.
@end deffn

@deffn {Wydawca Statement} mailer @var{url}
Sets the mailer @acronym{URL} to use.

@xref{mailer}, for more information on mailers.
@end deffn

@node invocation, Reporting Bugs, wydawca.rc, Top
@chapter @command{Wydawca} invocation summary.
@cindex invocation
@cindex command line options
  This chapter presents a short reference to 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}]
If @var{dir} is supplied it is set as the current inclusion
directory. Otherwise, the inclusion directory is set to the directory
part of the configuration file used.

@xref{include, File inclusion}.

@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, Copying This Manual, invocation, Top
@chapter How to Report a Bug

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

@itemize
@item Topmost date from the @file{ChangeLog} file.
@item Conditions under which the bug appears.
@end itemize

@node Copying This Manual, Concept Index, Reporting Bugs, Top
@include fdl.texi

@node Concept Index,  , Copying This Manual, Top
@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.