createrepo on FreeBSD?

I was looking to create a local mirror for my laptops that run Fedora onto my FreeBSD server. Unfortunately in order to create this mirror I need a program called 'createrepo'. I can't find any info about running it off of FreeBSD. Does anyone have experience using it?

Or is there a way I could compile it and run it from the linux emulation layer? Only time I ever used linux emulation on FreeBSD was back a few years ago to play some games; enemy-territory and america's army. Not to mention ut2004. :D

Anyways, any help would be appreciated. I just finished installing and upgrading my server as well as adding some virtual services to it with ezjail. That seemed to be alot easier to do than my current task of creating this local network mirror. :)
 
What is createrepo supposed to mirror? There may be similar programs that do the same..
 
Here's a site that lists some info about it - http://fedoraproject.org/wiki/Extras/CreateRepo


And then here is a quick description that I stole from another site..

createrepo/rpm metadata ¶

This project defines the rpm-metadata (repodata) format and maintains one of the programs (createrepo) which create this format from existing rpms and other sources.
rpm metadata ¶

This is an XML format for describing the critical metadata from an rpm package for dependency resolving and installation. Currently, this format is supported by apt-rpm,smartpm,red carpet and yum.

The files break down as follows:

* repomd.xml this is the file that describes the other metadata files. It is like an index file to point to the other files. It contains timestamps and checksums for the other files. This lets a client download this one, small file and know if anything else has changed. This also means that cryptographically (ex: gpg) signing this one file can ensure repository integrity.

* primary.xml.[gz] this file stores the primary metadata information. This includes information such as:
o name, epoch, version, release, architecture
o file size, file location, description, summary, format, checksums header byte-ranges, etc.
o dependencies, provides, conflicts, obsoletes, suggests, recommends
o file lists for the package for CERTAIN files - specifically files matching: /etc*, *bin/*, /usr/lib/sendmail [1]
* filelists.xml.[gz] this file stores the complete file and directory listings for the packages. The package is identified by: name, epoch, version, release, architecture and package checksum id.
* other.xml.[gz] this file currently only stores the changelog data from packages. However, this file could be used for any other additional metadata that could be useful for clients.
* groups.xml.[gz] this file is tentatively described. The intention is for a common package-groups specification as well. There is still some sections for this format that need to be fleshed out.

FIXME The specification needs better and more current documentation and needs to be included here. :)
createrepo ¶

A python program which generate the above format from a set of rpm files.

The above is taken from http://createrepo.baseurl.org/


Now there may or may not be a way to script this with a shell script but I'm not savvy with scripting. I tend to leave that thing to the experts like the chaps who wrote the python script to do the above on linux.

I had thought about shortcutting this and just moving the data(180GB i386/amd64 mirror) to my laptop which runs linux and then creating the repo but apparently it has to be reran each time new data is downloaded so it can rescan the directory and add the new file names and information to the metadata. Anyways that's why I setup this FreeBSD server to hold all this data in the first place. So moving the data back and forth kinda removes the necessity of the server, sorta. :D
 
Can't you mount a slice of your FreeBSD server over to a laptop and run that program locally, dumping the data on the NFS share?
 
Lol DutchDaemon @ after lunch comment. Completely understand though. But I'd rather use linux over windows on newer(less than 1-2 years since release date) laptops and FreeBSD over linux on servers. Just my tastes.

Anyways,.. I thought about NFS but I've read and heard a lot about it being insecure. I was leaning more towards setting it up as just another directory under 'lighttpd' like I do with my local FreeBSD distfiles mirror among other things. Fortunately FreeBSD doesn't need any metadata or any bs. Just 'cvsup'. :)

I could look a bit more into the NFS idea if noone has any other suggestions. I thought of it as a last resort idea just above the copy it over the network thought.
 
If security is a main concern, you can tunnel NFS over VPN/IPsec/Stunnel, etc.
 
Roger. Thanks for the suggestions. At least I now have a path to pursue as well as having a good laugh about your previous comment. For me though its very early in the morning and nothing better than a funny comment after a half cup of coffee. :)

Laughing is definitely a lot better than dealing with rpm/xml. :D
 
Is createrepo a single binary? If it is, you could still try copying the binary over to FreeBSD and install linux-base-f8 or -f10, mount linprocfs in /etc/fstab and try to run it locally. You may need to symlink some libraries here and there.
 
Createrepo apparently is just a script which executes /usr/share/createrepo/genpkgmetadata.py

It looks to be fully written in python. And from trying to follow the different paths and files.. it seems to stem from a single directory with .py and .pyc .pyo files.

I suppose I can try installing linux-base-f10 and trying it out.
 
Quick question for you about linux emulation in a jail environment. Would I install it in the base system and mount it there as well? Like I stated above I only ever used it on a desktop and for playing games. And I just use FreeBSD for my own personal servers at home for testing and learning purposes. So I don't have too much jail experience behind my belt.
 
If it's a python script you probably don't need a linux_base at all. You just need to install the fbsd python and perhaps a few modules.
 
I went the NFS route because that seemed to be the quickest and easiest. I am currently running 'createrepo' on my second set of directories now. Seems to work ok. I did have a problem getting NFS to run inside my Jail though.

Can you not run NFSD from Jail?
 
Cataztrohpy said:
Can you not run NFSD from Jail?
That shouldn't be a problem. It might be tricky to get it to bind to only the jail's IP though. Both nfsd and rpcbind should be able to do this but mountd will bind to all IP addresses.
 
Back
Top