User:Timothee Flutre/Notebook/Postdoc/2012/11/27

From OpenWetWare

(Difference between revisions)
Jump to: navigation, search
(How to make a GNU package?: add examples for README and INSTALL)
(How to make a GNU package?: add info for tests)
Line 13: Line 13:
  mkdir mypkg; cd mypkg
  mkdir mypkg; cd mypkg
  touch COPYING README INSTALL NEWS AUTHORS ChangeLog
  touch COPYING README INSTALL NEWS AUTHORS ChangeLog
-
  mkdir src build-aux doc test #lib scripts
+
  mkdir src build-aux doc tests #lib scripts
* populate the <code>src/</code> directory with your code, e.g. <code>hello.cpp</code>
* populate the <code>src/</code> directory with your code, e.g. <code>hello.cpp</code>
Line 22: Line 22:
* fill the information files, such as README ([http://bzr.savannah.gnu.org/lh/gsl/trunk/annotate/head:/README example]), INSTALL ([http://bzr.savannah.gnu.org/lh/gsl/trunk/annotate/head:/INSTALL example])...
* fill the information files, such as README ([http://bzr.savannah.gnu.org/lh/gsl/trunk/annotate/head:/README example]), INSTALL ([http://bzr.savannah.gnu.org/lh/gsl/trunk/annotate/head:/INSTALL example])...
-
* use [http://en.wikipedia.org/wiki/GNU_build_system Autotools] (see [http://www.lrde.epita.fr/~adl/autotools.html tutorial]):
+
* use [http://en.wikipedia.org/wiki/GNU_build_system Autotools] (see [http://www.lrde.epita.fr/~adl/autotools.html tutorial]; for the tests, have a look [http://www.sourceware.org/autobook/autobook/autobook_98.html here]):
  touch configure.ac Makefile.am src/Makefile.am doc/Makefile.am #and edit
  touch configure.ac Makefile.am src/Makefile.am doc/Makefile.am #and edit
  autoreconf --install
  autoreconf --install

Revision as of 18:01, 19 December 2012

Project name Main project page
Previous entry      

How to make a GNU package?

  • find a name for the package, for instance "mypkg"
  • structure the package directory:
mkdir mypkg; cd mypkg
touch COPYING README INSTALL NEWS AUTHORS ChangeLog
mkdir src build-aux doc tests #lib scripts
  • populate the src/ directory with your code, e.g. hello.cpp
  • retrieve the license, for instance GPLv3:
wget -O COPYING http://www.gnu.org/licenses/gpl-3.0.txt
  • fill the information files, such as README (example), INSTALL (example)...
touch configure.ac Makefile.am src/Makefile.am doc/Makefile.am #and edit
autoreconf --install
./configure #can be followed by --prefix=~/bin, LDFLAGS=-L/usr/local/lib, etc
make
make check
  • write some documentation in Texinfo:
 cd doc
 wget -O fdl.texi http://cvs.savannah.gnu.org/viewvc/*checkout*/gnustandards/fdl.texi?root=gnustand
ards&content-type=text%2Fplain
 touch manual.texi #and edit
 make pdf

  • make your package available to anyone:
make install
make distcheck #can be followed by DISTCHECK_CONFIGURE_FLAGS=LDFLAGS=-L/usr/local/lib for instance
tar tzvf mypkg-0.1.tar.gz #to check what is in the release


Personal tools