Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I want to learn to compile from source. My biggest question at the moment is: "after I download a tarball, where should I use tar to extract the contents to before installing?"
For example, I want to try to install the enlightenment wm/de. I got the source tarballs. Should I extract to where I downloaded, or some other directory? I hate to just extract to my downloads directory since it'll fill it up (visually) with a "million" files. Should I create a new directory somewhere for the EFL libraries, then another for the actual app?
More generally, in Slackware, it is suggested that you use a Slackbuild script when compiling from source. This will create a package that can be installed, upgraded and removed using Slackware package management tools. See https://slackbuilds.org/ and http://docs.slackware.com/slackware:slackbuild_scripts for further details.
a subdirectory named after that file we be created in whatever directory you are in. The output of the tar command as it scrolls across the screen will list the name of the new directory.
Here's a file and the resulting directory plucked at random from my computer:
Code:
$ ls fbreader*
fbreader.tar.gz
fbreader <-----the resulting directory (I've omitted the listing of the contents of the fbreader directory)
I understand that is what will happen, but is that proper? After make and make install will all of those source files be left wherever I extracted them to initially? I'm sorry if I'm coming across as dense. I'm OCD and try to keep things "clean".
You enter foo and compile from sources. After you perform the make install, the contents of the directory foo will remain unchanged. If you want later to remove that program, you can enter the foo directory and issue the command make uninstall.
When I started with Slackware, there was no Slackbuilds.org. There were a few independent Slackware repositories about, but not many. Almost everything I installed in those early days was by compiling from sources because I was very much a newb and didn't know any other way.
Don't let it intimidate you; it's really not all that complicated. Writing the code--that's the complicated part!
Also, if a make errors out, the first error message is most likely the one that matters; subsequent ones generally result from it.
You could even write your own little script so that it performs the extraction and the necessary steps followed by a tidy up to remove the build directory and leave you with only the original tar file
When you build software, you should always do it as yourself, not as root. You use root access only for the final install step. This means that you have to unpack the tarball in a directory to which you yourself have write access. It's up to you just where this, but usually it has to be somewhere in your home directory tree.
I would suggest creating a build subdirectory for your experiments. As frankbell said, a tarball is supposed to create its own top-level directory and unpack all the files into that, but if the tarball was incorrectly packaged by the developer, it could spill its files out into the directory you unpacked it in. That happened to me once. Unpacking in a dedicated subdirectory is safer.
If you want later to remove that program, you can enter the foo directory and issue the command make uninstall.
The annals of history are filled with examples of that technique failing, due to poorly written makefiles. (What software developer thinks that anybody would want to remove their software?)
Quote:
You could even write your own little script so that it performs the extraction and the necessary steps followed by a tidy up to remove the build directory and leave you with only the original tar file
That _is_ a SlackBuild script, except the build directory is left in /tmp for later inspection.
Quote:
When you build software, you should always do it as yourself, not as root. You use root access only for the final install step. This means that you have to unpack the tarball in a directory to which you yourself have write access. It's up to you just where this, but usually it has to be somewhere in your home directory tree.
A properly written SlackBuild script conducts those operations in the /tmp directory. The build can be conducted as a normal user, but the resulting package is installed as root.
@OP - Slackware is often denigrated for being a build from source distribution, rather than having an official repository for pre-built binary packages (although authoritative repositories are available e.g. http://bear.alienbase.nl/mirrors/ and http://rlworkman.net/pkgs/). It is rare for a Slackware user to not be able to find an appropriate SlackBuild script at https://www.slackbuilds.org/ , the officially endorsed location for the installation of third party software. Those scripts have been through a vetting process to ensure that the builds complete successfully on a full Slackware install and that install/documentation/startup file locations comply with Slackware standards.
I want to learn to compile from source. My biggest question at the moment is: "after I download a tarball, where should I use tar to extract the contents to before installing?"
For example, I want to try to install the enlightenment wm/de. I got the source tarballs. Should I extract to where I downloaded, or some other directory? I hate to just extract to my downloads directory since it'll fill it up (visually) with a "million" files. Should I create a new directory somewhere for the EFL libraries, then another for the actual app?
Thanks much.
Auroch
you're going to try Enlightenment on your first try? oooohhhh You got Big Balls...
I'd select a new directory created just for that. subdivided it into each separately then follow the instructions on what needs to be compiled first. keep everything in one main root directory.
and like @allend said it is best to use SlackBuild scripts for everything you install on Slack (not that you have to, on any linux/gnu actually) but it helps your system keep track of what is installed on it, for easier maintenance.
you're going to try Enlightenment on your first try? oooohhhh You got Big Balls...
I'd select a new directory created just for that. subdivided it into each separately then follow the instructions on what needs to be compiled first. keep everything in one main root directory.
and like @allend said it is best to use SlackBuild scripts for everything you install on Slack (not that you have to, on any linux/gnu actually) but it helps your system keep track of what is installed on it, for easier maintenance.
Haha, I hear ya. I guess it's not so much the size of my nuts, but rather that I'm already running a rock-solid slack on my desktop, where I run XFCE as root, and Plasma as my user DE. I'm doing this on a dedicated laptop that I'm using just to learn, so if I break the system, I'll just FDISK and start over. I managed to get E17 installed on a Gentoo system I built a few years ago, so maybe I do have some good luck afterall....haha.
I appreciate the help and comments. I'm gonna jump on this project right after work today, so I'll report back after a case or so of PBR : )
not sure what version Enlightenment is right now but if the current one is different the the one on that page all you have to do is edit the SLACKBUILD file to reflect the same version on the tar ball
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.