SlackwareThis Forum is for the discussion of Slackware Linux.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I tried compiling portaudio with a src2pkg script:
bash-3.1# src2pkg -X portaudio.src2pkg
Running build script: portaudio.src2pkg
Found source archive: portaudio_18.1.orig.tar.gz
Creating working directories:
Unpacking source archive - Done
Correcting source permissions - Done
Applying patches - from User-Supplied PATCHLIST
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:
/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
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:
## src2pkg script for: portaudio
## src2pkg Copyright 2005-2008 Gilbert Ashley <email@example.com>
# 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 ;
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.
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:
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.
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.