aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS1
-rw-r--r--ChangeLog210
-rw-r--r--Makefile.am4
-rw-r--r--NEWS36
-rw-r--r--README52
-rw-r--r--README-alpha61
-rw-r--r--README-hacking59
-rw-r--r--acinclude.m457
-rw-r--r--configure.ac139
-rw-r--r--doc/Makefile.am42
-rw-r--r--doc/fdl.texi450
-rwxr-xr-xdoc/gendocs_template105
-rw-r--r--doc/rendition.texi85
-rw-r--r--doc/wydawca.texi871
-rw-r--r--src/Makefile.am11
-rw-r--r--src/config.c6
-rw-r--r--src/directive.c6
-rw-r--r--src/diskio.c6
-rw-r--r--src/exec.c6
-rw-r--r--src/gpg.c6
-rw-r--r--src/mail.c6
-rw-r--r--src/method.c6
-rw-r--r--src/process.c6
-rw-r--r--src/sql.c6
-rw-r--r--src/triplet.c6
-rw-r--r--src/verify.c6
-rw-r--r--src/wydawca.c6
27 files changed, 2213 insertions, 42 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..ca6ccd1
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1 @@
+Sergey Poznyakoff <gray@gnu.org.ua>
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..360b0ef
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,210 @@
+2007-09-01 Sergey Poznyakoff <gray@gnu.org.ua>
+
+ Moved to a separate repository.
+
+
+2007-08-26 Sergey Poznyakoff <gray@gnu.org.ua>
+
+ * src/wydawca.h (struct file_triplet): New member user
+ (fill_project_name): New function
+ * src/verify.c (get_project_name): Rename to
+ fill_project_name, remove static qualifier.
+ * src/wydawca.rc: Update
+ * src/mail.c (notify_owner): Notify only the submitter on
+ ev_success, ev_bad_directive_signature and
+ ev_bad_detached_signature (should it be made configurable?)
+ (notify): Call fill_project_name
+ * src/triplet.c (hash_triplet_free): Free trp->user
+ (expand_user_real_name, expand_user_email): Change data indices to
+ match those of project_owner_method.
+
+ Implement project owner notifications.
+
+ * src/wydawca.c (syslog_printer): Reduce the number of memory
+ reallocations
+ (make_stat_expansion): Update
+ * src/method.c: Implement a new framework: methods may return
+ 2-dimensional arrays of strings.
+ * src/sql.c, src/sql.h: Implement the new method framework.
+ * src/verify.c (expand_param): kw_expansion may provide
+ expansion functions. An additional argument supplies user-defined
+ data for expansions.
+ (escape_kwexp): Extern
+ (free_kwexp): Improve
+ (get_project_name): New function
+ (make_default_kwexp): New function
+ (check_access_rights): Call get_project_name. Use
+ make_default_kwexp to initialize expansions
+ (verify_directive_file): Use make_default_kwexp to initialize
+ expansions
+ * src/wydawca.h (NITEMS): New macro
+ (enum access_method_type): New members: ncol, nrow
+ (struct directory_pair): New members url,project_owner_method,
+ user_data_method
+ (struct file_info): Replace mtime, uid with struct stat sb
+ (struct file_triplet): New members project, dpair, user_data
+ (TRIPLET_UID): Take into account the changes to struct file_info
+ (enum notification_event): New data type
+ (notify_project_owner, notify_admin, notify): New functions
+ (struct kw_expansion): New members static_p, expand and data.
+ (escape_kwexp,make_default_kwexp): New proto
+ (expand_param): Change signature
+ (triplet_expand_param): New function
+ (method_result): Change prototype
+ (method_num_rows,method_num_cols): New functions
+ * src/config.c: New statements project-owner, user-data,
+ admin-address, mail-user, user-message
+ directory can take an optional argument specifying base URL for
+ notification messages
+ * src/gpg.c (verify_directive_signature): Expand directives
+ even if the signature does not match. Useful for notifications.
+ Add notifications.
+ * src/process.c: Add notifications.
+ * src/directive.c: Add notifications
+ * src/wydawca.rc: Update
+ * src/mail.c, src/mail.h: Implement project owner
+ notifications
+ * src/triplet.c (triplet_expand_param): New function
+
+2007-08-25 Sergey Poznyakoff <gray@gnu.org.ua>
+
+ * configure.ac: Require mailutils for wydawca
+ * bootstrap: Require inttostr and strftime
+ * src/mail.h: New file
+ * src/mail.c: New file
+ * src/Makefile.am: Add mail.c and mail.h
+ * src/wydawca.c: Include mail.h
+ (stat_mask_p, make_stat_expansion): New functions
+ (logstats): Call mail_stats
+ (main): Call initialize mailer subsystem
+
+ * src/sql.c, src/sql.h: Keep usage reference count. Do not
+ deinitialize unless it falls to 0. Do not initialize if it is > 0.
+
+ * src/verify.c (expand_param): Rewrite to allow long keywords
+ All callers updated.
+ * src/wydawca.h (struct access_method): Keep reference count
+ (struct directory_pair): verify_method and gpg_key_method are
+ pointers to structs.
+ (struct kw_expansion): kw is char*
+ (count_collected_triplets): New function
+ (method_new): New function
+ * src/config.c: reimplement verify-user and gpg-key
+ New keywords mailer, admin-address, from-address, mail-admin-stat
+ and admin-stat-message
+ * src/process.c: Close methods only when their reference count
+ is 0.
+ * src/method.c: Likewise.
+ (method_new): New function
+ * src/wydawca.rc: Update
+ * src/diskio.c: Minor changes
+ * src/triplet.c (count_collected_triplets): New function
+
+ * src/wydawca.c, src/config.c, src/gpg.c: New stat
+ types STAT_ACCESS_VIOLATIONS and STAT_BAD_SIGNATURES.
+ * src/wydawca.h (expand_param): New function
+ (struct kw_expansion): New data type
+ * src/verify.c (expand_param): Rewrite.
+ (verify_directive_file): Call check_access_rights.
+
+2007-08-24 Sergey Poznyakoff <gray@gnu.org.ua>
+
+ * src/Makefile.am,
+ lib/Makefile.am, jabberd/Makefile.am: Fix include dirs
+ * src/wydawca.c: Use gsc_version to display
+ program version.
+ * doc/gsc.texi: Update
+ * bootstrap: Add vasprintf
+
+ Implement final statistics.
+
+ * src/wydawca.c (log_to_stderr): Init to -1 (autodetect)
+ (wydawca_stat,syslog_include_prio,print_stats): New variables
+ (version): Update
+ (main): New options --cron, --syslog
+ Autodetect log_to_stderr value, unless set explicitly
+ (syslog_printer): Output priority string if requested by
+ syslog_include_prio
+ Print final statistics
+ (logmsg): Update statistics
+ (logstats): New function
+ * src/wydawca.h (enum wydawca_stat): New type
+ (STAT_MASK, STAT_MASK_NONE, STAT_MASK_ALL, UPDATE_STATS): New defines
+ (syslog_include_prio,wydawca_stat,print_stats): New globals
+ * src/config.c: New statements "syslog-print-priority" and
+ "statistics"
+ (get_backup_version): Fix handling of ARGMATCH result.
+ * src/directive.c: Update statistics
+ * src/diskio.c: Likewise
+ * src/triplet.c: Likewise
+ * src/wydawca.rc: Update
+
+2007-08-23 Sergey Poznyakoff <gray@gnu.org.ua>
+
+ Improve safety checks; implement symlink/rmsymlink/archive
+ directives; Fix directive signature verification.
+
+2007-08-22 Sergey Poznyakoff <gray@gnu.org.ua>
+
+ * src/exec.c: New file
+ * src/diskio.c, src/directive.c: Implement all directives
+
+2007-08-21 Sergey Poznyakoff <gray@gnu.org.ua>
+
+ * src/wydawca.c (usage): Update
+ New option --lint
+ (tar_command_name): New variable
+ * src/wydawca.h: include backupfile.h
+ (enum archive_type,struct archive_descr): New data types
+ (struct directory_pair.archive): New member
+ (safe_file_name): New function
+ (move_file): Redo prototype
+ (start_prog,log_output): New declarations
+ * src/config.c: Include argmatch.h
+ (safe_file_name): New function
+ (archive,umask,tar-program): New configuration file statemenst
+ * src/gpg.c (start_prog,log_output): Remove static qualifiers
+ * src/directive.c (process_directives): Update
+ * src/wydawca.rc: Update
+ * src/diskio.c (move_file): Implement archiving and backups
+
+2007-08-20 Sergey Poznyakoff <gray@gnu.org.ua>
+
+ * src/sql.c (trim_length): Move to verify.c
+ * src/verify.c (trim_length, trim)
+ (check_access_rights): New functions
+ (expand_param): Export
+ (verify_triplet): Call verify_directive_format and
+ check_access_rights
+ * src/wydawca.h (trim_length, trim, directive_parse)
+ (directive_get_value, directive_pack_version)
+ (directive_version_in_range_p, verify_directive_format)
+ (directive_first, directive_next, process_directives)
+ (create_directory, move_file): New functions
+ (MIN_DIRECTIVE_VERSION,MAX_DIRECTIVE_VERSION)
+ (MKDIR_PERMISSIONS,CREAT_PERMISSIONS): New defines
+ * src/gpg.c (wydawca_gpg_homedir): Return a meaningful value
+ (verify_directive_signature): Call directive_parse
+ * src/process.c (parse_file_name): Return void
+ * src/directive.c: New file
+ * src/diskio.c: New file
+ * src/triplet.c (triplet_processor): Call process_directives
+ (enumerate_triplets): Arg is not const
+ * src/Makefile.am: Add new sources
+
+ * src/triplet.c (triplet_processor): Minor fix
+ * src/verify.c (verify_triplet): Save owner gid in reg.
+ Call verify_detached_signature
+ * src/wydawca.h (struct file_register): New member gid.
+ (verify_detached_signature): New function
+ * src/gpg.c (verify_detached_signature): New function
+
+2007-08-19 Sergey Poznyakoff <gray@gnu.org.ua>
+
+ * wydawca: New module
+
+
+Local Variables:
+mode: change-log
+version-control: never
+End:
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..0bc2a31
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,4 @@
+ACLOCAL_AMFLAGS = -I m4
+AUTOMAKE_OPTIONS = gnu 1.8.5
+
+SUBDIRS=gnu lib src doc
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..63fcd01
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,36 @@
+Wydawca NEWS -- history of user-visible changes. 2007-09-01
+Copyright (C) 2007 Sergey Poznyakoff
+See the end of file for copying conditions.
+
+Please send gsc bug reports to <gray@gnu.org.ua>.
+
+Version 1.0 (SVN)
+
+ First release.
+
+
+
+----------------------------------------------------------------------
+Copyright information:
+
+Copyright (C) 2007 Sergey Poznyakoff
+
+ Permission is granted to anyone to make or distribute verbatim copies
+ of this document as received, in any medium, provided that the
+ copyright notice and this permission notice are preserved,
+ thus giving the recipient permission to redistribute in turn.
+
+ Permission is granted to distribute modified versions
+ of this document, or of portions of it,
+ under the above conditions, provided also that they
+ carry prominent notices stating who last changed them.
+
+Local variables:
+mode: outline
+paragraph-separate: "[ ]*$"
+eval: (add-hook 'write-file-hooks 'time-stamp)
+time-stamp-start: "changes. "
+time-stamp-format: "%:y-%02m-%02d"
+time-stamp-end: "\n"
+end:
+
diff --git a/README b/README
new file mode 100644
index 0000000..52184b2
--- /dev/null
+++ b/README
@@ -0,0 +1,52 @@
+Wydawca README
+Copyright (C) 2007 Sergey Poznyakoff
+See the end of file for copying conditions.
+
+* Introduction
+
+Wydawca is a daemon for automatic project upload.
+
+* Installation
+
+Configure and make:
+
+ ./configure [OPTIONS]
+ make
+ make install
+
+See the file INSTALL for the description of ./configure and its
+generic options. The options and variables specific to Wydawca are
+described below:
+
+--enable-sendfile
+ Attempt to use sendfile(2) when possible
+
+* Documentation
+
+ Full documentation is shipped in doc subdirectory
+
+* Bug reporting.
+
+Send bug reports to <gray@gnu.org.ua>.
+
+
+* Copyright information:
+
+Copyright (C) 2007 Sergey Poznyakoff
+
+ Permission is granted to anyone to make or distribute verbatim copies
+ of this document as received, in any medium, provided that the
+ copyright notice and this permission notice are preserved,
+ thus giving the recipient permission to redistribute in turn.
+
+ Permission is granted to distribute modified versions
+ of this document, or of portions of it,
+ under the above conditions, provided also that they
+ carry prominent notices stating who last changed them.
+
+
+Local Variables:
+mode: outline
+paragraph-separate: "[ ]*$"
+version-control: never
+End:
diff --git a/README-alpha b/README-alpha
new file mode 100644
index 0000000..bae3397
--- /dev/null
+++ b/README-alpha
@@ -0,0 +1,61 @@
+This file is part of Wydawca.
+This document describes the actions needed to build the pre-release
+or alpha version of the package. See end of file for copying conditions.
+
+* Introduction
+
+This is a *pre-release* version, and not ready for production
+use yet. Please send comments and problem reports to <gray@gnu.org.ua>.
+
+* Building
+
+Run the following commands in this order:
+
+1. ./configure [OPTIONS]
+
+See README and INSTALL for the available OPTIONS
+
+2. make
+
+3. make install
+
+This usually must be done with root privileges.
+
+* Checking Out the Sources
+
+The following instructions apply if you wish to obtain sources from
+the SVN repository.
+
+To checkout the source tree from SVN, issue the following command:
+
+ svn checkout http://svn.gnu.org.ua/sources/wydawca/trunk wydawca
+
+This will give you read-only access. If you think you need write access,
+contact the mailing list.
+
+Read the file README-hacking for the instructions on bootstrapping the
+SVN version.
+
+
+* Copyright information
+
+ Copyright (C) 2007 Sergey Poznyakoff
+
+ Permission is granted to anyone to make or distribute verbatim copies
+ of this document as received, in any medium, provided that the
+ copyright notice and this permission notice are preserved,
+ thus giving the recipient permission to redistribute in turn.
+
+ Permission is granted to distribute modified versions of this
+ document, or of portions of it, under the above conditions, provided
+ also that they carry prominent notices stating who last changed
+ them.
+
+
+Local Variables:
+mode: outline
+paragraph-separate: "[ ]*$"
+version-control: never
+End:
+
+
diff --git a/README-hacking b/README-hacking
new file mode 100644
index 0000000..a7e251e
--- /dev/null
+++ b/README-hacking
@@ -0,0 +1,59 @@
+These notes intend to help people working on the SVN version of
+this package. See end of this file for the copying conditions.
+
+* Requirements
+
+You need the following packages to build the SVN version of Wydawca. I do
+not make any efforts to accommodate older versions of these packages,
+so please make sure that you have the latest stable version.
+
+- Automake <http://www.gnu.org/software/automake/>
+- Autoconf <http://www.gnu.org/software/autoconf/>
+- Bison <http://www.gnu.org/software/bison/>
+- Gnulib <http://www.gnu.org/software/gnulib/>
+- Flex <http://flex.sourceforge.net/>
+- M4 <http://www.gnu.org/software/m4/>
+- Subversion <http://subversion.tigris.org/>
+- Texinfo <http://www.gnu.org/software/texinfo>
+
+* Bootstrapping
+
+Obviously, if you are reading these notes, you did manage to check out
+the source tree from SVN. The next step is to create the configuration
+framework:
+
+1. Change to the source tree directory
+
+ $ cd wydawca
+
+2. Run `bootstrap' pointing the --gnulib-srcdir option to the location
+of the local directory where gnulib sources reside, e.g.:
+
+ ./bootstrap --gnulib-srcdir=/usr/src/gnulib
+
+Once done, proceed as described in the file README (section
+`Installation').
+
+
+* Copyright information
+
+ Copyright (C) 2007 Sergey Poznyakoff
+
+ Permission is granted to anyone to make or distribute verbatim copies
+ of this document as received, in any medium, provided that the
+ copyright notice and this permission notice are preserved,
+ thus giving the recipient permission to redistribute in turn.
+
+ Permission is granted to distribute modified versions
+ of this document, or of portions of it,
+ under the above conditions, provided also that they
+ carry prominent notices stating who last changed them.
+
+^L
+Local Variables:
+mode: outline
+paragraph-separate: "[ ^L]*$"
+version-control: never
+End:
+
+
diff --git a/acinclude.m4 b/acinclude.m4
new file mode 100644
index 0000000..eb82717
--- /dev/null
+++ b/acinclude.m4
@@ -0,0 +1,57 @@
+dnl This file is part of GSC
+dnl Copyright (C) 2007 Sergey Poznyakoff
+dnl
+dnl GSC is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 3, or (at your option)
+dnl any later version.
+dnl
+dnl GSC is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with GSC. If not, see <http://www.gnu.org/licenses/>.
+
+dnl MU_RESULT_ACTIONS -- generate shell code for the result of a test
+dnl $1 -- CVAR -- cache variable to check
+dnl $2 -- NAME -- if not empty, used to generate a default value TRUE:
+dnl `AC_DEFINE(HAVE_NAME)'
+dnl $2 -- TRUE -- what to do if the CVAR is not `no'
+dnl $3 -- FALSE -- what to do otherwise; defaults to `:'
+dnl
+AC_DEFUN([MU_RESULT_ACTIONS], [
+[if test "$$1" != "" -a "$$1" != no; then
+ ]ifelse([$3], ,
+ [AC_DEFINE(HAVE_]translit($2, [a-z ./<>], [A-Z___])[,1,[FIXME])],
+ [$3])[
+else
+ ]ifelse([$4], , [:], [$4])[
+fi]])dnl
+
+dnl Arguments:
+dnl $1 -- Library to look for
+dnl $2 -- Function to check in the library
+dnl $3 -- Any additional libraries that might be needed
+dnl $4 -- Action to be taken when test succeeds
+dnl $5 -- Action to be taken when test fails
+dnl $6 -- Directories where the library may reside
+AC_DEFUN([MU_CHECK_LIB],
+[
+ save_LIBS=$LIBS
+ AC_CACHE_CHECK([for -l$1], mu_cv_lib_$1,
+ [
+ for path in $6
+ do
+ LIBS="$save_LIBS -L$path"
+ unset ac_cv_lib_$1_$2
+ AC_CHECK_LIB($1, $2,
+ [mu_cv_lib_$1="$3 -L$path -l$1"
+ break],
+ [mu_cv_lib_$1=no],$3)
+ done
+ ])
+ MU_RESULT_ACTIONS([mu_cv_lib_$1],[LIB$1],[$4],[$5])
+ LIBS=$save_LIBS
+])
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..e92c238
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,139 @@
+# This file is part of Wydawca
+# Copyright (C) 2007 Sergey Poznyakoff
+#
+# Wydawca is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# Wydawca is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with wydawca. If not, see <http://www.gnu.org/licenses/>.
+
+AC_PREREQ(2.59)
+AC_INIT([wydawca], 1.0, [gray@gnu.org.ua])
+AC_CONFIG_SRCDIR([src/wydawca.c])
+AC_CONFIG_AUX_DIR([build-aux])
+AC_CONFIG_HEADER([config.h])
+AM_INIT_AUTOMAKE
+
+# Checks for programs.
+AC_PROG_CC
+gl_EARLY
+AC_PROG_LEX
+AC_PROG_YACC
+AC_PROG_RANLIB
+
+# Checks for libraries.
+
+# Checks for header files.
+AC_HEADER_STDC
+AC_HEADER_SYS_WAIT
+AC_CHECK_HEADERS([stdlib.h string.h sys/file.h unistd.h sys/sendfile.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_TYPE_SIGNAL
+AC_TYPE_UID_T
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+AC_HEADER_STDBOOL
+
+# Checks for library functions.
+gl_INIT
+AC_FUNC_FORK
+AC_FUNC_MALLOC
+AC_FUNC_MEMCMP
+AC_FUNC_STAT
+AC_FUNC_VPRINTF
+AC_CHECK_FUNCS([memset strchr strdup strerror strrchr setegid setregid setresgid seteuid setreuid vsyslog sysconf getdtablesize])
+
+# ***********************************
+# Sendfile
+# ***********************************
+AC_ARG_ENABLE([sendfile],
+ [AC_HELP_STRING([--enable-sendfile],
+ [Attempt to use sendfile(2) when possible])],
+ [case $enableval in
+ yes) USE_SENDFILE=1;;
+ no) USE_SENDFILE=0;;
+ *) AC_MSG_FAILURE([Invalid argument for --enable-sendfile])
+ esac],
+ [USE_SENDFILE=1])
+
+if test "$USE_SENDFILE" = 1; then
+ case $host in
+ *-linux-*) AC_DEFINE_UNQUOTED([USE_SENDFILE], 1,
+ [Define to 1 to use sendfile(2) on GNU/Linux]);;
+ esac
+fi
+
+# **********************
+# Mailutils
+# **********************
+status_mailutils=no
+
+AC_PATH_PROG(MU_CONFIG, mailutils-config, none, $PATH)
+if test "$MU_CONFIG" != "none"; then
+ status_mailutils=yes
+ AC_SUBST(MAILUTILS_VERSION, `$MU_CONFIG --info version|sed s/.*=//`)
+ AC_SUBST(MAILUTILS_INCLUDES, `$MU_CONFIG --compile`)
+ AC_SUBST(MAILUTILS_LIBS, `$MU_CONFIG --link mailer`)
+else
+ AC_MSG_FAILURE([The requested library libmailutils is not found])
+fi
+
+# **********************
+# MySQL
+# **********************
+status_mysql=no
+
+AC_SUBST(SQLLIB)
+AH_TEMPLATE(HAVE_MYSQL,[Define if you have libmysql])
+
+MU_CHECK_LIB(mysqlclient,
+ mysql_real_connect,
+ [-lm],
+ [ AC_DEFINE(HAVE_MYSQL)
+ SQLLIB="$mu_cv_lib_mysqlclient"
+ status_mysql=yes ],
+ [ AC_MSG_FAILURE([The requested library libmysqlclient is not found or is unusable])],
+ [/usr/lib/mysql /usr/local/lib/mysql])
+
+# **********************
+# GPGME
+# **********************
+
+status_gpgme=no
+AC_SUBST(GPGMELIB)
+AH_TEMPLATE(HAVE_GPGME,[Define if you have gpgme])
+
+AC_CHECK_HEADERS(gpgme.h)
+MU_CHECK_LIB([gpgme],[main],[],
+ [GPGMELIB="$mu_cv_lib_gpgme"
+ AC_DEFINE(HAVE_GPGME)
+ status_gpgme=yes ],
+ [ AC_MSG_FAILURE([The requested library libgpgme is not found or is unusable])],
+ [/usr/pkg/lib /opt/lib /sw/lib])
+
+AH_BOTTOM([
+#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
+# define __attribute__(x)
+#endif
+
+#ifndef GSC_PRINTFLIKE
+# define GSC_PRINTFLIKE(fmt,narg) __attribute__ ((__format__ (__printf__, fmt, narg)))
+#endif
+])
+
+AC_CONFIG_FILES([Makefile
+ doc/Makefile
+ gnu/Makefile
+ lib/Makefile
+ src/Makefile])
+
+AC_OUTPUT
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000..a06751b
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,42 @@
+# This file is part of Wydawca
+# Copyright (C) 2007 Sergey Poznyakoff
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 3 of the License, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+
+info_TEXINFOS=wydawca.texi
+wydawca_TEXINFOS=fdl.texi rendition.texi
+
+EXTRA_DIST = gendocs_template
+
+clean-local:
+ rm -rf manual
+
+# The rendering level is one of PUBLISH, DISTRIB or PROOF.
+# Just call `make RENDITION=PROOF [target]' if you want PROOF rendition.
+RENDITION = DISTRIB
+
+MAKEINFOFLAGS=-D$(RENDITION)
+
+GENDOCS=gendocs.sh
+
+TEXI2DVI=texi2dvi -t '@set $(RENDITION)' -E
+
+# Make sure you set TEXINPUTS.
+# TEXINPUTS=/usr/share/texmf/pdftex/plain/misc/ is ok for most distributions
+manual:
+ TEXINPUTS=$(srcdir):$(top_srcdir)/build-aux:$(TEXINPUTS) \
+ MAKEINFO="$(MAKEINFO) $(MAKEINFOFLAGS)" \
+ TEXI2DVI="$(TEXI2DVI) -t @finalout" \
+ $(GENDOCS) $(PACKAGE) '$(PACKAGE_NAME) manual'
+
diff --git a/doc/fdl.texi b/doc/fdl.texi
new file mode 100644
index 0000000..f13635b
--- /dev/null
+++ b/doc/fdl.texi
@@ -0,0 +1,450 @@
+@setfilename fdl.info
+@appendix GNU Free Documentation License
+@cindex FDL, GNU Free Documentation License
+@center Version 1.2, November 2002
+
+@display
+Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc.
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+@end display
+
+@enumerate 0
+@item
+PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+functional and useful document @dfn{free} in the sense of freedom: to
+assure everyone the effective freedom to copy and redistribute it,
+with or without modifying it, either commercially or noncommercially.
+Secondarily, this License preserves for the author and publisher a way
+to get credit for their work, while not being considered responsible
+for modifications made by others.
+
+This License is a kind of ``copyleft'', which means that derivative
+works of the document must themselves be free in the same sense. It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does. But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book. We recommend this License
+principally for works whose purpose is instruction or reference.
+
+@item
+APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work, in any medium, that
+contains a notice placed by the copyright holder saying it can be
+distributed under the terms of this License. Such a notice grants a
+world-wide, royalty-free license, unlimited in duration, to use that
+work under the conditions stated herein. The ``Document'', below,
+refers to any such manual or work. Any member of the public is a
+licensee, and is addressed as ``you''. You accept the license if you
+copy, modify or distribute the work in a way requiring permission
+under copyright law.
+
+A ``Modified Version'' of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A ``Secondary Section'' is a named appendix or a front-matter section
+of the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall
+subject (or to related matters) and contains nothing that could fall
+directly within that overall subject. (Thus, if the Document is in
+part a textbook of mathematics, a Secondary Section may not explain
+any mathematics.) The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The ``Invariant Sections'' are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License. If a
+section does not fit the above definition of Secondary then it is not
+allowed to be designated as Invariant. The Document may contain zero
+Invariant Sections. If the Document does not identify any Invariant
+Sections then there are none.
+
+The ``Cover Texts'' are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License. A Front-Cover Text may
+be at most 5 words, and a Back-Cover Text may be at most 25 words.
+
+A ``Transparent'' copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, that is suitable for revising the document
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters. A copy made in an otherwise Transparent file
+format whose markup, or absence of markup, has been arranged to thwart
+or discourage subsequent modification by readers is not Transparent.
+An image format is not Transparent if used for any substantial amount
+of text. A copy that is not ``Transparent'' is called ``Opaque''.
+
+Examples of suitable formats for Transparent copies include plain
+@sc{ascii} without markup, Texinfo input format, La@TeX{} input
+format, @acronym{SGML} or @acronym{XML} using a publicly available
+@acronym{DTD}, and standard-conforming simple @acronym{HTML},
+PostScript or @acronym{PDF} designed for human modification. Examples
+of transparent image formats include @acronym{PNG}, @acronym{XCF} and
+@acronym{JPG}. Opaque formats include proprietary formats that can be
+read and edited only by proprietary word processors, @acronym{SGML} or
+@acronym{XML} for which the @acronym{DTD} and/or processing tools are
+not generally available, and the machine-generated @acronym{HTML},
+PostScript or @acronym{PDF} produced by some word processors for
+output purposes only.
+
+The ``Title Page'' means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page. For works in
+formats which do not have any title page as such, ``Title Page'' means
+the text near the most prominent appearance of the work's title,
+preceding the beginning of the body of the text.
+
+A section ``Entitled XYZ'' means a named subunit of the Document whose
+title either is precisely XYZ or contains XYZ in parentheses following
+text that translates XYZ in another language. (Here XYZ stands for a
+specific section name mentioned below, such as ``Acknowledgements'',
+``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title''
+of such a section when you modify the Document means that it remains a
+section ``Entitled XYZ'' according to this definition.
+
+The Document may include Warranty Disclaimers next to the notice which
+states that this License applies to the Document. These Warranty
+Disclaimers are considered to be included by reference in this
+License, but only as regards disclaiming warranties: any other
+implication that these Warranty Disclaimers may have is void and has
+no effect on the meaning of this License.
+
+@item
+VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no other
+conditions whatsoever to those of this License. You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute. However, you may accept
+compensation in exchange for copies. If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+
+@item
+COPYING IN QUANTITY
+
+If you publish printed copies (or copies in media that commonly have
+printed covers) of the Document, numbering more than 100, and the
+Document's license notice requires Cover Texts, you must enclose the
+copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover. Both covers must also clearly and legibly identify
+you as the publisher of these copies. The front cover must present
+the full title with all words of the title equally prominent and
+visible. You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve