What is Source Mage GNU/Linux?
Source Mage GNU/Linux is a source based distribution of Linux. It has many powerful features that set it apart from other distros. Source code is always downloaded from the publisher's website and rarely patched. SMGL also includes many advanced features such as self-healing and sub-dependencies.
Sample Cast: mutt (most spells are simpler)
Because a picture is worth a thousand words, and because most of the people who will be most interested will realize the value without further explanation, here are a couple of sample casts of mutt under SMGL. Other distros will build from source mostly in the name of "speed optimization". SMGL does it 100% in the name of keeping the admin in control of what goes on their box. After all, aren't compiler flags just one small aspect of deciding how to build packages?
We include a few of these to demonstrate that the prompts you get are totally based on the answers you gave to previous steps. Sorcery automates the truly rote tasks without taking an ounce of control away from the administrator.
Build 1, this shows a fairly typical build of mutt's dev branch.
# cast mutt Computing previously installed dependencies... mutt preparing environment... Build which version? (0) stable (1) devel (2) cvs Which one do you want? [0] 1 mutt running configuration... Apply the compressed_folders patch? [n] n Apply the edit_threads patch? [n] y Apply the trash_folder patch? [n] y Apply the purge_message patch? [n] y Apply the maildir_header_cache patch? [n] n Apply the sidebar patch? [n] n Apply the attachment_counting patch? [n] y Apply the isalias patch? [n] y Apply the deepif patch? [n] y Apply the date_conditional patch? [n] y Apply the current_shortcut patch? [n] y Rebuild documentation affected by patches? (requires linuxdoc-tools) [y] y Enable POP support? [y] n Enable IMAP support? [y] n Enable the header cache? [n] n mutt checking dependencies... mutt optionally requires some MAIL-TRANSPORT-AGENT (to send mail). (0) [none] (1) courier (2) esmtp (3) exim (4) msmtp (5) nbsmtp (6) netqmail (installed) (7) postfix (8) qwikmail (9) sendmail Which one do you want? [0] 6
MAIL-TRANSPORT-AGENT is a pseudo-dependency, so all spells that provide this function are listed, with the currently installed one set as the default.
Build against which terminal library? (0) ncurses (1) slang Which one do you want? [0] 0 mutt depends on ncurses
ncurses is a real-time dependency, set because of the prior selection.
gnupg is an optional dependency for mutt (to support PGP signing and encrypting messages) Do you want to use gnupg? [y] y openssl is an optional dependency for mutt (to support S/MIME signing and encrypting messages) Do you want to use openssl? [y] y gpgme is an optional dependency for mutt (alternate backend for PGP and S/MIME) Do you want to use gpgme? [y] n libidn is an optional dependency for mutt (to use GNU libidn for domain names) Do you want to cast libidn? [n] n
Note that the default on optional dependencies is "y" for things that are installed and "n" for things that aren't. Also note that all of these prompts timeout to the default after a configureable interval.
mutt depends on automake mutt depends on autoconf
automake and autoconf are dependencies only because we applied patches and therefore will need to run ./prepare.
mutt depends on linuxdoc-tools netqmail No work to do. ncurses No work to do. gnupg No work to do. openssl No work to do. automake No work to do. autoconf No work to do. linuxdoc-tools No work to do. Collating dependencies... Spells are to be cast: --------------------------- mutt Do you want to cast these spells? [y] y Found source file mutt-1.5.9i.tar.gz for spell mutt in /var/spool/sorcery Found source file mutt-1.5.9i.tar.gz.asc for spell mutt in /var/spool/sorcery
We had the sources around from a previous cast, else it would have been downloaded.
Waiting for any Solo casts to complete... Waiting for any other casts of mutt to complete... done. Building mutt GPG checking source file mutt-1.5.9i.tar.gz... gpg signature verified!
Sorcery supports verification of downloaded sources via GPG signature checking as well as MD5 and other popular hashes.
Unpacking source file mutt-1.5.9i.tar.gz for spell mutt. Applying patch edit_threads [... snip patch output ...] Applying patch trash_folder [... snip patch output ...] Applying patch purge_message [... snip patch output ...] Applying patch attachment_counting [... snip patch output ...] Applying patch isalias [... snip patch output ...] Applying patch deepif [... snip patch output ...] Applying patch date_conditional [... snip patch output ...] Applying patch current_shortcut [... snip patch output ...] [... snip ./prepare output (run because we applied patches) ...] The mutt source code was successfully prepared. Type make && make install to build and install mutt. These are your current -- config options for spell mutt (/etc/sorcery/local/config_option_cache/mutt) --with-domain=example.com Do you wish to add -- options to ./configure? [n] y
Because we said "y", $EDITOR is started on the commented output of ./configure --help:
# `configure' configures this package to adapt to many kinds of systems. # # Usage: ./configure [OPTION]... [VAR=VALUE]... # # To assign environment variables (e.g., CC, CFLAGS...), specify them as # VAR=VALUE. See below for descriptions of some of the useful variables. # # Defaults for the options are specified in brackets. [... snip ...] # Optional Packages: # --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] # --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) # --with-gpgme-prefix=PFX prefix where GPGME is installed (optional) # --with-mixmaster=PATH Include Mixmaster support # --with-slang=DIR Use S-Lang instead of ncurses # --with-curses=DIR Where ncurses is installed # --with-regex Use the GNU regex library # --with-homespool=FILE File in user's directory where new mail is spooled # --with-mailpath=DIR Directory where spool mailboxes are located # --with-docdir=PATH Specify where to put the documentation # --with-domain=DOMAIN Specify your DNS domain name # --with-gss=PFX Compile in GSSAPI authentication for IMAP # --with-ssl=PFX Compile in SSL support for POP/IMAP # --with-nss=PFX Compile in SSL support for POP/IMAP via NSS # --with-gnutls=PFX Enable SSL support using gnutls # --with-sasl=PFX Use Cyrus SASL library for POP/IMAP authentication # --with-sasl2=PFX Use Cyrus SASL library version 2 for POP/IMAP # authentication # --with-idn=PFX Use GNU libidn for domain names # --with-exec-shell=SHELL Specify alternate shell (ONLY if /bin/sh is broken) # --without-gdbm Don't use gdbm even if it is available # --with-bdb=DIR Use BerkeleyDB4 if gdbm is not available # --with-libiconv-prefix=DIR # Search for libiconv in DIR/include and DIR/lib # --with-included-gettext Use the GNU gettext library included here # --without-wc-funcs Do not use the system's wchar_t functions # # Some influential environment variables: # CC C compiler command # CFLAGS C compiler flags # LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a # nonstandard directory <lib dir> # CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have # headers in a nonstandard directory <include dir> # CPP C preprocessor # # Use these variables to override the choices made by `configure' or to help # it to find libraries and programs with nonstandard names/locations. # --with-domain=example.com /tmp/cast.7200.configure Type: CONF Buf: 1 127/127,1 Bot :x
List whichever options you want to use on a line at the end of the file and save it...
OPTS= --with-domain=example.com
...and the spell picks it up.
[... snip compile output ...] Creating compile log /var/log/sorcery/compile/mutt-1.5.9.bz2 View Compile log for mutt-1.5.9? [n] n
Note that sorcery allows you to see the compile output during the build or turn it off, using the VOYEUR setting. Regardless, the compile output is permanently logged and can always be viewed via 'gaze compile <spell>'.
Creating install log /var/log/sorcery/install/mutt-1.5.9 Creating MD5 log /var/log/sorcery/md5sum/mutt-1.5.9 Creating cache file /var/cache/sorcery/mutt-1.5.9-i686-pc-linux-gnu.tar.bz2
The cache file is a tarball of the files the spell just installed and is stored in case you ever want to revert to this state. The MD5 log is used to verify files post-install or during a "resurrect" from a cache tarball.
View Install log for mutt-1.5.9? [n] n
The install log is also stored of course. It contains the list of all files installed or modified by this cast, using installwatch for tracking. It (and the other package and system state files) can be edited by the admin if necessary.
Finished processing install requests. Spells installed successfully: ------------------------------ mutt
Build 2, for something like a version upgrade, note that all the previous answers are remembered unless I specifically ask to reconfigure them.
# cast mutt Computing previously installed dependencies... mutt preparing environment... [[ Build which version? -> 'devel' ]] mutt running configuration... [[ Apply the compressed_folders patch? -> n ]] [[ Apply the edit_threads patch? -> y ]] [[ Apply the trash_folder patch? -> y ]] [[ Apply the purge_message patch? -> y ]] [[ Apply the maildir_header_cache patch? -> n ]] [[ Apply the sidebar patch? -> n ]] [[ Apply the attachment_counting patch? -> y ]] [[ Apply the isalias patch? -> y ]] [[ Apply the deepif patch? -> y ]] [[ Apply the date_conditional patch? -> y ]] [[ Apply the current_shortcut patch? -> y ]] [[ Rebuild documentation affected by patches? (requires linuxdoc-tools) -> y ]] [[ Enable POP support? -> n ]] [[ Enable IMAP support? -> n ]] [[ Enable the header cache? -> n ]] mutt checking dependencies... mutt optionally requires some MAIL-TRANSPORT-AGENT (to send mail). Continue to use netqmail? [y] y [[ Build against which terminal library? -> 'ncurses' ]] mutt depends on ncurses mutt optionally depends on gnupg mutt optionally depends on openssl mutt optionally depends on gpgme mutt optionally depends on libidn mutt depends on automake mutt depends on autoconf mutt depends on linuxdoc-tools netqmail No work to do. ncurses No work to do. gnupg No work to do. openssl No work to do. automake No work to do. autoconf No work to do. linuxdoc-tools No work to do. Collating dependencies... Spells are to be cast: --------------------------- mutt [... snip ...]
Build 3, using some different options and hinting at recursing into a more complicated dependency build.
# cast mutt Computing previously installed dependencies... mutt preparing environment... Build which version? (0) stable (1) devel (2) cvs Which one do you want? [0] 2 mutt running configuration... Apply the compressed_folders patch? [n] n Apply the trash_folder patch? [n] n Apply the maildir_header_cache patch? [n] n Apply the sidebar patch? [n] n Apply the attachment_counting patch? [n] n Apply the isalias patch? [n] n Apply the deepif patch? [n] n Apply the date_conditional patch? [n] n
The patch list varies based on the version selected.
Build documentation? (requires linuxdoc-tools) [y] y
Note that the above question is asked differently than it was in the other build, because we didn't apply any patches, but the CVS version doesn't come with pre-built documentation anyway.
Enable POP support? [y] y Enable IMAP support? [y] y Enable the header cache? [n] y mutt checking dependencies... mutt optionally requires some MAIL-TRANSPORT-AGENT (to send mail). (0) [none] (1) courier (2) esmtp (3) exim (4) msmtp (5) nbsmtp (6) netqmail (installed) (7) postfix (8) qwikmail (9) sendmail Which one do you want? [0] 6 mutt requires some CVS. (0) cvs (installed) (1) gcvs Which one do you want? [0] 0 Build against which terminal library? (0) ncurses (1) slang Which one do you want? [0] 0 mutt depends on ncurses gnupg is an optional dependency for mutt (to support PGP signing and encrypting messages) Do you want to use gnupg? [y] y openssl is an optional dependency for mutt (to support S/MIME signing and encrypting messages) Do you want to use openssl? [y] y
The above query allows the user to cast openssl if they don't already have it, it doesn't affect the compile flags, since it shouldn't for just S/MIME support.
gpgme is an optional dependency for mutt (alternate backend for PGP and S/MIME) Do you want to use gpgme? [y] n Use which header cache backend? (0) gdbm (1) db Which one do you want? [0] 0 mutt depends on gdbm libidn is an optional dependency for mutt (to use GNU libidn for domain names) Do you want to cast libidn? [n] y openssl is an optional dependency for mutt (to enable SSL support for POP/IMAP) Do you want to use openssl? [y] n
This openssl query does add the --with-ssl flag if selected, since this is where it's needed. The two queries are independent.
nss is an optional dependency for mutt (to enable SSL support for POP/IMAP via NSS) Do you want to cast nss? [n] n gnutls is an optional dependency for mutt (to enable SSL support for POP/IMAP via gnutls) Do you want to cast gnutls? [n] n cyrus-sasl is an optional dependency for mutt (to enable SASL2 authentication for POP/IMAP) Do you want to use cyrus-sasl? [y] y krb5 is an optional dependency for mutt (to enable GSSAPI authentication for IMAP) Do you want to cast krb5? [n] y mutt depends on automake mutt depends on autoconf
This time automake and autoconf are required because the CVS version has to run ./prepare as well.
mutt depends on linuxdoc-tools netqmail No work to do. cvs No work to do. ncurses No work to do. gnupg No work to do. openssl No work to do. gdbm No work to do. libidn preparing environment... cyrus-sasl No work to do. krb5 preparing environment... krb5 running configuration... Do you want to enable Kerberos V4 backwards compatibility ? [n] n Invoke ftp via xinetd? [y] n Invoke klogin via xinetd? [y] n Invoke kshd via xinetd? [y] n Invoke telnet via xinetd? [y] n Invoke krb5-admin-server at boot via init? [n] n Invoke krb5-kdc at boot via init? [n] n krb5 checking dependencies... krb5 depends on perl krb5 depends on bison linux-pam is an optional dependency for krb5 (for PAM support) Do you want to use linux-pam? [y] y tcl is an optional dependency for krb5 (for running test programs) Do you want to use tcl? [n] n
This stuff gets as nested as it needs to be. For fun, try building a fresh box and then typing 'cast xorg-server' with nothing else installed yet. Answer all the questions then walk away and come back later to a system built exactly as you want.
automake No work to do. autoconf No work to do. linuxdoc-tools No work to do. perl No work to do. bison No work to do. linux-pam No work to do. Automake No work to do. autoconf No work to do. linuxdoc-tools No work to do. perl No work to do. bison No work to do. linux-pam No work to do. Collating dependencies... Spells are to be cast: --------------------------- libidn krb5 mutt Do you want to cast these spells? [y] y Downloading source file libidn-0.5.4.tar.gz for spell libidn --18:14:20-- http://josefsson.org/libidn/releases/libidn-0.5.4.tar.gz => `libidn-0.5.4.tar.gz' 18:14:46 (73.05 KB/s) - `libidn-0.5.4.tar.gz' saved [1874570/1874570] [... snip libidn compile ...] Creating compile log /var/log/sorcery/compile/libidn-0.5.4.bz2 View Compile log for libidn-0.5.4? [n] n Creating install log /var/log/sorcery/install/libidn-0.5.4 Creating MD5 log /var/log/sorcery/md5sum/libidn-0.5.4 Creating cache file /var/cache/sorcery/libidn-0.5.4-i686-pc-linux-gnu.tar.bz2 View Install log for libidn-0.5.4? [n] n
You can't tell it in a static screenshot, but krb5 downloaded while libidn was compiling.
[... snip krb5 cast ...] Downloading source file mutt-cvs.tar.bz2 for spell mutt Previous source found. Extracting package mutt-cvs.tar.bz2... Running cvs update...
Since we already cast mutt from CVS once we just use that source and cvs update it.
[... snip etc. ...]
