echo -e "\e[0Ksection_end:$( date +%s ):yum_upgrade\r\e[0K"
- |
echo -e "\e[0Ksection_start:$( date +%s ):update_tzdata[collapsed=true]\r\e[0KExecuting: Installing or upgrading TZdata ..."
- echo -e "\e[0Ksection_end:$( date +%s ):update_tzdata\r\e[0K"
if rpm -qa | grep '^tzdata-' >/dev/null ; then
echo "Reinstalling tzdata ..."
echo "Executing: ${YUM} --assumeyes reinstall tzdata || true"
echo
echo "Timezone database:"
ls -l --color=always /usr/share/zoneinfo/zone.tab
+ echo -e "\e[0Ksection_end:$( date +%s ):update_tzdata\r\e[0K"
- |
echo -e "\e[0Ksection_start:$( date +%s ):install_additional[collapsed=true]\r\e[0KExecuting: Installing additional packages ..."
install_packages="${BUILD_PACKAGES}"
eval ${cmd} > "${man_file}.gz"
done
fi
+ - |
+ echo
+ echo "Creating source tree for tar file ..."
+ ODIR=$(pwd)
+ ROOT_OBJECTS=$( ls -A1 | egrep -vw ".git|rpmdir" )
+ PKG_VERSION=$( ./get-rpm-version )
+ PKG_RELEASE=$( ./get-rpm-release )
+ SRC_BASE="python${PYTHON_VERSION_NODOT}_${PKG_NAME}-${PKG_VERSION}"
+ SRC_DIR="rpmdir/SOURCES/${SRC_BASE}"
+ echo "Version to build: ${PKG_VERSION}-${PKG_RELEASE}"
+ tar cf - ${ROOT_OBJECTS} | (cd "${SRC_DIR}" ; tar xf -)
+ - |
+ echo
+ PKG_VERSION=$( ./get-rpm-version )
+ SRC_BASE="python${PYTHON_VERSION_NODOT}_${PKG_NAME}-${PKG_VERSION}"
+ TAR_BASE="${PKG_NAME}.${PKG_VERSION}.tar.gz"
+ SRC_TARBALL="rpmdir/SOURCES/${TAR_BASE}"
+ echo "Creating source tar file '${SRC_TARBALL}' ..."
+ cd rpmdir/SOURCES && tar cfz "${TAR_BASE}" "${SRC_BASE}"
+ ls -lA --color=always
+ cd "${ODIR}"
+ - |
+ echo -e "\e[0Ksection_start:$( date +%s ):specfile[collapsed=true]\r\e[0KGenerating '${SRC_SPEC_FILE}' => '${TGT_SPEC_FILE}' ..."
+ PKG_VERSION=$( ./get-rpm-version )
+ PKG_RELEASE=$( ./get-rpm-release )
+ cat "${SRC_SPEC_FILE}" | \
+ sed -e "s/@@@Version@@@/$PKG_VERSION/gi" \
+ -e "s/@@@Release@@@/${PKG_RELEASE}/gi" \
+ -e "s/@@@py_version_dot@@@/${PYTHON_VERSION_DOT}/gi" \
+ -e "s/@@@py_version_nodot@@@/${PYTHON_VERSION_NODOT}/gi" > "${TGT_SPEC_FILE}"
+ if [[ "${EL_MAJOR_VERSION}" -lt "8" ]] ; then
+ echo
+ echo "Removing 'Recommends' lines from '${TGT_SPEC_FILE}' ..."
+ sed -i '/^Recommends/d' "${TGT_SPEC_FILE}"
+ fi
+ echo
+ echo "Adding Changelog to '${TGT_SPEC_FILE}' ..."
+ dch2speclog debian/changelog >>"${TGT_SPEC_FILE}"
+ echo
+ echo "Generated spec-file:"
+ cat "${TGT_SPEC_FILE}"
+ echo
+ echo "Generating .rpm-version ..."
+ echo "${PKG_VERSION}-${PKG_RELEASE}" > .rpm-version
+ echo
+ echo -n "Cenerated .rpm-version: "
+ cat .rpm-version
+ echo -e "\e[0Ksection_end:$( date +%s ):specfile\r\e[0K"
+ - |
+ echo "Creating ${HOME}/.rpmmacros ..."
+ echo "%__python3 /bin/python${PYTHON_VERSION_DOT}" > "${HOME}/.rpmmacros"
+ echo "%_signature gpg" >> "${HOME}/.rpmmacros"
+ echo "Generated ${HOME}/.rpmmacros:"
+ cat "${HOME}/.rpmmacros"
+ - |
+ echo -e "\e[0Ksection_start:$( date +%s ):build_rpm[collapsed=true]\r\e[0KBuilding RPM packages ..."
+ echo "Building RPM packages:"
+ rpmbuild -ba --nocheck --verbose --define "_topdir $(pwd)/rpmdir" --define "version ${PKG_VERSION}" "${TGT_SPEC_FILE}"
+ echo -e "\e[0Ksection_end:$( date +%s ):build_rpm\r\e[0K"
+ - |
+ echo "Results:"
+ find rpmdir/*RPMS -type f -print0 | xargs --null --no-run-if-empty ls -l -d --color=always
# vim: et tabstop=2 expandtab shiftwidth=2 softtabstop=2 list