[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: What is location for building/ installing system-wide software?



Gregory Nowak wrote:
> David Christensen wrote:
> > But, this implies working as root.  I prefer building in my home
> > directory as a normal user, and finishing with "sudo make install",
> > "sudo vi /etc/<projectrc>", etc..
> > 
> > Does anybody have any compelling arguments for building as root
> > under /usr/local/src?
> 
> Since I need to become root in order to install,

Why?  Seriously, it isn't needed.  Just group 'staff'.

> I just go ahead and do the whole thing from start to finish as root

The problem with that is that a mistake (or nefarious intent) in a
Makefile can cause the build to crawl out of the build directory and
into the rest of the system.  Sure it would be a bug.  Sure it would
be addressed in a different version.  But there is no safety net.
Once tripped over then the damage to your system is already done.

> in /usr/local/src/project. Not much of an argument, but that's my
> rationale anyway. There are probably good arguments against doing it
> this way. I've so far built from source on only my own systems, and
> ultimately we can do with our own systems whatever we want.
> 
> If you want to build under /usr/local/src/project as a normal user,
> you should be able to as root:
> 
> mkdir /usr/local/src/project
> chown user.user /usr/local/src/project
> 
> and do the rest of the build as user.

Instead of the above add yourself to the 'staff' group.  (While there
you might as well add yourself to the 'adm' group too.  Then you can
view the /var/log/* files as yourself too.  Unrelated to the current
question but useful.)

  # adduser youruserid staff
  # adduser youruserid adm

Then log out and log back in again so that the new groups will be part
of your process.

  $ id | grep --color staff

Since all of the directories in /usr/local are writable by group
'staff' you now have the capability to write to files there without
being root.

I don't normally build there.  I normally build in my $HOME/src
directory.  But upon building it means I can install in the system
local /usr/local directory as myself *without root*.  That adds a good
safety net against makefile mistakes.

  $ tar xzvf project-1.0.1.tar.gz
  $ cd project-1.0.1
  $ make
  $ make check
  $ make install

That will install in /usr/local/bin and associated places.  No need
for root.  Just use group staff.

David Christensen wrote:
> For example, Java SDK and FreeCiv

Have you looked at what is already available in Debian?

  $ apt-cache search freeciv
  freeciv-client-extras - Civilization turn based strategy game (miscellaneous extras)
  freeciv-client-gtk - Civilization turn based strategy game (GTK+ client)
  freeciv-client-sdl - Civilization turn based strategy game (SDL client)
  freeciv-client-xaw3d - Civilization turn based strategy game (Xaw3D client)
  freeciv-data - Civilization turn based strategy game (game data)
  freeciv-server - Civilization turn based strategy game (server files)
  freeciv-sound-standard - Civilization turn based strategy game (standard sound pack)

  $ apt-cache search openjdk | grep ^openjdk-7
  openjdk-7-dbg - Java runtime based on OpenJDK (debugging symbols)
  openjdk-7-demo - Java runtime based on OpenJDK (demos and examples)
  openjdk-7-doc - OpenJDK Development Kit (JDK) documentation
  openjdk-7-jdk - OpenJDK Development Kit (JDK)
  openjdk-7-jre-zero - Alternative JVM for OpenJDK, using Zero/Shark
  openjdk-7-source - OpenJDK Development Kit (JDK) source files
  openjdk-7-jre - OpenJDK Java runtime, using Hotspot JIT
  openjdk-7-jre-headless - OpenJDK Java runtime, using Hotspot JIT (headless)
  openjdk-7-jre-lib - OpenJDK Java runtime (architecture independent libraries)

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: