LinuxQuestions.org
Review your favorite Linux distribution.
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 08-18-2008, 08:58 PM   #1
JosephS
Member
 
Registered: Jun 2007
Distribution: Debian Squeeze, CrunchBang Waldorf
Posts: 517

Rep: Reputation: 38
src2pkg "failure in make install"


I tried compiling portaudio with a src2pkg script:

bash-3.1# src2pkg -X portaudio.src2pkg
Quote:
Running build script: portaudio.src2pkg
Found source archive: portaudio_18.1.orig.tar.gz
Creating working directories:
PKG_DIR=/tmp/portaudio-18.1-pkg-1
SRC_DIR=/tmp/portaudio-18.1-src-1
Unpacking source archive - Done
Correcting source permissions - Done
Applying patches - from User-Supplied PATCHLIST
Applying: portaudio_18.1-6.diff.gz
NOTICE - '.am', '.ac' or '.in' config files were patched
Regenerating config files - Using: autoreconf -if Done!
Found configure script -
Configuring sources using:
CFLAGS=-O2 -march=i486 -mtune=i686 ./configure --prefix=/usr
Configuration has been - Successful!
Compiling sources - Using: 'make'
Compiling has been - Successful!
Checking for 'install' rule - Okay
Checking for DESTDIR, INSTALL_ROOT, PREFIX or CMAKE_INSTALL_PREFIX - Okay
Installing using PREFIX - Using:
make PREFIX=/tmp/portaudio-18.1-pkg-1/usr install
Notice - Possible error running 'make install'
FATAL! Running make install has failed with error: 1
Try using INSTALL_LINE 'make -i install' Exiting...
src2pkg FAILURE in make_install
I compiled: espeak-1.30 ok and got a package, but with
portaudio it stopped at make install.
What would be the problem with this?

I finished it with:
bash-3.1# make -i PREFIX=/tmp/portaudio-18.1-pkg-1/usr install

I got the following message:
Quote:
/usr/libexec/src2pkg/bin/ginstall -c -m 644 lib/libportaudio.so.0.0.18 /tmp/portaudio-18.1-pkg-1/usr/lib/libportaudio.so.0.0.18
/usr/libexec/src2pkg/bin/ginstall: cannot create regular file `/tmp/portaudio-18.1-pkg-1/usr/lib/libportaudio.so.0.0.18': No such file or directory
make: [install] Error 1 (ignored)
/usr/libexec/src2pkg/bin/ginstall -c -m 644 lib/libportaudio.a /tmp/portaudio-18.1-pkg-1/usr/lib/libportaudio.a
/usr/libexec/src2pkg/bin/ginstall: cannot create regular file `/tmp/portaudio-18.1-pkg-1/usr/lib/libportaudio.a': No such file or directory
make: [install] Error 1 (ignored)
cd /tmp/portaudio-18.1-pkg-1/usr/lib && rm -f libportaudio.so && ln -s libportaudio.so.0.0.18 libportaudio.so
/bin/sh: line 0: cd: /tmp/portaudio-18.1-pkg-1/usr/lib: No such file or directory
make: [install] Error 1 (ignored)
/usr/libexec/src2pkg/bin/ginstall -c -m 644 pa_common/portaudio.h /tmp/portaudio-18.1-pkg-1/usr/include/portaudio.h
/usr/libexec/src2pkg/bin/ginstall: cannot create regular file `/tmp/portaudio-18.1-pkg-1/usr/include/portaudio.h': No such file or directory
make: [install] Error 1 (ignored)

------------------------------------------------------------
PortAudio was successfully installed.

On some systems (e.g. Linux) you should run 'ldconfig' now
to make the shared object available. You may also need to
modify your LD_LIBRARY_PATH environment variable to include
the directory /tmp/portaudio-18.1-pkg-1/usr/lib
I didn't find any files in /tmp/portaudio-18.1-pkg-1/
or in /tmp


Thanks
 
Old 08-19-2008, 03:45 AM   #2
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,775

Rep: Reputation: 481Reputation: 481Reputation: 481Reputation: 481Reputation: 481
HMMM, are you building as 'root', or as a normal user?
The problem you are having my be related to the portaudio version. I have a build of a later version which worked fine.
Try using version: pa_stable_v19_20071207.tar.gz
Here's the src2pkg script:

Code:
#!/bin/bash
## src2pkg script for: 	portaudio
## src2pkg Copyright 2005-2008 Gilbert Ashley <amigo@ibilio.org>

SOURCE_NAME='pa_stable_v19_20071207.tar.gz'
ALT_NAME='portaudio'
ALT_VERSION='19.20071207'
# ARCH='i486'
BUILD='1'
PRE_FIX='usr'
# Any extra options go here
EXTRA_CONFIGS=' --sysconfdir=/etc --localstatedir=/var'
# STD_FLAGS='-O2 -march=i486 -mtune=i686'

# Get the functions and configs
. /usr/libexec/src2pkg/FUNCTIONS ;

pre_process
find_source
make_dirs
unpack_source
fix_source_perms
configure_source
compile_source
fake_install
fix_pkg_perms
strip_bins
create_docs
compress_man_pages
make_description
make_doinst
make_package
post_process
It could also be something caused by using the debian patch, although that is unusual.

I'll have a go at compiling v18 to see what is going on.
 
Old 08-19-2008, 04:32 AM   #3
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,775

Rep: Reputation: 481Reputation: 481Reputation: 481Reputation: 481Reputation: 481
Okay, found the problem. The Makefile doesn't support DESTDIR, so you need to include INSTALL_TYPE=JAIL in your src2pkg script, or run the build like this:
src2pkg -JAIL portaudio_18.1.orig.tar.gz
if you are building as a normal user.

Also, if you want the patches supplied with the debian patch to be used, you need to pull them out of the patched sources. You can do this easily by letting the build run and fail. Then copy these patches from /tmp/portaudio-18.1-src-1/debian/patches:
10_configure.in.dpatch
11_configure.dpatch
20_unix_oss.dpatch
30_oss_in_only.dpatch
dbug336890-kFreeBSD.dpatch
into the dir where the sources are and use the command as above to build with. Or, you can build the package as 'root' without the JAIL option.

src2pkg does not automatically apply pathces from a $SRC_DIR/debian/patches directory, so you should always check to see if there are any there and if you want/need them, copy them to the dir where you are building from. src2pkg will handle the *.dpatch files without the need to change them, but do not include the file named 01_config.dpatch, if present, or the 00list file. It is useful to look at the 00list file, though -it will tell you which of the patches are actually used for the debian build (sometimes old patches are still included in the directory but no longer used). For best results, only copy over the patches which are not commented out in the 00list file.

The problem with funky handling of PREFIX or DESTDIR is quite common, so whenever you have problems like this, it can usually be remedied by using the '-JAIL' option. src2pkg does not use -JAIL by default because -JAIL will fail just as often as the default INSTALL_TYPE=DESTDIR. And some sources will fail with both methods and mujst be built as 'root'. Building as 'root' using INSTALL_TYPE=REAL is the most dependable way to track content creation, but of course it is also more risky. It is best to avoid using -REAL while running as root if you are building/rebuilding/upgrading software which is already installed on your system. Still, until a few versions back, src2pkg used *only* this method, so it is still done as safely as possible. I have run src2pkg this way at least 100,000 times on the system I use every day and have no problems with it. src2pkg now uses DESTDIR as the default because most people think are familiar with that and think it is the best. I really think that using JAIL is better. The problem with DESTDIR is that sometimes the Makefiles only support it partially -this means that some files get installed to the DESDIR while others get installed to the real /. Either way, using DESTDIR or JAIL as a normal user will avoid overwriting any files on your system.
 
Old 08-20-2008, 06:55 PM   #4
JosephS
Member
 
Registered: Jun 2007
Distribution: Debian Squeeze, CrunchBang Waldorf
Posts: 517

Original Poster
Rep: Reputation: 38
These are the files in /tmp/portaudio-18.1-src-1/debian/patches/:
00list
01_config.dpatch
10_configure.in.dpatch
11_configure.dpatch
20_unix_oss.dpatch
30_oss_in_only.dpatch
dbug336890-kFreeBSD.dpatch

I copied all over except: 00list and 01_config.dpatch

I ran src2pkg with: src2pkg -JAIL portaudio_18.1.orig.tar.gz
The package was built successfully.

Question:
When I tried to build the first time, with scr2pkg -X portaudio.src2pkg
I got this output:
Applying patches - from User-Supplied PATCHLIST
Applying: portaudio_18.1-6.diff.gz

Does the file portaudio_18.1-6.diff.gz apply the patches from source?
Where are the patched sources?
I looked in portaudio-18.1.org.tar.gz, but I'm not sure which are the patches.

Thanks for your help.
 
Old 08-21-2008, 03:51 AM   #5
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,775

Rep: Reputation: 481Reputation: 481Reputation: 481Reputation: 481Reputation: 481
portaudio_18.1-6.diff.gz is a debian patch. If you look inside the toplevel SRC_DIR( that is: /tmp/portaudio-18.1-src-1 ), you'll see a file called patched-files-portaudio-18.1. This file is generated when src2pkg applies patches and shows which files are patched by which patch.

The debian patch does not (in this case) directly patch any of the source files. Instead the patch contains separate patches which are placed in the debian/patches directory. Under debian, these (those in the 00list) would be automatically applied by the debian/rules build file. src2pkg does not do this, so you need to manually copy the ones you want to use into the CWD where you are running src2pkg from.

Some debian patches *do* directly patch source files as well as create/modify those in the SRC_DIR/debian directory. The patched-files-$NAME-$VERSION file will always give you a full list of the files which have been modifed or created.

In this case, you can probably do without the separate patches if you want to build the sources staright from the developer. It is usually a good idea to use the debian patch if you have it. src2pkg can still use info from the files created by the main patch -it writes a nice slack-desc file from info in the debian/control file and picks up the configure options from debian/rules.

The reason your build was failing is because the Makefiles don't handle PREFIX/prefix correctly, so your build was trying to install the libs into the final destination ( /usr/lib ). As a normal user you can't do that. So, you need to use the -JAIL option. This option acts just like using DESTDIR in that it adds a subdir to the installation paths, excpet that JAIL does this internally instead of depending on the Makefiles.

src2pkg recognizes patches which have the '.diff', '.diff.gz', '.patch' or '.patch.gz' suffixes which are standard everywhere. Files with the '.dpatch' suffix are special debian-only patches which are meant to be applied with a debian tool, but I have taught src2pkg to work with these also. They are normal patches except that they have extra code at the beginning which src2pkg ignores. I did this because some sources use dozens of dpatch-type patches -editing them and changing the names is a PITA, so I just made src2pkg handle them as normal patches.

As mentioned, src2pkg does not automatically apply the patches in the debian/patches directory. Nor does it apply other patches found inside the source tarball. In order to have src2pkg apply patches, you must place them in the same directory where you run src2pkg from, or in a subdirectory of it called 'patches'. This assures that you are in control of which patches get applied, without having to turn auto-patching on and off for each package. The auto-patching routine of src2pkg works really well, though and avoids having to figure out the correct options/commands to use for each separate patch. This is why auto-patching is enabled by default -if you want to use a patch just place it with the sources and it will be handled.
 
  


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
So many errors when I typed the "make" and "make install" command Niceman2005 Linux - Software 23 07-22-2009 03:33 PM
src2pkg "FAILURE in make_install" JosephS Linux - Software 1 08-18-2008 10:06 AM
Lockdev src2pkg "make install" problems piete Amigo 2 02-18-2008 04:41 PM
Constant errors during "make" or "make install" with SUSE 10.1 Alpha 4 TehFlyingDutchman Linux - Software 3 12-30-2005 07:25 PM
Ndiswrapper install failure - LBA-Linux "make" command fails petteril Linux - Wireless Networking 1 04-23-2005 09:22 AM


All times are GMT -5. The time now is 09:36 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration