LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   How to build a Slackbuild script? (https://www.linuxquestions.org/questions/slackware-14/how-to-build-a-slackbuild-script-841190/)

Laodiceans 10-29-2010 10:46 AM

How to build a Slackbuild script?
 
Any links to a guide for building a slackbuid script?

The link http://www.slackwiki.org/Writing_A_SlackBuild_Script don't show nothing!

GrapefruiTgirl 10-29-2010 10:59 AM

Yes, interesting. Seems the domain has... Gone away. :/

What I'd suggest, unless you want to search for a guide somewhere (there's probably another one - check the LQ Slackware Wiki section!), is to just grab a Slackbuild script from some package, and examine it. Grab a few, examine & compare them. You can change it, re-write it to suit whatever you are trying to do.

The existing scripts have some commentary, are laid out clearly, and are not overly complicated so the format & intent of the various sections isn't too hard to figure out. If you don't have/find a guide, and have particular questions about something in the scripts, ask away.

Good luck & kind regards.

catkin 10-29-2010 11:12 AM

There is some information and a link to templates at http://slackbuilds.org/guidelines/. You can see some errors that this stumbling novice made and solved with great help from LQ here.

piratesmack 10-29-2010 11:23 AM

Here is Google's cache of that page:
http://webcache.googleusercontent.co...&ct=clnk&gl=us

Laodiceans 10-29-2010 12:42 PM

Thanks I will try to examine some Slackbuild scripts and use the cached page from google and the linuxpackages.com information about it too.
Any questions I will ask!

dive 10-29-2010 04:01 PM

Have a look at the templates: http://slackbuilds.org/templates/

dive 10-29-2010 04:02 PM

BTW Slackwiki will be back.

*Edit: it is back already.

jostber 10-30-2010 09:22 AM

You also have the Slackbuild toolkit from Eric H.:

http://alien.slackbook.org/AST/
http://alien.slackbook.org/blog/alie...build-toolkit/

dive 10-30-2010 06:02 PM

Might as well pimp my own then ;-)

http://dawoodfall.net/latest-projects/3-mkslack

Laodiceans 10-31-2010 06:03 AM

Is good to see that the community is still very strong.

vonbiber 11-01-2010 09:13 AM

building a package from source is most of the time
1. unpacking the source archive
2. ./configure __with_some_options
3. make
4. make install DESTDIR=SOME_TEMPORARY_FOLDER_HOSTING_THE_BUILT_FILES

But of course there are a lot of exceptions.
What I usually do is
1. I use a metascript (slackgenerator) that writes a skeleton
apname.SlackBuild
2. I unpack the archive to a temporary folder
and look at the README, INSTALL, etc. to find out
about specific options
3. If there's a configure script, I run
./configure --help
and see if there are any specific options to add
to the SlackBuild script
4. I copy the apname.SlackBuild to source folder, edit
it to remove any unecessary stuff and test it step by step
by commenting out everything except the first step (e.g., configure)
If there are errors (such as a missing library, I try to install
them before proceeding)
Then I continue: make, etc.

Sometimes there are no configure script but an autogen.sh
or just a plain Makefile
Some files need to be tweaked once in a while (Makefile, etc.)
I do it with sed

I learned a lot by looking at the src2slack script
(sorry, I forgot who wrote it), the SlackBuild scripts
at the slackbuild web site, and of course from the SlackBuilds
found in the source directory of slackware.

I suggest you first try to build some simple stuff
starting from a SlackBuild found in the source tree of
the slackware distro.
Start with the ones that only have
Code:

configure ...
make
make install DESTDIR=$PKG


Skaperen 11-01-2010 04:00 PM

When looking at that slackbuild guidelines several months back, what I remember was it needed some more simplistic example so it was clear what settings were needed for slackbuild context, and what was specific to certain packages. Maybe a minimal SlackBuild for a minimal HelloWorld program might be nice for some people. Otherwise, we just figure it out by finding 2 or 3 really simple packages and seeing what their SlackBuild files have in common.

I also vaguely remember some confusion as to identifying 32 vs. 64 platforms, and some SBo limitations on architectures (I like to experiment with ARM, MIPS, PPC, Sparc, and S/390).

Alien Bob 11-01-2010 05:15 PM

Quote:

Originally Posted by Skaperen (Post 4146143)
Maybe a minimal SlackBuild for a minimal HelloWorld program might be nice for some people.

Play around a bit with my interactive SlackBuild creator at http://slackware.com/~alien/AST . See what the results are when selecting each of the templates "web" (my own rich template) "sbo" (the http://SlackBuilds.org template) or "bare" (template for a SlackBuild script that stays closest to an original Slackware script).

By changing the parameters of the webform and looking at the results you will get an idea of how a SlackBuild is constructed from parts with well-defined functionality.

Eric

ChrisAbela 11-02-2010 04:23 AM

Quote:

Maybe a minimal SlackBuild for a minimal HelloWorld program might be nice for some people.
I had compiled one when I wanted to understand how SlackBuilds work and it can be downloaded from here:

https://www.yousendit.com/download/d...cTJrYUJFQlE9PQ


All times are GMT -5. The time now is 11:34 PM.