LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 10-20-2016, 07:05 PM   #1
Auroch
LQ Newbie
 
Registered: Oct 2016
Posts: 24

Rep: Reputation: Disabled
Compile from source / Slackware


Hey all,

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
 
Old 10-20-2016, 07:24 PM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,375

Rep: Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754
Welcome to LQ!

For enlightenment, I suggest you look at this thread in the Slackware forum. http://www.linuxquestions.org/questi...re-4175527047/

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.
 
Old 10-20-2016, 07:30 PM   #3
Auroch
LQ Newbie
 
Registered: Oct 2016
Posts: 24

Original Poster
Rep: Reputation: Disabled
Thanks. I'll take a look! I searched all over but couldn't find any direction as to WHERE to extract to.

I appreciate the quick response!

Auroch
 
Old 10-20-2016, 07:36 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,341
Blog Entries: 28

Rep: Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145
Generally, if you extract using

Code:
tar -xvf [Somefile]
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)

Last edited by frankbell; 10-20-2016 at 07:39 PM.
 
Old 10-20-2016, 07:40 PM   #5
Auroch
LQ Newbie
 
Registered: Oct 2016
Posts: 24

Original Poster
Rep: Reputation: Disabled
I see. And it doesn't matter where you do this from or where this new dir is placed? Thanks!

Auroch
 
Old 10-20-2016, 07:45 PM   #6
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,341
Blog Entries: 28

Rep: Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145
Yes, that is the normal behavior when you extract a tarball unless you instruct tar to do otherwise.
 
Old 10-20-2016, 07:51 PM   #7
Auroch
LQ Newbie
 
Registered: Oct 2016
Posts: 24

Original Poster
Rep: Reputation: Disabled
Frank,

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".

Auroch
 
Old 10-20-2016, 08:09 PM   #8
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,341
Blog Entries: 28

Rep: Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145
Say you extract foo.tar.gz to the directory foo.

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.

Enjoy.

Last edited by frankbell; 10-20-2016 at 08:11 PM.
 
Old 10-20-2016, 08:24 PM   #9
Auroch
LQ Newbie
 
Registered: Oct 2016
Posts: 24

Original Poster
Rep: Reputation: Disabled
Thanks man. I gotta hit it, but I'll dig in deep tomorrow and report back with my success story....haha! Much appreciated,

Auroch
 
Old 10-21-2016, 05:31 AM   #10
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,008

Rep: Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193
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
 
Old 10-21-2016, 05:41 AM   #11
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,609
Blog Entries: 19

Rep: Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458
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.
 
Old 10-21-2016, 07:18 AM   #12
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,375

Rep: Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754Reputation: 2754
Quote:
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.
 
Old 10-21-2016, 09:47 AM   #13
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by Auroch View Post
Hey all,

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.
 
Old 10-21-2016, 10:07 AM   #14
Auroch
LQ Newbie
 
Registered: Oct 2016
Posts: 24

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by BW-userx View Post
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 : )

Auroch
 
Old 10-21-2016, 10:49 AM   #15
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
SlackBuilds Repository 14.2 for enlightenment
https://slackbuilds.org/repository/1...enlightenment/

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

here
Code:
PRGNAM=enlightenment
VERSION=${VERSION:-0.17.6}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
then move down until you find this line and make sure it matches the tail end of your tar ball you may have gotten somewhere else
Code:
tar xvf $CWD/$PRGNAM-$SRC_VERSION.tar.bz2
so everything matches the actual name of the tar ball you're using. then save and run the script.

Code:
./enlightenment.SlackBuild
oh yeah don't forget to do your dependencies first

Last edited by BW-userx; 10-21-2016 at 11:00 AM.
 
  


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
Glib-1.2-10 source from a mirror does not compile on Slackware-Current johnbradley66 Linux - Software 3 02-14-2016 10:10 PM
[SOLVED] Slackware-Current, compile questions for firefox source slackbuild gordydawg Slackware 2 09-06-2014 08:42 PM
First Slackware Kernel compile from source 2.6.29.6, am I doing this right? linus72 Slackware 41 02-07-2010 11:05 AM
Slackware 9.0 Kernel Source and Compile PrimaryDataLoop Slackware 7 05-19-2003 09:32 PM
Can't compile source code in Slackware 9.0 kernel 2.4.20) GrandTheft Slackware 2 04-29-2003 10:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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