# pkg port to Linux



## vbu (Aug 5, 2015)

I am working on building FreeBSD packages on Fedora. I am working with pkgng on FreeBSD.
Has anyone ported pkg tool to Linux ?


----------



## drhowarddrfine (Aug 5, 2015)

This sounds like a Fedora/Linux question you should ask on a Fedora/Linux board.


----------



## kpa (Aug 5, 2015)

Porting pkg itself to Linux shouldn't be too hard since the code is quite simple C code and is quite portable, it's already ported to DragonFlyBSD where it has become the official package manager. The big hurdle on Linux would be to create the ports(7) tree equivalent for Linux. Pkg and the ports tree are inseparable at the moment, much of the pkg's internal workings are based on assumptions made on the ports tree.


----------



## vbu (Aug 5, 2015)

I don't intend to use pkg as a package manager in lLinux. I just want to compile and generate the new style BSD packages on lLinux. That is because lI use lLinux as the build environment.
The code is quite simple and lI have a hacked up version working on Fedora. Was wondering if someone already ported it in a clean way.


----------



## ANOKNUSA (Aug 5, 2015)

You want to port the FreeBSD package manager to Linux so you can use Linux as a platform to build packages for FreeBSD? Am I understanding that correctly?

If so, this is almost certainly an X-Y problem. Let's revisit your question: you're wondering if anyone has bothered to port pkg(8) to Linux, because you'd like to use it on Linux to build FreeBSD packages. The answer is probably, "No, no-one has ported pkg(8) to Linux for that or any other purpose." What someone quite likely _has_ done, however, is addressed whatever deficiency you think there is in building FreeBSD packages on a FreeBSD system. Clearly, the rudimentary tools for building packages using FreeBSD exist. On top of that, FreeBSD already has its own bulk package building and continuous integration systems. Not too surprising, since the package manager would be worthless without them.

So why would you go through the extra work for some dirty hack to get packages to build on a non-native platform? What are you _really_ trying to do? What do you _really_ expect to happen?


----------



## vbu (Aug 5, 2015)

I have multiple targets and packages are built for lLinux, BSD, cygwin etc, So some x-y problem is necessary.
Currently I have the packages built for BSDFreeBSD 8, but with 10 the new package manager comes in and that is why ii need to port the pkg tool to get the new style packages.


----------



## ANOKNUSA (Aug 6, 2015)

vbu said:


> I have multiple targets and packages are built for lLinux, BSD, cygwin etc,



Targets for what, exactly? What packages are you building? Obviously if you have at least one FreeBSD target then you have at least one FreeBSD system you can use to build the packages.

Unless, of course, you're trying to package software you've written yourself for FreeBSD, and the targets are other users. If that's the case, then just submit your port for inclusion into the ports tree. It will be built into an official package for inclusion in the official repository, just as every other port is. No need to bother with trying to slap some kludge together, and the package will be built by folks who know the package manager better than most of us.


----------

