# createrepo on FreeBSD?



## Cataztrohpy (Aug 3, 2009)

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. 

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.


----------



## SirDice (Aug 3, 2009)

What is createrepo supposed to mirror? There may be similar programs that do the same..


----------



## DutchDaemon (Aug 3, 2009)

Do you want to dump images, or just run a full copy of the hard drive? Tools like sysutils/rsnapshot can do the latter from the FreeBSD host.


----------



## Cataztrohpy (Aug 3, 2009)

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 Â¶
> ...



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.


----------



## DutchDaemon (Aug 3, 2009)

rpm _and_ xml. Glad I read this after lunch ..


----------



## DutchDaemon (Aug 3, 2009)

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?


----------



## Cataztrohpy (Aug 3, 2009)

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.


----------



## DutchDaemon (Aug 3, 2009)

If security is a main concern, you can tunnel NFS over VPN/IPsec/Stunnel, etc.


----------



## Cataztrohpy (Aug 3, 2009)

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.


----------



## DutchDaemon (Aug 3, 2009)

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.


----------



## Cataztrohpy (Aug 3, 2009)

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.


----------



## Cataztrohpy (Aug 3, 2009)

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.


----------



## SirDice (Aug 3, 2009)

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.


----------



## Cataztrohpy (Aug 4, 2009)

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?


----------



## SirDice (Aug 4, 2009)

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.


----------

