LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-21-2005, 06:57 PM   #1
Kenji Miyamoto
Member
 
Registered: Dec 2004
Distribution: Mandrake 10.1; Fedora Core 3; FreeBSD 5.3; Slackware 10.1 (2.6.10);
Posts: 234

Rep: Reputation: 30
Compiling Software


I've been told several bits of information on how to install software. Everyone recommends using something with packages, but I'm wondering if there's any good way of doing source compilation with something like packages.

The PkgBuild script has been mentioned, but I can't find any information on it.

Could someone clear this up?
 
Old 05-21-2005, 07:12 PM   #2
marghorp
Senior Member
 
Registered: Jan 2004
Location: Slovenia
Distribution: Slackware 10.1, SLAX to the MAX :)
Posts: 1,040

Rep: Reputation: 45
The best way to install software is to compile it from source, if you know what you are doing or you will probably not succeed (or you might). It all depends on dependencies issues. Dependencies are other software that the one you are installing depends on using. The one you are installing can't be installed without the dependencies resolved, so you make sure you have it resolved. The package manager that Slackware uses to clear the dependencies issue is PkgTools. So if you are downloading software, try to find a package for Slackware (probably .tgz) and install it using pkgtool. It's very easy to use and you have met it at slack install. Before you know what pkgtool does, pkgbuild is of no importance to you
 
Old 05-21-2005, 07:41 PM   #3
Kenji Miyamoto
Member
 
Registered: Dec 2004
Distribution: Mandrake 10.1; Fedora Core 3; FreeBSD 5.3; Slackware 10.1 (2.6.10);
Posts: 234

Original Poster
Rep: Reputation: 30
Doesn't PkgTool just install the binaries, like RPM or FreeBSD Packages?
 
Old 05-21-2005, 08:38 PM   #4
gbhil
Member
 
Registered: Jan 2005
Location: /dev/input/chair0
Distribution: Slackware, Gentoo, Vector, Roll-your-own-with-GNU binutils
Posts: 174

Rep: Reputation: 30
Quote:
Originally posted by Kenji Miyamoto
Doesn't PkgTool just install the binaries, like RPM or FreeBSD Packages?
Yep.
If you want to keep your installed packages database up to date, and still be able to compile code from source, I'd recommend checkinstall

http://asic-linux.com.mx/~izto/checkinstall/
 
Old 05-21-2005, 08:45 PM   #5
Kenji Miyamoto
Member
 
Registered: Dec 2004
Distribution: Mandrake 10.1; Fedora Core 3; FreeBSD 5.3; Slackware 10.1 (2.6.10);
Posts: 234

Original Poster
Rep: Reputation: 30
The site timed out on loading.
 
Old 05-21-2005, 09:10 PM   #6
gbhil
Member
 
Registered: Jan 2005
Location: /dev/input/chair0
Distribution: Slackware, Gentoo, Vector, Roll-your-own-with-GNU binutils
Posts: 174

Rep: Reputation: 30
works fine here. try again maybe
 
Old 05-21-2005, 09:34 PM   #7
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Checkinstall is a good second choice for building packages. The ideal way for me-- when the install scripts allow it -- is to use
Code:
./configure --DESTDIR=/tmp/mypackage
and then makepkg. Checkinstall has several shortcomings. The two most frequently occuring are:
1. It often installs both gzipped and ungzipped versions for each man page.
2. It messes up [/usr]/sbin and [/usr]/bin ownership.
 
Old 05-21-2005, 09:49 PM   #8
Kenji Miyamoto
Member
 
Registered: Dec 2004
Distribution: Mandrake 10.1; Fedora Core 3; FreeBSD 5.3; Slackware 10.1 (2.6.10);
Posts: 234

Original Poster
Rep: Reputation: 30
So I do 'makepkg' instead of 'make' and 'make install' and everything should run?
 
Old 05-21-2005, 10:12 PM   #9
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
no, you still have to do make and make install. it's just that if you configure the build with DESTDIR (or, whatever the installation calls it), then the package will use the value of DESTDIR in place of / (root) when installing the binaries. so, for example, if i set DESTDIR=/tmp/mypkg, a binary which ordinarily would have installed into /usr/bin will now install itself in /tmp/mypkg/usr/bin. if effect, you have a miniature file tree now rooted at /tmp/mypkg containing only files that came from the recently installed program. at this point, you cd into $DESTDIR and build a slackware package "manually" using makepkg. this is more work than using checkinstall since you probably want to create a decent $DESTDIR/usr/doc/package-name and $DESTDIR/install/{slack-desc,do.inst} before running makepkg. So it's more work but with the outcome of having a "correct" package.
I hope I didn't scare you. If you're just starting out, checkinstall is the easy way to go since you just
Code:
 ./configure
make
checkinstall
But eventually there comes a time when you start to notice little things that could be done better. That's when you do it manually.

Last edited by Berhanie; 05-21-2005 at 10:23 PM.
 
Old 05-21-2005, 10:31 PM   #10
Kenji Miyamoto
Member
 
Registered: Dec 2004
Distribution: Mandrake 10.1; Fedora Core 3; FreeBSD 5.3; Slackware 10.1 (2.6.10);
Posts: 234

Original Poster
Rep: Reputation: 30
I understood it all, but I don't know if using all of the time on documentation is really so efficient. I know it's not the most important thing on Earth, espcially if I don't go and distribute it. Besides, would one normally have documentation other than a manpage with a project compiled from source?
 
Old 05-21-2005, 11:24 PM   #11
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Man pages are what you'll be using on a day-to-day basis. It's the more in-depth material that you usually put in /usr/doc. Things like FAQs. Admittedly, you can usually find such documents online, but then again online documents often pertain to the most recent version of a program, while you might be looking for something which applies to the version you have installed. (By the way, checkinstall does have a way to include the documentation of your choice: you just create a doc-pak directory, if i remember correctly, in the source dir and all files therein will be placed in the package's /usr/doc. So that's not really the issue).

A common task after building a package from source is to add a new user to the /etc/passwd database. For example, a certain daemon included in the package might have to be run as this user. Furthermore, this user will be the owner of certain files which should be accessible to the daemon. In this situation, you might install the package first, then add this user manually using useradd from the command line, and then use chown to make certain files accessible to the daemon. A better alternative is to write a script to do all this. That's what the do.inst file is for. It's run automatically after the package is installed.

Another issue is a startup script. How will the newly-installed daemon be called to run at boot time? Again you have two alternatives: add a script in /etc/rc.d/ after installation, or include it in the package.

If you build your own package from the ground up, you can build a self contained package: one which adds whatever users it needs to the database, includes a startup script, includes proper documentation, maybe even a logrotation script, etc.

Of course, you can always use checkinstall to create a package and then modify the created package to your liking (you can tell checkinstall to save a package before installing it). You'd therefore have to modify the package, uninstall the old package, and install the modified one. One drawback is that you'd have to clean your /usr/man directory, because of the man page problem with checkinstall I mentioned earlier (even if you uninstall the package, only the gzipped man pages would be removed, but not the ungzipped ones). But. modifying a package created by checkinstall might be the most reasonable option if the build script does not offer a target option like DESTDIR.

Last edited by Berhanie; 05-21-2005 at 11:30 PM.
 
Old 05-21-2005, 11:57 PM   #12
Kenji Miyamoto
Member
 
Registered: Dec 2004
Distribution: Mandrake 10.1; Fedora Core 3; FreeBSD 5.3; Slackware 10.1 (2.6.10);
Posts: 234

Original Poster
Rep: Reputation: 30
Is this requirement of creating a user and changing the ownership of some files told within the install?
 
Old 05-22-2005, 12:43 AM   #13
__J
Senior Member
 
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973

Rep: Reputation: 46
if you get checkinstall, I'd recommend you get it from a slack mirror:
ftp://ftp.slackware.com/pub/slackwar.../checkinstall/

it's a modified version that works a little better than the default version. to use, do your usual

./configure <options>
make

but instead of "make install" use "checkinstall".
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Problem Compiling Software IvanLow Linux - Newbie 1 03-27-2005 10:17 AM
Compiling software? Ilushka Linux - Newbie 2 04-04-2004 09:10 PM
Compiling Software GameboyHippo Debian 2 11-06-2003 12:54 PM
Software Compiling Problem... Chryzmo Linux - Newbie 3 08-31-2003 12:02 AM
compiling software GT I.N.C Linux - Software 15 07-09-2002 07:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:39 AM.

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