LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 11-15-2007, 12:35 PM   #31
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Original Poster
Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612

Lufbery, your experience with trying to package Open Office shows that not everything can be done automatically. This is especially true for large, complicated packages that support mulitple platforms. It would be impossible to write a program which would figure out all the options and possibilities and do the right thing without human intervention. This shows how important it is to take the time to examine what is happening when your packages are built and how they work once installed. src2pkg mostly tries to take the tedium out of running the same old steps time after time while you figure out what is needed to make the package really work. Of course, in may cases, no adjustments or extra code is needed. You were perfectly right to consult with a SlackBuild script, or even with an rpm .spec file if one is included. Usually you can just cut and paste the few needed lines from a SlackBuild script.
In the case of the above mentioned fixes for Open Office, only the relocation of the docs would be handled automatically by src2pkg. The other fixes can be done either by adding the lines of code to the src2pkg script or from a doinst.sh script. Any code you add in the script which creates links will be automatically written to a doinst.sh -unless you have supplied one. Some stuff can only be done from a doinst.sh, anyway. src2pkg makes it possible for you to combine manually written code for a doinst.sh with automatic creation of the link-creation code.
For manual adjustment of paths in the package you should usually add the code after the fake_install function is run, using the $PKG_DIR variable (although as mentioned you can paste code from a SlackBuild which uses $PKG).
I see that it mentions wrappers -these will have been manually adjusted or edited using a patch or sed within the SlackBuild. For wrappers, I usually create or alter them manually and then just add the code which places them in the package.
For instance, Open Office is started with a link in /usr/OpenOffice.orgx.x.x. which points to a wrapper which calls a binary. This is kind of a worst case scenario for such things. What I did for OpenOffice is create a wrapper to place in /usr/bin with this content:

#!/bin/bash
# soffice.wrapper
cd /usr/OpenOffice.org1.0.3 && exec ./soffice "$@"
exit 0

So, we have a wrapper which calls a link which is linked to *another* wrapper. A real mess this one, but the thing is that you need to be inside the main /usr/OpenOffice directory when you call the binary so that it can find its' other directories which contain all the binaries and shared data.

So then, the wrapper is placed in the same directory as the sources and src2pkg script and gety inserted into /usr/bin like this:

mkdir -p $PKG_DIR/usr/bin
cp $CWD/soffice.wrapper $PKG_DIR/usr/bin/soffice
chown root:root $PKG_DIR/usr/bin/soffice
chmod 755 $PKG_DIR/usr/bin/soffice

Moving pixmaps or other files is done in a similar manner -The only variables you need to understand are $CWD, $SRC_DIR and $PKG_DIR. Otherwise the commands are usually just like what you would do from the command-line.

Most software can be packaged well with little or no fixes of this sort. But some programs need lots of lines of manually inserted code which must be worked out and proofed by rebuilding many times. Still src2pkg makes it as easy as possible to do so without requiring you to be an expert script writer. If you have a look at the script I mentioned above for gcc-3.4.6, you'll see that it is mostly taken from the regular SlackBuild script and contains probably 50 lines of 'manual' code. Certainly a worst case scenario, but still no reason to not take advantage of whatever src2pkg can do automatically. In difficult cases, you simply comment out the src2pkg function and insert the manual code that is needed -usually this is either the code for configuration, compiling or installation of the software. Each src2pkg function can pretty much stand alone, so you can skip or add to any of the functions without losing the functionality of the rest. And even if it takes 50 lines of manual code, if it saves you writing and testing another 25-50 lines then it has made things easier.

I see that you tried out some of the other uses of src2pkg for creating packages from pre-built binaries like Opera, and for converting binary rpm's. It can also be used as a structure for creating 'noarch' packages or basically any kind of content at all.

I appreciate you taking the time to and choosing to review src2pkg for Linux.com. It will give some exposure for Slackware, as well.
I appreciate also the constructive-spirited criticism. I've never been happy with the documentation and have started over several times. I always wind up getting bogged down. I don't have to tell you how difficult it is to write clear concise paragraphs -especially for technical writing. The documents are spread out as a way of trying to resolve the main problem of writing good tech info -that is to be able to focus the writing toward a certain user knowledge level. Many users don't care to know about the why's or how's of advanced features. But others are keen to know exactly what src2pkg does and, why it does it that way, at every step. Since src2pkg (and trackinstall) have lots of capabilities it makes for a lot of info which should be provided. Now that the functionality and features have mostly stabilized there is a better chance of getting it right. As I mentioned to you privately, I used to write professionally, so I'm quite aware of the shortcomings. But I'm a typical coder in that I'd rather write code than document it. And by now, my level of experience makes it somewhat difficult for me to write effectively for less experienced users.
Anyway, thanks again for *your* efforts.
 
Old 11-15-2007, 10:24 PM   #32
Lufbery
Senior Member
 
Registered: Aug 2006
Location: Harrisburg, PA
Distribution: Slackware 64 14.2
Posts: 1,180
Blog Entries: 29

Rep: Reputation: 135Reputation: 135
Gilbert,

My review is slated, tentatively, to be published on Linux.com on Thanksgiving day, November 22nd.

The approach you outlined above for Open Office is what I started to figure out would be appropriate. But, I only started to figure that out after building a handful of packages a few different ways.

In any event, I'm saving this thread because your instructions are so clear and helpful.

As for the documentation issue -- I understand the challenge of writing technical documentation. What level of experience do your users have? What are the common problems they'll encounter? What information is most critical for them to know? What information will enhance their understanding after they've been using the product for a while? Etc.

It's a tall order.

Warm regards,

-Drew
 
Old 11-17-2007, 03:03 PM   #33
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Original Poster
Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
src2pkg-1.7 has been released, so I'll refer those reading this thread to the new thread which announces the new release. Please see here:
http://www.linuxquestions.org/questi...5/#post2962328
 
  


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
where to download src2pkg matters Slackware 8 01-28-2017 03:20 AM
New problem with src2pkg browser Slackware 67 02-09-2008 07:31 PM
src2pkg 1.5 question hitest Slackware 4 08-01-2007 02:58 PM
src2pkg has a new home! gnashley Slackware 19 07-16-2007 09:18 PM
PkgBuild/src2pkg upgrade gnashley Slackware - Installation 1 10-20-2006 07:28 AM

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

All times are GMT -5. The time now is 11:50 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