Gnuppix, software package handling a'la GoboLinux (and stow)

Slackware.SE Wiki

Hoppa till: navigering, sök

Innehåll

[redigera] Gnuppix, software package handling a'la GoboLinux (and stow) but with a slightly different approach.

http://linuxconfig.dyndns.org:1184/lazy/LazyLinuxWiki/Gnuppix

[redigera] The filesystem is the package manager (as in GoboLinux)!

The programs are installed/uninstalled by scripts which are distributed *together* with the program. No package management is needed.

All files (except for the base system) are stored in /gnuppix/programs/

The /usr directory contains (optional) symlinks to the programs in /gnuppix/programs/ (As in stow)

This means that the root filesystem can be kept very small since it mostly contains symlinks. /gnuppix/programs can be mounted or symlinked from another filesystem.

[redigera] All programs should be available regardless of the distribution!

A program consists of a single directory. Easy to redistribute and maintain as a simple tar.gz archive.

Contains source archives (archive), installed files(installed), build and install scripts (scripts) and a build directory (source).

{{{ ls Python-2.5.2 1.7 archive/ installed/ scripts/ source/ }}}

[redigera] Any user is allowed to install programs.

Each individual program will be owned by the user that installs it. Can be changed later to root.

Possible to have a user account solely for installing and testing new programs = security "Sandbox".

/gnuppix/programs can be changed to /home/user1/gnuppix/programs (or any other path) for testing or security reasons.

[redigera] Optional symlinks for compatibility with other programs.

Creating symlinks are done in a separate action, usually as root.

Does not interfere with the base system unless the symbolic links are created.

[redigera] Source based packages, optional to include binary files.

Different versions (or builds) of the same program kan coexist.

Dependency check is done when building the program, since if a dependency is missing the program can not be built.

Flexible to distribute - can be binary only, source only, scripts only or a combination.

[redigera] Should be mostly distribution independent.

Any differences between dists should be hidden by the scripts.

Simple scripts which only need small modifications for different programs.

{{{ ls mc/mc-4.6.1/scripts/ build.sh* common.sh* create_symlinks.sh* install.sh* newpkg.sh* newprog.sh* prepare.sh* remove_symlinks.sh* variables/ }}}

The scripts can be totally rewritten and customized for a specific program.

Lesser risk for incompatibilities since the scripts are distributed together with the program. A program which has been installed with a set of scripts is always guaranteed to be compatible with the same set of scripts.

[redigera] Latest version 2008-07-03

http://linuxconfig.dyndns.org:1184/lazy/LazyLinuxWiki/Gnuppix/Introduction?action=AttachFile&do=get&target=template-1.9.tar.gz

Happy hacking!

-) Magnus Uppman

magnus_uppman@hotmail.com


[redigera] Usage:


[redigera] Create a new program directory from a template

newprog.sh


[redigera] Configure the build, must be edited before the main scripts are run:

common.sh

Modify the data in variables/ for your program


[redigera] Fetch the source (to "archive") and unpack it (to "source"):

prepare.sh


[redigera] Compile the source:

build.sh


[redigera] Install the compiled files to "installed":

install.sh


[redigera] Symlink the installed files to an arbitrary location, for example /usr:

create_symlinks.sh


[redigera] Remove the symlinks:

remove_symlinks.sh


[redigera] Create a package in ~/repo :

newpkg.sh



[redigera] Use the template for a program (e.g. myprog, version 0.63):

[redigera] First download the template program (see above):

cd /gnuppix/programs

tar --extract --verbose --gunzip --file template-VERSION.tar.gz

[redigera] Secondly, create the dir structure for your program and copy the template:

[redigera] Use newprog.sh

cd /gnuppix/programs/template/template-VERSION/scripts

{{{ PROG_GNUPPIX=mc VERSION_GNUPPIX=4.6.1 MAIN_FILE=mc-4.6.1.tar.gz URL_MAIN_FILE=http://www.ibiblio.org/pub/Linux/utils/file/managers/mc/mc-4.6.1.tar.gz newprog.sh }}}

[redigera] Manually

cd /gnuppix/programs

mkdir myprog

cd myprog

cp -r ../template/template-VERSION myprog-0.63

Edit common.sh (and variables/PROG_GNUPPIX etc.) for location and information about the source and other stuff.

If not a standard GNU build, also edit build.sh, install.sh and possibly prepare.sh.


[redigera] Structure

{{{ ls /gnuppix/programs/ advancemame/ ekiga/ gnome-icon-theme/ intltool/ libmcrypt/ opal/ pygtk/ Python/ .......

ls /gnuppix/programs/Python/ Python-2.5.2/ Python-2.5.2-links.log.gz

ls Python/Python-2.5.2 1.7 archive/ installed/ scripts/ source/ }}}

[redigera] Main program directory

/gnuppix/programs

Owned by root, read/write for everybody with restricted deletion flag.

chmod a+rwxt /gnuppix/programs

drwxr-xr-t 2 root root 48 2008-03-18 07:39 programs/

/gnuppix/programs/tar/tar-1.16.1

/gnuppix/programs/tar/tar-1.16.2

[redigera] Compressed source and patches

/gnuppix/programs/tar/tar-1.16.1/archive

[redigera] Uncompressed and possibly patched source

/gnuppix/programs/tar/tar-1.16.1/source

tar -xvf archive/tar-1.19.tar.gz -C source/

[redigera] Installed files

/gnuppix/programs/tar/tar-1.16.1/installed

[redigera] Scripts

/gnuppix/programs/tar/tar-1.16.1/scripts /gnuppix/programs/tar/tar-1.16.1/scripts/variables

[redigera] Common data for all scripts and specific data for the program

common.sh variables/

[redigera] Fetch source and apply any patches. Clears the "source" dir first.

prepare.sh

[redigera] Build and compile source.

build.sh

[redigera] Copy compiled files to the "installed" directory. Clears the "installed" dir first.

install.sh

[redigera] Create (optional) symlinks for a custom toplevel directory, e.g. /usr, to all files in "installed"). The toplevel directory is specified in common.sh.

create_symlinks.sh

[redigera] Remove (optional) symlinks

remove_symlinks.sh

[redigera] Logs

Generated by create_symlinks.sh, contains the files and/or directories which have been symlinked.

/gnuppix/programs/tar/tar-16.1-links.log.gz

[redigera] Software "packages"

Any combination is valid.. The scripts and (directory structure) is the only mandatory part.

1 (all). All files. Filename consists of the program name and version. lbreakout2-2.6beta-7.tar.gz

2 (scripts). Scripts only. Append tag -scripts. lbreakout2-2.6beta-7-scripts.tar.gz

3 (source). Buildscript and source archive(s). Append tag -src. lbreakout2-2.6beta-7-src.tar.gz

4 (compiled). Buildscript, source archive(s), and compiled source (Files in 'installed' are not included). Append tag -src-ARCH. Where arch is e.g. i486. lbreakout2-2.6beta-7-src-i486.tar.gz

[redigera] Create software "package" with newpkg.sh

GNUPPIX_PKG_TYPE=all newpkg.sh

GNUPPIX_PKG_TYPE=scripts newpkg.sh

GNUPPIX_PKG_TYPE=source newpkg.sh

GNUPPIX_PKG_TYPE=compiled newpkg.sh

[redigera] Manually create a "package" with only buildscript

rm -r /tmp/lbreakout2/lbreakout2-2.6beta-7

cp -r /gnuppix/programs/lbreakout2/lbreakout2-2.6beta-7 /tmp/lbreakout2/lbreakout2-2.6beta-7

rm -r /tmp/lbreakout2/lbreakout2-2.6beta-7/installed/*

rm -r /tmp/lbreakout2/lbreakout2-2.6beta-7/source/*

rm -r /tmp/lbreakout2/lbreakout2-2.6beta-7/archive/*

cd /tmp

tar --create --gzip --verbose --file lbreakout2-2.6beta-7-scripts.tar.gz lbreakout2/lbreakout2-2.6beta-7

[redigera] Install software "package"

cd /gnuppix/programs

tar --extract --verbose --gunzip --file lbreakout2-2.6beta-7-src-i486.tar.gz

[redigera] Special tricks

[redigera] Use the "installed" dir from another /gnuppix/programs archive

Preserves disk space. Only the links are stored in the base system.

Assume other archive /mnt/hd/gnuppix/programs

ln -s /mnt/hd/gnuppix/programs/lbreakout2/lbreakout2-2.6beta-7/installed /gnuppix/programs/lbreakout2/lbreakout2-2.6beta-7/installed

cd /gnuppix/programs/lbreakout2/lbreakout2-2.6beta-7/scripts

./create_symlinks.sh

Personliga verktyg