So I began by installing mock
- yum install mock
- usermod -aG mock hitman
- mock -r fedora-18-i386 grep-2.9-1.fc18.src.rpm
INFO: mock.py version 1.1.32 starting...
Start: init plugins
INFO: selinux enabled
Finish: init plugins
Start: run
INFO: Start(grep-2.9-1.fc18.src.rpm) Config(fedora-18-i386)
Start: lock buildroot
Start: clean chroot
Finish: clean chroot
Finish: lock buildroot
Start: chroot init
Start: lock buildroot
Mock Version: 1.1.32
INFO: Mock Version: 1.1.32
INFO: calling preinit hooks
INFO: enabled root cache
INFO: enabled yum cache
Start: cleaning yum metadata
Finish: cleaning yum metadata
INFO: enabled ccache
Start: device setup
Finish: device setup
Start: yum update
Start: Outputting list of available packages
Finish: Outputting list of available packages
Finish: yum update
Start: creating cache
Finish: creating cache
Finish: lock buildroot
Finish: chroot init
INFO: Installed packages:
Start: build phase for grep-2.9-1.fc18.src.rpm
Start: device setup
Finish: device setup
Start: build setup for grep-2.9-1.fc18.src.rpm
Finish: build setup for grep-2.9-1.fc18.src.rpm
Start: rpmbuild -bb grep-2.9-1.fc18.src.rpm
Start: Outputting list of installed packages
Finish: Outputting list of installed packages
Finish: rpmbuild -bb grep-2.9-1.fc18.src.rpm
Finish: build phase for grep-2.9-1.fc18.src.rpm
INFO: Done(grep-2.9-1.fc18.src.rpm) Config(fedora-18-i386) 4 minutes 3 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-18-i386/result
Finish: run
Took me about 4 minutes 3 seconds as can be seen from the output above.
Then I ran mock to build the other package less
- mock -r fedora-18-i386 less-451-1.fc18.src.rpm
Start: init plugins
INFO: selinux enabled
Finish: init plugins
Start: run
INFO: Start(less-451-1.fc18.src.rpm) Config(fedora-18-i386)
Start: lock buildroot
Start: clean chroot
INFO: chroot (/var/lib/mock/fedora-18-i386) unlocked and deleted
Finish: clean chroot
Finish: lock buildroot
Start: chroot init
Start: lock buildroot
Mock Version: 1.1.32
INFO: Mock Version: 1.1.32
INFO: calling preinit hooks
INFO: enabled root cache
Start: unpacking root cache
Finish: unpacking root cache
INFO: enabled yum cache
Start: cleaning yum metadata
Finish: cleaning yum metadata
INFO: enabled ccache
Start: device setup
Finish: device setup
Start: yum update
Start: Outputting list of available packages
Finish: Outputting list of available packages
Finish: yum update
Finish: lock buildroot
Finish: chroot init
INFO: Installed packages:
Start: build phase for less-451-1.fc18.src.rpm
Start: device setup
Finish: device setup
Start: build setup for less-451-1.fc18.src.rpm
Finish: build setup for less-451-1.fc18.src.rpm
Start: rpmbuild -bb less-451-1.fc18.src.rpm
Start: Outputting list of installed packages
Finish: Outputting list of installed packages
ERROR: Exception(less-451-1.fc18.src.rpm) Config(fedora-18-i386) 0 minutes 25 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-18-i386/result
ERROR: Command failed. See logs for output.
# ['bash', '--login', '-c', 'rpmbuild -bb --target i686 --nodeps builddir/build/SPECS/less.spec']
About time something had to go wrong. Let me check the result and modify my specs.
Did some research and found this article, they were talking about re-installing ncurses? so I figured, maybe it needs ncurses-devel. I added "BuildRequires: ncurses-devel" and ran mock again. It build without any issues.
[hitman@localhost SRPMS]$ mock -r fedora-18-i386 less-451-1.fc18.src.rpm
INFO: mock.py version 1.1.32 starting...
Start: init plugins
INFO: selinux enabled
Finish: init plugins
Start: run
INFO: Start(less-451-1.fc18.src.rpm) Config(fedora-18-i386)
Start: lock buildroot
Start: clean chroot
INFO: chroot (/var/lib/mock/fedora-18-i386) unlocked and deleted
Finish: clean chroot
Finish: lock buildroot
Start: chroot init
Start: lock buildroot
Mock Version: 1.1.32
INFO: Mock Version: 1.1.32
INFO: calling preinit hooks
INFO: enabled root cache
Start: unpacking root cache
Finish: unpacking root cache
INFO: enabled yum cache
Start: cleaning yum metadata
Finish: cleaning yum metadata
INFO: enabled ccache
Start: device setup
Finish: device setup
Start: yum update
Start: Outputting list of available packages
Finish: Outputting list of available packages
Finish: yum update
Finish: lock buildroot
Finish: chroot init
INFO: Installed packages:
Start: build phase for less-451-1.fc18.src.rpm
Start: device setup
Finish: device setup
Start: build setup for less-451-1.fc18.src.rpm
Finish: build setup for less-451-1.fc18.src.rpm
Start: rpmbuild -bb less-451-1.fc18.src.rpm
Start: Outputting list of installed packages
Finish: Outputting list of installed packages
Finish: rpmbuild -bb less-451-1.fc18.src.rpm
Finish: build phase for less-451-1.fc18.src.rpm
INFO: Done(less-451-1.fc18.src.rpm) Config(fedora-18-i386) 0 minutes 30 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-18-i386/result
Finish: run
Just took about 30 seconds. That is pretty neat!
Here is a link to my changed spec file.
less.spec
I think Mock tool is amazing, one thing I liked about it is, you can build packages on different architectures using mock which is nice.
The whole lab took be about 45 minutes to complete.
No comments:
Post a Comment