summaryrefslogtreecommitdiffstats
path: root/pki/ipa/meta/build_ipa
diff options
context:
space:
mode:
Diffstat (limited to 'pki/ipa/meta/build_ipa')
-rwxr-xr-xpki/ipa/meta/build_ipa78
1 files changed, 78 insertions, 0 deletions
diff --git a/pki/ipa/meta/build_ipa b/pki/ipa/meta/build_ipa
new file mode 100755
index 000000000..585c3e0bd
--- /dev/null
+++ b/pki/ipa/meta/build_ipa
@@ -0,0 +1,78 @@
+#!/bin/bash
+# BEGIN COPYRIGHT BLOCK
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# (C) 2010 Red Hat, Inc.
+# All rights reserved.
+# END COPYRIGHT BLOCK
+
+# Always switch into the base directory of this
+# shell script prior to executing it so that all
+# of its output is written to this directory
+cd `dirname $0`
+
+# Retrieve the directory name housing this component
+PWD=`pwd`
+
+# Establish release root for 'meta' packages
+RELEASE_ROOT="${PWD}/../../../release/pki/meta"
+
+# Specify 'meta' functions
+clean_release_root()
+{
+ printf "Removing 'meta' release root . . . "
+ rm -rf ${RELEASE_ROOT}
+ printf "done.\n"
+}
+
+create_RPM_build_directories()
+{
+ printf "Creating 'meta' RPM build directories . . . "
+ mkdir -p ${RELEASE_ROOT}
+ mkdir -p ${RELEASE_ROOT}/BUILD
+ mkdir -p ${RELEASE_ROOT}/BUILDROOT
+ mkdir -p ${RELEASE_ROOT}/RPMS
+ mkdir -p ${RELEASE_ROOT}/SOURCES
+ mkdir -p ${RELEASE_ROOT}/SPECS
+ mkdir -p ${RELEASE_ROOT}/SRPMS
+ printf "done.\n"
+}
+
+build_specified_meta_package()
+{
+ package=$1
+ spec_file="${package}.spec"
+
+ printf "BEGIN: Building 'meta' package called '${package}' . . .\n"
+ cp ${spec_file} ${RELEASE_ROOT}/SPECS
+ rpmbuild --define "_topdir ${RELEASE_ROOT}" -ba --clean ${RELEASE_ROOT}/SPECS/${spec_file}
+ printf "END: Building 'meta' package called ${package}'.\n"
+}
+
+destroy_RPM_build_directories()
+{
+ printf "Destroying 'meta' RPM build directories . . . "
+ rm -rf ${RELEASE_ROOT}/BUILD
+ rm -rf ${RELEASE_ROOT}/BUILDROOT
+ rm -rf ${RELEASE_ROOT}/SOURCES
+ rm -rf ${RELEASE_ROOT}/SPECS
+ printf "done.\n"
+}
+
+# Build the 'meta' package called 'ipa-pki'
+clean_release_root
+create_RPM_build_directories
+build_specified_meta_package ipa-pki
+destroy_RPM_build_directories
+