Create a package (tarball) for distribution
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
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 --sysconfdir=/etc
compile the app
install the compiled app afterwards
change into the PACKAGE-folder
Optional: create a folder which contains all the 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 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.