Hi,
I'm reposting this from here (
http://www.linuxquestions.org/questi...4/#post4769128) mainly because that thread, having been marked "Solved", probably didnt get any attention.
-----------
I'd really love to have an example of how to maintain a package installed from source.
I think it would help a lot of people if there were a decent hand-holding guide for "maintaining packages installed from source".
However, I can't seem to coax Google into finding such a guide for the 2 distros I use - CentOS(server) and Ubuntu(Desktop).
As an example, there is a fine editor / dev environment, that is somehow not popular among linux users for whatever reasons, called
SETEdit (
http://setedit.sourceforge.net/ ) which depends on
TVision (
http://tvision.sourceforge.net/ ). It is an opensource port of
the likeable old TurboPascal IDE from Borland on which a lot of devs learnt programming in university.
Now both need to be compiled from source as the latest versions of CentOS and Ubuntu dont have it (and it doesnt always work to change a distro for an editor / dev env).
So if I want to compile from source
tv and
setedit (setedit needs tv installed to display the widgets that make up setedit), and I also want to be able to future-proof my installs by allowing for multiple versions of both, then is this the way to do it, roughly...
Code:
/home/user $ cd ~
/home/user $ mkdir tv2.0.3
/home/user $ cd tv2.0.3/
/home/user/tv2.0.3 $ wget http://tv-site/tv-2.0.3.tar.gz
/home/user/tv2.0.3 $ tar xvf tv-2.0.3.tar.gz
/home/user/tv2.0.3 $ cd tv2.0.3-src/
/home/user/tv2.0.3/tv2.0.3-src $ ./configure
/home/user/tv2.0.3/tv2.0.3-src $ make --prefix='/opt/tv2.0.3'
/home/user/tv2.0.3/tv2.0.3-src $ sudo make install --prefix='/opt/tv2.0.3'
/home/user/tv2.0.3/tv2.0.3-src $ cd ~
/home/user $ mkdir set0.5.4
/home/user $ cd set0.5.4/
/home/user/set0.5.4 $ wget http://set-site/set0.5.4.tar.gz
/home/user/set0.5.4 $ tar xvf set0.5.4.tar.gz
/home/user/set0.5.4 $ cd set0.5.4-src/
/home/user/set0.5.4/set0.5.4-src $ ./configure
/home/user/set0.5.4/set0.5.4-src $ make --prefix='/opt/set0.5.4'
/home/user/set0.5.4/set0.5.4-src $ sudo make install --prefix='/opt/set0.5.4'
This would install first
tv2.0.3 in
/opt/tv2.0.3
Then it would install
set0.5.4 in
/opt/set0.5.4
( I think I might have missed a step in telling the installation of set0.5.4 that it should pick up tv2.0.3 from /opt/tv2.0.3 )
Now imagine, after 6 months, tv project realeases an updated version
tv2.0.4 and that actually breaks a
nice feature X in set0.5.4.
But I want tv2.0.4 for some
crucial updates, but I also want my set0.5.4 working fine as it has been.
So this time, I repeat the above steps, but with new locations.
I
make-make-install tv2.0.4 to
/opt/tv2.0.4 and I compile set0.5.4 (same old version) with tv2.0.4 (which removes feature SetX, but adds some nice bling to tv widgets thmeselves) telling it to
pick up tv from /opt/tv2.0.4.
This new set version I install into
/opt/set0.5.4-1
So now I have :
Code:
/opt/tv2.0.3/
/opt/tv2.0.4/
/opt/set0.5.4/ (compiled using /opt/tv2.0.3/)
/opt/set0.5.4-1/ (compiled using /opt/tv2.0.4/)
and so I have full freedom to use either
/opt/set0.5.4 or
/opt/set0.5.4-1, depending on my whim.
This would be really really neat.
I looked it up and find that there is a distro that does this:
Gobolinux
But alas! I have to use Centos on server, and Ubuntu on desktop, for several reasons.
So switching to Gobolinux is out of question.
The other option I have is using
portable linux apps, but that is a long learning curve and a whole project in itself, not a day's work.
So, can I pull off the above?
I have faced this scenario a couple of times for packages far more important than setedit - where the single piece of software absolutely essential for the server is not in the official repos or installing other repos isnt allowed.
If this
multiple-version side-by-side /opt solution works, that would be the best thing to happen to me in Linux in some time, and solve a lot of maintenance issues.
Note that I also dont have to bother uninstalling an obsolete version from /opt - I just install a new version and simply don't use the old one!
---------
Also,
Is it better to use
/usr/local for this purpose or
/opt ? I personally think not, because /opt seems cleaner and further away from the distro-maintained core sytem than /usr/local. The further away any custom things, the better, I think.
Another possiblity that struck me on some thought is why not simply create a
/home/user/bin and install both
tv and
set into it - as so:
Code:
/home/user/bin/tv2.0.3/
/home/user/bin/tv2.0.4/
/home/user/bin/set0.5.4/
/home/user/bin/set0.5.4-1/
using
--prefix=/home/user/bin/tv2.0.3/ or similar ?
And then,
adding /home/user/bin to the system path...
That way absolutely nothing is touched in the core system.
Would this way -
/home/user/bin work with a server package - like say a web proxy server -
nginx / squid / lighttpd / etc?
Or do these simply
have to be installed into /opt, /usr/local at best, and from the native package manager at worst?
If I could locally install and compile from source into
/home/user/bin/nginx-x.y.A,
/home/user/bin/nginx-x.y.B, etc. I could easily
test multiple versions and configurations while being fully assured that I broke nothing in the server!
That would be a great thing.
-------
Apologies for the long post, but this is couldn't possibly have been shortened (without making it decently google-searchable)
Thanks in advance!