LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 09-18-2007, 02:34 PM   #1
BCarey
Senior Member
 
Registered: Oct 2005
Location: New Mexico
Distribution: Slackware
Posts: 1,453

Rep: Reputation: Disabled
src2pkg and non-standard configure


Hi,

I was trying to use src2pkg to compile avidemux2, but ran into a problem and I don't know what to do.

Basically the problem is (I think) that before running "configure" you need to run "make -f Makefile.dist". I don't know how to get it to do that.

It also seems to think the sources are "rpm2tgz" format, but they are definitely source code.

Any help would be appreciated.

Thanks,
Brian
 
Old 09-18-2007, 08:47 PM   #2
MS3FGX
Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
I know that src2pkg allows you to specify additional arguments for "make" and "configure", but I don't think there is any option to prefix those commands with another command entirely. Likewise, there is support for giving src2pkg a custom installation script, but that wouldn't be run until after it has already been compiled...

gnashley (the author) is fairly active on the forums though, and will certainly be able to advise you on the issue.

Incidentally, situations like this one are one of the main reasons I could never start using src2pkg as a serious tool on my system. How can I know which arguments to give configure, or if there are any special build requirements, without decompressing the source tarball? If I have already decompressed the source, then one of the main advantages of src2pkg is already out the window. I just never really understood the logic of it; perhaps I am missing something.

Not that writing slackbuilds really alleviates the issue, but at least there I have direct control over the build process and can adjust it accordingly.
 
Old 09-18-2007, 09:48 PM   #3
BCarey
Senior Member
 
Registered: Oct 2005
Location: New Mexico
Distribution: Slackware
Posts: 1,453

Original Poster
Rep: Reputation: Disabled
Let me also ask a different src2pkg question: is there a way to use src2pkg to create a slackware tgz for source code that is already compiled (ie. like you would use checkinstall)?

Brian
 
Old 09-19-2007, 01:38 AM   #4
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,750

Rep: Reputation: 462Reputation: 462Reputation: 462Reputation: 462Reputation: 462
BCarey: For the first problem, the easiest way is to first have src2pkg generate a script for using the -N option. Then open it with your favorite editor and insert the needed line between fix_source_perms and configure_source, like this

fix_source_perms
cd $SRC_DIR && make -f Makefile.dist
configure_source

Don't worry about it incorrectly guessing that it's a rpm2tgz format. src2pkg doesn't do anything special there anyway. That's a glitch in a routine that used to work more accurately. I just noticed the other day that it was falsely reporting that sometimes and have meant to simply remove the prompt as src2pkg is just trying to brag about how smart it is anyway :-).

As for the second question, src2pkg includes the trackinstall program which works mostly the same as checkinstall for sources you have compiled. Or if it's a pre-compiled binary with an installer script you can do that also by using trackinstall -S -i='installer-script-command'

MS3FGX, while src2pkg can very often produce a proper package on the first try, I don't expect you to automatically trust, use or distribute the package it produces the first time. You should always examine the contents of the uncompressed PKG_DIR and any doinst.sh script which is produced for accuracy. Quite often the *perfect* will require an extra rule or line of extra code(like adding an xinitrc file, etc).
Also, you'll usually want to edit the slack-desc file which gets generated(unless you already created one before running src2pkg). I usually start a build by running
src2pkg -N tarball-name (this just creates a script and new.slack-desc without doing anything else.
Then I start the first build by running 'srcpkg -X' which just executes script.
Then, while it is building I go in and open the README .spec or control file and pull the text I want for the slack-desc file and put it in there and then change the name of it to just slack-desc. (The naming scheme keeps any slack-desc file from getting clobbered. If you run src2pkg -N or -A, the new.slack-desc gets rewritten each time).
Usually there is enough time to edit and rename the new.slack-desc file before src2pkg gets to the point of inserting the file into the PKG_DIR, so it can be included in the first build.
Either way, when src2pkg has finished the first build you can take your time to look into the PKG_DIR and/or SRC_DIR to see whether the build has succeeded in doing everything you want or expect. If not, lines can be easily added to the script.
You can then re-run the build and use the -W option to remove the temporary files and dirs.
I highly encourage you to always check the package content and re-run the build after any changes. This is only annoying when the compile takes a long time.

The default build which src2pkg carries out is normally based on the generic commands ./configure, make, make install. Obvoiously this doesn't work for all sources and src2pkg can certainly *not* interpret the README file to figure out some weird directions that might be there, or know that you need to pass '--enable-hellfire-and-brimstone' to get it to compile. (I do still have plans to make it read the configure line from any included .spec file and try those options if you have not given any configure options and the build has failed) This sort of interpretation is pretty far-out and hence low-priority.

src2pkg is very flexible. If you can't figure out how to get the built-in routines to do what you want, just comment them out and insert the needed lines of code. This still saves you *lots* of lines of coding and the only variables you need to know about usually are CWD, SRC_DIR and PKG_DIR. I quite often comment out one or all of the configure_source, compile_source and fake_install lines and insert lines there. Also, many, many packages need manual code to repair operations which are incorrectly done by the Makefile, or to add special content which the sources, or you, provide. Usually even complex changes can be coded with just a few lines and you can still take advantage of the automatic features for the rest of the build. Each of the src2pkg functions is designed to be independent to make this possible.
 
Old 09-19-2007, 10:06 PM   #5
BCarey
Senior Member
 
Registered: Oct 2005
Location: New Mexico
Distribution: Slackware
Posts: 1,453

Original Poster
Rep: Reputation: Disabled
Thanks, gnashley, that seems to be working (its compiling now).

Brian
 
  


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
src2pkg-1.6 released gnashley Slackware 32 11-17-2007 03:03 PM
where to download src2pkg matters Slackware 2 06-11-2007 06:29 AM
Configure kernel source for standard debian kernel (module install) twinkers Debian 2 12-22-2005 11:19 AM
standard configure and Mandrake 10.1 CE FireHawk321 Linux - Software 3 11-24-2004 04:18 PM
How do I configure my standard Session-type erik_wout_ew2 Linux - Software 4 12-09-2003 11:02 AM


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

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