You can view this document as separate HTML pages by clicking here.
The Ape Base Compile System is a set of bash scripts to leverage both ESP EPM (http://www.epmhome.org/) and MREPO (http://dag.wieers.com/home-made/mrepo/) in maintaining Red Hat based systems that require custom and secluded binaries. If you need "Ape" to be an acronym, then go for "Application Packaging Environment" as christened by Mark Stokan. The original notion for the name was that this system was "aping" the performance of several tasks.
Since there's a lot of information to cover here, some explanation conventions will be handy.
Commonly, `ls` is the file listing command.
[root@localhost:/ape/_compile]$ echo 'This is a shell prompt - bash, sh, csh, cygwin, etc...' This is a shell prompt - bash, sh, csh, cygwin, etc... [root@localhost:/ape/_compile]$ |
[root@localhost:/ape/_compile]$ |Thus the command...
[root@localhost:/ape/_compile]$ ls -ld ./src drwxr-xr-x 14 root root 4096 Mar 15 02:17 ./src [root@localhost:/ape/_compile]$ |Is functionally the equivalent of the command...
[root@localhost:~]$ ls -ld /ape/_compile/src drwxr-xr-x 14 root root 4096 Mar 15 02:17 /ape/_compile/src [root@localhost:~]$ |This convention only applies to *nix shell prompts.
#!/bin/bash
# this will set a variable for use later in compile
export THIS_IS_A_VAR='value'
Relative paths should never be used in scripts or other files unless instructed to do so.
Using Ape User Configuration Variables and Ape Internal System Variables is the preffered method of substituting directory names inside scripts and files.
In order to install Ape Base Compile System via the RPM, you will need these things. If you installed another way that doesn't support dependancies, you should gather and install these tools. In addition to them, there are some optional things that may make usage easier.
It should be noted that you don't need to start a bash prompt per se to run Ape Base Compile System. The scripts run it internally via their shebang.
Other POSIX style shells, such as Bourne, can be used but Bash itself is a requirement of installing the RPM. You are, however, on your own. Substituting the shell is unsupported until further notice. If you wish to substitute shells, you have two options. First, you may pass your script at a shell prompt (`/bin/sh ./scripts/foo-1.0.sh`). This method may not always work, as the shell you are executing may honor the "#!/bin/bash" shebang within the default scripts. Second and simplest, you may change the shebang itself in your script. Since all other scripts are sourced rather than executed, the script should go fine as long as the shell's functionality supports a bash-like instruction set.
Most any application you wish to compile will need this.
Most any application you wish to compile will need this too. If you are not installing the RPM, I would recommend using GCC, but any compiler supported by automake can be used.
There are two ways to get Ape Base Compile System. You can either install the RPM (recommended) or checkout the Subversion repository.
To install the RPM, first download the current release from the SourceForge download page at https://sourceforge.net/project/showfiles.php?group_id=220974. You must browse the site if you wish to find the direct download link for use with `wget`. Then install it in the normal manner.
[root@localhost:~]$ wget http://somemirror.dl.sourceforge.net/sourceforge/apebase/apeBase-1.0-ap20088363.el5.ape.noarch.rpm [root@localhost:~]$ rpm -i apeBase-1.0-ap20088363.el5.ape.noarch.rpm [root@localhost:~]$ |
You're done you lucky RPM user you. Skip on ahead to the Setup section.
There are two ways to install via Subversion. The first is if you wish to merely install and do not plan to develop or contribute to the Ape Base Compile System project. The second is for developers and contributors who wish to do extensive work. I would recommend you perform an RPM installation rather than a Subversion installation unless you plan to develop Ape Base Compile System. If for some reason, you can't use RPM (perhaps OS X), then by all means use the first method of Subversion installation.
We will need to manually create the /ape directory and `svn export` the Ape Base Compile System trunk to create /ape/_compile. Once that is done, manually run the post-installation script.
[root@localhost:~]$ mkdir /ape [root@localhost:~]$ svn export https://apebase.svn.sourceforge.net/svnroot/apebase/trunk /ape/_compile # lots of subversion output ensues... A here/sourceballs/.ape_create_directory Exported revision NN. [root@localhost:~]$ /ape/_compile/util/bin/ape_post_install.sh ## ape_post_install.sh # In directory /ape/_compile/rpms. create symbolic link `redhat' to `centos' create symbolic link `up-mrepo.sh' to `../util/bin/up-mrepo.sh' ## ape_post_install.sh # In directory /ape/_compile/rpms/centos. create symbolic link `el4.6' to `el4' ## ape_post_install.sh # In directory /ape/_compile/scripts. create symbolic link `_blank_build_script-copy_to_create_your_own.sh' to `../include/_blank_build_script-copy_to_create_your_own.sh' ## ape_post_install.sh # In directory /ape/_compile/rpms/mrepo-www. create symbolic link `apeDocs' to `../../util/docs' ## ape_post_install.sh # Complete. [root@localhost:~]$ |
To upgrade, simply perform the last two steps again.
[root@localhost:~]$ svn export https://apebase.svn.sourceforge.net/svnroot/apebase/trunk /ape/_compile # lots of subversion output ensues... A here/sourceballs/.ape_create_directory Exported revision NN. [root@localhost:~]$ /ape/_compile/util/bin/ape_post_install.sh ## ape_post_install.sh # In directory /ape/_compile/rpms. create symbolic link `redhat' to `centos' create symbolic link `up-mrepo.sh' to `../util/bin/up-mrepo.sh' ## ape_post_install.sh # In directory /ape/_compile/rpms/centos. create symbolic link `el4.6' to `el4' ## ape_post_install.sh # In directory /ape/_compile/scripts. create symbolic link `_blank_build_script-copy_to_create_your_own.sh' to `../include/_blank_build_script-copy_to_create_your_own.sh' ## ape_post_install.sh # In directory /ape/_compile/rpms/mrepo-www. create symbolic link `apeDocs' to `../../util/docs' ## ape_post_install.sh # Complete. [root@localhost:~]$ |
For minor development, patch files and revised copies are acceptable to submit with bug reports. There is no need to perform a Subversion installation if you are merely patching the project. The subversion trunk always contains the stable release and is not to be developed against. If you wish to develop, please use the latest version number in /branches and coordinate with the other developers to hear news about branch changes.
Similar to the Checkout method, will need to manually create the /ape directory and `svn co` to create /ape/_compile. However, we need to `svn co` instead of `export` and use the path to the branch. Once that is done, manually run the post-installation script.
[root@localhost:~]$ mkdir /ape [root@localhost:~]$ svn co https://apebase.svn.sourceforge.net/svnroot/apebase/branches/*VERSION* /ape/_compile # lots of subversion output ensues... A here/sourceballs/.ape_create_directory Exported revision NN. [root@localhost:~]$ /ape/_compile/util/bin/ape_post_install.sh ## ape_post_install.sh # In directory /ape/_compile/rpms. create symbolic link `redhat' to `centos' create symbolic link `up-mrepo.sh' to `../util/bin/up-mrepo.sh' ## ape_post_install.sh # In directory /ape/_compile/rpms/centos. create symbolic link `el4.6' to `el4' ## ape_post_install.sh # In directory /ape/_compile/scripts. create symbolic link `_blank_build_script-copy_to_create_your_own.sh' to `../include/_blank_build_script-copy_to_create_your_own.sh' ## ape_post_install.sh # In directory /ape/_compile/rpms/mrepo-www. create symbolic link `apeDocs' to `../../util/docs' ## ape_post_install.sh # Complete. [root@localhost:~]$ |
Depending on how you want to use Ape Base Compile System, your setup can either be really fast or extensive. Either way, the first thing you'll want to do is set up a system wide config file. To do so, copy the sample to get yourself started.
[root@localhost:~]$ cp /ape/_compile/include/sample.ape_config.sh /ape/_compile/include/ape_config.sh [root@localhost:~]$ |
All of the Ape User Configuration Variables are available in /ape/_compile/include/ape_config.sh. Some that are commonly changed have been provided in the sample file. If /ape/_compile/include/ape_config.sh does not exist, all default values will be used but your script will proceed to run.
If you don't need MREPO to be served via a webserver and already have EPM installed, then you are done. If you need to build EPM or have MREPO served via HTTPD, then proceed.
If you'd like to build ESP EPM, there is already a script ready for you to do so. First set up your ./src directory.
A script has already been prodived to both test your installation and build ESP EPM. The script is ./scripts/ape.epm-4.1.sh. Note that you should not copy this script to create one of your own. To create your own script, copy the file ./scripts/_blank_build_script-copy_to_create_your_own.sh.
First, let's look at its help output.
Now would be a good opportunity to take a quick read of /ape/_compile/scripts/ape.epm-4.1.sh before we use it.
[root@localhost:~]$ less /ape/_compile/scripts/ape.epm-4.1.sh [root@localhost:~]$ # press [q] to exit `less` when you are done reading [root@localhost:~]$ |
If you compare /ape/_compile/scripts/ape.epm-4.1.sh to the default user script /ape/_compile/scripts/_blank_build_script-copy_to_create_your_own.sh, you'll notice that only five variables have changed. The first two are mandatory for any usage of Ape Base Compile System. The final three are optional to use in your own scripts. I use them to bind the installation of EPM to your Ape Base Compile System installation so your preferred APE_CONF_BASE_DEST_PARENT_DIR can stay clean.
# Proper name of package for RPM package naming such as "php" or "mysql".
# package names can only contain letters and numbers. No spaces or punctuation
# such as a dash ("-") or underscore ("_") are allowed.
export APE_CONF_PACKAGE_NAME="epm"
# Version number that we will use for the final directory name of the install.
#
export APE_CONF_VERSION="4.1"
# prefix for proper name of package used in RPM package naming to differentiate
# from packages built by others. Such as "ape" to produce an RPM for "apePhp".
#
export APE_CONF_PACKAGE_NAME_PREFIX="ape"
# whether or not to build a link-to-current script - yes or no
#
#export APE_CONF_SKEL_LINKTO_SCRIPT="no"
export APE_CONF_SKEL_LINKTO_SCRIPT="yes"
# Base install path (the root directory for --prefix)
# Change this if you want your applications to end up in a place other than /ape.
#
export APE_CONF_BASE_DEST_PARENT_DIR="/ape"
Time for the good stuff. Let's run /ape/_compile/scripts/ape.epm-4.1.sh. Though we would be tempted to use the "-a" flag here, EPM doesn't exist yet, so the RPM step will fail. Instead, we will run the script with "-cmis". Note that I've edited out the non- output below for brevity.
[root@localhost:~]$ /ape/_compile/scripts/ape.epm-4.1.sh -cmis ## ape.epm-4.1.sh # Auto enable -k option ## ape.epm-4.1.sh # Auto enable -s option ## ape.epm-4.1.sh # Begining apeEpm from sources in epm-4.1. ## ape.epm-4.1.sh # Target Directory: /ape/epm/4.1 ## ape.epm-4.1.sh # Detected "i386" mode. ## ape.epm-4.1.sh # Lib path (APE_SYS_DETECTED_ARCHITECTURE) is "lib" ## ape.epm-4.1.sh # Using APE_CONF_COMPILE_HOME /ape/_compile ## ape.epm-4.1.sh # Moving to /ape/_compile/src/epm-4.1 ## ape.epm-4.1.sh # Running `/ape/_compile/src/epm-4.1/configure` ## ape.epm-4.1.sh # Configure String: -->( ./configure --prefix=/ape/epm/4.1 2>&1 | tee /ape/_compile/output/configure-apeEpm-4.1-ap167463-i386.log )<-- ## ape.epm-4.1.sh # ape_sys_run_configure result: 0 ## ape.epm-4.1.sh # `make clean` result: 0 ## ape.epm-4.1.sh # ape_sys_run_make result: 0 ## ape.epm-4.1.sh # Removing previous build... ## ape.epm-4.1.sh # ape_sys_run_remove result: 0 ## ape.epm-4.1.sh # ape_sys_run_make_install result: 0 ## ape.epm-4.1.sh # Skipping creation of "/ape/_compile/skels/epm-4.1/bin/link_to_current.epm-4.1.sh" as it would overwrite an existing file ## ape.epm-4.1.sh # ape_sys_run_create_ltcurr_script result: 0 ## ape.epm-4.1.sh # Copying skeleton files from "", "/ape/_compile/skels/epm-4.1" and "". ## ape.epm-4.1.sh # Executing `/usr/bin/rsync --stats --recursive --copy-links --copy-dirlinks --times --human-readable --exclude-from=/ape/_compile/include/skel_exclude.txt /ape/_compile/skels/epm-4.1/ /ape/epm/4.1/ 2>&1`. ## ape.epm-4.1.sh # Skel rsync number of files: 3 ## ape.epm-4.1.sh # ape_sys_run_skel result: 0 ## ape.epm-4.1.sh # Moving back to /ape/_compile [root@localhost:~]$ |
Asuming that all went well, and you didn't get any compile errors, we're ready for the final two steps. We are going to run the link-to-current script /ape/epm/4.1/bin/link_to_current.epm-4.1.sh to make our version the active one. Then we are finally going to roll our intallation into an RPM by running /ape/_compile/scripts/ape.epm-4.1.sh with the "-r" flag.
[root@localhost:~]$ /ape/epm/4.1/bin/link_to_current.epm-4.1.sh ** link_to_current.epm-4.1.sh ** begun for APP "epm" VER "4.1" ** link_to_current.epm-4.1.sh ** CAUTION! Linking version 4.1 to be the current epm version! create symbolic link `/ape/epm/current' to `/ape/epm/4.1' create symbolic link `/ape/bin/epm' to `/ape/epm/current/bin/epm' create symbolic link `/ape/bin/epminstall' to `/ape/epm/current/bin/epminstall' create symbolic link `/ape/bin/mkepmlist' to `/ape/epm/current/bin/mkepmlist' create symbolic link `/ape/bin/link_to_current.epm-4.1.sh' to `/ape/epm/4.1/bin/link_to_current.epm-4.1.sh' ** link_to_current.epm-4.1.sh ** complete. [root@localhost:~]$ /ape/_compile/scripts/ape.epm-4.1.sh -r ## ape.epm-4.1.sh # Begining apeEpm from sources in epm-4.1. ## ape.epm-4.1.sh # Target Directory: /ape/epm/4.1 ## ape.epm-4.1.sh # Detected "i386" mode. ## ape.epm-4.1.sh # Lib path (APE_SYS_DETECTED_ARCHITECTURE) is "lib" ## ape.epm-4.1.sh # Using APE_CONF_COMPILE_HOME /ape/_compile ## ape.epm-4.1.sh # Moving to /ape/_compile/src/epm-4.1 ## ape.epm-4.1.sh # Skipping creation of "/ape/_compile/skels/epm-4.1/bin/link_to_current.epm-4.1.sh" as it would overwrite an existing file ## ape.epm-4.1.sh # ape_sys_run_create_ltcurr_script result: 0 ## ape.epm-4.1.sh # Compiling epm list file "/ape/_compile/epm-extra/epm-4.1.list" ## ape.epm-4.1.sh # Executing "/ape/bin/mkepmlist --prefix /ape/epm/4.1/ /ape/epm/4.1/ >>/ape/_compile/epm-extra/epm-4.1.list" ## ape.epm-4.1.sh # Executing "/ape/bin/epm --output-dir /ape/_compile/util/tmp-build -f rpm apeEpm /ape/_compile/epm-extra/epm-4.1.list 2>&1" ## ape.epm-4.1.sh # Moved `/ape/_compile/util/tmp-build/apeEpm-4.1-ap167464-linux-2.6-intel.rpm' -> `/ape/_compile/rpms/centos/el5/i386/apeEpm-4.1-ap167464.el5.ape.i386.rpm'. ## ape.epm-4.1.sh # Executing APE_CONF_POST_RPM_CMD "/ape/_compile/rpms/up-mrepo.sh -v". ## ape.epm-4.1.sh # Nothing to do. Either MREPO is not installed or no processes called mrepoHttpd were found. ## ape.epm-4.1.sh # ape_sys_run_rpm result: 0 ## ape.epm-4.1.sh # Moving back to /ape/_compile [root@localhost:~]$ |
You may have noticed the references to a file called "link_to_current.epm-4.1.sh" landing in "/ape/epm/4.1/bin". Link-to-current scripts are explained fully explained later. For now, let's just run it to complete the EPM installation. You might be able to glean some information from its output.
[root@localhost:~]$ /ape/epm/4.1/bin/link_to_current.epm-4.1.sh ** link_to_current.epm-4.1.sh ** begun for APP "epm" VER "4.1" ** link_to_current.epm-4.1.sh ** CAUTION! Linking version 4.1 to be the current epm version! create symbolic link `/ape/epm/current' to `/ape/epm/4.1' create symbolic link `/ape/bin/epm' to `/ape/epm/current/bin/epm' create symbolic link `/ape/bin/epminstall' to `/ape/epm/current/bin/epminstall' create symbolic link `/ape/bin/mkepmlist' to `/ape/epm/current/bin/mkepmlist' create symbolic link `/ape/bin/link_to_current.epm-4.1.sh' to `/ape/epm/4.1/bin/link_to_current.epm-4.1.sh' ** link_to_current.epm-4.1.sh ** complete. [root@localhost:~]$ |
You are now ready to finalize a complete Ape Base Compile System installation by moving on to the next step and setting up Apache to serve MREPO repositories.
I'm hoping you can accomplish this based upon the instructions for setting up EPM. The process should be the same, except this time you are grabbing the Apache Foundation HTTPD daemon. We aren't recompiling MREPO as that takes some advanced usage (MREPO doesn not support `configure` nor it's "--prefix" parameter).
You'll want to grab the source files from httpd.apache.org and move your source tarball to the ./sourceballs directory. For our example, we grabbed ourselves a copy of "httpd-2.2.8.tar.gz" from a mirror. WE're also asuming you've extracted it to ./src/httpd-2.2.8.
These are the default directories created by installing Ape Base Compile System. You will undoubtably make some of your own as well.
[root@localhost:/ape/_compile]$ tree ./include/ ./include/ |- _blank_build_script-copy_to_create_your_own.sh # actual file copy in ./scripts lis linked to |- ape_config.sh # master configuration |- ape_functions.sh #common functions file |- ape_init.sh # Ape Base Compile System init file |- ape_variables.sh # internal system variables `- scripts_common.sh # the file that your script will eventually execute to compile with [root@localhost:/ape/_compile]$ |This is where the non-user portions of the compile system live. Please fo not edit them unless you really, absolutely, positively know what you are doing. The only exception is the file "ape_config.sh", which you can customize to suit your desired environment. Customizing "ape_config.sh" will alter default configuration values for all scripts.
This is a place for you to store arbitrary scripts which you have set to run using Triggered Commands. For more information about when you can trigger commands, see variables such as APE_CONF_POST_CONFIGURE_CMD in the Ape User Configuration Variables section. If a file named " ${APE_CONF_PACKAGE_NAME}- ${APE_CONF_VERSION}.post-install.sh" is created in the ./post-install directory, it will be assumed to be your intended APE_CONF_POST_RPM_INSTALL_CMD script. It will be included in the disrtibution as " /${APE_CONF_BASE_DEST_PARENT_DIR} /${APE_CONF_DEST_DIR_LABEL} /${APE_CONF_VERSION}/bin/${APE_CONF_PACKAGE_NAME}-${APE_CONF_VERSION}.post-install.sh" but not run at RPM installation until entered as the value of APE_CONF_POST_RPM_INSTALL_CMD.
[root@localhost:/ape/_compile]$ tree -dl ./rpms/ ./rpms/ |- centos # centos rpms | |- el4 | | |- i386 | | |- ia64 | | `- x86_64 | |- el5 | | |- i386 | | |- ia64 | | `- x86_64 | |- gold4 # final production ready rpms | | |- i386 | | |- ia64 | | `- x86_64 | `- gold5 # final production ready rpms | |- i386 | |- ia64 | `- x86_64 |- misc # unknown or undetected *nix brand | |- gold # final production ready rpms | | |- i386 | | |- ia64 | | `- x86_64 | |- i386 | |- ia64 | `- x86_64 |- mrepo-src # mrepo mirror dir if mrepoHttpd is built |- mrepo-www # mrepo web root if mrepoHttpd is built |- up-mrepo.sh # script for updating the local mrepoHttpd install `- redhat -> centos # symlinked back to ./centos [root@localhost:/ape/_compile]$ |
There are three RPM archive directories created by default. They are ./rpms/centos, ./rpms/misc and ./rpms/redhat which is a symbolic link to ./rpms/centos. Additionally, Ape Base Compile System will create a directory tree for your OS or disro if it can be detected, but release subdirectories will not be created for non-RHEL based disributions. If the OS or distro can't be detected, created RPMs will be placed in the ./rpms/misc tree.
Red Hat based distributions will contain subdirectories for the release, such as ./rpms/centos/el4. Though a Fedora tree is not created at installation, it will also contain directories such as ./rpms/fedora/fc7 when needed.
The "./rpms" directory will be kept orderly even if mounted remotely from machines of differing architectures, provided you use mostly default names and locations for produced RPMS. If the mrepohttpd ("./scripts/ape.mrepoHttpd-2.2.8.sh") is built and installed, it will utilized the "./rpms" sirectory as it's source. As you find builds you are happy with, you may want to copy the RPM to your gold repository and have the rest of your non-development architecture feed from that. You can also build an RPM directly to the gold directories by using the -g option for -r when you run your script.
This is your primary working directory. A copy of "_blank_build_script-copy_to_create_your_own.sh" is there waiting for you to create your own compile scripts with. The user scripts will be discussed in detail later.
[root@localhost:/ape/_compile]$ tree ./skels/ ./skels/ |- epm-4.1 # skel directory for the 4.1 version of EPM | `- bin | `- link_to_current.epm-4.1.sh # script to automate linking the 4.1 version to current |- mrepoHttpd # generic mrepoHttpd skel dir - all version will get these | |- LICENSE # duh | |- conf # the apache conf directory | | |- conf.d | | | `- mrepo.conf #settings for mrepo - not a vhost | | |- extra # apache extras | | |- magic #mime file | | |- mime.types # mime types file | | |- mrepoHttpd.conf # minimal httpd.conf | | `- original# original httpd configs for reference | `- etc # local /etc | |- init.d | | `- mrepoHttpd # file usable for chkconfig | |- mrepo.conf # mainly empty mrepo.conf | |- mrepo.conf.d | | `- apelocal.repo.conf # the ape local mrepo repositories | |- sysconfig | `- yum.repos.d | `- apelocal.repo # a yum config for checking the local repo |- mrepoHttpd-2.2.8 # version specific skel - only applied to 2.2.8 | `- bin | `- link_to_current.mrepoHttpd-2.2.8.sh # link build of 2.2.8 to the current version `- link_to_current._template_.sh # template link-to-current file [root@localhost:/ape/_compile]$ |
This may look complicated, but it's not. There's just a lot in example stuff there. The function of the ./skels directory is to store files you wish copied to your installation directory after the make install step.
[root@localhost:/ape/_compile]$ tree -ld ./util ./util |- bin # semi-stable extra utilities |- dev-extra # unstable extra utilities |- docs # documentation | |- images | `- src | |- about | |- conf_vars | |- root_dirs | |- sys_vars | |- tut | `- usage `- tmp-build # a temp directory for Ape Base Compile System to use [root@localhost:/ape/_compile]$ |
There is some neat stuff in here, but most of it is experimental. The ./tmp-buld directory is exactly what it sounds like. A temporary storage space. As such, you may wish to clean it out every so often.
The main thing of interest to you should be the documentation (./doc) subdirectory. The rest of the ./util directory will have to wait to be documented until each part is stable.
This should go without saying, but you need to create a compile script for yourself before you can do anything with this. You need to copy the file name "_blank_build_script-copy_to_create_your_own.sh" to an appripriate name of your choosing. A good rule of thumb is to at least use the application name and version number. Assuming we are preparing to guild "myapp" version 1.0, we would:
[root@localhost:~]$ cd /ape/_compile # for easy access to files [root@localhost:/ape/_compile]$ cp ./scripts/_blank_build_script-copy_to_create_your_own.sh ./scripts/myapp-1.0.sh [root@localhost:/ape/_compile]$ vi ./scripts/myapp-1.0.sh # make our adjustments to the script so we can use it. [root@localhost:/ape/_compile]$ ./scripts/myapp-1.0.sh -a # perform all steps from configure to RPM. [root@localhost:/ape/_compile]$ # If compile failed, curse and go back to the `vi` command above. [root@localhost:/ape/_compile]$ |
Once you have your script created and configured, the usage like the usage below, but with a different script name:
Making a script to package an application is rather easy. Of course, compiling that application may be another story.
The above list is numbered because we will be dealing with some possible complications of these items at the end of this section after we've got the basics.
These tutorials will take you in order from simple to complex.
The most essential part of your compile and packaging efforts is the source code for your application. In our example, we'll be getting ready to compile ESP EPM. To place it, we'll download the source package from http://www.epmhome.org/ to our ./sourceballs directory, extract it to the ./src directory and know what we need to chage if anything in our user script. Please be sure to use the appropriate mirror from http://www.epmhome.org/ to download. We will be dealing with a GZipped Tarball in this example. If you have a zip, rar or other type of package, please substitute the `tar` commands below for their appropriate equivalent and read the documentation for that equivalent.
First, grab the source package.
[root@localhost:~]$ wget --directory-prefix=/ape/_compile/sourceballs 'http://ftp.SOME-MIRROR/pub/epm/4.1/epm-4.1-source.tar.gz' --10:24:06-- http://ftp.SOME-MIRROR/pub/epm/4.1/epm-4.1-source.tar.gz Resolving ftp.SOME-MIRROR... 208.256.256.256 Connecting to ftp.SOME-MIRROR|208.256.256.256|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 509728 (498K) [application/x-gzip] Saving to: `/ape/_compile/sourceballs/epm-4.1-source.tar.gz' 100%[=================================================================================================================================================>] 509,728 984K/s in 0.5s 10:24:07 (984 KB/s) - `/ape/_compile/sourceballs/epm-4.1-source.tar.gz' saved [509728/509728] [root@localhost:~]$ |
Now we extract it to /ape/_compile/src/, but first we check to see that everything in the source package is inside of a directory. In this case, the directory is named in the style of "app-version" as Ape Base Compile System will expect it: ("epm-4.1"). If the contents of the source package are at the root of the package, you may wish to alter "--directory /ape/_compile/src" to something like "--directory /ape/_compile/src/app-version" in the second command below.
[root@localhost:~]$ tar --gzip --list --file /ape/_compile/sourceballs/epm-4.1-source.tar.gz | head -n 10 epm-4.1/ epm-4.1/doc/ epm-4.1/doc/3-packaging.html epm-4.1/doc/epmlogo.tif epm-4.1/doc/epm.man epm-4.1/doc/d-relnotes.html epm-4.1/doc/mkepmlist.man epm-4.1/doc/c-reference.html epm-4.1/doc/epminstall.man epm-4.1/doc/Makefile.in [root@localhost:~]$ tar --gzip --extract --directory /ape/_compile/src --file /ape/_compile/sourceballs/epm-4.1-source.tar.gz [root@localhost:~]$ ls -ld /ape/_compile/src/epm-4.1 drwxrwxr-x 5 1110 games 4096 Apr 10 2007 /ape/_compile/src/epm-4.1 [root@localhost:~]$ |
In this case, you'll notice the odd owner and group of /ape/_compile/src/epm-4.1 in the final directory listing (`ls`). These were the permissions from the extracted archive. We shoudl fix them before going on.
[root@localhost:~]$ chown -R root:root /ape/_compile/src/epm-4.1 [root@localhost:~]$ ls -ld /ape/_compile/src/epm-4.1 drwxrwxr-x 5 root root 4096 Apr 10 2007 /ape/_compile/src/epm-4.1 [root@localhost:~]$ |
If you wish to further organize the ./src directory, you can do so. Perhaps you'd like to keep all of your MySQL sources together. In such a case you would create the directory in ./src and adjust your APE_CONF_SOURCE_DIR_NAME variable accordingly in your user script.
(this section has yet to be written)
The most commonly useful of thes variables are already in the template "_blank_build_script-copy_to_create_your_own.sh" for use in creating your own scripts. There are several here that are not normally included in that template which may be useful to you for more complicated tasks. Processing a compile task begins as these variables are initialized where possible in "./include/ape_config.sh" and the settings in your coopy of "_blank_build_script-copy_to_create_your_own.sh" overwrites the values where needed. Finally, "./include/scripts_common.sh" performs any needed validation before starting the requested task.
The Ape Base Compile System internal system variables have yet to be documented for the end-user.