Create a package (tarball) for distribution

From NAS-Central Buffalo - The Linkstation Wiki
Revision as of 16:17, 14 February 2007 by (Talk)

Jump to: navigation, search

This article assumes you want to download and build some software from the software's source code. It further assumes the source code is available as some tar file (a tar ball) and that the software source follows a common structure and comes with a common mechanism to build it.

Since there are many, many different software packages out there, there is no guarantee that the particular package can be build exactly as described here. There is no guarantee that it is packed as a tar file, and there is no guarantee that you have everything to build it. That's why many packages come with d-o-c-u-m-e-n-t-a-t-i-o-n! It might sound shocking, but it is a clever idea to read that one first. Often the documentation also explains what additional tools and libraries are needed to build the software, and how to fine-tune the build.

The remainder of this article further assumes

  • The source code comes with a configure script
  • You have all the common development tools installed

1) Download the source to the preferred place:

mkdir -p <compiling-folder> #I suggest to create a folder on /dev/hda3.../mnt/ on ppc-LS, /mnt/hda/ on the LS2
cd <compiling-folder>    
wget http://<download-location>/<app-source>

2) Untar the package - use xzvf if it has a tar.gz-extension (=.tgz) and xjvf if it has tar.bz2

 tar xzvf <app-source>.tar.gz

3) change into the new directory

 cd <app-source>

4) create the folder-structure for the Package we want to create

 mkdir -p PACKAGE/usr/local/

5) check which options are available for ./configure by executing

 ./configure --help

6) configure the app with the right prefix

 ./configure --prefix=<path2this_folder>/PACKAGE/usr/local --sysconfdir=/etc <additional optional options>

7) compile the app


8) install the compiled app afterwards

 make install

9) change into the PACKAGE-folder


10) Optional: create a folder which contains all the packages

 mkdir <compiling-folder>/PACKAGES

11) tar the file-structure up into a nice package

 tar zvcf /<compiling-folder>/PACKAGES/<appname>_<architecure>.tar.gz

where architecure is ppc for LS1, HG & HS and mips for the LS2

you should now have a freshly compiled package in /<compiling-folder>/PACKAGES which is perfect for distribution or later for the creation of ipkg-packages!

No, you have a package which often has pathes compiled into it. And since you have pointed the --prefix to some local path you probably have a package which can't be installed anywhere else than on <some strange path>/PACKAGE/usr/local while you really want it to be working in /usr/local. Examples are applications which compile the path to their help files, shared libs, config files, etc. into themself, taking the data from configure.

Then tell us how to create perfect packages. You seem to know it, so why don`t you share your knowledge? Mindbender 20:41, 19 July 2006 (EDT)