|
|
Installing programs(updated as of GoboLinux 007) Installing programs from sourceIf you are used to compiling programs in Linux, you are aware that it is mostly a three-part process: prepare the sources (configure), compile them (make), and install the files generated by the compilation (make install). The process is basically the same in GoboLinux. However, it requires additional setup in the first step, in order to prepare the sources to compile targeting the GoboLinux directories, and additional actions in the third step, so that files installed in /Programs get linked in /System (in order words, to make the files from the programs available for the system). GoboLinux fetures a series of scripts that automate this process. They are:
PrepareProgram and SymlinkProgram are wrappers to the first and third step of compilation as explained above (the second step being simply running 'make'). CompileProgram is a higher-level wrapper script, that wraps the process as a whole: well-behaved autoconf-based programs can be compiled with a single CompileProgram command. Setting up the sources: PrepareProgramThe PrepareProgram script does two things. It creates a directory hierarchy for the program under /Programs, and it attempts to prepare the sources for compilation. The syntax for the PrepareProgram is: PrepareProgram <ProgramName> <VersionNumber> [ -- <AdditionalOptions> ] Passing a program name and version number is mandatory. These names are the ones used in the directories under programs. For example, PrepareProgram SuperFoo 1.0 creates the directories /Programs/SuperFoo/Settings, /Programs/SuperFoo/1.0, /Programs/SuperFoo/1.0/bin and so on. The second task performed by PrepareProgram is to prepare the sources. Since there isn't a standardized format for distribution of source-code tarballs in the free software world, there is no way to implement completely automated preparation. Fortunately, the popularization of the GNU AutoTools brings us closer to such a standard. PrepareProgram, in this second step, will detect availability of preparation tools and perform one of the following:
In short, PrepareProgram can be considered a wrapper to 'configure'. Instead of running, for example, ~/superfoo-1.0] configure --with-shared=yes you'll run ~/superfoo-1.0] PrepareProgram SuperFoo 1.0 -- --with-shared=yes However, for most programs that use GNU AutoTools, you'll want to use the all-in-one CompileProgram wrapper script. Linking the sources: SymlinkProgramThe final step in the compilation of a program is performed by the SymlinkProgram. The syntax for SymlinkProgram is: SymlinkProgram <ProgramName> [ <VersionNumber> ] The second argument is optional. If no version number is specified, the one linked as Current will be used. SymlinkProgram is the script responsible for creating the symbolic links under /System/Links. It can also, optionally, provide a controlled environment for safely executing 'make install', using a sandbox provided by the FiboSandbox script. To have SymlinkProgram perform 'make install', use the --make (-m) option, like this: SymlinkProgram -m SuperFoo It is recommended that 'make install' is always executed through SymlinkProgram, because the sandbox ensures that 'make install' will only have permissions to store files under /Programs/SuperFoo/Current and /Programs/SuperFoo/Settings. SymlinkProgram features many command-line switches. Please refer to the --help page for details. Wrapping the entire compilation process: CompileProgramThe CompileProgram script wraps PrepareProgram, make and SymlinkProgram in a single command, while adding other niceties. The syntax for CompileProgram is: CompileProgram <FileOrPath> [ <ProgramName> [ <VersionNumber> ] ] [ -- <AdditionalOptions> ] The first argument is the filename of the source tarball or the path where the sources are located. Normally, you'll want to use the '.' (current) directory as an argument, doing something like this:
~] aunpack superfoo-1.0.tar.gz Note that, unlike in PrepareProgram and SymlinkProgram, here both the program name and version are optional. CompileProgram performs a number of heuristics to determine the program name (and capitalization) and version. These heuristics, among other things, read the directory name and scan the README file. CompileProgram will display the name and version detected, and ask for confirmation. If those are not satisfactory, the user can cancel the process and enter the correct names in the command line, like:
~/superfoo-1.0] CompileProgram . Prior to compilation, CompileProgram will display on screen the README and INSTALL files, if present. They may contain relevant information for the user such as additional switches to be passed to configure. These options can be passed to CompileProgram like in PrepareProgram: appended to the commandline options, after '--'. CompileProgram then runs 'make' (with no arguments as default, or with an argument passed with --make-target) and then SymlinkProgram. CompileProgram features additional command-line switches to further refine its behavior for special cases. Please refer to the --help page for details. Using binary packagesGoboLinux binary packagesGoboLinux uses a very simple format for binary packages. For a given program, say Foo 1.0, a package is simply an archive in .tar.bz2 format containing the Foo/1.0/ and Foo/Settings/ directories (and their contents). For a package built for a i686 architecture, the package will be named Foo--1.0--i686.tar.bz2. Installing binary packagesTo install binary packages, simply run InstallPackage passing the package name as a parameter. For example: InstallPackage Foo--1.0--i686.tar.bz2 This will unpack the archive inside /Programs, and will call SymlinkProgram to update /System/Links. Creating binary packagesTo create a binary package, use the CreatePackage script. It has the following syntax: CreatePackage <ProgramName> It will create a package of the Current version of the specified program, and store the generated archive at /Programs. Note: please be careful with the contents of the Settings directory when creating a binary package, so that it does not include personal information. A package submitted for inclusion in the packages directory at GoboLinux.org must feature sensible default settings, preferrably the defaults as specified by the application right after its compilation. Cleaning upGoboLinux does not feature a specific script to clean up the broken links that will emerge when programs are deleted, but it has a generic script for cleaning broken symbolic links, called RemoveBroken. RemoveBroken will verify if any of the files passed to it in the command line is a broken link, and remove those. If no arguments are passed, it receives filenames from standard input (tipically through a pipe). The usual procedure to clean up symbolic links, is, then:
~] cd /System/Links Notes on command-line switches
|