문제

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