www.delorie.com/gnu/docs/GNU/maintain_15.html   search  
Buy GNU books!

Information For Maintainers of GNU Software

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.1 Distribution tar Files

The tar file for version m.n of program foo should be named `foo-m.n.tar'. It should unpack into a subdirectory named `foo-m.n'. Tar files should not unpack into files in the current directory, because this is inconvenient if the user happens to unpack into a directory with other files in it.

Here is how the `Makefile' for Bison creates the tar file. This method is good for other programs.

dist: bison.info
        echo bison-`sed -e '/version_string/!d' \
          -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q version.c` > .fname
        -rm -rf `cat .fname`
        mkdir `cat .fname`
        dst=`cat .fname`; for f in $(DISTFILES); do \
           ln $(srcdir)/$$f $$dst/$$f || { echo copying $$f; \
             cp -p $(srcdir)/$$f $$dst/$$f ; } \
        tar --gzip -chf `cat .fname`.tar.gz `cat .fname`
        -rm -rf `cat .fname` .fname

Source files that are symbolic links to other file systems cannot be installed in the temporary directory using ln, so use cp if ln fails.

Using Automake is a good way to take care of writing the dist target.

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003