You are not logged in.
I am preparing a PKGBUILD file for an app. Since it installs files into non-standard directory, I have to make it install to /opt/app/. I have done the PKGBUILD file, but I have no idea how to achieve this effect: after installation, the working user can immediately invoke the app from command line, in other words, I wanna the app immediately under the user's search path. I tried put an "export PATH=$PATH:/opt/app/bin" in post_install(), but it seems not work. Any idea?
Last edited by plmday (2010-09-25 14:37:41)
Arch, the Portal of Linux
Offline
Environment variables can only be exported to child processes. There is no way to alter the environment of parent processes.
If you want immediate availability, add a launcher script and put that into /usr/bin.
But why would you want this, anyway? I'd prefer you'd rather do nothing and trust the user to figure it out. pacman -Ql isn't that hard, really.
Offline
But why would you want this, anyway? I'd prefer you'd rather do nothing and trust the user to figure it out. pacman -Ql isn't that hard, really.
I'm not sure if it's the Arch way, but you can put it in the install script:
http://wiki.archlinux.org/index.php/PKGBUILD
It may set the PATH or only echo some message to inform the user of some actions that need to be taken: http://aur.archlinux.org/packages/pkgto … ls.install
Last edited by karol (2010-09-25 08:40:06)
Offline
I'm not sure if it's the Arch way, but you can put it in the install script:
http://wiki.archlinux.org/index.php/PKGBUILDIt may set the PATH or only echo some message to inform the user of some actions that need to be taken: http://aur.archlinux.org/packages/pkgto … ls.install
It's not even the Unix way. Again, export is a one way street. Exporting PATH in a child process will not magically alter PATH in the parent process.
If a package needs env vars to be set, a script in /etc/profile.d is the right way to do it.
Offline
Thanks for the help, guys. I do both.
Arch, the Portal of Linux
Offline