質問

im having this part of spec file ,

%post
%{__mv} %{_sysconfdir}/sysconfig/data.py /opt/data.py
%{__mv} %{_sysconfdir}/sysconfig/get-pip.py /opt/get-pip.py



yum -y install python-psycopg2
python /opt/get-pip.py
pip install setuptools --no-use-wheel --upgrade
pip install requests


echo -e "*/5 * * * * /usr/bin/python  /opt/data.py"  >> /var/spool/cron/root

%files
%{_sysconfdir}/sysconfig/data.py
%{_sysconfdir}/sysconfig/get-pip.py

%changelog

the rpmbuild without error , but when i try to install the package its stuck , i've doubt about dependence installation , im using yum am i right or there is different way to to yum here

役に立ちましたか?

解決

I believe it stuck because you are trying to run multiple YUM/RPM processes (Your package and python-psycopg2). However, you should not run yum or rpm within you rpm, but declare python-psycopg2 as a dependency, so YUM will install it before installing your RPM.

他のヒント

Just put the package in Requires in your rpm spec ex:-

Requires: python-psycopg2

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top