diff options
author | Endi Sukma Dewata <edewata@redhat.com> | 2012-03-24 02:27:47 -0500 |
---|---|---|
committer | Endi Sukma Dewata <edewata@redhat.com> | 2012-03-26 11:43:54 -0500 |
commit | 621d9e5c413e561293d7484b93882d985b3fe15f (patch) | |
tree | 638f3d75761c121d9a8fb50b52a12a6686c5ac5c /scripts/compose_pki_tps_packages | |
parent | 40d3643b8d91886bf210aa27f711731c81a11e49 (diff) | |
download | pki-621d9e5c413e561293d7484b93882d985b3fe15f.tar.gz pki-621d9e5c413e561293d7484b93882d985b3fe15f.tar.xz pki-621d9e5c413e561293d7484b93882d985b3fe15f.zip |
Removed unnecessary pki folder.
Previously the source code was located inside a pki folder.
This folder was created during svn migration and is no longer
needed. This folder has now been removed and the contents have
been moved up one level.
Ticket #131
Diffstat (limited to 'scripts/compose_pki_tps_packages')
-rwxr-xr-x | scripts/compose_pki_tps_packages | 194 |
1 files changed, 194 insertions, 0 deletions
diff --git a/scripts/compose_pki_tps_packages b/scripts/compose_pki_tps_packages new file mode 100755 index 000000000..eb7738641 --- /dev/null +++ b/scripts/compose_pki_tps_packages @@ -0,0 +1,194 @@ +#!/bin/bash +# BEGIN COPYRIGHT BLOCK +# (C) 2010 Red Hat, Inc. +# All rights reserved. +# END COPYRIGHT BLOCK + +## +## Include common 'compose' functions +## + +COMPOSE_PWD=`dirname $0` +source ${COMPOSE_PWD}/compose_functions + + +## Always switch into the base directory three levels +## above this shell script prior to executing it so +## that all of its output is written to this directory + +cd `dirname $0`/../.. + + +## +## Retrieve the name of this base directory +## + +PKI_PWD=`pwd` + + +## +## Establish the 'pki-tps' name and version information +## + +PKI_TPS="pki-tps" +PKI_TPS_VERSION="10.0.0.a1" + + +## +## Establish the SOURCE files/directories of the 'pki-tps' source directory +## + +PKI_SPECS_FILE="${PKI_DIR}/specs/${PKI_TPS}.spec" +PKI_COMPONENT_LIST="tps" + + +## +## Establish the TARGET files/directories of the 'pki-tps' source/spec files +## + +PKI_PACKAGES="${PKI_PWD}/packages" +PKI_TPS_BUILD_DIR="${PKI_PACKAGES}/BUILD" +PKI_TPS_RPMS_DIR="${PKI_PACKAGES}/RPMS" +PKI_TPS_SOURCES_DIR="${PKI_PACKAGES}/SOURCES" +PKI_TPS_SPECS_DIR="${PKI_PACKAGES}/SPECS" +PKI_TPS_SRPMS_DIR="${PKI_PACKAGES}/SRPMS" + +PKI_TPS_TARBALL="${PKI_TPS}-${PKI_TPS_VERSION}.tar.gz" +PKI_TPS_SPEC_FILE="${PKI_TPS_SPECS_DIR}/${PKI_TPS}.spec" +PKI_TPS_PACKAGE_SCRIPT="${PKI_PACKAGES}/package_${PKI_TPS}" +PKI_TPS_PACKAGE_COMMAND="${RPMBUILD_CMD} SPECS/${PKI_TPS}.spec" + +PKI_TPS_STAGING_DIR="${PKI_PACKAGES}/staging" +PKI_TPS_DIR="${PKI_TPS_STAGING_DIR}/${PKI_TPS}-${PKI_TPS_VERSION}" +PKI_TPS_BASE_DIR="${PKI_TPS_DIR}/base" + + +## +## Always create a top-level 'packages' directory +## + +mkdir -p ${PKI_PACKAGES} + + +## +## Always create 'pki-tps' package directories +## + +mkdir -p ${PKI_TPS_BUILD_DIR} +mkdir -p ${PKI_TPS_RPMS_DIR} +mkdir -p ${PKI_TPS_SOURCES_DIR} +mkdir -p ${PKI_TPS_SPECS_DIR} +mkdir -p ${PKI_TPS_SRPMS_DIR} + + +## +## Always start with new 'pki-tps' package files +## + +rm -rf ${PKI_TPS_BUILD_DIR}/${PKI_TPS}-${PKI_TPS_VERSION} +rm -f ${PKI_TPS_RPMS_DIR}/${PKI_TPS}-${PKI_TPS_VERSION}*.rpm +rm -f ${PKI_TPS_SOURCES_DIR}/${PKI_TPS_TARBALL} +rm -f ${PKI_TPS_SPEC_FILE} +rm -f ${PKI_TPS_SRPMS_DIR}/${PKI_TPS}-${PKI_TPS_VERSION}*.rpm + + +## +## Copy a new 'pki-tps' spec file from the +## current contents of the PKI working repository +## + +cp -p ${PKI_SPECS_FILE} ${PKI_TPS_SPECS_DIR} + + +## +## If specified, copy all Patches from the spec file URL to SOURCES +## + +if [ ${FETCH_PATCH_FILES} -eq 1 ] ; then + Fetch_Patch_Files ${PKI_SPECS_FILE} ${PKI_TPS_SOURCES_DIR} +fi + + +## +## Copy the specified Source Tarball from the spec file URL to SOURCES, or +## Generate a fresh Source Tarball from the local source +## + +if [ ${FETCH_SOURCE_TARBALL} -eq 1 ] ; then + Fetch_Source_Tarball ${PKI_SPECS_FILE} ${PKI_TPS_SOURCES_DIR} +else + ## + ## Always start with a new 'pki-tps' staging directory + ## + + rm -rf ${PKI_TPS_STAGING_DIR} + + + ## + ## To generate the 'pki-tps' tarball, construct a staging area + ## consisting of the 'pki-tps' source components from the + ## current contents of the PKI working repository + ## + + mkdir -p ${PKI_TPS_DIR} + cd ${PKI_DIR} + for file in "${PKI_FILE_LIST}" ; + do + cp -p ${file} ${PKI_TPS_DIR} + done + find ${PKI_CMAKE_DIR} \ + -name .svn -prune -o \ + -name *.swp -prune -o \ + -print | cpio -pdum ${PKI_TPS_DIR} > /dev/null 2>&1 + cd - > /dev/null 2>&1 + + mkdir -p ${PKI_TPS_BASE_DIR} + cd ${PKI_BASE_DIR} + cp -p ${PKI_BASE_MANIFEST} ${PKI_TPS_BASE_DIR} + for component in "${PKI_COMPONENT_LIST}" ; + do + find ${component} \ + -name .svn -prune -o \ + -name *.swp -prune -o \ + -print | cpio -pdum ${PKI_TPS_BASE_DIR} > /dev/null 2>&1 + done + cd - > /dev/null 2>&1 + + + ## + ## Create the 'pki-tps' tarball + ## + + mkdir -p ${PKI_TPS_SOURCES_DIR} + cd ${PKI_TPS_STAGING_DIR} + gtar -zcvf ${PKI_TPS_TARBALL} \ + "${PKI_TPS}-${PKI_TPS_VERSION}" > /dev/null 2>&1 + mv ${PKI_TPS_TARBALL} ${PKI_TPS_SOURCES_DIR} + cd - > /dev/null 2>&1 + + + ## + ## Always remove the PKI staging area + ## + + rm -rf ${PKI_TPS_STAGING_DIR} +fi + + +## +## Always generate a fresh 'pki-tps' package script +## + +rm -rf ${PKI_TPS_PACKAGE_SCRIPT} +printf "#!/bin/bash\n\n" > ${PKI_TPS_PACKAGE_SCRIPT} +printf "${PKI_TPS_PACKAGE_COMMAND}\n\n" >> ${PKI_TPS_PACKAGE_SCRIPT} +chmod 775 ${PKI_TPS_PACKAGE_SCRIPT} + + +## +## Automatically invoke RPM/SRPM creation +## + +cd ${PKI_PACKAGES} ; +bash ./package_${PKI_TPS} | tee package_${PKI_TPS}.log 2>&1 + |