diff options
author | mharmsen <mharmsen@c9f7a03b-bd48-0410-a16d-cbbf54688b0b> | 2011-01-12 01:54:34 +0000 |
---|---|---|
committer | mharmsen <mharmsen@c9f7a03b-bd48-0410-a16d-cbbf54688b0b> | 2011-01-12 01:54:34 +0000 |
commit | a3f79f73e3a3ab5fe2403db86e4f9be3b78e20f4 (patch) | |
tree | aee9261a291289344cee99a4706679b2cc66e4a8 /pki/scripts | |
parent | 57d529cce8f005d2ca98681f4e2df1008ef6130d (diff) | |
download | pki-a3f79f73e3a3ab5fe2403db86e4f9be3b78e20f4.tar.gz pki-a3f79f73e3a3ab5fe2403db86e4f9be3b78e20f4.tar.xz pki-a3f79f73e3a3ab5fe2403db86e4f9be3b78e20f4.zip |
Bugzilla Bug #665777 - cmake based builds should have option to produce tar and SRPM only
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/trunk@1724 c9f7a03b-bd48-0410-a16d-cbbf54688b0b
Diffstat (limited to 'pki/scripts')
-rwxr-xr-x | pki/scripts/compose_dogtag_pki_theme_packages | 10 | ||||
-rw-r--r-- | pki/scripts/compose_functions | 74 | ||||
-rwxr-xr-x | pki/scripts/compose_ipa_pki_theme_packages | 10 | ||||
-rwxr-xr-x | pki/scripts/compose_pki_console_packages | 10 | ||||
-rwxr-xr-x | pki/scripts/compose_pki_core_packages | 10 | ||||
-rwxr-xr-x | pki/scripts/compose_pki_kra_packages | 10 | ||||
-rwxr-xr-x | pki/scripts/compose_pki_migrate_packages | 10 | ||||
-rwxr-xr-x | pki/scripts/compose_pki_ocsp_packages | 10 | ||||
-rwxr-xr-x | pki/scripts/compose_pki_ra_packages | 10 | ||||
-rwxr-xr-x | pki/scripts/compose_pki_tks_packages | 10 | ||||
-rwxr-xr-x | pki/scripts/compose_pki_tps_packages | 10 |
11 files changed, 164 insertions, 10 deletions
diff --git a/pki/scripts/compose_dogtag_pki_theme_packages b/pki/scripts/compose_dogtag_pki_theme_packages index e792f530f..f4ae0c756 100755 --- a/pki/scripts/compose_dogtag_pki_theme_packages +++ b/pki/scripts/compose_dogtag_pki_theme_packages @@ -4,6 +4,14 @@ # 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 @@ -53,7 +61,7 @@ DOGTAG_PKI_THEME_SRPMS_DIR="${PKI_PACKAGES}/SRPMS" DOGTAG_PKI_THEME_TARBALL="${DOGTAG_PKI_THEME}-${DOGTAG_PKI_THEME_VERSION}.tar.gz" DOGTAG_PKI_THEME_SPEC_FILE="${DOGTAG_PKI_THEME_SPECS_DIR}/${DOGTAG_PKI_THEME}.spec" DOGTAG_PKI_THEME_PACKAGE_SCRIPT="${PKI_PACKAGES}/package_${DOGTAG_PKI_THEME}" -DOGTAG_PKI_THEME_PACKAGE_COMMAND="rpmbuild --define \"_topdir \`pwd\`\" -ba SPECS/${DOGTAG_PKI_THEME}.spec" +DOGTAG_PKI_THEME_PACKAGE_COMMAND="${RPMBUILD_CMD} SPECS/${DOGTAG_PKI_THEME}.spec" DOGTAG_PKI_THEME_STAGING_DIR="${PKI_PACKAGES}/staging" DOGTAG_PKI_THEME_DIR="${DOGTAG_PKI_THEME_STAGING_DIR}/${DOGTAG_PKI_THEME}-${DOGTAG_PKI_THEME_VERSION}" diff --git a/pki/scripts/compose_functions b/pki/scripts/compose_functions new file mode 100644 index 000000000..5bd54ebb0 --- /dev/null +++ b/pki/scripts/compose_functions @@ -0,0 +1,74 @@ +## +## Obtain various platform information +## + +OS=`uname` +if [ "${OS}" != "Linux" ] ; then + printf "'$0' is ONLY available on '${OS}'!\n" + exit 255 +fi + +PLATFORM=`uname -p` +if [ "${PLATFORM}" = "i686" ] ; then + ARCHITECTURE="32-bit" +elif [ "${PLATFORM}" = "x86_64" ] ; then + ARCHITECTURE="64-bit" +else + printf "'$0' is ONLY available on 'i686' or 'x86_64' platforms!\n" + exit 255 +fi + +if [ -f "/etc/redhat-release" ] ; then + DISTRIBUTION=`cat /etc/redhat-release | cut -c1-7` + DIST_VERSION=`cat /etc/redhat-release | tr -d [:alpha:][:blank:][\(\)]` + if [ "${DISTRIBUTION}" = "Fedora " ] ; then + MESSAGE="[built for ${ARCHITECTURE} Fedora ${DIST_VERSION}]" + elif [ "${DISTRIBUTION}" = "Red Hat" ] ; then + MESSAGE="[built for ${ARCHITECTURE} Red Hat ${DIST_VERSION}]" + else + printf "'$0' is ONLY available on 'Fedora' or 'Red Hat' " + printf "distributions!\n" + exit 255 + fi +else + printf "'$0' is ONLY available on 'Fedora' or 'Red Hat' distributions!\n" + exit 255 +fi + + +## +## Usage statement +## + +Usage() +{ + printf "\n" + printf "Usage: $0 <target>\n\n" + printf " where <target> is one of the following:\n\n" + printf " srpm - produces tarball, spec, and SRPM\n" + printf " [suitable for use by 'mock']\n\n" + printf " rpms - produces tarball, spec, SRPM, and RPM(S)\n" + printf " ${MESSAGE}\n\n" +} + + +## +## Check for command line argument validity +## + +if [ $# -ne 1 ] ; then + Usage + exit 255 +fi + +if [ $1 = "srpm" ] ; then + RPMBUILD_CMD="rpmbuild --define \"_topdir \`pwd\`\" -bs" +elif [ $1 = "rpms" ] ; then + RPMBUILD_CMD="rpmbuild --define \"_topdir \`pwd\`\" -ba" +else + Usage + exit 255 +fi +export RPMBUILD_CMD + + diff --git a/pki/scripts/compose_ipa_pki_theme_packages b/pki/scripts/compose_ipa_pki_theme_packages index 675bd9067..ae2c21506 100755 --- a/pki/scripts/compose_ipa_pki_theme_packages +++ b/pki/scripts/compose_ipa_pki_theme_packages @@ -4,6 +4,14 @@ # 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 @@ -53,7 +61,7 @@ IPA_PKI_THEME_SRPMS_DIR="${PKI_PACKAGES}/SRPMS" IPA_PKI_THEME_TARBALL="${IPA_PKI_THEME}-${IPA_PKI_THEME_VERSION}.tar.gz" IPA_PKI_THEME_SPEC_FILE="${IPA_PKI_THEME_SPECS_DIR}/${IPA_PKI_THEME}.spec" IPA_PKI_THEME_PACKAGE_SCRIPT="${PKI_PACKAGES}/package_${IPA_PKI_THEME}" -IPA_PKI_THEME_PACKAGE_COMMAND="rpmbuild --define \"_topdir \`pwd\`\" -ba SPECS/${IPA_PKI_THEME}.spec" +IPA_PKI_THEME_PACKAGE_COMMAND="${RPMBUILD_CMD} SPECS/${IPA_PKI_THEME}.spec" IPA_PKI_THEME_STAGING_DIR="${PKI_PACKAGES}/staging" IPA_PKI_THEME_DIR="${IPA_PKI_THEME_STAGING_DIR}/${IPA_PKI_THEME}-${IPA_PKI_THEME_VERSION}" diff --git a/pki/scripts/compose_pki_console_packages b/pki/scripts/compose_pki_console_packages index 0effd5798..efd6a385d 100755 --- a/pki/scripts/compose_pki_console_packages +++ b/pki/scripts/compose_pki_console_packages @@ -4,6 +4,14 @@ # 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 @@ -53,7 +61,7 @@ PKI_CONSOLE_SRPMS_DIR="${PKI_PACKAGES}/SRPMS" PKI_CONSOLE_TARBALL="${PKI_CONSOLE}-${PKI_CONSOLE_VERSION}.tar.gz" PKI_CONSOLE_SPEC_FILE="${PKI_CONSOLE_SPECS_DIR}/${PKI_CONSOLE}.spec" PKI_CONSOLE_PACKAGE_SCRIPT="${PKI_PACKAGES}/package_${PKI_CONSOLE}" -PKI_CONSOLE_PACKAGE_COMMAND="rpmbuild --define \"_topdir \`pwd\`\" -ba SPECS/${PKI_CONSOLE}.spec" +PKI_CONSOLE_PACKAGE_COMMAND="${RPMBUILD_CMD} SPECS/${PKI_CONSOLE}.spec" PKI_CONSOLE_STAGING_DIR="${PKI_PACKAGES}/staging" PKI_CONSOLE_DIR="${PKI_CONSOLE_STAGING_DIR}/${PKI_CONSOLE}-${PKI_CONSOLE_VERSION}" diff --git a/pki/scripts/compose_pki_core_packages b/pki/scripts/compose_pki_core_packages index cadc18e6b..3837d3b94 100755 --- a/pki/scripts/compose_pki_core_packages +++ b/pki/scripts/compose_pki_core_packages @@ -4,6 +4,14 @@ # 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 @@ -53,7 +61,7 @@ PKI_CORE_SRPMS_DIR="${PKI_PACKAGES}/SRPMS" PKI_CORE_TARBALL="${PKI_CORE}-${PKI_CORE_VERSION}.tar.gz" PKI_CORE_SPEC_FILE="${PKI_CORE_SPECS_DIR}/${PKI_CORE}.spec" PKI_CORE_PACKAGE_SCRIPT="${PKI_PACKAGES}/package_${PKI_CORE}" -PKI_CORE_PACKAGE_COMMAND="rpmbuild --define \"_topdir \`pwd\`\" -ba SPECS/${PKI_CORE}.spec" +PKI_CORE_PACKAGE_COMMAND="${RPMBUILD_CMD} SPECS/${PKI_CORE}.spec" PKI_CORE_STAGING_DIR="${PKI_PACKAGES}/staging" PKI_CORE_DIR="${PKI_CORE_STAGING_DIR}/${PKI_CORE}-${PKI_CORE_VERSION}" diff --git a/pki/scripts/compose_pki_kra_packages b/pki/scripts/compose_pki_kra_packages index 1a2cabaaa..a1cd25f01 100755 --- a/pki/scripts/compose_pki_kra_packages +++ b/pki/scripts/compose_pki_kra_packages @@ -4,6 +4,14 @@ # 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 @@ -53,7 +61,7 @@ PKI_KRA_SRPMS_DIR="${PKI_PACKAGES}/SRPMS" PKI_KRA_TARBALL="${PKI_KRA}-${PKI_KRA_VERSION}.tar.gz" PKI_KRA_SPEC_FILE="${PKI_KRA_SPECS_DIR}/${PKI_KRA}.spec" PKI_KRA_PACKAGE_SCRIPT="${PKI_PACKAGES}/package_${PKI_KRA}" -PKI_KRA_PACKAGE_COMMAND="rpmbuild --define \"_topdir \`pwd\`\" -ba SPECS/${PKI_KRA}.spec" +PKI_KRA_PACKAGE_COMMAND="${RPMBUILD_CMD} SPECS/${PKI_KRA}.spec" PKI_KRA_STAGING_DIR="${PKI_PACKAGES}/staging" PKI_KRA_DIR="${PKI_KRA_STAGING_DIR}/${PKI_KRA}-${PKI_KRA_VERSION}" diff --git a/pki/scripts/compose_pki_migrate_packages b/pki/scripts/compose_pki_migrate_packages index 40c8ce7fd..befca54f5 100755 --- a/pki/scripts/compose_pki_migrate_packages +++ b/pki/scripts/compose_pki_migrate_packages @@ -4,6 +4,14 @@ # 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 @@ -53,7 +61,7 @@ PKI_MIGRATE_SRPMS_DIR="${PKI_PACKAGES}/SRPMS" PKI_MIGRATE_TARBALL="${PKI_MIGRATE}-${PKI_MIGRATE_VERSION}.tar.gz" PKI_MIGRATE_SPEC_FILE="${PKI_MIGRATE_SPECS_DIR}/${PKI_MIGRATE}.spec" PKI_MIGRATE_PACKAGE_SCRIPT="${PKI_PACKAGES}/package_${PKI_MIGRATE}" -PKI_MIGRATE_PACKAGE_COMMAND="rpmbuild --define \"_topdir \`pwd\`\" -ba SPECS/${PKI_MIGRATE}.spec" +PKI_MIGRATE_PACKAGE_COMMAND="${RPMBUILD_CMD} SPECS/${PKI_MIGRATE}.spec" PKI_MIGRATE_STAGING_DIR="${PKI_PACKAGES}/staging" PKI_MIGRATE_DIR="${PKI_MIGRATE_STAGING_DIR}/${PKI_MIGRATE}-${PKI_MIGRATE_VERSION}" diff --git a/pki/scripts/compose_pki_ocsp_packages b/pki/scripts/compose_pki_ocsp_packages index 24b26362d..8ebf512be 100755 --- a/pki/scripts/compose_pki_ocsp_packages +++ b/pki/scripts/compose_pki_ocsp_packages @@ -4,6 +4,14 @@ # 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 @@ -53,7 +61,7 @@ PKI_OCSP_SRPMS_DIR="${PKI_PACKAGES}/SRPMS" PKI_OCSP_TARBALL="${PKI_OCSP}-${PKI_OCSP_VERSION}.tar.gz" PKI_OCSP_SPEC_FILE="${PKI_OCSP_SPECS_DIR}/${PKI_OCSP}.spec" PKI_OCSP_PACKAGE_SCRIPT="${PKI_PACKAGES}/package_${PKI_OCSP}" -PKI_OCSP_PACKAGE_COMMAND="rpmbuild --define \"_topdir \`pwd\`\" -ba SPECS/${PKI_OCSP}.spec" +PKI_OCSP_PACKAGE_COMMAND="${RPMBUILD_CMD} SPECS/${PKI_OCSP}.spec" PKI_OCSP_STAGING_DIR="${PKI_PACKAGES}/staging" PKI_OCSP_DIR="${PKI_OCSP_STAGING_DIR}/${PKI_OCSP}-${PKI_OCSP_VERSION}" diff --git a/pki/scripts/compose_pki_ra_packages b/pki/scripts/compose_pki_ra_packages index 07b9d3baf..997f95151 100755 --- a/pki/scripts/compose_pki_ra_packages +++ b/pki/scripts/compose_pki_ra_packages @@ -4,6 +4,14 @@ # 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 @@ -53,7 +61,7 @@ PKI_RA_SRPMS_DIR="${PKI_PACKAGES}/SRPMS" PKI_RA_TARBALL="${PKI_RA}-${PKI_RA_VERSION}.tar.gz" PKI_RA_SPEC_FILE="${PKI_RA_SPECS_DIR}/${PKI_RA}.spec" PKI_RA_PACKAGE_SCRIPT="${PKI_PACKAGES}/package_${PKI_RA}" -PKI_RA_PACKAGE_COMMAND="rpmbuild --define \"_topdir \`pwd\`\" -ba SPECS/${PKI_RA}.spec" +PKI_RA_PACKAGE_COMMAND="${RPMBUILD_CMD} SPECS/${PKI_RA}.spec" PKI_RA_STAGING_DIR="${PKI_PACKAGES}/staging" PKI_RA_DIR="${PKI_RA_STAGING_DIR}/${PKI_RA}-${PKI_RA_VERSION}" diff --git a/pki/scripts/compose_pki_tks_packages b/pki/scripts/compose_pki_tks_packages index e71660ae3..39a539d10 100755 --- a/pki/scripts/compose_pki_tks_packages +++ b/pki/scripts/compose_pki_tks_packages @@ -4,6 +4,14 @@ # 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 @@ -53,7 +61,7 @@ PKI_TKS_SRPMS_DIR="${PKI_PACKAGES}/SRPMS" PKI_TKS_TARBALL="${PKI_TKS}-${PKI_TKS_VERSION}.tar.gz" PKI_TKS_SPEC_FILE="${PKI_TKS_SPECS_DIR}/${PKI_TKS}.spec" PKI_TKS_PACKAGE_SCRIPT="${PKI_PACKAGES}/package_${PKI_TKS}" -PKI_TKS_PACKAGE_COMMAND="rpmbuild --define \"_topdir \`pwd\`\" -ba SPECS/${PKI_TKS}.spec" +PKI_TKS_PACKAGE_COMMAND="${RPMBUILD_CMD} SPECS/${PKI_TKS}.spec" PKI_TKS_STAGING_DIR="${PKI_PACKAGES}/staging" PKI_TKS_DIR="${PKI_TKS_STAGING_DIR}/${PKI_TKS}-${PKI_TKS_VERSION}" diff --git a/pki/scripts/compose_pki_tps_packages b/pki/scripts/compose_pki_tps_packages index 2dbd11ea1..ee78a57c1 100755 --- a/pki/scripts/compose_pki_tps_packages +++ b/pki/scripts/compose_pki_tps_packages @@ -4,6 +4,14 @@ # 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 @@ -53,7 +61,7 @@ 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 --define \"_topdir \`pwd\`\" -ba SPECS/${PKI_TPS}.spec" +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}" |