LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-13-2005, 10:09 AM   #1
small_boy22
Member
 
Registered: May 2005
Posts: 45

Rep: Reputation: 15
Permisions in slackware for created packages


hi,
since much applications in slackware like Firefox, or TV application don't ship with the default installation i have to compile them and moreover create a package so that is easy to update and install/unistall.I know the existance of linuxpackages.net but there they dont supply the Slack.Build script so you have to trust the binary that you get..

So what user,group,world permisions should i give ????
(kinda very general right ? :P )

I work like a normal user.So when i install e.g. Firefox i should "chown to root:root" and just then give the world r-x ???

Or should i "chown to user:users" so that i don't have any problems while i work ?? that is risky i believe because if a user gains access to me as a user though this program he may infect it and I execute the same program another time as root i may be compomised.
I dont want to discuss what happens if he gains access as a root::we allo know

The above questions apply better to maybe Slackware Administration or in general linux administration so is there any Free E-book,web-site,resource out there that deal with this matter ???
Except from Slackware book, slackware linux unleashed 3rd edition and Running linux 4th edition O'Reilly.
 
Old 05-13-2005, 10:35 AM   #2
Nobber
Member
 
Registered: Jun 2002
Location: Nova Scotia
Distribution: Debian (home), Kubuntu 7.04 (work)
Posts: 265

Rep: Reputation: 30
The permissions/ownership applied when you "make install" are usually suitable. I don't think I've ever had to change them for a "./configure && make && make install"-type package.
 
Old 05-13-2005, 10:56 AM   #3
cathectic
Member
 
Registered: Sep 2004
Location: UK, Europe
Distribution: Slackware64
Posts: 761

Rep: Reputation: 35
1) Firefox

Get it from -current, it's just a Slack friendly repackaged version of the official binaries.

2) Permissions

Never use chmod. Ownership is usually root.root, except for binaries in /usr/bin or /usr/local/bin or /bin, which are root.bin (same goes for the /sbin's). Let the "make install deal" with the permissions, but use DESTDIR to point to somewhere you can repackage from (run "make install DESTDIR=/tmp/package-whatever")

3) SlackBuild's

I suggest writing your own SlackBuild's if you will be frequently rebuilding a package. (You will have to run them as root though).
 
Old 05-13-2005, 10:57 AM   #4
small_boy22
Member
 
Registered: May 2005
Posts: 45

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by Nobber
The permissions/ownership applied when you "make install" are usually suitable. I don't think I've ever had to change them for a "./configure && make && make install"-type package.
well mostly i want to create packages thats why i am asking so many things.
Without packages after a lot of installations && upgrades it's gonna be a chaos inside my /usr/local/* :P


Quote:
Originally posted by cathectic
1) Firefox

Get it from -current, it's just a Slack friendly repackaged version of the official binaries.

2) Permissions

Never use chmod. Ownership is usually root.root, except for binaries in /usr/bin or /usr/local/bin or /bin, which are root.bin (same goes for the /sbin's). Let the "make install deal" with the permissions, but use DESTDIR to point to somewhere you can repackage from (run "make install DESTDIR=/tmp/package-whatever")

3) SlackBuild's

I suggest writing your own SlackBuild's if you will be frequently rebuilding a package. (You will have to run them as root though).
i saw the firefox 1.0.3 @ current but no SlackBuild at source tree.
But firefox 1.0.3 has a critical bug, i dont know if it affect linux though :P
I've read about the DESTDIR and i am going to take a look to the permissions assigned by "make install".
I have to check SlackBuild scripts to have a more general approach so that can start to make my own ones later

Do permissions differ i you run "./configure && make" as a root and not as a user ?

Last edited by small_boy22; 05-13-2005 at 11:02 AM.
 
Old 05-13-2005, 11:01 AM   #5
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
chown -R root:root your entire package directory then create the package
(or use -c option for makepkg but this is not the Volkerding way)
 
Old 05-13-2005, 11:03 AM   #6
small_boy22
Member
 
Registered: May 2005
Posts: 45

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by keefaz
chown -R root:root your entire package directory then create the package
(or use -c option for makepkg but this is not the Volkerding way)
What is the Volkerding way ??? I though he supplied to us the tools that he uses to create packages
 
Old 05-13-2005, 11:11 AM   #7
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
From official coreutils.SlackBuild script :
Code:
...
tar xjvf $CWD/coreutils-$VERSION.tar.bz2
cd coreutils-$VERSION
chown -R root.root .
...
mkdir -p $PKG/usr/sbin
chown -R root.bin usr/bin usr/sbin
...
Note that of course makepkg is used to create the package,
but he does not uses it to change permissions

Last edited by keefaz; 05-13-2005 at 11:12 AM.
 
Old 05-13-2005, 11:25 AM   #8
cathectic
Member
 
Registered: Sep 2004
Location: UK, Europe
Distribution: Slackware64
Posts: 761

Rep: Reputation: 35
small_boy22:

Mozilla Firefox

Mozilla Firefox SlackBuild's - For 1.0.4, update the version in the SlackBuild to 1.0.4, and replace all occurrences of 1.0.3 with 1.0.4 in mozilla-firefox-simple.diff.gz (you'll also need to grab the correct Firefox from Mozilla's FTP, *don't* use the Firefox installer package).

SlackBuild's:

Pat uses SlackBuild scripts to build the packages, and that's it. The only 'tools' you need are the basic utilities for manipulating files.

A SlackBuild script always runs as root. It:[list=1][*]Extracts the tar package as root (the chown root.root is run on the source files, *not* the resulting files from a "make install")[*]Runs ./configure (if /usr/local is the default install path, it uses --prefix=/usr)[*]make[*]make install DESTDIR=/tmp/<program_name>[*]Strip binaries (remove unnecessary debugging symbols, etc from the binaries to reduce their size)[*]Gzip the man pages (reduce size)[*]Create a /usr/doc/<program_name>-<version> containing ChangeLog, README, TODO, NEWS, etc...[*]Run "makepkg -l y -c n" and dump the finished package to /tmp[/list=1]

Last edited by cathectic; 05-13-2005 at 11:27 AM.
 
Old 05-13-2005, 03:19 PM   #9
bmfan
Member
 
Registered: Mar 2005
Posts: 74

Rep: Reputation: 15
there is a firefox buildscript you could use
Code:
#!/bin/sh

CWD=`pwd`
PKG="$CWD/package-firefox"
rm -rf $PKG

VERSION=1.0.4
ARCH=i686
BUILD=1ron

mkdir -p $PKG/usr/lib $PKG/usr/bin
cd $PKG/usr/lib

tar xzfv $CWD/firefox-$VERSION.tar.gz

cd $PKG/usr/bin
ln -s ../lib/firefox/firefox ./firefox

mkdir -p $PKG/usr/share/pixmaps
cp $CWD/Firefox.png $PKG/usr/share/pixmaps/Firefox.png

chown -R root:root $PKG
chown root.bin $PKG/usr/lib/firefox/firefox-bin

mkdir -p $PKG/usr/share/applications
#create firefox.desktop
cat << _EOF_ > $PKG/usr/share/applications/firefox.desktop
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Firefox
GenericName=
Comment=
Icon=/usr/share/pixmaps/Firefox.png
TryExec=firefox
Exec=firefox
Terminal=0
Categories=GNOME;KDE;GTK;Application;Network;

_EOF_
mkdir -p $PKG/install
#create slack-desc
cat << _EOF_ > $PKG/install/slack-desc
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.  Line
# up the first '|' above the ':' following the base package name, and the '|' on
# the right side marks the last column you can put a character in.  You must make
# exactly 11 lines for the formatting to be correct.  It's also customary to
# leave one space after the ':'.

   |-----handy-ruler------------------------------------------------------|
firefox: firefox (Mozilla Firefox Web browser)
firefox:
firefox: This project is a redesign of the Mozilla browser component written
firefox: using the XUL user interface language.  Firefox empowers you to
firefox: browse faster, more safely and more efficiently than with any other
firefox: browser.
firefox:
firefox: Visit the Mozilla Firefox project online:
firefox:   http://www.mozilla.org/projects/firefox/
firefox:
firefox:

_EOF_
cd $PKG
makepkg -l y -c n "$CWD"/firefox-$VERSION-$ARCH-$BUILD.tgz

#clean up
rm -r $PKG

#Optinal Install or Upgrade
cd $CWD
#installpkg firefox-$VERSION-$ARCH-$BUILD.tgz
#upgradepkg firefox-$VERSION-$ARCH-$BUILD.tgz
echo "Firefox Slackpackage Complete."
http://s05.imagehost.org/1136/Firefox.png

Last edited by bmfan; 05-13-2005 at 06:50 PM.
 
  


Reply



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
slackware packages warpedlinuxmind Slackware 3 08-02-2005 01:05 AM
slackware packages ilnli Slackware 7 01-08-2005 11:23 PM
Manually Created Devices Disappear - Slackware 10 Kernel 2.6.9 rovitotv Slackware 1 01-01-2005 04:53 PM
Created a user account on slackware and now I cant enter root shirokiba Linux - Newbie 2 04-18-2004 07:44 PM
Newer Slackware Packages on older slackware version pengStudent Slackware 2 11-12-2003 12:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:11 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
Open Source Consulting | Domain Registration