User:Timothee Flutre/Notebook/Postdoc/2012/11/27
From OpenWetWare
(Difference between revisions)
(→How to make a GNU package?: mention autoreconf --force) |
(→How to make a GNU package?: add git cmd-line) |
||
| Line 8: | Line 8: | ||
==How to make a GNU package?== | ==How to make a GNU package?== | ||
| - | * find a name for the package, for instance " | + | * find a name for the package, for instance "hello" |
* structure the package directory: | * structure the package directory: | ||
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 tests #lib scripts | + | mkdir src build-aux doc tests # you can also add other directories, e.g. 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 23: | Line 23: | ||
* use [http://en.wikipedia.org/wiki/GNU_build_system Autotools] (see the [http://www.gnu.org/software/automake/manual/automake.html manual] and this [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]): | * use [http://en.wikipedia.org/wiki/GNU_build_system Autotools] (see the [http://www.gnu.org/software/automake/manual/automake.html manual] and this [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 these files |
| - | autoreconf --install # use autoreconf --force the next times | + | autoreconf --install # use autoreconf --force the next times you want re-build configure |
| - | ./configure #can be followed by --prefix=~/bin, LDFLAGS=-L/usr/local/lib, etc | + | ./configure # can be followed by --prefix=~/bin, LDFLAGS=-L/usr/local/lib, etc |
make | make | ||
| - | make check | + | make check # to automatically execute the tests |
* write some documentation in [http://en.wikipedia.org/wiki/Texinfo Texinfo]: | * write some documentation in [http://en.wikipedia.org/wiki/Texinfo Texinfo]: | ||
| Line 34: | Line 34: | ||
wget -O fdl.texi http://cvs.savannah.gnu.org/viewvc/*checkout*/gnustandards/fdl.texi?root=gnustand | wget -O fdl.texi http://cvs.savannah.gnu.org/viewvc/*checkout*/gnustandards/fdl.texi?root=gnustand | ||
ards&content-type=text%2Fplain | ards&content-type=text%2Fplain | ||
| - | touch | + | touch manual_hellp.texi # and edit |
make pdf | make pdf | ||
</nowiki> | </nowiki> | ||
| Line 40: | Line 40: | ||
* make your package available to anyone: | * make your package available to anyone: | ||
make install | make install | ||
| - | make distcheck #can be followed by DISTCHECK_CONFIGURE_FLAGS=LDFLAGS=-L/usr/local/lib for instance | + | 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 | + | tar tzvf mypkg-0.1.tar.gz # to check what is in the release |
* share your code, for instance on [http://en.wikipedia.org/wiki/GitHub GitHub] (see [http://openwetware.org/wiki/User:Timothee_Flutre/Notebook/Postdoc/2012/08/14 my tips]) | * share your code, for instance on [http://en.wikipedia.org/wiki/GitHub GitHub] (see [http://openwetware.org/wiki/User:Timothee_Flutre/Notebook/Postdoc/2012/08/14 my tips]) | ||
| + | git init | ||
| + | git add AUTHORS COPYING ChangeLog INSTALL Makefile.am NEWS README TODO build-aux/* configure.ac | ||
| + | git add src/Makefile.am # etc | ||
| + | git add doc/fdl.texi doc/Makefile.am # etc | ||
| + | git add tests/Makefile.am # etc | ||
| + | git commit -m "first commit" | ||
<!-- ##### DO NOT edit below this line unless you know what you are doing. ##### --> | <!-- ##### DO NOT edit below this line unless you know what you are doing. ##### --> | ||
Revision as of 12:50, 15 January 2013
Main project page Previous entry
| |
How to make a GNU package?
mkdir mypkg; cd mypkg touch COPYING README INSTALL NEWS AUTHORS ChangeLog mkdir src build-aux doc tests # you can also add other directories, e.g. lib scripts
wget -O COPYING http://www.gnu.org/licenses/gpl-3.0.txt touch configure.ac Makefile.am src/Makefile.am doc/Makefile.am # and edit these files autoreconf --install # use autoreconf --force the next times you want re-build configure ./configure # can be followed by --prefix=~/bin, LDFLAGS=-L/usr/local/lib, etc make make check # to automatically execute the tests
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_hellp.texi # and edit make pdf
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 git init git add AUTHORS COPYING ChangeLog INSTALL Makefile.am NEWS README TODO build-aux/* configure.ac git add src/Makefile.am # etc git add doc/fdl.texi doc/Makefile.am # etc git add tests/Makefile.am # etc git commit -m "first commit" | |



