LinuxQuestions.org
Help answer threads with 0 replies.
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 06-05-2013, 05:42 PM   #1
neymac
Member
 
Registered: May 2009
Distribution: Slackware64-14.1
Posts: 138

Rep: Reputation: 19
Question desc files and slackbuilds


Someone knows why the "slack-desc" files are not included inside the slackbuild files? Is there any advantages to use them alone? I think that if the slack-desc files were inside the slackbuilds it would be easier and save some space (a little bit).

Last edited by neymac; 06-05-2013 at 05:47 PM.
 
Old 06-05-2013, 06:47 PM   #2
Diantre
Member
 
Registered: Jun 2011
Distribution: Slackware
Posts: 515

Rep: Reputation: 234Reputation: 234Reputation: 234
It's possible to put the slack-desc file inside the SlackBuild script, however pkgtools (installpkg, upgradepkg, etc.) need this file inside the package in the install directory. So at the end you'll need a separate slack-desc, at least inside the package.

The advantage of having separate slack-desc files (in my opinion) is that you need less code in the SlackBuild to handle the description text, and if the description for a package changes, you don't need to modify the SlackBuild and vice-versa. I don't really see a disadvantage with the description files, the space you'd save by eliminating them wouldn't be that much.

The beauty of the Slackware packaging is that it doesn't restrict you in any way. If you want to create your SlackBuilds scripts with the slack-desc inside them, go right ahead. If you want to code your SlackBuild in python (or any other language for that matter), you can do that too. The only thing that the package tools expect is a /install/slack-desc file and an optional /install/doinst.sh.
 
Old 06-06-2013, 06:05 AM   #3
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018
I don't think it'd really save any space, but it's one less file to worry about. However, as the slackbuild tar files also tend to contain a README and a .info file there is probably less advantage of internalising the slack-desc to the script.

I've been using this sort of mechanism in my personal slackbuilds, so it's certainly doable.
This is from my kernel.Slackbuild script.
Code:
cat > install/slack-desc <<_EOF
kernel-${OBJVER}: Kernel ${OBJVER}
kernel-${OBJVER}:
kernel-${OBJVER}: This is an all-in-one package that contains
kernel-${OBJVER}: a linux kernel, its modules and its build directory.
kernel-${OBJVER}:
kernel-${OBJVER}: Package includes:
kernel-${OBJVER}:   /boot/vmlinuz-${OBJVER}
kernel-${OBJVER}:   /boot/System.map-${OBJVER}
kernel-${OBJVER}:   /lib/modules/${OBJVER}/...
kernel-${OBJVER}:   /usr/obj/${OBJVER}/...
kernel-${OBJVER}:
_EOF
 
2 members found this post helpful.
Old 06-06-2013, 10:43 AM   #4
neymac
Member
 
Registered: May 2009
Distribution: Slackware64-14.1
Posts: 138

Original Poster
Rep: Reputation: 19
@Gazl: The space saved depends on the file system used (some slack-desc files are smaller than the minimum size required by the storage media to save a file - ext4 uses 4 Kbytes blocks sizes, then each small file must use at least 4 Kb to be storaged), and when added up through thousands of them, it could save a little bit of space, mainly on the slackbuild.org and mirrors of slackware servers around the world. I'm not sure how much space would be saved because I didn't make the maths yet (and I don't know how to do it, but I'm sure that the amount of size added to the Slackbuild script will be smaller than that used by one regular slack-desc file on a storage media).

Last edited by neymac; 06-06-2013 at 11:08 AM.
 
Old 06-06-2013, 10:59 AM   #5
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
slackbuilds.org currently hosts 3685 slack-desc files, which, altogether, take up 3,254,441 bytes. This is an average of 883 bytes per slack-desc file, and all 3685 files take up only 3.25MB, or 3.10 MiB. On any modern filesystem this is absolutely negligible. The only reason to integrate slack-desc into a SlackBuild is to make sure they don't get separated -- if you have the SlackBuild, you have everything you need to build the package. If that is not a concern, then there is no reason whatsoever to integrate the two.
 
3 members found this post helpful.
Old 06-06-2013, 11:20 AM   #6
neymac
Member
 
Registered: May 2009
Distribution: Slackware64-14.1
Posts: 138

Original Poster
Rep: Reputation: 19
Quote:
Originally Posted by T3slider View Post
slackbuilds.org currently hosts 3685 slack-desc files, which, altogether, take up 3,254,441 bytes. This is an average of 883 bytes per slack-desc file, and all 3685 files take up only 3.25MB, or 3.10 MiB. On any modern filesystem this is absolutely negligible.
I agree, but each slack-desc file, depending on the file system used, needs at least 4KB of space (if using ext-4 file system), but even so it is still negligible as you've said.

Last edited by neymac; 06-06-2013 at 11:36 AM.
 
Old 06-06-2013, 11:47 AM   #7
neymac
Member
 
Registered: May 2009
Distribution: Slackware64-14.1
Posts: 138

Original Poster
Rep: Reputation: 19
The main reason I posted this thread was due the fact that sometimes when I run SlackBuilds scripts they complain the lack of slack-desc file (sometimes it was saved as slack-desc.txt due my mistake off course, and sometimes I just forgot to download them). But I noticed that some SlackBuilds (from some good slackware collaborators) integrates slack-desc into theirs SlackBuilds scripts (minus one file to worry about...).

Last edited by neymac; 06-06-2013 at 11:51 AM.
 
Old 06-06-2013, 06:34 PM   #8
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,661

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
if you used SlackBuild from SBo project, then slack-desc will be there as it's part of the regular check when people submit their script to SBo admins
 
Old 06-06-2013, 07:49 PM   #9
neymac
Member
 
Registered: May 2009
Distribution: Slackware64-14.1
Posts: 138

Original Poster
Rep: Reputation: 19
@willysr: I knew it, I just asked why the slack-desc files are not included (merged) with the SlackBuilds files like some scripts (non SBo's or official Slackware)are. With SBo's one I had no problems at all, thanks.

Last edited by neymac; 06-06-2013 at 07:58 PM.
 
Old 06-07-2013, 01:18 AM   #10
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
It's an old argument as to how much a build script should be stand-alone. It is nice in a way to have everything except the sources in a single script. But, there are always builds which don't lend themselves to this -builds which include patches, for instance. Some scripts contain a few lines of sed code to accomplish small changes in the sources where the same could be done with a small patch.

While writing src2pkg I gave lots of thought to such things. I decided that I liked using separate 'accessory' files better than trying to incorporate everything into the script. I like short, structured scrips where it easy to see how this build differs from other builds. Lots of build scripts contain repetitive code which is exactly like the code in many/most other scripts. I find this type of code distracts me from the real 'meaty' parts of the script -I want to be able to see at a glance exactly, and only the parts of this build which are not like many/most other builds. Of course, src2pkg accomplishes this by hiding the repetitive code in functions which are sourced and called by the script. Anything really unusual gets written between, or replaces, the function calls. I'm sure that many folks don't like that approach since it is not so immediately transparent. As said, the nice thing is that you can do it your own way.
 
1 members found this post helpful.
Old 06-07-2013, 01:55 AM   #11
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 875

Rep: Reputation: 282Reputation: 282Reputation: 282
Quote:
Originally Posted by neymac View Post
The main reason I posted this thread was due the fact that sometimes when I run SlackBuilds scripts they complain the lack of slack-desc file (sometimes it was saved as slack-desc.txt due my mistake off course, and sometimes I just forgot to download them).
If this is the problem the solution is to download the slackbuild package link and not the individual files links, that way you get a tar.gz that has the SlackBuild, slack-desc and anything else (other than source code) that you might need.

eg for ffmpeg you would download this link :-
http://slackbuilds.org/slackbuilds/1.../ffmpeg.tar.gz

and not these :-
http://slackbuilds.org/slackbuilds/1.../ffmpeg/README
http://slackbuilds.org/slackbuilds/1...peg.SlackBuild
http://slackbuilds.org/slackbuilds/1...eg/ffmpeg.info
http://slackbuilds.org/slackbuilds/1...peg/slack-desc
 
Old 06-07-2013, 04:33 AM   #12
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 wildwizard View Post
If this is the problem the solution is to download the slackbuild package link and not the individual files links, that way you get a tar.gz that has the SlackBuild, slack-desc and anything else (other than source code) that you might need.

eg for ffmpeg you would download this link :-
http://slackbuilds.org/slackbuilds/1.../ffmpeg.tar.gz

and not these :-
http://slackbuilds.org/slackbuilds/1.../ffmpeg/README
http://slackbuilds.org/slackbuilds/1...peg.SlackBuild
http://slackbuilds.org/slackbuilds/1...eg/ffmpeg.info
http://slackbuilds.org/slackbuilds/1...peg/slack-desc
Here is a quick, single-line command that will fetch the whole content of that ffmpeg directory:
Code:
lftp -c "open http://slackbuilds.org/slackbuilds/14.0/multimedia/ ; mirror ffmpeg"
Eric
 
2 members found this post helpful.
  


Reply

Tags
descriptors, slackbuild



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
[SOLVED] slackbuilds leftover files patostevens Slackware 3 02-23-2011 01:48 PM
slack-desc: not working? Transhour Slackware 7 02-05-2011 02:51 AM
Slackpkg and slack-desc Panci Slackware 9 04-05-2009 06:15 AM
Use SlackBuilds.org or my own hosting to offer up SlackBuilds? hollywoodb Slackware 6 11-30-2006 08:56 PM
Makepkg and slack-desc mirto Slackware 7 10-15-2005 03:17 PM

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

All times are GMT -5. The time now is 08:08 AM.

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