| 1 | #!/bin/sh
 | 
|---|
| 2 | 
 | 
|---|
| 3 | #
 | 
|---|
| 4 | # rpmbuild-bot-env.sh: RPM Build Bot distribtuion build environment example.
 | 
|---|
| 5 | #
 | 
|---|
| 6 | # Author: Dmitriy Kuminov <coding@dmik.org>
 | 
|---|
| 7 | #
 | 
|---|
| 8 | # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 | 
|---|
| 9 | # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 | 
|---|
| 10 | #
 | 
|---|
| 11 | # Synopsis
 | 
|---|
| 12 | # --------
 | 
|---|
| 13 | #
 | 
|---|
| 14 | # This script sets up the environment necessary to build RPM packages with
 | 
|---|
| 15 | # rpmbuild-bot.sh.
 | 
|---|
| 16 | #
 | 
|---|
| 17 | # NOTE: The values in this script are global and distribution channel specific
 | 
|---|
| 18 | # settings (rather than site- or user-specific). They are only intended to be
 | 
|---|
| 19 | # changed when the distribution rules change. All user-configurable
 | 
|---|
| 20 | # site-specific options are located in a separate script named
 | 
|---|
| 21 | # rpmbuild-bot-local.sh (which is executed when present in $HOME).
 | 
|---|
| 22 | #
 | 
|---|
| 23 | 
 | 
|---|
| 24 | #
 | 
|---|
| 25 | # Load local settings (if any).
 | 
|---|
| 26 | #
 | 
|---|
| 27 | 
 | 
|---|
| 28 | local_env="${0%.sh}"
 | 
|---|
| 29 | local_env="${local_env##*/}"
 | 
|---|
| 30 | local_env="$HOME/${local_env%-env}-local.sh"
 | 
|---|
| 31 | [ -f "$local_env" ] && . "$local_env"
 | 
|---|
| 32 | 
 | 
|---|
| 33 | #
 | 
|---|
| 34 | # Default POSIX shell environment.
 | 
|---|
| 35 | #
 | 
|---|
| 36 | 
 | 
|---|
| 37 | # Use English messages.
 | 
|---|
| 38 | export LANG=en_US
 | 
|---|
| 39 | 
 | 
|---|
| 40 | # Use RPM ash.
 | 
|---|
| 41 | export SHELL=`rpm --eval '%_bindir'`/sh.exe     # general shell
 | 
|---|
| 42 | export EMXSHELL=$SHELL                          # LIBC shell
 | 
|---|
| 43 | export CONFIG_SHELL=$SHELL                      # configure shell
 | 
|---|
| 44 | export MAKESHELL=$SHELL                         # make shell
 | 
|---|
| 45 | export EXECSHELL=$SHELL                         # perl shell
 | 
|---|
| 46 | 
 | 
|---|
| 47 | # Reset common vars (for consistency).
 | 
|---|
| 48 | export CFLAGS=
 | 
|---|
| 49 | export CXXFLAGS=
 | 
|---|
| 50 | export FFLAGS=
 | 
|---|
| 51 | export LDFLAGS=
 | 
|---|
| 52 | 
 | 
|---|
| 53 | #
 | 
|---|
| 54 | # Default rpmbuild-bot conviguration.
 | 
|---|
| 55 | #
 | 
|---|
| 56 | 
 | 
|---|
| 57 | # List of architectures to build (the last one is used for the ZIP
 | 
|---|
| 58 | # package and for local test builds).
 | 
|---|
| 59 | RPMBUILD_BOT_ARCH_LIST="pentium4 i686"
 | 
|---|
| 60 | 
 | 
|---|
| 61 | # Overrides of RPM arch list for specific packages.
 | 
|---|
| 62 | # Note that dash symbols in package names should be replaced with underscores
 | 
|---|
| 63 | # in the variables below (e.g. use RPMBUILD_BOT_ARCH_LIST_foo_bar for the
 | 
|---|
| 64 | # foo-bar package).
 | 
|---|
| 65 | RPMBUILD_BOT_ARCH_LIST_libc="i686" # Binary build -> no other archs.
 | 
|---|
| 66 | RPMBUILD_BOT_ARCH_LIST_kLIBCum="i686" # Binary build -> no other archs.
 | 
|---|
| 67 | 
 | 
|---|
| 68 | # Legacy DLLs for specific packages. Each RPM from the list (format is
 | 
|---|
| 69 | # "ABI|NAME|VERSION-RELEASE|[FILEMASK]|[ARCH]") for each target platform is
 | 
|---|
| 70 | # downloaded from a repository specified in RPMBUILD_BOT_UPLOAD_REPO_STABLE
 | 
|---|
| 71 | # and scanned for FILEMASK files (*.dll by default). These files are then
 | 
|---|
| 72 | # extracted to a directory called RPM_SOURCE_DIR/PACKAGE-legacy (preserving the
 | 
|---|
| 73 | # original directory tree) and, if PACKAGE.spec contains a macro named
 | 
|---|
| 74 | # %legacy_runtime_packages, they are later placed to a sub-package called
 | 
|---|
| 75 | # `legacy-ABI` when rpmbuild is run. If ARCH is specified, this platform's
 | 
|---|
| 76 | # legacy package will be used for all target platforms.
 | 
|---|
| 77 | RPMBUILD_BOT_LEGACY_libvpx="2|libvpx|1.4.0-2"
 | 
|---|
| 78 | 
 | 
|---|
| 79 | # Basic RPM repository layout for this distribution channel.
 | 
|---|
| 80 | RPMBUILD_BOT_UPLOAD_REPO_LAYOUT_rpm="\$base/i386/\$arch"
 | 
|---|
| 81 | RPMBUILD_BOT_UPLOAD_REPO_LAYOUT_srpm="\$base/i386/SRPMS"
 | 
|---|
| 82 | RPMBUILD_BOT_UPLOAD_REPO_LAYOUT_zip="\$base/zip"
 | 
|---|
| 83 | 
 | 
|---|
| 84 | # List of repositories for "upload" command (the first one is the default).
 | 
|---|
| 85 | RPMBUILD_BOT_UPLOAD_REPO_LIST="exp rel"
 | 
|---|
| 86 | 
 | 
|---|
| 87 | # Name of the stable repository (must be present in the above list).
 | 
|---|
| 88 | RPMBUILD_BOT_UPLOAD_REPO_STABLE="rel"
 | 
|---|
| 89 | 
 | 
|---|
| 90 | # Sanity checks.
 | 
|---|
| 91 | check_dir_var "RPM_NETLABS_ORG_DIR"
 | 
|---|
| 92 | 
 | 
|---|
| 93 | # Directory in the local filesystem for each repository (usually mapped
 | 
|---|
| 94 | # to a WEBAV resource).
 | 
|---|
| 95 | RPMBUILD_BOT_UPLOAD_exp_DIR="$RPM_NETLABS_ORG_DIR/experimental/00"
 | 
|---|
| 96 | RPMBUILD_BOT_UPLOAD_rel_DIR="$RPM_NETLABS_ORG_DIR/release/00"
 | 
|---|