LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-08-2011, 04:23 PM   #1
veeruk101
Member
 
Registered: Mar 2005
Distribution: Ubuntu 12.04 LTS
Posts: 249

Rep: Reputation: 16
Suggestions for where to store tars and source directories?


Some questions about organizing where I put source directories:

1) Is there any convention or best practice as to where to store source tars for packages that you have to build yourself, as well as for where to store the source directories that are extracted (the ones containing the generated Makefile)? I'm getting to a point where there are tars and source directories all over my home directory and elsewhere, and it's becoming disorganized very quickly.

2) Are the entire source directories needed to be kept around, or could simply the Makefile be enough to perform a 'make uninstall' if necessary?

3) Is there any problem with moving around the source folders after a package has been built and installed? Meaning if I install a package, move the source directory, then do a 'make uninstall' from that new location, would it successfully remove the package?

4) Now that I think about it is there any reason to keep around the tars after installing a package? As long as you have the source directory, what point would there be?

I'm hoping for tips and suggestions from people like you who have far more Linux experience than I do and know the best way to manage these things.
 
Old 06-08-2011, 05:18 PM   #2
ShadowCat8
Member
 
Registered: Nov 2004
Location: Ontario, CA
Distribution: Gentoo, Arch, (RedHat4.x-9.x, FedoraCore 1.x-4.x, Debian Potato-Sarge, LFS 6.0, etc.)
Posts: 236

Rep: Reputation: 52
Greetings,

Well, let me give you a couple of my insights on the subject:
  1. If the package is going to be globally available, then I tend to use /usr/src for the unpacking of source-tarballs.
    If it's an app that only *I* will use, then I will do one of 3 things:
    1. Make a ~/build directory and untar and build the package there. Depending on the package, I may or may not remove the source tree after the build.
    2. If it's a big package, I will make a /tmp/build directory, but then I will not keep the sources there after the build (Besides, the next reboot of the system will wipe it anyway.)
    3. If it's a root-only type of app, I will create a /root/build directory and build it there. Again, I will not leave the source tree after the build, but I will keep the source-tarball for future reference.
  2. I keep a directory for downloaded source-tarballs called ~/dls/srcs. I also tend to keep the tarballs until either there's an upgrade to replace it or I have burned a copy off to W.O.R.M. media. (e.g. CD, DVD or BD-R)
  3. With regards to moving the source trees, I'm pretty sure that it depends on how the package is written/put together. I know that you can move some source trees without an issue, but I'm not sure that it is that way across the board.
  4. In regards to keeping the tars, I think keeping the source-tarballs is far more important than keeping the source trees. Generally, the tarballs are compressed and take up a fraction of the space that the decompressed source tree would. (i.e. the kernel source tarball for 2.6.36 is just shy of 70MB, where the actual source tree is about 734MB.)

HTH. Let us know.
 
Old 06-08-2011, 06:48 PM   #3
veeruk101
Member
 
Registered: Mar 2005
Distribution: Ubuntu 12.04 LTS
Posts: 249

Original Poster
Rep: Reputation: 16
If you don't keep the source tree around but just the tar, how do you uninstall? I was under the impression you need the Makefile that you used for installation to be present for uninstallation - I must be mistaken.

When you say a package is globally available, does that mean all users on the system? My system is essentially a 1-user system of just the administrator, so for me I guess it would make sense for every package to go under /usr/src...

Also, if any other people would like to share how they go about this as per my OP I'd love to hear it.
 
Old 06-08-2011, 07:32 PM   #4
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,529

Rep: Reputation: 2896Reputation: 2896Reputation: 2896Reputation: 2896Reputation: 2896Reputation: 2896Reputation: 2896Reputation: 2896Reputation: 2896Reputation: 2896Reputation: 2896
Personally I have not found that many (reliable) make uninstall options for packages so the answer to:
Quote:
If you don't keep the source tree around but just the tar, how do you uninstall? I was under the impression you need the Makefile that you used for installation to be present for uninstallation - I must be mistaken.
Is that you will need to find a way to track what / where items are installed by your package and then remove those when
you decide to 'uninstall' it.

I have been attempting to build a package management system for a linux build of my own design and my setup
for storage and installation is:

1. Only tar'ed and compressed files are kept in /var/spool/sources and patches in /var/spool/patches
2. All building done in /usr/src/build
3. Copy of what is installed by a package so as to be removed later /var/log/install

In all 3 cases the I also try to keep the file naming convention the same, for ease of locating:

package_name-version.{tar.gz, patch, log}

This is for all global packages, other than that I agree with ShadowCat8 that any personal / testing packages
be processed and setup within your home path
 
  


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
syslog to central server and store logs in separate host directories steve.goldner Linux - Enterprise 11 04-07-2012 02:26 PM
How to store files/directories in different different directories!! anishkumarv Linux - Newbie 7 03-23-2011 05:26 PM
LXer: Red Hat to set up open-source software store: source LXer Syndicated Linux News 0 03-09-2007 02:16 PM
Extract Mplayer tars into what directories? FC4 moxieman99 Linux - Software 2 02-03-2007 03:41 PM
Where to store source .tar.gz aje Linux - Newbie 4 12-30-2005 08:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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