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'm wondering why src2pkg won't work when I run it from $HOME, even though the source tarball and destination package are to be in other directories (PKG_DEST_DIR="/usr/local/packages"), so it shouldn't be doing anything in pwd:
$ src2pkg ~/downloads/audacious-plugins-3.3.2.tar.bz2
FATAL! Home directory was given as a critical src2pkg variable,
or is the current directory. Please read the src2pkg documentation for help.
I couldn't find the string, "was given as a critical" anywhere in /etc, /usr/local/bin, and /usr/bin, and 'strings makepkg' didn't show anything for "as a critical", so I'm thinking it's in a localised file somewhere else. Anyway, I was just looking for that in order to find out why it had a problem with being in $HOME.
I have read the documentation but the only related mention of the home directory I found is in the tutorial, where it says one can create a directory off there.
It's a safety precaution. Please use a subdir to create packages in. The process can create several temporary files which are unique to the build. Also, working directly in $HOME might leave some files there which would be messy.
The src2pkg program you run is a shell script. It sources most of the main code from files which are in /usr/libexec/src2pkg -that's where grepping will find 'given as a critical' mentioned. In that code you can also see more places listed where src2pkg will not allow you to work -basically any system directories are ruled out. Early on, one user was trying to run src2pkg from /usr/share or /usr/bin, so the checks were implemented.
It really is best to build each package in a separate directory, or use a subdir where you do nothing but builds.
You have a good point, and it's one I thought about alot. I even did some of the work to make it possible to direct the creation of all temp files to a specific place.
But, there is a reason for using a separate dir -it allows you to run multiple builds at once using src2pkg. The problem is not just the path to where the temporary files are being created, but also one of their naming. To save complexity in naming, generic names can be used instead of having to name files by NAME, VERSION, BUILD, etc. src2pkg looks for existing files like doinst.sh, slack-desc, etc in the PWD. So you don't have to name them like NAME.doinst.sh, NAME-VERSION.slack-desc, etc.
src2pkg, as delivered for Slackware, does use /tmp for the creation of the main bulk of the temp files -I mean where the sources are unpacked and built, and where the package content is assembled. But you might try setting up your src2pkg.conf file the way I do for my use - Use $CWD for all temp files:
[[ $SOURCES_DIR ]] || SOURCES_DIR="$CWD"
[[ $SRC_BUILDS_DIR ]] || SRC_BUILDS_DIR="$CWD"
[[ $PKG_BUILDS_DIR ]] || PKG_BUILDS_DIR="$CWD"
[[ $PKG_DEST_DIR ]] || PKG_DEST_DIR="$CWD"
[[ $BACKUP_DIR ]] || BACKUP_DIR="$CWD"
That way, everything is one place and is much easier to browse through. You cd'ing into /tmp amounts to the same thing, except that there will usually be some 'clutter' in /tmp. I often run concurrent builds, so that won't work for me, plus I like to see 'all and only' the source and build files in the same place.
That said, I will see about fixing it so that what you want would work -at least for single builds.