AUTOPROJECT(1) | Programmer's Manual | AUTOPROJECT(1) |
autoproject - create a skeleton source package for a new program
autoproject [options] [name]
autoproject simplifies the creation of a source package for a new program. The idea is that you execute autoproject just once when you start a new project. It will create a new directory and populate it with standard files, customized for the new project.
autoproject asks for the name of the new program (unless it is given on the command line), a program description and other data. It then creates a subdirectory and populates it with a C program with command line parsing, a simple manual page and texinfo page, and other standard files. The package is intended to follow the GNU programming standards. It uses autoconf(1) to configure itself, and automake(1) to create the Makefile.
The new program will always support the options "--help" and "--version", and will optionally support certain standard options such as "--quiet".
Optionally, autoproject can set the new project up to use the argp command line parsing interface that is included in GNU C library 2.1.
Alternatively, the new project can use a command line parser generator. autoproject will create an appropriate options description file, and the generated Makefile will include the commands to invoke the parser generator as needed. Currently, autogen(1) and clig(1) are supported.
At present autoproject supports main programs only in c, sh, or c++. For other languages mentioned, autoproject only adds macros in configure.in so autoconf(1) will look for the relevant compilers. (You may add skeleton files supporting other languages. See CUSTOMIZATION, below.)
The version number for the new program is initialized as 0.1.0, and is set in configure.in (only). It is available in C programs as the macro VERSION, and in the Makefile as $(VERSION).
If, after populating the new directory, there exists an executable file named postinst, then it is executed. If it executes successfully, then autoproject deletes it. Currently, autoproject does not supply a file postinst. However, a user can install one to perform any necessary actions. (See CUSTOMIZATION, below.)
If the GNU version of getopt(1) is installed, autoproject will accept the following options. Otherwise, autoproject will use getopts(1) to parse its arguments, and it will not longer accept long options or options with optional arguments. If autoproject is used to generate a shell-based project, it will still be dependent on GNU getopt.
The autoproject package includes a set of skeleton files which are usually installed under /usr/share/autoproject. It selects which subdirectories to use based on the interface type, primary language, and parser generator chosen by the user.
The user may create a similar directory tree under $HOME/.autoproject, and populate it with additional files and/or replacements for the standard files. The system administrator may create a similar tree under /etc/autoproject. autoproject searches in $HOME/.autoproject first, then /etc/autoproject, and finally in the standard tree. It uses only the first file it finds of a given name.
For example, if a user wants to add a paragraph to every README file that points to his web page, he could copy /usr/share/autoproject/all/all/all/README to ~/.autoproject/all/all/all/README and make that change. Of course, any file overridden in this way will not inherit updates when the next version of autoproject is installed.
If a skeleton file contains any of these variables, autoproject will substitute the corresponding value:
Note that these substitutions are made when autoproject runs. Substitutions can also be made at program configuration or build time by suitable makefile commands (for example, using the makefile variable VERSION, or the output of date(1)).
If you write a generally applicable skeleton file, such as a main program for a language currently not supported, please consider contributing it to autoproject.
$HOME/.autoproject
/etc/autoproject
/usr/share/autoproject
Directory trees containing skeleton files.
autoconf(1), automake(1), autogen(1), clig(1), `Parsing Program Options with Argp' in `The GNU C Library Reference Manual' (type `info libc argp')
James R. Van Zandt <jrvz@comcast.net>.
September 16, 2002 |