LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-03-2008, 02:58 AM   #1
stu_mueller
Member
 
Registered: Aug 2006
Location: England
Distribution: Slackware, Zenwalk
Posts: 114

Rep: Reputation: 15
SlackBuild scripts


Sorry for the newb posting.

I see a lot of references to SlackBuild script, what are they? As far as I can gather you download a Build script and the source for the program you want, put them in the same directory run the script and it will build you a package, or do you just run the script without downloading the source?

I presume the slackbuild script will ./configure make and make install the programs sources and then create a package for you? which will save you the time of configuring and installing manually?

Can I use any version of hte source with a slackbuild script or is each slackbuild script specific to a certain version of the application in question.. ie could i have a slackbuild script for kplayer and download any version of the kplayer source?

Which is better to use the packages found off linuxpackage.net or slackbuild scripts? And why do some packages come with slackbuild scripts?

Thanks for taking hte time to answer my questions

Stu
 
Old 04-03-2008, 03:09 AM   #2
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Quote:
Originally Posted by stu_mueller View Post
As far as I can gather you download a Build script and the source for the program you want, put them in the same directory run the script and it will build you a package, or do you just run the script without downloading the source?
The first one.
Quote:
Originally Posted by stu_mueller View Post
I presume the slackbuild script will ./configure make and make install the programs sources and then create a package for you? which will save you the time of configuring and installing manually?
That's right.
Quote:
Originally Posted by stu_mueller View Post
Can I use any version of hte source with a slackbuild script or is each slackbuild script specific to a certain version of the application in question.. ie could i have a slackbuild script for kplayer and download any version of the kplayer source?
Generally they're specific to a particular version, but it's usually quite simple to make it work for another version. Often, it's just a case of changing the version number in the script.
Quote:
Originally Posted by stu_mueller View Post
Which is better to use the packages found off linuxpackage.net or slackbuild scripts? And why do some packages come with slackbuild scripts?
I tend not to use the linuxpackages.net packages, especially if they don't come with a build script. I mostly get my SlackBuilds from www.slackbuilds.org.
Quote:
Originally Posted by stu_mueller View Post
Thanks for taking hte time to answer my questions
No problem Hope it helps.
 
Old 04-03-2008, 04:53 AM   #3
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Quote:
Originally Posted by stu_mueller View Post
I see a lot of references to SlackBuild script, what are they? As far as I can gather you download a Build script and the source for the program you want, put them in the same directory run the script and it will build you a package, or do you just run the script without downloading the source?
The SlackBuild scripts that I write and publish at http://www.slackware.com/~alien/slackbuilds/ will download the sources in case they are missing, but that is not common practice. The SlackBuild scripts made available at http://slacky.eu do this too I think.

A SlackBuild script is nothing more than formalizing what you otherwise do manually when compiling a piece of software. The advantage is that a good script also creates a proper Slackware package that you can install as well as cleanly uninstall. And also, it allows you to upgrade to a newer version of the software easily because it would involve changing only a single variable in the script, get the new source tarball and compile the new package by executing a single command. It is ease-of-use.

Regards, Eric
 
Old 04-03-2008, 05:23 AM   #4
stu_mueller
Member
 
Registered: Aug 2006
Location: England
Distribution: Slackware, Zenwalk
Posts: 114

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Alien Bob View Post
A SlackBuild script is nothing more than formalizing what you otherwise do manually when compiling a piece of software. The advantage is that a good script also creates a proper Slackware package that you can install as well as cleanly uninstall.
So will the slackBuild script install the software as well as creating a package, or will it just create hte package and leave it to you to install?

Quote:
Originally Posted by Alien Bob View Post
And also, it allows you to upgrade to a newer version of the software easily because it would involve changing only a single variable in the script, get the new source tarball and compile the new package by executing a single command.
So if a newer version of a piece of software comes out, I could change the variable in the slackbuild script, and re-run it to get the new version, would I then need to uninstall the old package, or could I just 'upgradepkg newpackage.tgz'?

Also why do some tgz packages come with SlackBuild scripts?

Thanks

Stuart
 
Old 04-03-2008, 05:40 AM   #5
chess
Member
 
Registered: Mar 2002
Location: 127.0.0.1
Distribution: Slackware and OpenBSD
Posts: 740

Rep: Reputation: 190Reputation: 190
Quote:
Originally Posted by stu_mueller View Post
So will the slackBuild script install the software as well as creating a package, or will it just create hte package and leave it to you to install?
No, installing packages is left to the administrator.

Quote:
So if a newer version of a piece of software comes out, I could change the variable in the slackbuild script, and re-run it to get the new version, would I then need to uninstall the old package, or could I just 'upgradepkg newpackage.tgz'?
Yes. Sometimes there is more to it than simply changing the version number if it's a major update, but usually that is all you need to do.

Quote:
Also why do some tgz packages come with SlackBuild scripts?
So you can view it, edit it, customize it, and make a package with exactly what options you need.

As an aside, I have created a little tool called 'sbopkg' which provides a way to easily interact with the SlackBuilds.org repository. You can browse a local copy of the repo, build packages, edit the slackbuilds, etc. from within a dialog interface or from the command line. It's still in a testing phase, but I have been using it personally and it has been working well. You can check it out and download a package for it at http://code.google.com/p/sbopkg.
 
Old 04-03-2008, 06:26 AM   #6
machines
LQ Newbie
 
Registered: Mar 2008
Distribution: slackware 12
Posts: 21

Rep: Reputation: 15
if i could just jump in on this topic with my own question, if you create a slackbuild script, would you need to put any uninstall commands in there, so as to enable uninstall at a later date? or will pkgtool just handle that?
 
Old 04-03-2008, 06:45 AM   #7
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
A SlackBuild script has a Slackware package as the end product. But then it is not yet installed to your computer.
The next step would be to install that package using Slackware's installpkg command. If you ever want to remove the package, you do so with Slackware's removepkg command.
A SlackBuild script needs to know nothing of these two commands. Read more about how you work with a SlackBuild script, at http://slackbuilds.org/howto/
 
Old 04-03-2008, 06:48 AM   #8
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Quote:
Originally Posted by machines View Post
if i could just jump in on this topic with my own question, if you create a slackbuild script, would you need to put any uninstall commands in there, so as to enable uninstall at a later date? or will pkgtool just handle that?
The idea is that pkgtool handles the installation and removal of the package created in the SlackBuild script by makepkg.

edit: too slow!
 
Old 04-03-2008, 09:03 AM   #9
machines
LQ Newbie
 
Registered: Mar 2008
Distribution: slackware 12
Posts: 21

Rep: Reputation: 15
thanks guys
 
Old 04-03-2008, 11:01 AM   #10
adriv
Member
 
Registered: Nov 2005
Location: Diessen, The Netherlands
Distribution: Slackware 15
Posts: 700

Rep: Reputation: 43
Quote:
Originally Posted by chess View Post
You can check it out and download a package for it at http://code.google.com/p/sbopkg.
I'm testing it right now and it looks promising.
 
Old 04-03-2008, 02:29 PM   #11
fcaraballo
Member
 
Registered: Feb 2004
Location: WA
Distribution: Slackware
Posts: 230

Rep: Reputation: 31
Quote:
So if a newer version of a piece of software comes out, I could change the variable in the slackbuild script, and re-run it to get the new version, would I then need to uninstall the old package, or could I just 'upgradepkg newpackage.tgz'?
Quote:
Yes. Sometimes there is more to it than simply changing the version number if it's a major update, but usually that is all you need to do.
However, even a minor update will not work as expected from time to time.

If you run into problems when changing the version number, I would email the maintainer first before posting here or the SBo mailing list. More than likely, they will already know why it didn't work and be able to suggest a workaround until a newer script can be made available.

After all, the SBo team only has enough time to test the versions that were submitted to them. They rely on the maintainers to know the ins and outs of the scripts they maintain.

MagicMan
 
Old 04-03-2008, 03:38 PM   #12
Romanus81
Member
 
Registered: Feb 2008
Posts: 201

Rep: Reputation: 31
Is there an advantage to using a SlackBuild script as opposed to something like src2pkg?
 
Old 04-03-2008, 04:23 PM   #13
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
Quote:
Originally Posted by Romanus81
Is there an advantage to using a SlackBuild script as opposed to something like src2pkg?
Good question. Both produce a .tgz package that you can install (at least I think src2pkg does or at least can, although I've never used it), so they're both pretty good. A SlackBuild allows you to go back and see all the options that were used to compile the package, so if you need to make any changes or recompile it or compile a newer version you can use it as a guide and only change what needs to be changed. It's a very nice log of events that can be transferred to any system (as long as any system-specific variables are changed). However, if there isn't a SlackBuild available, you must write it yourself (not that difficult to do, but you do need to learn how to build packages to be able to do it and not all packages have the exact same build procedure). src2pkg tries to do some of the above for you, so if there isn't a SlackBuild available, there is still a good chance that src2pkg will work with minimal effort to build a nice package. I'm not sure if src2pkg saves its compile options somewhere (someone else will have to answer that), so I'm not sure if it can be used as a reference like a SlackBuild or not.

If you don't wish to learn how to create SlackBuilds or if it is just too time-consuming, I have heard great things about src2pkg. I would ultimately recommend using slackbuilds.org first if they have a SlackBuild for the application you wish to install (since it's basically guaranteed to work since it's been tested). If they don't have a SlackBuild for the app you want, give src2pkg a try since it may still work -- but although I've heard it's pretty good, it may not work 100% of the time depending on the way the app needs to be compiled (there may be certain options that are required). I think you can also pass options to src2pkg in an application-specific way, so that'll make the chances of success even higher, but it requires knowledge of how the program SHOULD be compiled (read the documentation that comes with the app).

Basically it's a choice. Both are good ways. A SlackBuild allows you to customize everything about the compilation and maintains a record of what you did -- it is also, coincidentally, the way Pat builds his packages. src2pkg is a more automated solution that also produces great results. Research both and make an informed choice.
 
Old 04-03-2008, 04:25 PM   #14
chess
Member
 
Registered: Mar 2002
Location: 127.0.0.1
Distribution: Slackware and OpenBSD
Posts: 740

Rep: Reputation: 190Reputation: 190
Quote:
Originally Posted by Romanus81 View Post
Is there an advantage to using a SlackBuild script as opposed to something like src2pkg?
I have not used src2pkg, but the reason I like using SlackBuilds is that (1) it is the "native" way to make packages because that is what Patrick uses to create the official packages and (2) by manually examining the source code and writing a SlackBuild, I have a better understanding of how the source code works and how the package is created, and also have the opportunity to customize the final product by, for example, selecting only those configure options I want.
 
Old 04-03-2008, 09:29 PM   #15
duryodhan
Senior Member
 
Registered: Oct 2006
Distribution: Slackware 12 Kernel 2.6.24 - probably upgraded by now
Posts: 1,054

Rep: Reputation: 46
Finally src2pkg is a program. It can't be as smart as someone who has written down script. src2pkg works great many of the times , but slackbuilds are better if you don't want to think much.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Rebuilding a Slackware Package With Slackbuild Scripts Woodsman Slackware 11 10-14-2006 05:08 AM
Using slackbuild scripts Steve50 Slackware 3 10-11-2006 02:42 AM
Slackbuild and Patches stormtracknole Slackware 4 03-30-2006 08:12 PM
SlackBuild CrEsPo Slackware 2 03-19-2006 01:58 PM
Project FFMpeg (SlackBuild scripts) shilo Slackware 3 10-05-2005 10:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration