Difference between revisions of "Create a package (tarball) for distribution"

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search
Line 1: Line 1:
''this works only if there is a configure-script.'' <br>
+
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.
''If there isn`t one you will have to modify the supplied makefile manually.''
+
  
'''Prerequisits:'''
+
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.
Development Tools
+
  
 +
The remainder of this article further assumes
  
download the source to the preferred place:
+
* The source code comes with a <tt>configure</tt> script
  cd <compiling-folder>     (i suggest to create a folder on /dev/hda3.../mnt/ on ppc-LS, /mnt/hda/ on the LS2)
+
* You have all the common development tools installed
  wget http://<download-location>/<app-source>
+
 
untar the package - use xzvf if it has a tar.gz-extension (=.tgz) and xjvf if it has tar.bz2
+
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>   
 +
<nowiki>wget http://</nowiki><download-location>/<app-source>
 +
 
 +
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
 
   tar xzvf <app-source>.tar.gz
 
change into the new directory
 
change into the new directory
Line 31: Line 36:
  
 
'''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!'''
 
'''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 the the --prefix to some local path you probably have a package which can't be installed anywhere else than on <tt><some strange path>/PACKAGE/usr/local</tt>. Examples are applications which compile the path to their help files, shared libs, config files, etc. into themself, taking the data from configure.

Revision as of 21:07, 19 July 2006

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

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>

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

change into the new directory

 cd <app-source>

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

 mkdir -p PACKAGE/usr/local/

configure the app with the right prefix

 ./configure --prefix=<path2this_folder>/PACKAGE/usr/local

compile the app

 make

install the compiled app afterwards

 make install

change into the PACKAGE-folder

 cd PACKAGE

Optional: create a folder which contains all the packages

 mkdir <compiling-folder>/PACKAGES

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 the 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. Examples are applications which compile the path to their help files, shared libs, config files, etc. into themself, taking the data from configure.