Modify python-dateutil RPM build process

The current build process for the python-dateutil RPM generates a
package that when installed lays a number of files on a filesystem
that only root can read.  This is problematic for non-root owned
processes that are trying to read these files.  Adding this patch
opens up those files to reading by process that aren't running as
root.  For example, this would allow for the running of the
reference uWSGI based implementation as a non-root user.

Fixes: bug #1288033
Change-Id: I3bff45bab272de888992cb42a8b8709a3fcd8ec6
This commit is contained in:
Sig Sigler
2014-03-04 23:29:54 -06:00
parent 4d2ce30cd6
commit 45795fadbb

View File

@@ -27,8 +27,51 @@ fpm -s python -t rpm -n python-keystoneclient-barbican -v 0.4.1 python-keystonec
fpm -s python -t rpm -v 0.12 stevedore
fpm -s python -t rpm -n python-crypto pycrypto
# --> python-crypto 2.0.1-22.el6 exists, but is too old
fpm -s python -t rpm python-dateutil
# --> python-dateutil 1.4.1-6.el6 exists, but is incompatible
################################################################################
# Modified python-dateutil RPM build process via fpm #
# python-dateutil RPM file permissions are too restrictive when generated by a #
# default fpm call, i.e. fpm -s python -t rpm python-dateutil, so this #
# modified process addresses that problem. #
################################################################################
pypi_pdu_version="python-dateutil-2.2"
pypi_pdu_version_md5="c1f654d0ff7e33999380a8ba9783fd5c"
fpm_tmp_dir=$(mktemp -d --suffix=-fpm-python-dateutil)
if [ $? -ne 0 ]
then
echo "Unable to create tmp dir for python-dateutil fpm build." 1>&2
exit 1
fi
wget -P $fpm_tmp_dir \
https://pypi.python.org/packages/source/p/python-dateutil/\
$pypi_pdu_version.tar.gz --no-check-certificate
echo "$pypi_pdu_version_md5 $fpm_tmp_dir/$pypi_pdu_version.tar.gz" \
| md5sum -c -
if [ $? -ne 0 ]
then
echo "The md5 check for python-dateutil from pypi failed." 1>&2
rm -rf $fpm_tmp_dir
exit 1
fi
tar xvfz $fpm_tmp_dir/$pypi_pdu_version.tar.gz -C $fpm_tmp_dir
find $fpm_tmp_dir/$pypi_pdu_version/python_dateutil.egg-info -type f \
-exec chmod go+r {} \;
chmod go+rx $fpm_tmp_dir/$pypi_pdu_version/python_dateutil.egg-info
chmod go+r \
$fpm_tmp_dir/$pypi_pdu_version/dateutil/zoneinfo/zoneinfo--latest.tar.gz
fpm -s python -t rpm $fpm_tmp_dir/$pypi_pdu_version/setup.py
rm -rf $fpm_tmp_dir
################################################
# End python-dateutil modified fpm build process
################################################
fpm -s python -t rpm -v 1.3.0 jsonschema
fpm -s python -t rpm -v 0.7.10 SQLAlchemy
# --> python-sqlalchemy 0.5.5-3.el6_2 exists, but is incompatible