Saturday, November 27, 2010

Creating a custom Yum repository's rpm

A yum repository is just a directory of packages and some metadata.

- Inorder to sign rpm packages, I created a gpg key and appended the info in ~/.rpmmacros

Here are  the contents of that file

%_gpg_name Rizwan <rizwanulhaq@gmail.com>
%_signature gpg
%_gpg_path /root/.gnupg/
%_gpgbin /usr/bin/gpg

- make a directory inside /var/www/ called repository and copy all the packages into the repository directory.

I ran the command in the repsitory directory  rpm --addsign *.*
to sign all the rpm packages.


- use this command to create repository metadata for repository

createrepo repository

- I then created a .repo file with $baseURL pointing to localhost and gpgkey pointing to the location of the gpg file.

Here are the contents of that file

Rizwan-Repository]
name=Rizwan Haq for $releasever - $basearch
baseurl=http://localhost/repository/
failovermethod=roundrobin
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/rizwan-GPG-KEY

- Making an RPM for the repository

 here is the link for my repository rpm file.

https://my.senecacollege.ca/bbcswebdav/users/rhaq1/My.Website/rizwanrepo-0.1-1.fc14.i686.rpm

Building packages using Koji

Koji:

Koji is a client-server system which allows you to queue builds within the Fedora build farm. This permits you to test whether your package builds on several different architectures, which is especially useful when you don't otherwise have access to the machines of that architecture.

Installed Koji using:

yum install fedora-packager

fedora-packager provides useful scripts to help maintain and setup your koji environment. Additionally, it includes dependencies on the Koji CLI, so it will be installed when you install fedora-packager.

After the installation the following command needs to be run in order to do the initial koji setup.

/usr/bin/fedora-packager-setup

to be able to generate certificates so the user can log on to the web interface for koji.

command to install a package using koji is :

koji build dist-f12 --scratch vim-7.2.446-2.fc14.src.rpm

the file is uploaded to the server and then built. here are the results for my vim built.

Uploading srpm: vim-7.2.446-2.fc14.src.rpm
[====================================] 100% 00:01:39   9.57 MiB  98.52 KiB/sec
Created task: 2630305
Task info: http://koji.fedoraproject.org/koji/taskinfo?taskID=2630305
Watching tasks (this may be safely interrupted)...
2630305 build (dist-f12, vim-7.2.446-2.fc14.src.rpm): open (ppc08.phx2.fedoraproject.org)
  2630312 buildArch (vim-7.2.446-2.fc14.src.rpm, i686): open (x86-11.phx2.fedoraproject.org)
  2630309 buildArch (vim-7.2.446-2.fc14.src.rpm, ppc): open (ppc04.phx2.fedoraproject.org)
  2630311 buildArch (vim-7.2.446-2.fc14.src.rpm, ppc64): open (ppc09.phx2.fedoraproject.org)
  2630310 buildArch (vim-7.2.446-2.fc14.src.rpm, x86_64): open (x86-09.phx2.fedoraproject.org)
  2630310 buildArch (vim-7.2.446-2.fc14.src.rpm, x86_64): open (x86-09.phx2.fedoraproject.org) -> closed
  0 free  4 open  1 done  0 failed
  2630312 buildArch (vim-7.2.446-2.fc14.src.rpm, i686): open (x86-11.phx2.fedoraproject.org) -> closed
  0 free  3 open  2 done  0 failed
  2630309 buildArch (vim-7.2.446-2.fc14.src.rpm, ppc): open (ppc04.phx2.fedoraproject.org) -> closed
  0 free  2 open  3 done  0 failed

^[[B^[2630305 build (dist-f12, vim-7.2.446-2.fc14.src.rpm): open (ppc08.phx2.fedoraproject.org) -> closed
  0 free  1 open  4 done  0 failed
  2630311 buildArch (vim-7.2.446-2.fc14.src.rpm, ppc64): open (ppc09.phx2.fedoraproject.org) -> closed
  0 free  0 open  5 done  0 failed

2630305 build (dist-f12, vim-7.2.446-2.fc14.src.rpm) completed successfully

Building packages using MOCK

Mock:

Mock creates chroots and builds packages in them. Its only task is to reliably populate a chroot and attempt to build a package in that chroot.

 I built the vim package on an older machine and it took about 16 minutes

[root@Rizwan rpmbuild]# mock -r fedora-14-i386 --rebuild vim-7.2.446-2.fc14.src.rpm
INFO: mock.py version 1.1.6 starting...
State Changed: init plugins
INFO: selinux enabled
State Changed: start
INFO: Start(vim-7.2.446-2.fc14.src.rpm)  Config(fedora-14-i386)
State Changed: lock buildroot
State Changed: clean
State Changed: init
State Changed: lock buildroot
Mock Version: 1.1.6
INFO: Mock Version: 1.1.6
INFO: enabled root cache
INFO: enabled yum cache
State Changed: cleaning yum metadata
INFO: enabled ccache
State Changed: running yum
State Changed: creating cache
State Changed: setup
State Changed: build
INFO: Done(vim-7.2.446-2.fc14.src.rpm) Config(fedora-14-i386) 16 minutes 17 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-14-i386/result

Creating an .spec file

I created a skeleton .spec file using the command in ~/rpmbuild/SPECS directory.

rpmdev-newspec nled

- building a .spec file for nled was pretty easy. After filing in the version . summary and the regular, since i already had the executable file.. I filled in %install section with a copy command to copy nled to /usr/bin/nled directory.
- after editing the .spec file, checked it with rpmbuild -ba nled.spec
- It worked fine.

Thursday, November 11, 2010

AutoQA Project plan 0.1

AutoQA:
The autoqa project provides a basic framework for executing a series of tests and reporting results.

- I cloned autoqa available tests and configurations files using :
git clone git://git.fedorahosted.org/autoqa.git autoqa

- Installed Autotest on Romain server and it worked fine.
I used the instructions available here:
https://fedoraproject.org/wiki/Install_and_configure_autotest

The framework is ready to go. The easy part is done. I still need to start writing up the actual code for tests.

Returning after a long time

I logged in for blogging after a long time ... I was overwhelmed with so many things. anyways

Happy to be finally back

Just finished working on setting up Autotest and cloning Autoqa for my project. but I will blog about them after i catch up with the previous blogs.

Be back soon

Friday, September 24, 2010

Compiling with different J values

I compiled audacity with different -j values in the open lab and here are the results. j1 took the least time to compile.

j1
real    6m34.068s
user 5m44.576s
sys    0m37.742s

j2
real    6m34.891s
user 5m44.713s
sys    0m38.189s

j3
real    6m39.111s
user 5m44.737s
sys    0m37.833s

j4
real    6m39.228s
user 5m46.737s
sys    0m38.582s

j5
real    6m46.783s
user    5m49.364s
sys    0m40.147s