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

No comments:

Post a Comment