Page 1 of 1

build a src.rpm file

PostPosted: Jan 2nd, '22, 22:47
by flink
I want to compile by myself a src.rpm into a rpm file.

I follow the Wiki Packaging for Beginners - Understanding the Directory proposal.

http://rpm.pbone.net/resultsb_dist_90_s ... c.rpm.html
Download the file docker-20.10.9-3.mga9.src.rpm
.

Code: Select all
[franz@localhost SRPMS]$ pwd
/home/franz/rpmbuild/SRPMS
[franz@localhost SRPMS]$ ls
docker-20.10.9-3.mga9.src.rpm         docker-containerd-1.5.8-1.mga9.src.rpm  docker-registry-2.7.1-3.mga8.src.rpm
docker-compose-1.29.2-1.mga9.src.rpm  docker-machine-0.16.2-3.mga8.src.rpm
[franz@localhost SRPMS]$


Code: Select all
[franz@localhost SRPMS]$ sudo urpmi docker-20.10.9-3.mga9.src.rpm
[sudo] Passwort für franz:
Bitte benutzen Sie --buildrequires oder --install-src, Vorgabe ist --buildrequires


It does not work how the Wiki guide shows it.

Re: build a src.rpm file

PostPosted: Jan 3rd, '22, 00:41
by sturmvogel
You missed to unpack the source rpm according this wiki:
https://wiki.mageia.org/en/Packagers_RPM_tutorial#From_a_source_package

Re: build a src.rpm file

PostPosted: Jan 3rd, '22, 10:03
by flink
So the Packaging_for_beginners is not really for beginners, because it is missing important informations.

I have executed the SRC-RPM compilation.

Code: Select all
[franz@localhost rpmbuild]$ rpm -i /home/franz/cauldron/SRPMS/docker-20.10.9-3.mga9.src.rpm
Warnung: Benutzer iurt existiert nicht - root wird verwendet
Warnung: Gruppe iurt existiert nicht - root wird verwendet


Do I need a user and group iurt?

Re: build a src.rpm file

PostPosted: Jan 3rd, '22, 10:59
by sturmvogel
Here is the information about iurt. It is only necessary if you will get a packager and provide and upload official Mageia packages to the build server. For your personal use it's not necessary.
https://wiki.mageia.org/en/Iurt

Re: build a src.rpm file

PostPosted: Jan 3rd, '22, 17:55
by doktor5000
flink wrote:So the Packaging_for_beginners is not really for beginners, because it is missing important informations.

https://wiki.mageia.org/en/Packaging_fo ... nvironment shows how to create the build environment and https://wiki.mageia.org/en/Packaging_fo ... _structure shows how to install the src.rpm.
So what is missing exactly ? It doesn't suggest anywhere to install the src.rpm with urpmi as you did.

flink wrote:I have executed the SRC-RPM compilation.

Code: Select all
[franz@localhost rpmbuild]$ rpm -i /home/franz/cauldron/SRPMS/docker-20.10.9-3.mga9.src.rpm
Warnung: Benutzer iurt existiert nicht - root wird verwendet
Warnung: Gruppe iurt existiert nicht - root wird verwendet



No, you installed the src.rpm into your rpm build environment. And no, you don't need that user.

Re: build a src.rpm file

PostPosted: Jan 3rd, '22, 17:59
by doktor5000
sturmvogel wrote:Here is the information about iurt. It is only necessary if you will get a packager and provide and upload official Mageia packages to the build server. For your personal use it's not necessary.

iurt is still pretty useful even if you're not a packager and if you want to rebuild packages in a clean chroot instead of your regular Mageia installation.

Re: build a src.rpm file

PostPosted: Jan 8th, '22, 13:18
by papoteur
And instead of iurt, you can use mock.
The chroot method used by mock or iurt has the advantage to leave your standard system without packages installed only for the build. Another advantage is that you can build packages for other systems than yours, like for cauldron on Mageia 8, or for 32bits (or even for aarch64) on 64bits.
The drawback is that it uses lot of disk space, like 2 or 3 Gb by system.