-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Package building assistance #66
Comments
Those instructions are for creating a slackware package for a plugin. Putting any binaries and webui pages from the SRC directory into a compliant installable slackware package with a date as the version number and modifies the plugin plg file with the package name. |
The binary packages I personally compile for unraid I do so in a VM with the latest version of unraid. I install my DevPack plugin which contains the headers that they remove from unraid for the binaries that are built in. DevPack also includes many of packages necessary for compiling. So first you need a VM or a install of unraid. I don't recommend your main install of unraid. But you could use it and the reboot once you're done. You need to create a build directory on you flash drive of the VM or unraid you're using to compile. Next install DevPack. Then you need to go to slackbuilds.org and search for the package you want to compile. In this case micro. I only saw a slackbuild for slackware 15 but it should work. You need to download the micro.tar.gz slackbuild file and extract it into the build directory you created on your flash drive in its own directory micro. (not sure if the slackbuild file has paths built in) It contains the micro.Slackbuild file which is the script to compile micro. I edit the Slackbuild file to output txz instead of tgz. Next you can download the source from slackbuild or the linux 64 source from github. You need the tar.gz format. Place that in the build/micro. Next you ssh into the vm and go to build/micro. The run sh micro.Slackbuild and see what errors or headers it complains about. Maybe you'll get lucky and it will compile. It will create the package in /tmp. You need to move that to your flash drive or somewhere other than temporary memory. |
@dmacias72 thank you very much for the writeup. That clears a ton of things up. My understanding of Unraid licensing is that starting the array requires a paid license, while booting into the OS shouldn't require anything. I'm unsure if I can install DevPack to an unlicensed Unraid install, but I'll look into it tonight. Perhaps I can install it on a trial then continue using it afterwards? I've done a quick writeup here which documents my understanding of what you've written. Please correct me where I've gone astray. I'm missing Environment Setup:
Build Package:
Prepare Git Pull Request:
Again, thank you for taking the time out to assist me with this. Hopefully I can pay it forward. |
Looks like you got it. The pkg_build.sh and mkpkg were only for creating packages for plugins. When I make a change to the NerdPack or other plugin I use them to create the new plugin package. I also forgot, you need to edit the micro.Slackbuild file and make changes at the top of the file to point to the new version of source if it's different. You don't need to extract the micro source either. Just place the micro-2.0.10-linux64.tar.gz in the same directory as micro.Slackbuild. While I have a couple unraid licenses, I never went through the process of setting up the VM using a second USB stick because at the time have 2 unraid usb sticks when booting wouldn't work constantly. Maybe the option to select the main boot USB wasn't complete yet. Now I think you can pick a particular USB to boot from and it will work. So I boot the VM with a virtual image. Can't remember if I just cloned my main usb or not. You are correct you can't start the array and unraid will complain about the invalid license. But you can install plugins and compile all you want. I just make copies of the virtual drive and upgrade so I can have multiple copies and run different versions. You can just do a pull request on the main branch. Just place the package in the correct unraid version directory. Also you can add the source slackbuild files under src like I've done for some packages. Also thanks very much for trying to do this. I just don't have much time anymore and rarely get on the forums. |
@dmacias72 Sweet. Ok Take II Environment Setup:
Build Package:
Prepare Git Pull Request:
I left the creation of a new branch branch management in there since A) It's best practice and B) it can really help compartmentalize things should someone be working on multiple different packages at a time (which people will definitely be doing since it makes sense to build 5 packages on the particular version of Unraid currently installed before moving to the next one vs cycling through versions X times per package, 5 different times) Unfortunately I ran out of time to test the VM (and the whole process) but I should be able to carve some time out tomorrow. Believe me, I know the horrific burden of discovering I've signed up for a forever task. Hopefully these instructions will allow absolutely anyone to build packages, meaning your job will just be to glance over/approve the pull requests and do periodic package updates. If you care to peel back the curtain a bit more on what happens when my instructions end, perhaps there's some more automated releasing that can be done. I have less than zero knowledge about how releasing plugins to Community Apps works, but walk me through it and maybe we can completely automate the process. Heck, how sweet would it be to feed a script the URL to download the source tar.gz, the SlackBuild tar.gz, and then sit back and let it crank out 15 different packages for 15 different Unraid versions, and finally push the entire shebang to the Community Apps store? |
It sounds great. For Community apps, I believe you have to create a repo with xml files pointing to the plugin repos. Community apps polls the repo for changes. Nerdpack just polls the packages repo for changes. So if you update a package, once it's pages to github, it will show up in unraid's webui. When you mentioned before about branches it got me thinking that all the packages should be separated out into their own repo for unraid packages. Then have different branches for different version of unraid. Nerdpack repo should just be for code changes. I really never add packages to older versions. Most people are either on the latest or version just before or testing the next version. |
Ok well I had a beautiful dream but I keep stepping on a rake at Stage 1. I cannot, for the life of me, get an Unraid VM working on a Windows or Mac machine. And that's using every human-flexible trick at my disposal, not even trying to script the process. How did you build your VM? |
I run my Unraid VMs on unraid. I followed some guide on the forum a long time ago but here's a link to a guide I just found. https://docs.ibracorp.io/virtual-unraid/ Edit: |
After try a few hours later. I mostly know what to do,but the package I make still need redo. OK, The first one is I using ubuntu, so maybe some can use? Second, I try use dev tools in unraid, but I try to make borg package in unraid, missing openssl. So cant make package. Even I check openssl version, and cli have show the version. So I swap to ubuntu, See Readme say copy makepkg to /sbin/makepkg. I find makepkg also in /sbin/makepkg in unraid, Copy this to /sbin/makepkg in ubuntu, Also change Chown(owner and group) to root in ubuntu. and change chmod in mc. on: read by owner, write by owner, execute/search by owner, read by group, execute/searchby group, read by other, execute/searchby other. I follow SlackBuild>download the build I want>follow #66 (comment) >Run xxx.slackbuild> get xxx.txz But I only get xxx.txz, not have md5, and the package still need redo. Because it still don't working. And size is strange, from nerdpack is 4.2MB, from me is less for 1MB. Who Know how to fix this? |
here is my script named
Everything works fine except that the md5 is not generated |
Howdy! I want to help create packages myself but I'm struggling with the instructions. I'm not familiar enough with the process to understand why certain things are being done, so I'm having trouble translating them to a different environment. Please bear with me as my questions will likely look like someone fumbling in the dark.
I'm using a Mac machine, but ultimately I think it would be beneficial to have the instructions cover all OSes. I'd be happy to walk through this process on multiple machines and really iron out the instructions so anyone can follow.
The first package I'd like to create is for micro so let's use that as an example. Currently I can install it on Unraid with:
For this operation, I'm assuming I should download the source code from their releases page, which I've done and I have unzipped in
~/example/micro-2.0.10
. Or am I taking a built/installed executable and zipping that into a package? Should I be using the/usr/bin/micro
from my Unraid server directly?copy tar-1.13 from unRAID to /bin/tar-1.13 on laptop
Is this used by
makepkg
? Is it referencingtar-1.13
or justtar
? Will any version do or does it have to be1.13
?Both Mac and Windows support tar natively, and I believe this is true of 99% of Linux distros as well. Can this step be eliminated entirely?
copy makepkg from unRAID to /sbin/makepkg on laptop
Mac locks down
/sbin/
quite thoroughly. You can get to it but it requires rebooting into a special safe mode. I putmakepkg
in/usr/local/bin/
and it appears on my PATH. Should that be enough?I modified gfjardim's pkg_build.sh to take an argument and add arch type plus modified the lettering function
Is this strictly for reference or should I be doing something with
pkg_build.sh
at this point? Presumablypkg_build.sh
should be somewhere specific, but where? The only one in this repo is/source/SlackBuild/rmlint/pkg_build.sh
. Is that right? Should I invoke it somehow?To compile the packages for unRAID plugin run from the source directory
sudo ./mkpkg plugin
This creates a slackware compliant package and md5 in the archive directory with the date as the version number
And adds the date to the plugin file in plugins directory.
e.g.
plugin-2017.06.09-x86_64-1.txz
andplugin-2016.06.09-x86_64-1.md5
Oh boy here we go. What is
the source directory
in this context? Is it~/example/micro-2.0.10
?sudo ./mkpkg plugin
predictably says that./mkpkg
can't be found. For grins I tried it withsudo makepkg micro
and it saidERROR: Package extension .micro is not supported
. I put my executable in/source/
, ransudo ./mkpkg micro
and it dumped an empty.txz
in/archive/
along with anmd5
.At this point I'm pretty stumped. I'm sure the instructions are complete if you have enough familiarity with this kind of thing, but as you can tell I'm clearly missing the important stuff. Please help :)
The text was updated successfully, but these errors were encountered: