===== Porting rpm/deb package into archlinux enviroment ===== For some software there is only a precompiled package available (usually the case of commercial ones - for example in the my case [[https://aur.archlinux.org/packages/mestrenova/| this sw]]). But, the [[https://www.archlinux.org/|Archlinux]] is not as widely used distribution as the rpm/deb packaging system based distributions. This means that the package for the Archlinux is sometimes unavailable as it is in my case. Luckily, it's not so hard to get a successful port of the package. I've performed a case-example of this on the [[http://mestrelab.com/software/mnova/|MestReNova]] NMR software. ** This method should be avoided when the source code is available. You should have some really good motive to undergo this. Keep in mind that this is not the cleanest and the safest way how to make a SW package. ** ===== Unpacking ===== * **bsdtar** is capable of unpacking both the .rpm and the .deb packages, syntax is **bsdtar -xf filename**. It's also used by makepkg for unpacking source files. ===== Optimizing ===== == Getting things working == * Package for fedora/RHEL requied selinux in this case - if you have it, maybe good for you. If you don't, than it's unneeded dependency. * Dependencies sometimes show itself when binary is ran from console. This was case for almost all of dependencies. * **[[https://linux.die.net/man/1/ldd | ldd]]** comes pretty handy when program is not so communicative. [[https://strace.io/|strace]] can be used when things get nasty. * Sometimes running ldd on libraries provided by package helps (was case of one Qt5 library and libglu). * If you're in dark, trying to look for package dependencies in original package could help, of course usually library in Archlinux is provided under different package compared to for example Debian. * Don't forget to try the functionality, not only if the program gets started. In my case, the program worked until I wanted to zoom spectrum, than it segfaulted (problem was solved by the libglu library). == Getting things nice == * Make a clear archlinux installation. * Try to get the package working under those conditions to identify all the crucial dependencies. ===== Repacking ===== * It's good to read a few makepkg files and don't forget that [[https://wiki.archlinux.org/index.php/Creating_packages | there is also a wiki page ]] and some man pages too. * Make a copy of a similar makepkg recipe (just some which also goes from precompiled package) and fit it to your case. * When you're modifying recipe dont forget to keep up with [[https://wiki.archlinux.org/index.php/Arch_packaging_standards | Arch packaging standards]] especially [[https://wiki.archlinux.org/index.php/Arch_packaging_standards#Directories | Directories]] and [[https://wiki.archlinux.org/index.php/Arch_packaging_standards#Licenses | Licences]] * Usually some desktop inplementation can improve user experience (for example line 18 in [[https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=mestrenova | this PKGBUILD ]] ) * Clean up everything * If you're satisfied don't forget how long it took you to get things working. When you upload your PKGBUILD to [[https://aur.archlinux.org/ | AUR]], you can actually save someone this amount of time.