<div dir="ltr">I recently was working on creating a new SlackBuild and found it had several dependencies that were not on SBo, so I had to create those. Whenever I needed to do this, I would always grab the templates from SBo, however, it ends up requiring a lot of adjustments. There's just so much text to remove (comments in the SlackBuild, text in the .info, and adjusting the slack-desc to match the new appname and removing all the text in there).<div><br></div><div>I eventually prepped some local templates, but there's some minor work that needed to be done (moving the files, adding the various info, adjusting slack-desc, etc), so I figured I should just create a script to handle all of this for me.</div><div><br></div><div>It's pretty easy to use, you just call the script, specify the number that corresponds with the type of SlackBuild you want (autotools, python, cmake, etc), then the PRGNAM and VERSION. Optionally you can add a category at the end to keep things sorted that will be used as a subdirectory for your local repo. You can also use options to fill all the info in the .info (see sbgen.sh -h output for more details). The numbers for the various type of scripts (autotools, python, cmake, etc) correspond with the frequency of their usage on SBo, so it goes autotools, python, cmake, perl, haskell, ruby... 1-6. There is also a 7 for those scripts that don't use any of those build systems (make just repackaging a binary).</div><div><br></div><div>I will be adding an interactive version (like Slackware's adduser script) to allow easier copy/paste and to minimize long complex commands.</div><div><br></div><div>A simple script for a cmake-based SlackBuild would be:<br></div><div><span style="background-color:rgb(238,238,238)"><br></span></div><div><font face="monospace, monospace" style="background-color:rgb(238,238,238)">sbgen.sh 3 myprogram 2.6.7</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="arial, helvetica, sans-serif">But you can also get all of the .info filled using options:</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace" style="background-color:rgb(238,238,238)">sbgen.sh -w <a href="https://github.com/project/myprogram">https://github.com/project/myprogram</a> \</font></div><div><font face="monospace, monospace" style="background-color:rgb(238,238,238)">  -d <a href="https://github.com/project/myprogram/archive/2.6.7/myprogram-2.6.7.tar.gz">https://github.com/project/myprogram/archive/2.6.7/myprogram-2.6.7.tar.gz</a> \</font></div><div><font face="monospace, monospace" style="background-color:rgb(238,238,238)">  -m f4261584809b70f908a53fad87aa87e1 \</font></div><div><font face="monospace, monospace" style="background-color:rgb(238,238,238)">  -r "program1 program2" \</font></div><div><font face="monospace, monospace" style="background-color:rgb(238,238,238)">  3 program 2.6.7 libraries</font></div><div><font face="monospace, monospace" style="background-color:rgb(238,238,238)"><br></font></div><div>(You can use a capital D and capital M for the 64bit DOWNLOAD and MD5SUM variables.)</div><div><br></div><div>Hopefully this can cut down on a lot of the initial prep work when creating a new SlackBuild.</div><div><br></div><div>You can edit the top of the script to set your name, email, and copyright year, as well as the location to store the SlackBuilds once created. There's checks in place to make sure you don't overwrite existing SlackBuilds (unless you use the -f option to force it).</div><div><br></div><div><div>I'd love to hear your thoughts and suggestions as well as any issues you may have if you're willing to test.</div><div><br></div><div><a href="https://github.com/bassmadrigal/scripts/blob/master/sbgen.sh">https://github.com/bassmadrigal/scripts/blob/master/sbgen.sh</a></div></div><div><br></div><div>Thanks for your time</div><div>Jeremy (aka bassmadrigal on LQ)</div></div>