1

I'm learning how to create RPMs for my own packages. Normally I can do everything while logged into my own account but instructions on making RPMs always seem to want you to use some other account.

One tutorial I followed utilized rpm-build and rpmdevtools. The rpmdev-setuptree, for example, creates a directory rpmbuild/ in my home directory and (not the current directory as I would have expected). The instructions also suggested that I create a separate build account. This seems excessive and it makes managing files between this special account and the account I'm developing on difficult.

The official fedora documentation uses the fedora-packager and fedora-review packages and then proceeds to have you add yourself to the mock group. Again, it suggests:

You can also create a separate user and use it for doing RPM development. Ensure that the user is part of the mock group and enters the fedora-packager-setup command.

Both of these instructions encourage building an RPM on a separate account.

Why is this? My knee-jerk reaction is to try an work around this somehow for convenience. What problems might I face by creating RPMs from my normal account?

3

The general principle when packaging is that you should not make any assumptions about the system that aren't declared in the packaging configuration. This includes a lot of things: the packages needed for building, the packages needed for execution, the accounts (user or group) needed, the permissions needed, etc. Otherwise, you might find that the spec file you wrote might build on your snowflake system, but not in a clean environment. And even if it did build, it might not install. And even if it did install, it might not work as expected.

This way, distros can use automated build systems, where a maintainer just has to upload the packaging configuration, and the build system does all the rest. Packages built this way are, of course, much more reliable. Because everything they require are specified in the packaging, it's a lot more unlikely that installing them will break a user's system.

  • I'm a bit surprised it's just a separate account being used and not a build account in a chroot. – Kusalananda Aug 22 at 7:14
  • Ideally they'd use mock, which should use a separate account in a chroot – muru Aug 22 at 7:27
1

Both of these instructions encourage building an RPM on a separate account.

I don’t read the Fedora documentation in that way; to me, it says that if you want to, you can use a separate account to do your packaging work, and it explains what you need to do to get that working. It doesn’t say you have to, or even encourage you to do so.

I use my main account for my packaging work. However I do ensure that my build requirements are complete by running mock builds (and of course, building on Koji or our internal equivalent).

0

You can tell rpmbuild where you're files are using --define '_builddir <Your_Root>' You don't need to run it with a different account, although I think it's a good practice to so. Hope this helpful. Eran.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.