summaryrefslogtreecommitdiffstats
path: root/pki/ipa/ca-ui/build_ipa
diff options
context:
space:
mode:
Diffstat (limited to 'pki/ipa/ca-ui/build_ipa')
-rwxr-xr-xpki/ipa/ca-ui/build_ipa82
1 files changed, 82 insertions, 0 deletions
diff --git a/pki/ipa/ca-ui/build_ipa b/pki/ipa/ca-ui/build_ipa
new file mode 100755
index 000000000..ce06bc191
--- /dev/null
+++ b/pki/ipa/ca-ui/build_ipa
@@ -0,0 +1,82 @@
+#!/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) 2007 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`
+
+# Set IPA component-specific environment variables
+IPA_BUILD_SCRIPT=`basename $0`
+export IPA_BUILD_SCRIPT
+IPA_COMPONENT=`basename ${PWD}`
+export IPA_COMPONENT
+IPA_SPECFILE="ipa-pki-ca-ui.spec"
+export IPA_SPECFILE
+
+# Set PKI 'ant' environment variables (originally obtained from specfile)
+PKI_PRODUCT_UI_FLAVOR_PREFIX="ipa"
+export PKI_PRODUCT_UI_FLAVOR_PREFIX
+PKI_PRODUCT_PREFIX="pki"
+export PKI_PRODUCT_PREFIX
+PKI_PRODUCT="ca-ui"
+export PKI_PRODUCT
+PKI_VERSION="9.0.1"
+export PKI_VERSION
+
+# Set IPA helper variables
+IPA_COMPONENT_NAME=${PKI_PRODUCT}
+export IPA_COMPONENT_NAME
+IPA_WGET_URL=http://cvs.fedora.redhat.com/viewvc
+export IPA_WGET_URL
+
+# Obtain '${IPA_SPECFILE}' as necessary
+if [ "$1" = "refresh" ]; then
+ if [ -f "${IPA_SPECFILE}" ]; then
+ printf "Removing '${IPA_SPECFILE}' . . . "
+ rm -rf ${IPA_SPECFILE}
+ printf "done.\n"
+ fi
+ shift
+fi
+if [ ! -f "${IPA_SPECFILE}" ]; then
+ # Check for Fedora Operating System
+ if [ ! -f /etc/fedora-release ]; then
+ printf "'${IPA_COMPONENT_NAME}' ONLY builds on Fedora!\n"
+ exit 255
+ fi
+ # Obtain Fedora Operating System Version
+ FEDORA_VERSION="F-`cat /etc/fedora-release | awk '{print $3}'`"
+ export FEDORA_VERSION
+ # Retrieve '${IPA_SPECFILE}' from Koji
+ printf "Fetching '${IPA_SPECFILE}' for '${FEDORA_VERSION}' . . .\n"
+ wget -O ${IPA_SPECFILE} ${IPA_WGET_URL}/${FEDORA_VERSION}/${IPA_COMPONENT_NAME}/${IPA_SPECFILE}?view=co
+ if [ ! -s "${IPA_SPECFILE}" ]; then
+ printf "Failed to fetch '${IPA_SPECFILE}' for '${FEDORA_VERSION}'!\n"
+ rm -rf ${IPA_SPECFILE}
+ exit 255
+ fi
+fi
+
+# Invoke the shared IPA PKI build script
+config-ext/build_ipa_pki $@
+