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!! |
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. |
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. |
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:
Code:
sudo apt-get update Code:
mkdir /tmp/compil |
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? |
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.
|
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! |
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 |
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:
Code:
grep bultin debian/rules 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 # ) |
I've tried
Quote:
Rather, I find such a passage in the debian/rules file: Quote:
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!! |
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 Your problems with end of line will probably not appear with gnu readline. |
I've finally succeed! Thank you very much!!
|
All times are GMT -5. The time now is 08:50 AM. |