开发者

setting installation path for python rpm

开发者 https://www.devze.com 2023-02-05 15:56 出处:网络
Can I set the installation path (relative or absolute) for a p开发者_如何学运维ython rpm\'s content?

Can I set the installation path (relative or absolute) for a p开发者_如何学运维ython rpm's content?

Would I set this in the spec file?

Specifically I am trying to do this for Fedora.


Yes, if you can build a new RPM, you can set it in the spec file. How to do this depends on the package, but basically you get the package to install itself into the desired path inside the buildroot.

Probably the most common way to do that would be by passing PREFIX and DESTDIR to make in the %install target, e.g.:

%install
rm -rf %{buildroot}
make -e install PREFIX=/home/user DESTDIR=%{buildroot}

If you want to do it without building a new RPM, you can install it using rpm --relocate, e.g.
rpm --relocate /=/home/user -ivh <foo.rpm>.

See the rpm man page for details.

0

精彩评论

暂无评论...
验证码 换一张
取 消