User:Timothee Flutre/Notebook/Postdoc/2012/11/27: Difference between revisions

From OpenWetWare
Jump to navigationJump to search
(→‎How to make a GNU package?: add files requested by GNU)
(→‎How to make a GNU package?: mention autoreconf --force)
(6 intermediate revisions by the same user not shown)
Line 8: Line 8:
==How to make a GNU package?==
==How to make a GNU package?==


* find a name for the package
* find a name for the package, for instance "mypkg"


* make the structure of the project directory ([http://www.sourceware.org/autobook/autobook/autobook_46.html ref])
* structure the package directory:
  touch README INSTALL NEWS AUTHORS COPYING ChangeLog
mkdir mypkg; cd mypkg
  mkdir src doc test lib config
  touch COPYING README INSTALL NEWS AUTHORS ChangeLog
  mkdir src build-aux doc tests #lib scripts


* populate the <nowiki>src/</nowiki> directory with your code, e.g. one <nowiki>.cpp</nowiki> file
* populate the <code>src/</code> directory with your code, e.g. <code>hello.cpp</code>


* use Autotools ([http://www.lrde.epita.fr/~adl/autotools.html ref])
* retrieve the license, for instance [http://www.gnu.org/licenses/gpl.html GPLv3]:
wget -O COPYING http://www.gnu.org/licenses/gpl-3.0.txt
 
* 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 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
autoreconf --install # use autoreconf --force the next times
./configure #can be followed by --prefix=~/bin, LDFLAGS=-L/usr/local/lib, etc
make
make check
 
* write some documentation in [http://en.wikipedia.org/wiki/Texinfo Texinfo]:
<nowiki>
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
</nowiki>
 
* 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
 
* 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])


<!-- ##### 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 17:44, 8 January 2013

Project name <html><img src="/images/9/94/Report.png" border="0" /></html> Main project page
<html><img src="/images/c/c3/Resultset_previous.png" border="0" /></html>Previous entry<html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</html>

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 # use autoreconf --force the next times
./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