Because a picture is worth a thousand words, and because the kind of people I want to make sure hear about it will realize the value without further explanation, here are a couple of sample casts of mutt under Source Mage. 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?
I 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.
Note: The version of the mutt spell (package) used in these screenshots is not in the stable branch of Source Mage yet; it's a new version I'm developing. However, it's good for getting the idea across, and I'm familiar with this spell so I can comment on the nicer features it has.
Build 1, this shows the way I normally want mutt built.
# cast mutt Computing previously installed dependencies... mutt Build which version? (0) stable (1) devel (2) cvs Which one do you want? [0] 1 mutt 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 mutt 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 provides 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 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. Compare this to global USE flags for "doing the Right Thing" and pick your preference. Also note that all of these prompts timeout to the default after a configureable interval.
mutt automake mutt autoconf
automake and autoconf are dependencies only because we applied patches and therefore will need to run ./prepare.
mutt linuxdoc-tools netqmail ncurses gnupg openssl automake autoconf linuxdoc-tools --------------------------- mutt Do you want to cast these spells? [y] y mutt-1.5.9i.tar.gz mutt /var/spool/sorcery mutt-1.5.9i.tar.gz.asc mutt /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. mutt
Sorcery supports verification of downloaded sources via GPG signature checking as well as MD5 and other popular hashes.
mutt-1.5.9i.tar.gz mutt. [... snip patch output ...] [... snip patch output ...] [... snip patch output ...] [... snip patch output ...] [... snip patch output ...] [... snip patch output ...] [... snip patch output ...] [... 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. 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...
--with-domain=example.com
...and the spell picks it up.
[... snip compile output ...] /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>'.
/var/log/sorcery/install/mutt-1.5.9 /var/log/sorcery/md5sum/mutt-1.5.9 /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 intall 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.
------------------------------ 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 [[ Build which version? -> 'devel' ]] mutt [[ 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 mutt MAIL-TRANSPORT-AGENT (to send mail). Continue to use netqmail? [y] y [[ Build against which terminal library? -> 'ncurses' ]] mutt ncurses mutt gnupg mutt openssl mutt gpgme mutt libidn mutt automake mutt autoconf mutt linuxdoc-tools netqmail ncurses gnupg openssl automake autoconf linuxdoc-tools --------------------------- 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 Build which version? (0) stable (1) devel (2) cvs Which one do you want? [0] 2 mutt 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 mutt 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 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 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 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 mutt
This time automake and autoconf are required because the CVS version has to run ./prepare as well.
mutt netqmail cvs ncurses gnupg openssl gdbm libidn cyrus-sasl krb5 krb5 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 krb5 krb5 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' 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 autoconf linuxdoc-tools perl bison linux-pam utomake autoconf linuxdoc-tools perl bison linux-pam --------------------------- libidn krb5 mutt Do you want to cast these spells? [y] y libidn-0.5.4.tar.gz 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 ...] /var/log/sorcery/compile/libidn-0.5.4.bz2 View Compile log for libidn-0.5.4? [n] n /var/log/sorcery/install/libidn-0.5.4 /var/log/sorcery/md5sum/libidn-0.5.4 /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 ...]
Since we already cast mutt from CVS once we just use that source and cvs update it.
[... snip etc. ...]