You are not logged in.

#1 2005-07-22 04:01:25

windrider
Member
Registered: 2005-05-07
Posts: 27

n00b question about PKGBUILD and sed

Hi, i find sed being used in quite a few PKGBUILDs but i dont really understand what it does after see the the man page and stuff...

for example,

# Maintainer: Link Dupont <link@subpop.net>
# Contributor: Link Dupont <link@subpop.net>

pkgname=cedega
pkgver=4.4
tgrel=1
pkgrel=2
pkgdesc="Transgaming's flagship product, allowing Windows games to run on Linux"
url="http://www.transgaming.com/"
license="non-free"
depends=('x-server' 'python' 'pygtk')
install=
source=("${pkgname}_${pkgver}-$tgrel.i386.tgz" "point2play-small-2.0.1.tgz" "transgaming-fontinstaller-1.0.tgz" "cedega.sh" "transgaming-mozctlinstaller-1.0-1.i386.tgz" "http://downloads.transgaming.com/misc_d … pengl32.so")

build() {
    cd $startdir/src
    mkdir -p $startdir/pkg/opt/cedega $startdir/pkg/etc/profile.d
    mv $startdir/src/usr/* $startdir/pkg/opt/cedega

    sed -e "s|/usr|/opt/cedega|" -i $startdir/pkg/opt/cedega/bin/Point2Play
    sed -e "s|/usr|/opt/cedega|" -i $startdir/pkg/opt/cedega/bin/cedega
    sed -e "s|/usr|/opt/cedega|" -i $startdir/pkg/opt/cedega/bin/tg-font-install
    sed -e "s|/usr|/opt/cedega|" -i $startdir/pkg/opt/cedega/bin/tg-mozctl-install
   
    rm -rf $startdir/pkg/opt/cedega/share/gnome/
    rm -rf $startdir/pkg/opt/cedega/share/icons/
    rm -rf $startdir/pkg/opt/cedega/lib/menu
    cp $startdir/src/cedega.sh $startdir/pkg/etc/profile.d/

    # Apply hotfix that fixes OpenGL rendering in World of Warcraft
    cp $startdir/src/libopengl32.so $startdir/pkg/opt/cedega/lib/transgaming_cedega/winex/lib/
}
md5sums=('20592555c86cae4f4638e69281b80a8d' '8c3a22d57b897ecc9c6ec82ec9df0c6b'
         '9be0cf8bdd62658f46c52fdcba4be34e' '98078ba55a7f7f50750181adea924621'
         'fdb94eadf8c681e7e84a8c8235562274' '56d6f04788bbf0355e309e2eff4f4b4d')



what exactly does sed do for example in this above PKGBUILD?

Offline

#2 2005-07-22 04:15:52

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: n00b question about PKGBUILD and sed

its substituting /opt/cedega/ in place of /usr/ in each of the files on the right.
s is substitue
| is the seperator
i is insert into file
e is execute these commands

Offline

#3 2005-07-22 05:54:23

windrider
Member
Registered: 2005-05-07
Posts: 27

Re: n00b question about PKGBUILD and sed

AHH i see, thanks alot.

Offline

#4 2005-07-22 08:40:21

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: n00b question about PKGBUILD and sed

The man page for sed isn't very clear i think - it is worth learning how it works tho

Offline

#5 2005-07-22 10:35:44

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: n00b question about PKGBUILD and sed

cedega is a happy resident in /usr, there is no need to /opt it.

Offline

Board footer

Powered by FluxBB