SlackwareThis Forum is for the discussion of Slackware Linux.
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've been using Linux for about 4 years but I'm new to Slackware. I just want to say that I LOVE Slack -- I love how straightforward it is.
Anyway, I am used to RPM's and .debs to install apps. I really never compiled source very often.
So, my question is a "best practices" kind of question:
How do you compile apps? Not the ./configure, make, make install -- I mean, where? Do you download into /usr/src and compile there? Is that reserved for the kernel? If so, do you download and install into /usr/local? Where should the binaries be installed /usr/bin or /usr/local/bin or /usr/sbin? I know about checkinstall and to use that instead of "make install" so that's cool but I'm still trying to figure out where I should do my compiling.
I also see folks use a parameter when compiling like ./configure --prefix=/usr or something like that. What is that and why should I use that?
I guess I'm looking for advice from you Slack veterans on what is the best way to maintain my slack box in terms of compiling and managing packages.
I usually download them to my home directory, then I configure & compile and finally use checkinstall to create a package but I switch to root to do that. It's just a matter of taste where you put the sources.
When you compile programs they are installed under /usr/local/ by default, that's why some guys use the --prefix=/usr switch, to install them under /usr instead. I personally prefer to install them in /usr/local. Again it's just a matter of taste.
If you intend to use checkinstall it doesn't really matter where you build your packages. I usually just extract them in my home directory. I usually grab some text off the project's home page to make a decent slack-desc file, rather than just typing in the project name when checkinstall asks for it.
Prefix just tells make where to put the binaries. Depending on who you ask you'll probably get several different answers. Some people will tell you to use --prefix=/usr and some will tell you to use --prefix=/usr/local There are valid reasons for both.
as said, your home dir. is the place to work and by using checkinstall you can keep track of all files.
also, when you compile from source, first thing to do after extracting
is running " ./configure --help ".
this will give a list of options, some standard and some specific to that program.
the options you want to use are then added to the configure-command
like " ./configure --enable-opt1 --enable-opt2 --etc ".
btw.: compiling a kernel can also be done in your home dir.
it's even advised by the kernel team.
I have created a special user (build), who is only in his own group (build). This way, when I do a make install DESTDIR=<something>, I'm sure nothing ends up in /etc, /bin or /usr.
I should have written that, you're right! I simply decided, there was no reason to keep users from compiling things in /usr/local/src (only installation is restricted). So I ran (as root):
Code:
chmod 770 /usr/local/src
and all users that are allowed to compile things there (that's only me, actually) are part of /usr/local/src's group.
Also, after the package is extracted, view the Readme's and Install .txt files. There is a lot of useful info in there. It will tell you the default install routes and sometimes includes the various options. Usually, I let it build to defaults as the developer intended. Its rare that I change many options, except for architecture stuff.
you could set an alias in your .bashrc /.zshrc (if you use zsh) for configure to be ./configure --prefix=/usr
I can't remember the bash syntax for aliases of the top of my head, but that could work (don't use it myself, i include it in the build script instead).
Distribution: None (Linux doesn't support my basic hardware)
Posts: 61
Rep:
Ya that seems to be the best option at the moment. It brings up other problems because of restrictions later if you want something besides what the alias is but this isn't for me. I'm actually seeking help for a buddy of mine which I have no idea what he is actually trying to do.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.