LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices



Reply
 
Search this Thread
Old 11-22-2007, 05:41 AM   #1
lawrence_lee_lee
Member
 
Registered: May 2007
Posts: 141

Rep: Reputation: 16
How to compile package myself?


Most of the time, installing packages is very convenient in Ubuntu, by simply using the Synaptic Package Manager. But I met a problem.

I want to compile a package (gnuplot) myself, because if I used the Synaptic Package Manager to install it, the readline function is not enabled during its auto compilation.

So, can I just download the package through Synaptic Package Manager but do the compilation myself?

Another question, where is the package downloaded to?

Thanks a lot!!
 
Old 11-22-2007, 06:26 AM   #2
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
There's a good sticky on this in Linux - General: http://www.linuxquestions.org/questi...ograms.-45094/

Might be worth a quick once-over.

Of note, using make install, as mentioned in the thread, won't allow the program to be visible to the package manager, so it won't be able to uninstall it. I'd suggest trying to create a .deb file. This is possible with checkinstall (which should be available with your package manager). You then substitute the make install command with checkinstall, and the script prompts you for info.
 
Old 11-22-2007, 06:34 AM   #3
pusrob
Member
 
Registered: Jan 2006
Distribution: Debian
Posts: 468

Rep: Reputation: 35
Hi.
First of all, you must know, that Synaptic doesn't compile anything. The packages used by Synaptic, are pre-compiled packages. The software was compiled by somebody else, and put into a binary package, which are used by package managers (Synaptic too). This is why the installation of a package is so fast.
If you want to compile a package, you need to download the source tarball from here. Here you need the gnuplot-4.2.2.tar.gz file. Download it, extract it somewhere, and than read the README and/or INSTALL files (if there any) inside the tarball. There will be described how to compile that prog. Don't forget to install -dev files for the dependecies, otherwise it will not work. Good compiling.
 
Old 11-22-2007, 07:39 AM   #4
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 53
Don't do what is said in the link otherwise, as someone said, it won't be a package and then you go back 10 years ago when people had program spread everywhere and had to watch every week if a new version was available,..... lots of other reasons.

A quick way to do it:

First, you need lines to get the sources of your distro's gnuplot (==gnuplot+distro specific patches)

ex on debian:

/etc/apt/sources.list:

Quote:
deb-src http://ftp.fr.debian.org/debian/ etch main non-free contrib
Code:
sudo apt-get update
Second, do your compilation, in /tmp/compil for example:

Code:
mkdir /tmp/compil
cd /tmp/compil
apt-get source gnuplot
cd gnuplot*
sed -i 's/builtin/gnu/' debian/rules
sudo apt-get build-dep gnuplot
sudo apt-get install libreadline-dev
fakeroot dpkg-buildpackage -us -uc
cd ..
sudo dpkg -i *.deb
Third, try gnuplot and tell us if something goes wrong with the exact message.

Last edited by nx5000; 11-26-2007 at 07:19 AM.
 
Old 11-25-2007, 03:12 AM   #5
lawrence_lee_lee
Member
 
Registered: May 2007
Posts: 141

Original Poster
Rep: Reputation: 16
Thanks everyone very much! But I still got problems in compiling...

Thanks for all kindly replies. But I still failed in all attempts to compile the gnuplot package.

For nx5000's method, when I type "deb-src http://ftp.fr.debian.org/debian/ etch main non-free contrib", it said that deb-src is an unknown command. And I don't know how to proceed.

For pusrob's method, I downloaded the package source and followed the instructions given in the file INSTALL. That is,
./configure
sudo make
sudo make install
The results were that the package was successfully compiled, but with lot s of errors (so many that I can't post it here). And the compiled gnuplot still do not have the readline function. Even worse, there was no x11 terminal available after compilation.

Can anyone give me some ints about what's going on?
 
Old 11-25-2007, 07:44 AM   #6
pusrob
Member
 
Registered: Jan 2006
Distribution: Debian
Posts: 468

Rep: Reputation: 35
Well, try to type this: ./configure --help This will give you all the switches you need, so you can compile the package as you need.
 
Old 11-25-2007, 10:36 AM   #7
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 53
No you don't have to type deb-src, it's a line that describes a repository where the sources can be found.

Can you post what is in your /etc/apt/sources.list
?

You should find which line to put for your distribution (ubuntu xx), the one I posted is for debian! Don't mix!
 
Old 11-26-2007, 06:29 AM   #8
lawrence_lee_lee
Member
 
Registered: May 2007
Posts: 141

Original Poster
Rep: Reputation: 16
contents of /etc/apt/sources.list

Below is the content of /etc/apt/sources.list.
By the way, how can I make these long text into a "text box" like what you have done?


deb cdrom:[Ubuntu 7.10 _Gutsy Gibbon_ - Release amd64 (20071016)]/ gutsy main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.

deb http://hk.archive.ubuntu.com/ubuntu/ gutsy main restricted
deb-src http://hk.archive.ubuntu.com/ubuntu/ gutsy main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://hk.archive.ubuntu.com/ubuntu/ gutsy-updates main restricted
deb-src http://hk.archive.ubuntu.com/ubuntu/ gutsy-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb http://hk.archive.ubuntu.com/ubuntu/ gutsy universe
deb-src http://hk.archive.ubuntu.com/ubuntu/ gutsy universe
deb http://hk.archive.ubuntu.com/ubuntu/ gutsy-updates universe
deb-src http://hk.archive.ubuntu.com/ubuntu/ gutsy-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://hk.archive.ubuntu.com/ubuntu/ gutsy multiverse
deb-src http://hk.archive.ubuntu.com/ubuntu/ gutsy multiverse
deb http://hk.archive.ubuntu.com/ubuntu/ gutsy-updates multiverse
deb-src http://hk.archive.ubuntu.com/ubuntu/ gutsy-updates multiverse

## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://hk.archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse
# deb-src http://hk.archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository. This software is not part of Ubuntu, but is
## offered by Canonical and the respective vendors as a service to Ubuntu
## users.
# deb http://archive.canonical.com/ubuntu gutsy partner
# deb-src http://archive.canonical.com/ubuntu gutsy partner

deb http://security.ubuntu.com/ubuntu gutsy-security main restricted
deb-src http://security.ubuntu.com/ubuntu gutsy-security main restricted
deb http://security.ubuntu.com/ubuntu gutsy-security universe
deb-src http://security.ubuntu.com/ubuntu gutsy-security universe
deb http://security.ubuntu.com/ubuntu gutsy-security multiverse
deb-src http://security.ubuntu.com/ubuntu gutsy-security multiverse
 
Old 11-26-2007, 07:19 AM   #9
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 53
Well, you have deb-src lines as you can see. These lines tells your packaging system where to find the SOURCES of packages so that they can be recompiled.
So jump to step "Second".


As I don't really know the ubuntu package, we should check before modifying the package before recompilation:

BEFORE this step

Quote:
sed -i 's/builtin/gnu/' debian/rules
Please type this command
Code:
grep bultin debian/rules
and give the result here before proceeding. The sed command will replace in the "debian makefile" readline bultin in gnuplot by readline from GNU which is what you need.

Maybe these packages in ubuntu are different, but shouldn't be..


To make big text areas, select the text (double clicking or triple clicking for the whole line) and click on QUOTE button (the icon above, left to # )
 
Old 11-28-2007, 03:18 AM   #10
lawrence_lee_lee
Member
 
Registered: May 2007
Posts: 141

Original Poster
Rep: Reputation: 16
I've tried
Quote:
grep bultin debian/rules
but it give me null result.

Rather, I find such a passage in the debian/rules file:
Quote:
config.status: configure
dh_testdir

./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) CFLAGS="$(CFLAGS)" \
--prefix=/usr \
--mandir=\$${prefix}/share/man \
--infodir=\$${prefix}/share/info \
--libexecdir=\$${prefix}/lib/gnuplot \
--datadir=\$${prefix}/share/gnuplot \
--with-gihdir=\$${prefix}/share/gnuplot \
--without-gnu-readline --without-lasergnu \
--with-png --with-gd --without-lisp-files \
--without-linux-vga

build-arch: config.status build-arch-stamp
build-arch-stamp:
dh_testdir
in which I saw something likely to be relevant: -without-gnu-readline

Should I change this line and then follow your instruction?

Another question, in my current gnuplot, not only is the readline function disabled, but also the ... well, I don't know how to say... I can't use keys like delete, home, end, and that if a line is full, it doesn't continue to the next line, instead the typing following becomes invisible (but they did got inputted!). I can't guess what the problem is.

Thanks for helping me so much!!
 
Old 11-28-2007, 06:43 AM   #11
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 53
Ok so they are a bit different

Which means that the sed should be

Code:
sed -i 's/without-gnu-readline/with-gnu-realine/' debian/rules
The rest should be correct.

Your problems with end of line will probably not appear with gnu readline.
 
Old 11-29-2007, 12:03 AM   #12
lawrence_lee_lee
Member
 
Registered: May 2007
Posts: 141

Original Poster
Rep: Reputation: 16
I've finally succeed! Thank you very much!!
 
  


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
Package manager/compile from source doowttam Linux - Newbie 3 07-07-2006 02:44 AM
how to compile real player package phanee Linux - Software 1 08-21-2005 02:44 PM
compile software by tar package kernelvn *BSD 2 06-12-2005 01:17 PM
Compile Vs. Package Phyrexicaid Linux From Scratch 3 01-20-2005 08:17 AM
Uninstall package after compile? mijohnst Linux - Newbie 1 06-14-2004 09:53 PM


All times are GMT -5. The time now is 01:39 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration