The point of this Tech Tip is not to defend the practice of building everthing from source - we presume you've already decided that you want to, and are looking for advice - but we will touch on some of our reasoning;
We use the excellent wget tool to fetch each package, and from there we extract it to its own area. This example fetches Postfix:# mkdir /home/source # mkdir /home/source/tarballs # ln -s home/source /source
# cd /source/tarballs # wget ftp://postfix.cloud9.net/official/postfix-2.0.12.tar.gz # cd .. # gtar -xzvf tarballs/postfix-2.0.12.tar.gz # cd postfix-2.0.12 continue building
Our practice has been to create a small shell script in the /source directory that contains the methods required to build the package. For instance, in the case of Postfix above, we had
# cat /source/configure-postfix
make makefiles CCARGS='-DDEF_COMMAND_DIR=\"/usr/local/sbin\" \
-DDEF_DAEMON_DIR=\"/usr/local/libexec/postfix\" \
-DDEF_MAILQ_PATH=\"/usr/local/bin/mailq\" \
-DDEF_NEWALIAS_PATH=\"/usr/local/bin/newaliases\" \
-DDEF_SAMPLE_DIR=\"/etc/postfix/samples\" \
-DDEF_SENDMAIL_PATH=\"/usr/local/sbin/sendmail\" \
-DHAS_MYSQL -I/home/mysql/include/mysql' \
AUXLIBS='-L/home/mysql/lib/mysql -lmysqlclient'
Here we provided non-default installation directories that are to our liking,
plus pointed Postfix at the location of the MySQL client libraries. To use
these, we do
It's important that the configure-postfix script be kept in the parent of the Postfix source area, for two reasons.# cd /source/postfix-2.0.12 # sh ../configure-postfix # make ... continue to build/test/install
# cd /source/mysql-4.0.13
# ./configure --help > ../configure-mysql
# vi ../configure-mysql
edit the file to add the actual configure code
# more ../configure-mysql
exec ./configure \
--prefix=/home/mysql \
--enable-assembler \
--enable-local-infile \
--without-innodb \
--with-mysqld-user=mysql \
--with-unix-socket-path=/var/run/mysql/mysqld.sock
`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.
.... the rest of configure help output
The help output itself is not executable - it's just a quick reference - and
the exec just before the configure script name insures that the shell
won't execute any of the documentation.
The configure front-end script can also contain additional commentary, such
as important pre-installation steps (such as creating specific system users
or groups).
These front-end scripts show their further utility when a build need be done on some other system: copy the configure-whatever script to the new system and known-to-work parameters will be an excellent starting point even if machine-specific changes need be made.
Navigate: More Tech Tips