Jump to content
linux_learner

portage is now available for suse

Recommended Posts

This is the bash_history script for installing Portage under SuSE. Just follow the guide and all should be ok.

 

We accept no reponsibility whatsoever for any loss of data caused from using this tutorial.

 

#Installing portage to suse

#alpha at present

#created with suse 9.0

#tested with suse 9.0 only

 

#this is NOT a script

#run each command in the script, and follow any instructions as necessary

#PLEASE report any and all errors to netmaster10000 [at] yahoo.com

 

#here goes nothing

#(except ur suse system)

 

#at this point you must run yast and install some packages you probably don't have

#gcc

#gcc-g++

#autoconf

#automake

#bison

#build

#dejagnu

#gettext

#gettext-devel

#wget

#pico

#python

#rsync

#make

echo

#this will also install:

#binutils

#expect

#glibc-devel

#libgcj

#libstdc++-devel

#m4

#tcl

#texinfo

 

#this is a good thing, they are all needed by portage, remember that in the future everything will

#be compiled from source so lots of tools are requited

 

yast

 

#Get the portage rescue package

 

wget http://dev.gentoo.org/~carpaski/portage_re....50-r1-x86.tbz2

 

#Create a script that i found on the gentoo forums, don't really know what it does, but apparently it does the whole job

#to this i say bullshit

 

cat > script.sh << "EOF"

#!/bin/bash

#

# call with one argument "again" or call it with no arguments at all

# call it with no arguments first time.

# call it again with "again" to bypass some operations.

#

 

if [ "$#" == "1" ];then

  again=$1

else

  again=""

fi

 

if [ "`id -u`" != "0" ]; then

  echo ""

  echo "Su as root and try again."

  echo ""

fi

 

pythonV=`python -V 2>&1`

if [ "$pythonV" \< "Python 2.2.0" ];then

  echo ""

  echo "Install python 2.2 and then try again"

  echo ""

  exit 1

fi

 

if [ "$again" == "" ];then

  mkdir -p /usr/lib/portage/bin

  mkdir -p /usr/lib/portage/pym

  mkdir -p /usr/portage/profiles

  mkdir /etc/env.d

 

  wget ftp://gentoo.mirrors.pair.com/distfiles/p...0.50-r1.tar.bz2 -O /tmp/portage-2.0.50-r1.tar.bz2

  cd /tmp

  if [ ! -f portage-2.0.50-r1.tar.bz2 ];then

      echo ""

      echo "Mirror error. Try this script again after a while without any args".

      echo ""

      exit 1

  fi

  tar jxf portage-2.0.50-r1.tar.bz2

 

  cd portage-2.0.50-r1/bin

  cp * /usr/lib/portage/bin

  export PATH=/usr/lib/portage/bin:$PATH

  cd ../pym ; cp * /usr/lib/portage/pym/

  cd ../man ;cp *.1 /usr/man/man1 ;cp *.5 /usr/man/man5

  cd ../src/python-missingos

  ./setup.py install

  cd ../sandbox-1.1

  make && make install

  cd ../../cnf; cp * /etc

 

  if [ "`id portage`" == "" ]; then

      groupadd -g 250 portage

      useradd -d /var/tmp/portage -g portage -u 250 portage

  fi

 

  cd /usr/sbin

  ln -s ../lib/portage/bin/regenworld .

  ln -s ../lib/portage/bin/pkgmerge .

  ln -s ../lib/portage/bin/fixpackages .

  ln -s ../lib/portage/bin/etc-update .

  ln -s ../lib/portage/bin/env-update .

  ln -s ../lib/portage/bin/emerge-webrsync .

  ln -s ../lib/portage/bin/ebuild.sh .

  ln -s ../lib/portage/bin/ebuild .

  ln -s ../lib/portage/bin/dispatch-conf .

  ln -s ../lib/portage/bin/archive-conf .

 

  cd /usr/bin

  ln -s ../lib/portage/bin/xpak .

  ln -s ../lib/portage/bin/repoman .

  ln -s ../lib/portage/bin/quickpkg .

  ln -s ../lib/portage/bin/portageq .

  ln -s ../lib/portage/bin/g-cpan.pl .

  ln -s ../lib/portage/bin/emerge .

fi

 

export PATH=/usr/lib/portage/bin:$PATH

echo "CC=gcc;CXX=g++" > /etc/env.d/compilers.sh

echo "LDPATH=\"/lib:/usr/lib:/usr/local/lib:/usr/X11R6/lib:/usr/kerberos/lib\"" > /etc/env.d/10ldpath

. /etc/env.d/compilers.sh

emerge sync

#

# emerge sync should get /usr/portage/profiles

#

if [ -d /usr/portage/profiles/default-x86-1.4 ];then

  ln -s /usr/portage/profiles/default-x86-1.4 /etc/make.profile

else

  echo ""

  echo "Something wrong. Get /usr/portage/profiles dir from a working"

  echo "Gentoo system and try again."

  echo ""

  exit 1

fi

 

# inject the "dangerous" packages first.

glibcP=`emerge -p -O glibc|grep ebuild|cut -d" " -f8`

emerge inject $glibcP

gccP=`emerge -p -O gcc|grep ebuild|cut -d" " -f8`

emerge inject $gccP

binP=`emerge -p -O binutils|grep ebuild|cut -d" " -f8`

emerge inject $binP

 

# fetch the baselayout.

emerge -f -O baselayout

 

# now inject it too.

baseP=`emerge -p -O baselayout|grep ebuild|cut -d" " -f8`

emerge inject $baseP

 

#was inject success

ret=`emerge -p baselayout|grep "ebuild  R"`

 

if [ "$ret" == "" ] ;then

  echo "Inject has failed. Please verify and continue with cut & paste of rest of the steps"

  echo "ERROR."

  exit 1

fi

 

# if it fails with some errors, its fine.

emerge -O portage

 

cd /tmp

cp /usr/portage/distfiles/rc-scripts*.tar.bz2 .

tar xjpf rc-scripts*.tar.bz2

cd rc-scripts*/sbin

cp depscan.sh /sbin; cp functions.sh /sbin

mkdir -p /lib/rcscripts/awk

cd ../src/awk

cp *.awk /lib/rcscripts/awk/

cd /etc/init.d

ln -s /sbin/depscan.sh .

ln -s /sbin/functions.sh .

 

emerge -O gawk

 

# FOLLOWING SHOULD NOT GIVE ANY ERRORS HERE. You screwed up if it did.

emerge -O portage

 

if ! fgrep -q "/etc/profile.env" /etc/profile ; then

  echo ". /etc/profile.env" >> /etc/profile

fi

 

echo ""

echo "#############################################################"

echo "You are now free to enjoy portage. Make sure you tune"

echo "/etc/make.conf and other portage configuration files to take"

echo "advantage of portage. If you screwed up, its OK. Pick yourself"

echo "up and give it another go."

echo "#############################################################"

echo ""

EOF

 

#symlink nano to pico (for my sanity as all gentoo docs tell u to use nano)

ln -s /usr/bin/pico /usr/bin/nano

 

#make mystical script executable

chmod +x script.sh

 

#extract the portage rescue from wherever you left it into root directory

cd /

tar -xvjpf /root/portage-rescue-2.0.50-r1-x86.tbz2

 

#download and import an entire /usr/portage dir from another system, if you don't have another system this can be done by importing a portage snapshot from the gentoo site.

cd /usr

wget http://www.mirror.ac.uk/sites/www.ibiblio....0040410.tar.bz2

tar -xvjpf portage-20040410.tar.bz2

 

#ran the magical script (maybe this is the first time, maybe not, i became quite the expert at running it)

cd /root/

./script.sh

 

#!!! BAD COUNTER in 'sys-devel/gcc-3.3.2-r5'

#expect this error, i don't know what causes it, neither does anyone else

#but apparently it's not a problem

 

cat > prune << "EOF"

#!/bin/bash

emerge sync

emerge -p -uD world > /tmp/world.update

for i in `cat /etc/portage/package.mask.ORG` ;

do

matching=`grep "$i" /tmp/world.update`

if [ -n "$matching" ]; then

toInject=`echo $matching|cut -d " " -f 4`;

echo "Injecting $toInject"

'emerge' inject $toInject

fi

done

EOF

 

chmod +x prune

./prune

 

#tell portage about all the apps that are already installed

emerge inject sys-libs/ncurses-5.4-r1

emerge inject dev-python/python-fchksum-1.6.1-r1

emerge inject app-shells/bash-2.05b-r9

emerge inject sys-apps/groff-1.18.1-r4 sys-apps/man-1.5l-r6

emerge inject sys-apps/texinfo-4.5

emerge inject sys-devel/m4-1.4-r1

emerge inject sys-devel/libperl-5.8.2

emerge inject dev-lang/perl-5.8.2-r1

emerge inject sys-devel/autoconf-2.58-r1

emerge inject sys-devel/automake-1.8.3

emerge inject sys-apps/coreutils-5.0.91-r4

emerge inject sys-apps/texinfo-4.5

emerge inject dev-lang/python-2.3.3

 

#reinstall portage itself to ensure lasest version is installed

emerge portage

 

#install yacc (the suse cersion causes errors)

emerge yacc

 

#install m4 over the suse version

emerge m4

 

#same for autoconf/make, suse versions dnt work

emerge autoconf automake

 

#this unbreaks some stuff

emerge pam

 

#update config files

etc-update

 

#this was a test, it should install correctly, who knows, maybe it will

emerge squid

 

for those who like gui, once portage is installed you could do webportage http://sourceforge.net/projects/webportage/ a webmin type interface for portage.

Share this post


Link to post
Share on other sites

I used something like this under slackware before, emerde i think it was. The problem with these is they will probably make your system so incosisent that if you ever run yast again to update your system it will prolly go crazy on you.

 

Just don't test this on a box your using full time. ;)

Share this post


Link to post
Share on other sites

the information i have is that it would work as another package manager.

 

QUOTE (jeremy @ May 5 2004, 07:35) [Does this install the Portage versions over the SUSE versions or alongside them? If it installs over them it could cause problems with your RPM database and dependencies, if it is choice between Portage or YaST/RPM I think I would go for the latter. ]

 

 

Installing portage will install packages over the top of rpm versions, however, it should not damage them, nor should it prevent you from using rpm in the future. Portage and rpm unfortunately keep seperate databases and therefore will not know about the existance of each other. Therefore installing an rpm may downgrade a package installed using portage. However portage is very unlikely to downgrade anything.

In conclusion, although the 2 package managers install to the same locations, they are unlikely to cause too many problems with each other.

 

Also i would disagree with your choice of rpm over source based installs, but that's just my opinion as some1 with a 3GHz cpu who can compile stuff in seconds.

 

Another note: portage for suse is only alpha, and the programmer was probably drunk when he ported it, so dnt test it where the rpm database (or anything else) is important.

 

Another note: that said, please try it and let me know if they do work alongside each other successfully, i've had a lot of luck myself.

 

http://forums.suselinuxsupport.de/index.ph...st=0entry5617

Share this post


Link to post
Share on other sites
Installing portage will install packages over the top of rpm versions, however, it should not damage them, nor should it prevent you from using rpm in the future. Portage and rpm unfortunately keep seperate databases and therefore will not know about the existance of each other. Therefore installing an rpm may downgrade a package installed using portage. However portage is very unlikely to downgrade anything.

In conclusion, although the 2 package managers install to the same locations, they are unlikely to cause too many problems with each other.

 

Thats doesn't really make much sense to me. If two different versions of a package are installed in the same place, how is that not going to cause problems?

 

Having two very different types of package management on one system doesn't sound like too good an idea to me. That said, I haven't tried it... ;)

Share this post


Link to post
Share on other sites
Guest jentuu

I canot make this step in this skript:

./setup.py install

uzurpator:/usr/bin # cd /tmp

uzurpator:/tmp # cd portage-2.*/bin

uzurpator:/tmp/portage-2.0.54/bin # cd ../src/python-missingos

uzurpator:/tmp/portage-2.0.54/src/python-missingos # ls

. .. ChangeLog missingos.c PKG-INFO README setup.cfg setup.py

uzurpator:/tmp/portage-2.0.54/src/python-missingos # ./setup.py install

Traceback (most recent call last):

File "./setup.py", line 5, in ?

from distutils.core import setup, Extension

ImportError: No module named distutils.core

uzurpator:/tmp/portage-2.0.54/src/python-missingos #

any ideas? :mellow:

thnx ;)

:thumbs:

Share this post


Link to post
Share on other sites

If you want to use something else on linux that is handling deps and building from source, I would look at pkgsrc from netbsd, I use it on Solaris too, and works pretty well. That way it isn't overiding other area's of your system, everything goes into /usr/pkg and /usr/pkgsrc

 

http://www.netbsd.org/Documentation/pkgsrc/index.html

 

http://www.asyd.net/home/docs/solaris/pkgsrc#libtool

 

http://www.drxyzzy.org/opsys/pkgsrc-sol9.html

 

http://blogs.sun.com/roller/page/eric_bout...cratch_table_of

Share this post


Link to post
Share on other sites

I'd rather use a Gentoo stage 3 installation that this dirty hack, which is utterly unlikely to find followers.

Most SuSE users have already a pretty decent package manager (no, no... not Yast of course- Synaptic), so they won't be too impressed by that, which will make installations much slower, and system consistency questionable.

Share this post


Link to post
Share on other sites
Guest dve
I canot make this step in this skript:

./setup.py install

...

File "./setup.py", line 5, in ?

from distutils.core import setup, Extension

ImportError: No module named distutils.core

...

 

It seems you are missing some python packages. Distutils is package for distributing python programs. You can get it by installing python-devel package.

Share this post


Link to post
Share on other sites

SuSe has a hard enough time not falling over on its own, I'd hate to see it with portage :)

 

I'm not a fan (although I do PR writing work for Novell, so don't tell them :P )

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...