LinuxQuestions.org
Help answer threads with 0 replies.
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-16-2008, 06:04 PM   #1
-{Jester}-
Member
 
Registered: Apr 2008
Location: The Internet
Distribution: Slackware
Posts: 49

Rep: Reputation: 15
Slackware Package Management Best Practices


I was wondering if the more experienced members would not mind sharing the way that they handle/manage packages on their system. Obviously when a Slackware package is available, using installpkg is the logical choice. I also use slapt-get to keep my system up to date with the latest security patches. I guess mostly what I am wondering about is what you guys do when you have to build something from source. Before I actually do build something from source, I do check SlackBuilds.org to see if there is a script. However, so far I have had to build several things from source.

I'd be nice to have everything in a centralized place so I can just use pkgtool to manage everything. Should I just learn to write SlackBuilds scripts, or are there other alternatives?

Last edited by -{Jester}-; 04-16-2008 at 10:59 PM. Reason: spelling...
 
Old 04-16-2008, 06:19 PM   #2
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
What I do when I want to add something to Slackware that has no Slack package, is download the source, run the configure & make scripts with the option(s) I want for my system, and if it will configure & make with no problems, I then run src2pkg with the config & make options I used, and I make a slackpackage from the source.
Then, it can be installed/removed with the built in SLackware package manager.

Note that you will STILL need to monitor for updates, security patches etc.. for the packages you make, if they are not part of the official Slack tree.

I also build most everything from source, for several reasons, though none of them new, exciting, or earth-shattering but this way, I keep the sourcecode package around somewhere, the .tgz slackpackage somewhere else, and I can otherwise do all the package manager functions (install/remove/view/etc..) to it.
If I decide to upgrade the package with a newer version, I either (not usually) remove it with package manager, then install the new one, OR (usually) do like "upgradepkg OLDPKGNAME%NEWPKGNAME" to upgrade to the newer version.

See my signature for the way to GNashley's src2pkg - it is AWESOME!

Sasha

Last edited by GrapefruiTgirl; 04-16-2008 at 06:20 PM.
 
Old 04-16-2008, 06:25 PM   #3
jelaiwang
LQ Newbie
 
Registered: Nov 2006
Posts: 28

Rep: Reputation: 15
Here's what I do:
  • Most packages can be managed using tools like slackpkg/slaptget/swaret (which are scripts around the standard Slackware pkgtool suite). These are usually set up to communicate directly to a Slackware mirror. I use slackpkg.
  • For software that doesn't come from an official Slackware package repository, but has a package, I'll download it and manually use installpkg. For me, this includes stuff like the proprietary ATI drivers or stuff from linuxpackages.net.
  • For software that comes as a binary package, but not in Slackware tgz format, like rpms, I'll use src2pkg.
  • For software that comes as source code, I'll either use src2pkg or a SlackBuild. In the old days, I would configure, compile, and at the make install step run checkinstall to create a Slackware package (then I use installpkg). These days I've found src2pkg to be really good.
Hope this helps. Looks like the only thing you are really missing is src2pkg or trackinstall/checkinstall.

Last edited by jelaiwang; 04-16-2008 at 06:26 PM.
 
Old 04-16-2008, 10:01 PM   #4
BCarey
Senior Member
 
Registered: Oct 2005
Location: New Mexico
Distribution: Slackware
Posts: 1,477

Rep: Reputation: Disabled
Quote:
Originally Posted by GrapefruiTgirl View Post
What I do when I want to add something to Slackware that has no Slack package, is download the source, run the configure & make scripts with the option(s) I want for my system, and if it will configure & make with no problems, I then run src2pkg with the config & make options I used, and I make a slackpackage from the source.
Sasha,

You may have some other reason for doing it that way (like generating scripts), but if you have already compiled your software you can create the package directly with "trackinstall" (comes with src2pkg). You don't need to re-compile it by running src2pkg.

Brian
 
Old 04-17-2008, 02:52 AM   #5
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
You can also try paco as an alternative.
 
Old 04-17-2008, 03:53 AM   #6
duryodhan
Senior Member
 
Registered: Oct 2006
Distribution: Slackware 12 Kernel 2.6.24 - probably upgraded by now
Posts: 1,054

Rep: Reputation: 46
Quote:
You may have some other reason for doing it that way (like generating scripts), but if you have already compiled your software you can create the package directly with "trackinstall" (comes with src2pkg). You don't need to re-compile it by running src2pkg.
Although src2pkg will make the whole package as normal user too and you won't need to be root (not that it matters

and I remember gnashley saying somewhere that people should use src2pkg and not trackinstall as src2pkg does more stuff , I just don't remember what.. I guess we should just wait for him !
 
Old 04-17-2008, 03:56 AM   #7
rkrishna
Member
 
Registered: Mar 2005
Location: chennai(madras), India
Distribution: slackware ofcourse
Posts: 654

Rep: Reputation: 32
hello i was also asking the same question

http://www.linuxquestions.org/questi...aptget-634835/

Sbopkg - a command line and dialog tool to interact with the SlackBuilds.org repository

http://code.google.com/p/sbopkg/
 
Old 04-17-2008, 05:40 AM   #8
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,768

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
duryodhan, there are several good reasons to use src2pkg instead of trackinstall. Mainly because it will keep a better record of any special options you have passed to the configure script, but it is also very helpful when the sources can't be configured and compiled with the usual './configure && make && make install' trio of commands. It is also able to handle sources that use scons, jam, imake and cmake -usually without any help at all. There are only a couple of cases where trackinstall may be able to create a package and src2pkg can't -such as with some pre-compiled binaries which use an interactive installation script.

I'm glad to see that jelaiwang mentioned using src2pkg instead of rpm2tgz -src2pkg does a much more thorough job of converting binary packages from rpm or deb format since the resulting package conetent id subjected to all the usual src2pkg conetent checks -like being sure that directories have the right ownership and permissions, plus stripping the libs and bins, compressing the man-pages if needed and any other special steps which you ask for. rpm2tgz has been around a long time and is part of the official Slackware release, but it is really not adequate for converting *binary* rpm packages, though it works fine for converting srpm's -that is rpm source archives. If you point src2pkg at an rpm source archive, it will unpack it and try to compile it like a regular tar.gz/tar.bz2 source archive.

My advice about keeping your system up-to-date is to just check the Slackware site from time to time for patches to your installed version, or subscribe to receive the security upgrade notices. Then just manually download the packages and use upgradepkg to install them. Trying to keep up with 'current' is not a good idea if you like to keep your installation stable or if you have other things to do besides continually messing with your system.
 
Old 04-17-2008, 08:16 AM   #9
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Definitely -- like gnashley said too, keeping up with 'current' is prolly a hassle with ANY distro, unless that's "your thing".. FWIW I have a bunch of stuff (like Bash for example, and HDparm) that ARE in the Slack tree, however I have upgraded them beyond the version that Slack currently offers in its stable tree.
Therefore, when I run Slackpkg --update and then Slackpkg --upgrade-all it will often tell me to 'upgrade' to an older package. This is part of what you will want to monitor on your own, if you are installing stuff from outside the supported tree.
Maybe one day, the version of BASH that I am using, WILL be the version included in Slack, in which case I will select "Yes - upgrade Bash" but until then, I must just keep an eye on that package myself, and choose how/when to upgrade it.

PS - Good to see you gnashley; I have been away for a while, but have got the NEW src2pkg already, and as usual, love it!

Sasha
 
Old 04-17-2008, 10:50 AM   #10
MannyNix
Member
 
Registered: Dec 2005
Location: ~
Distribution: Slackware -current, OpenBSD
Posts: 449

Rep: Reputation: 41
Quote:
Originally Posted by GrapefruiTgirl View Post
..when I run Slackpkg --update and then Slackpkg --upgrade-all it will often tell me to 'upgrade' to an older package. This is part of what you will want to monitor on your own, if you are installing stuff from outside the supported tree.
Yes, or maybe add it to etc/slackpkg/blacklist and remember it
 
Old 04-17-2008, 11:34 AM   #11
shadowsnipes
Senior Member
 
Registered: Sep 2005
Distribution: Slackware
Posts: 1,441

Rep: Reputation: 70
For keeping up to date on your custom software I recommend joining their respective mailing lists or adding their feeds to your favorite rss agregator. If they don't have either of those, then you will probably just have to check their site once in a while (or find someone who blogs about it all the time and add their rss feed).

There are tons of alternatives to use in package building with Slackware. Personally, I tend to write my own slackBuild if one is not available. Usually I can just slightly modify one of my existing build scripts, so it does not take too much effort. I test building it manually first, however. It would be quicker to use src2pkg, though. If you do make a slackBuild, however, then you can possibly contribute to the slackBuilds.org project, which is always appreciated. Keep in mind that there are other build script repositories other than SlackBuilds.org (see the links in the SlackWiki for some examples).

After my packages are built I always put them under a directory under /root since root is the one that will install them. I divvy them up (have separate folders) based on how they were made (manually, official slackware packages, slackBuilds, src2pkg, etc).

Before I install a package I run a quick sanity test script. This will tell me if I am about to overwrite any files and will show me the contents of the doinst.sh script.

If you ever decide to install a binary package and aren't familiar with the source, I recommend taking a close look at the package. Pay particular attention to what the file permissions are on the folders. I've seen some bad packages that look good at first until you notice that /etc under the package doesn't have execute permissions for others. Do a tar tvf on the package to check the perms.
 
Old 04-17-2008, 01:05 PM   #12
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
blacklist

Quote:
Originally Posted by MannyNix View Post
Yes, or maybe add it to etc/slackpkg/blacklist and remember it
Well lol there's an idea!
Seriously, though I NEVER even think of the blacklist, that is a valid point; though my memory (MY memory) may fail me and I'll forever forget about anything I blacklisted

Thanks for that reminder though!

SV
 
Old 04-17-2008, 02:48 PM   #13
+Alan Hicks+
Member
 
Registered: Feb 2005
Distribution: Slackware
Posts: 72

Rep: Reputation: 54
There's nothing better than writing your own SlackBuild script. That's what I do, and I think that if you asked most of the real hardcore Slackers out there you'll find that is what they do as well.

To stay up to date, I rsync down patches/ in a nightly cron job and then apply them as needed manually. I never trust my systems to any automagical tool
 
Old 05-18-2008, 12:15 AM   #14
sfxpt
Member
 
Registered: Feb 2008
Distribution: Debian Testing
Posts: 99
Blog Entries: 3

Rep: Reputation: 16
gnashley, what do you say about deb2tgz and src2pkg? same thing as rpm2tgz?

thanks

xpt
 
Old 05-18-2008, 01:20 AM   #15
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,276

Rep: Reputation: 686Reputation: 686Reputation: 686Reputation: 686Reputation: 686Reputation: 686
Quote:
Originally Posted by sfxpt
gnashley, what do you say about deb2tgz and src2pkg? same thing as rpm2tgz?
Well, I'm not gnashley, but I would say that deb2tgz=bad, rpm2tgz=bad, src2pkg=good. deb2tgz and rpm2tgz attempt to create Slackware packages from packages built for other systems. This has a high percentage of not working. For RPMs, "alien" is better than rpm2tgz because it tries to use the install script properly (rpm2tgz has issues with that). I don't know much about deb2tgz, but it would be similar. Building a package for your specific distro is ALWAYS better than trying to convert a package from another distro.

I can guarantee gnashley will say he likes src2pkg -- since he wrote it. src2pkg actually compiles the application from source code, trying to "guess" the correct parameters (or you can pass your own) and building a nice package. I haven't tried it myself, but from what I've heard it has very good accuracy. src2pkg *can* also try to convert rpms (and as gnashley said it does a better job than rpm2tgz), but that's really not its main function -- and it's really a last-resort (like if a package is ONLY distributed as an RPM with no sources). Try src2pkg to build your packages from source -- you'll probably be pleasantly surprised.

Last edited by T3slider; 05-18-2008 at 01:21 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Slackware security - package management 52fitz Slackware 4 02-21-2006 03:28 PM
software management - best practices? curmudgeon42 Linux - Software 1 06-03-2004 09:12 PM
Slackware Package Management gonzalo76 Slackware 12 05-11-2004 07:20 PM
Slackware Package Management kemplej Slackware 1 12-22-2003 05:34 PM
slackware package management Vlad_M Slackware 6 08-15-2003 04:20 AM


All times are GMT -5. The time now is 05:22 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration