jordansissel / fpm

Effing package management! Build packages for multiple platforms (deb, rpm, etc) with great ease and sanity.
http://fpm.readthedocs.io/en/latest/
Other
11.16k stars 1.07k forks source link

Support for opkg #1323

Open mcandre opened 7 years ago

mcandre commented 7 years ago

FPM is the shit! Could we also build .ipk's with FPM, for embedded Linux distros like OpenWrt / busybox?

jordansissel commented 7 years ago

The more the merrier! I don't know much about the opkg format, but if we had details about how to create these packages, we could codify that in fpm.

hjc4869 commented 5 years ago

.ipk packages are basically the same as dpkg deb files. It seems that the key difference is, ipkg package format is tar.gz, while deb is ar.

Besides, Debian and Ubuntu typically use Architecture: amd64 for x86_64 systems, while OSes like OpenWrt use Architecture: x86_64 instead. I saw a conversion in fpm code, and this should be removed to pack a usable OpenWrt package.

I wrote a simple script snippet to demonstrate how to convert an existing deb file to ipk in my blog, although I'm not sure to what degree it works.

ar x openwrttest_1.0.0-1_amd64.deb

mkdir control && pushd control
tar xf ../control.tar.gz

sed "s/Architecture:\\ amd64/Architecture:\\ x86_64/g" ./control -i
tar czf ../control.tar.gz ./*

popd
tar czf openwrttest_1.0.0-1_x86_64.ipk control.tar.gz data.tar.gz debian-binary

opkg install ./openwrttest_1.0.0-1_x86_64.ipk
mcandre commented 4 years ago

@hjc4869 In that case, would you mind submitting a pull request to copy-paste-modify a new IPK output option based on the DEB output option?

pldubouilh commented 2 years ago

I'll try to have a look at this if time allows - in the meantime I hacked up a script from @hjc4869 suggestion https://gist.github.com/pldubouilh/c5703052986bfdd404005951dee54683