Redhat – Add RPM package to mrepo

redhatrpm

I'm learning mrepo. I've got it generating repos based on ISOs. But is there a way I can add an RPM (package I built) quickly/easily to one of these repos?

Do I just add the RPM to the srcdir?

My srcdir currently has subfolders for various distributions and ISOs. I want my package to be available only in specifics distros.

Do I need to re-run the generation command?

Other thoughts or missing information.

Best Answer

I would consider not mucking with the official repositories and instead create your own. Any directory of RPMs can be turned into an RPM repository for Yum with the createrepo command. So, after you gather your RPM's in one place, run createrepo in the location:

createrepo -dp .

A ./repodata sub-directory will be created. Yum pulls the necessary metadata from this location to find the packages your client is looking for, so this entire directory will need to be exposed to the client in the same way your existing ISO based repositories are currently.

From the createrepo man page:

createrepo [options] <directory>  
-p --pretty  
    Output xml files in pretty format.  
-d --database  
    Generate sqlite databases for use with yum.

Note: I just like the "pretty" format option in case I have to get into those files and have an edit by hand.