LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-12-2008, 12:05 PM   #1
rpedrica
Member
 
Registered: Nov 2008
Location: Cape Town
Distribution: Slackware64 -current
Posts: 281

Rep: Reputation: 42
src2pkg and mod_perl ( perl mods with options )


@Gilbert: Apologies for the harassment, either I'm being dense or I'm finding all the corner cases. I'm trying to compile mod_perl which normally takes the following for its configure options:

perl Makefile.PL MP_APXS=/opt/apache2/bin/apxs

However, src2pkg doesn't seem to handle the additional MP_APXS option - I get the following error:

Correcting source permissions - Done
Found perl Makefile.PL - Running perl Makefile.PL -n
Reading Makefile.PL args from @ARGV
no conflicting prior mod_perl version found - good.

Next we need to know where the 'apxs' script is located. This script
provides a lot of information about the Apache installation, and makes
it easier to find things on your system. Normally it's located in the
same directory as the 'httpd' executable.


This means that the MP_APXS option is not being parsed. I've tried doing a base script and then editing it but no luck there - same issue. Tried using double quotes and character escape ( \ ) but no luck either.

I noticed that your examples do a lot of extra stuff after the fake_install section - would it not be better to do it make_doinst and make_package?

Finally, to get this going, I've commented out CONFIG_COMMAND and configure_src and put:

cd $SRC_DIR
perl Makefile.PL MP_APXS=/opt/apache2/bin/apxs

directly after it. That seems to do the trick - is that ok? Also, had to use FORCE_ZERO_LENGTH=YES otherwise a whole bunch of files are removed and that might not be a good thing.

Regards, Robby
 
Old 11-12-2008, 01:25 PM   #2
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Yeah, the handling of perl modules is just straight forward. I've not worked with them that much, so I was unaware that some needed options passed to them. This routine does not respond to extra otpions. Your solution is the correct one -just pluck out that offending eye, I mean comment out the offending instruction and replace with (usually) the exact same code you'd use from the command line -sometimes you have to make sure you are in the right place by putting 'cd $SRC_DIR) before starting. Each routine assures it is in the right place before doing anything, but less care is taken about ensuring that the function exits to the same location it started from.

I probably need to set FORCE_ZERO_LENGTH=YES any time a perl module is built -it seems that they nearly all contain empty place-holder files.

Do you mean do all extra steps just before running make_package? Of course you can do it that way, but I find it more sensible to group the commands more closely with the 'natural' order you'd do it manually. Also, because of all the extra things src2pkg does after fake_install it makes sense to do things earlier. For instance, if you need to add extra programs or scripts in with the binarioes which are installed by make install, if you do that just after fake_install runs, then src2pkg will take care of checking the perms and ownership of them.
All the little things that src2pkg does after running make install are the most important of all, as they (try to) assure package sanity and completeness.
 
Old 11-16-2008, 10:14 AM   #3
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Here's a fix for that -I'd appreciate it if you try it out -I don't have apaches sources to try this out completely, but it appears to be working.

You need to edit /usr/libexec/src2pkg/06-configure_source lines starting at 416 from this:
Code:
	elif [[ -f $CONFIG_DIR/Makefile.PL ]] ; then
		echo $BLUE"Found perl Makefile.PL - "$NORMAL"Running perl Makefile.PL -n"
		cd $CONFIG_DIR;
		perl Makefile.PL -n
		# set this because perl modules usually conatin empty place-holder files
		FORCE_ZERO_LENGTH=YES
to this:
Code:
	elif [[ -f $CONFIG_DIR/Makefile.PL ]] ; then
		echo $BLUE"Found perl Makefile.PL - "$NORMAL"Running perl Makefile.PL -n"
		cd $CONFIG_DIR;
		if [[ $MAKE_COMMAND != "" ]] ; then
		  echo $BLUE"Compiling perl module using: "$NORMAL $MAKE_COMMAND
		  $MAKE_COMMAND
		else
		  echo $BLUE"Compiling perl module using: "$NORMAL "perl Makefile.PL -n $EXTRA_CONFIGS"
		  perl Makefile.PL -n $EXTRA_CONFIGS
		
		fi
		# set this because perl modules usually contain empty place-holder files
		FORCE_ZERO_LENGTH=YES
		# this is a safer bet than DESTDIR
		INSTALL_TYPE=JAIL
This will let you do what you want two different ways:
You can either set MAKE_COMMAND to the full line, just like you use from the command line:
MAKE_COMMAND="perl Makefile.PL MP_APXS=/opt/apache2/bin/apxs"
or set EXTRA_CONFIGS like this:
EXTRA_CONFIGS="MP_APXS=/opt/apache2/bin/apxs"
src2pkg will then compose that to:
"perl Makefile.PL -n MP_APXS=/opt/apache2/bin/apxs"

Let me know if that works as this will be useful for other modules.
 
Old 11-16-2008, 09:08 PM   #4
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,

As a follow-up, please let me know if any of this will be useful in the src2pkg wiki. :-D

Regards,
-Drew
 
Old 11-17-2008, 01:41 AM   #5
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Once the new release is out, it would be good to mention that variables can be passed using either method when compiling perl modules. But since the code is now built in, it shoulddn't be mentioned as a hack that the users needs to do(editing the code, I mean). I just suggested that rpedrica try it so that the code is tested before releasing. I am getting close to a release -it has been a long time and again the list of changes is quite long. Over the summer I moved which hasn't helped in getting a release out.
 
Old 11-17-2008, 01:25 PM   #6
Lufbery
Senior Member
 
Registered: Aug 2006
Location: Harrisburg, PA
Distribution: Slackware 64 14.2
Posts: 1,180
Blog Entries: 29

Rep: Reputation: 135Reputation: 135
Quote:
Originally Posted by gnashley View Post
Once the new release is out, it would be good to mention that variables can be passed using either method when compiling perl modules. But since the code is now built in, it shoulddn't be mentioned as a hack that the users needs to do(editing the code, I mean). I just suggested that rpedrica try it so that the code is tested before releasing. I am getting close to a release -it has been a long time and again the list of changes is quite long. Over the summer I moved which hasn't helped in getting a release out.
Hi Gilbert,

Moves are horribly disruptive, but hopefully you like your new locale.

My last major project requiring compilation was when I installed Quantum GIS. The list of dependencies was huge and much of what I needed I built with src2pkg.

That was a few months ago, however, but I don't think there has been a new release of src2pkg since then. I look forward to the new release and continuing to help document src2pkg.

Were you able to figure out some of the cmake stuff that bedeviled me?

Warm regards,

-Drew
 
Old 11-17-2008, 04:04 PM   #7
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Yes, the cmake stuff has been in there for quite a long while. The list of changes is hugely long -the changelog has over 320 lines since the last release! Of course most of it is minor stuff and things that have changed and re-changed. Still there will be several items that need to be documented -I'll do my best to sum things up icely in the shorter CHANGES file, to make the wiki update easier. The last release was in February, so I am long overdue.
Thanks, we do like our new place -big garden for my four year old son to play in.
 
Old 11-18-2008, 07:12 AM   #8
Lufbery
Senior Member
 
Registered: Aug 2006
Location: Harrisburg, PA
Distribution: Slackware 64 14.2
Posts: 1,180
Blog Entries: 29

Rep: Reputation: 135Reputation: 135
Quote:
Originally Posted by gnashley View Post
Thanks, we do like our new place -big garden for my four year old son to play in.
That's important! My son turns three tomorrow. Having a nice yard to run around in is very nice. It helps him burn off energy.

Regards,
-Drew
 
Old 11-18-2008, 11:45 AM   #9
rpedrica
Member
 
Registered: Nov 2008
Location: Cape Town
Distribution: Slackware64 -current
Posts: 281

Original Poster
Rep: Reputation: 42
Thanks Gilbert and sorry for the delay in reply - I'll be testing this a little later on this eve and will let you know. Thanks for the changeset ...

Regards, Robby

Last edited by rpedrica; 11-18-2008 at 11:50 AM.
 
Old 11-18-2008, 03:42 PM   #10
rpedrica
Member
 
Registered: Nov 2008
Location: Cape Town
Distribution: Slackware64 -current
Posts: 281

Original Poster
Rep: Reputation: 42
Hi Gilbert, this appears to work fine under both circumstances ( using -e or -m ). Will this be std in the upcoming version?

Regards and thanks for the help, Robby
 
Old 11-19-2008, 12:42 AM   #11
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Yes, this is already in the code -I just wanted you to test it as it appeared to be working here. It has been so long since I released that it would be a shame to introduce a new piece of code without it having been tested a little. It's a minor change, but it only takes one bad character to spoil the whole thing...
 
  


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
src2pkg and post install options rpedrica Slackware 6 11-12-2008 01:35 PM
New src2pkg release available for download -Introducing the src2pkg WIKI gnashley Slackware 11 05-06-2008 11:09 AM
Trouble switching from mod_perl to cgi perl tibberous Linux - Server 0 03-02-2008 01:00 PM
compiling perl with c options fobius Slackware 1 10-06-2004 09:05 PM
perl mods? sk8guitar Programming 2 08-07-2003 06:40 PM

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

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