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

From OpenWetWare
Jump to navigationJump to search
(→‎How to make a GNU package?: test git repo with git clone)
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 manual_hellp.texi # and edit
  touch manual_hello.texi # and edit
  make pdf
  make pdf
</nowiki>
</nowiki>
Line 43: Line 43:
  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])
* version your code, for instance with [http://en.wikipedia.org/wiki/Git_%28software%29 Git] (read the [http://git-scm.com/book book]!):
  git init
  git init
  git add AUTHORS COPYING ChangeLog INSTALL Makefile.am NEWS README TODO build-aux/* configure.ac  
  git add AUTHORS COPYING ChangeLog INSTALL Makefile.am NEWS README TODO build-aux/* configure.ac  
  git add src/Makefile.am # etc
  git add src/Makefile.am src/hello.cpp
  git add doc/fdl.texi doc/Makefile.am # etc
  git add doc/Makefile.am doc/manual_hello.texi doc/fdl.texi
  git add tests/Makefile.am # etc
  git add tests/Makefile.am tests/test1.bash
  git commit -m "first commit"
  git commit -m "first commit"
# and edit .git/info/exclude or .gitignore, tag your release, etc
And check that you have all required files in your repo:
cd ~/tmp; git clone ~/<path_to_original_repo>/hello
autoreconf --force
./configure
make
make check
make install
make distcheck
* share your code, for instance on [http://en.wikipedia.org/wiki/GitHub GitHub] (read the [http://help.github.com/ help]!)


<!-- ##### 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 10:14, 15 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 "hello"
  • structure the package directory:
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
  • 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 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
  • 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_hello.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
  • version your code, for instance with Git (read the book!):
git init
git add AUTHORS COPYING ChangeLog INSTALL Makefile.am NEWS README TODO build-aux/* configure.ac 
git add src/Makefile.am src/hello.cpp
git add doc/Makefile.am doc/manual_hello.texi doc/fdl.texi
git add tests/Makefile.am tests/test1.bash
git commit -m "first commit"
# and edit .git/info/exclude or .gitignore, tag your release, etc

And check that you have all required files in your repo:

cd ~/tmp; git clone ~/<path_to_original_repo>/hello
autoreconf --force
./configure
make
make check
make install
make distcheck
  • share your code, for instance on GitHub (read the help!)