You are not logged in.

#1 2010-08-26 23:30:56

foss.linux
Member
Registered: 2010-07-20
Posts: 31
Website

Pkgbuild and Evn Path

when I learn to compile umtsmon, I find some export command in pkgbuild script

  export QTDIR=/opt/qt
  export PATH=/opt/qt/bin:$PATH

but, when I try "echo $PATH" in terminal I can't find /opt/qt/bin, what's wrong?


OS : Archlinux i686 » Kernel : 2.6.37-ARCH

Offline

#2 2010-08-26 23:33:43

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: Pkgbuild and Evn Path

Try putting it in your ~/.zshrc, ~/.bashrc, etc.

Offline

#3 2010-08-26 23:40:03

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Pkgbuild and Evn Path

And if you want to cd to an exported dir, I think you need to have

shopt -s cdable_vars

in your .bashrc.

Offline

#4 2010-08-27 01:47:36

foss.linux
Member
Registered: 2010-07-20
Posts: 31
Website

Re: Pkgbuild and Evn Path

thanks for reply bro.. but I just want to know.. why it's not added itself? it's export command not working in PKGBUILD?


OS : Archlinux i686 » Kernel : 2.6.37-ARCH

Offline

#5 2010-08-27 01:50:00

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Pkgbuild and Evn Path

You have to source the file, not run it.
https://bbs.archlinux.org/viewtopic.php … 43#p814943

Offline

#6 2010-08-27 01:56:12

foss.linux
Member
Registered: 2010-07-20
Posts: 31
Website

Re: Pkgbuild and Evn Path

so.. makepkg -s don't execute thats script?


OS : Archlinux i686 » Kernel : 2.6.37-ARCH

Offline

#7 2010-08-27 01:58:27

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Pkgbuild and Evn Path

foss.linux wrote:

so.. makepkg -s don't execute thats script?

This is executing:

./my_script

This is sourcing

. my_script

Offline

#8 2010-08-27 02:04:55

foss.linux
Member
Registered: 2010-07-20
Posts: 31
Website

Re: Pkgbuild and Evn Path

sorry Karol, I really don't understand about it.. and I want to know more..

# Contributor: János Illés <ijanos@gmail.com>
pkgname=umtsmon
pkgver=0.9
pkgrel=6
pkgdesc="A tool to manage your UMTS (3G) card/device (send sms, modify pin, monitor traffic)"
url="http://umtsmon.sourceforge.net/"
license="GPL"
arch=('i686' 'x86_64')
depends=('qt3' 'ppp' 'libusb')
optdepends=('gksu: umtsmon will complain if gksu is missing, but works fine after ignoring the error message'
            'usb_modeswitch: devices with ZeroCD functionality may need this to get working'
            'polymer: nice looking QT3 theme without KDE dependencies')
source=(http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.src.tar.gz)
md5sums=('2f9260d1fc69b230cf0035efa1a962f0')

build() {
  export QTDIR=/opt/qt
  export PATH=/opt/qt/bin:$PATH
  cd $srcdir/$pkgname-$pkgver
  sed -i '29i#include <sys/stat.h>\n' src/base/SerialPort.cpp

  qmake || return 1
  make all || return 1
  lupdate umtsmon.pro ||return 1
  lrelease umtsmon.pro ||return 1

  install -m755 -D umtsmon $pkgdir/usr/sbin/umtsmon
  mkdir -p $pkgdir/usr/share/umtsmon/translations/
  cp i18n/*.qm $pkgdir/usr/share/umtsmon/translations/
  install -m644 -D umtsmon.desktop $pkgdir/usr/share/applications/umtsmon.desktop
  install -m644 -D images/128/umtsmon-128x128.png $pkgdir/usr/share/pixmaps/umtsmon-128x128.png
}

makepkg -s executing each line in PKGBUILD script, isn't it?

sorry about my english..


OS : Archlinux i686 » Kernel : 2.6.37-ARCH

Offline

#9 2010-08-27 02:07:31

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Pkgbuild and Evn Path

Well, the shell is executing it, yes.

Offline

#10 2010-08-27 02:09:53

foss.linux
Member
Registered: 2010-07-20
Posts: 31
Website

Re: Pkgbuild and Evn Path

thanks for answer... but I'm still don't understand... I'm pure newbie in Linux... don't be angry if my question very stupid.


OS : Archlinux i686 » Kernel : 2.6.37-ARCH

Offline

#11 2010-08-27 02:13:57

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Pkgbuild and Evn Path

Create a file, my_script :

#!/bin/bash
export QTDIR=/opt/qt
export PATH=/opt/qt/bin:$PATH

Run

chmod +x my_script

Put it in the directory with PKGBUILD.

Try this

build() {
  . my_script

The rest of your PKGBUILD stays the same.

Offline

#12 2010-08-27 02:18:01

foss.linux
Member
Registered: 2010-07-20
Posts: 31
Website

Re: Pkgbuild and Evn Path

yep... thats make more understandable for me... thanks Karol... great solutions... smile


OS : Archlinux i686 » Kernel : 2.6.37-ARCH

Offline

Board footer

Powered by FluxBB