Redhat: действительно ли возможно установить пакеты в своего рода ложной среде для создания RPMs

Вы имеете command-not-found установленный?

Просто введите команду в ударе или zsh, и это скажет Вам, какой пакет имеет его, и если необходимо включить неосновной repos или зафиксировать ПУТЬ. Или звоните command-not-found $command_name.

Или Вы могли перейти к http://packages.ubuntu.com/file:bin/nslookup, но это принимает значение по умолчанию к кармическим пакетам.

10
задан 4 January 2013 в 22:31
3 ответа

Yes, the tool is called mock and it's in EPEL.

Typical usage:

rpmbuild -bs mypackage.spec
mock -r epel-6-x86_64 mypackage-0.1-1.src.rpm

This is actually the preferred way to build RPMs, precisely because it isolates the process from the system so that unexpected dependencies don't get pulled in.

You can modify the files in /etc/mock to have it pull in your own packages, private repo, etc., or check the docs for info on how to add packages to the mock chroot environment manually.

Note that users should be added to the mock group to be allowed to use mock.

Not coincidentally, the koji build server that Red Hat uses calls mock to build each individual package. If you have to build a lot of packages all the time, it may be worth looking into setting up a koji build server.

8
ответ дан 2 December 2019 в 22:10

I think attempting to build packages on production hosts is bad practice and attempting to do it without root privileges is more complicated than bringing up your own build machines. What I normally do is the following.

  1. Install VirtualBox or similar tool on your desktop/laptop
  2. Create 32/64 VMs of the OS you use in production
  3. Install the usually mock, rpmbuild, etc tools
  4. Create the RPMs for the package and any additional deps for both archs on yours VMs
  5. After testing push the RPMs into your internal repo for distribution to your servers
  6. Test again to make sure the proper dependencies are being pulled in
  7. Release via your config management.
3
ответ дан 2 December 2019 в 22:10

You want to use mock. It allows you to build rpms in a chroot

https://fedorahosted.org/mock/

0
ответ дан 2 December 2019 в 22:10

Теги

Похожие вопросы