Need help about PKGBUILD creation (post_install trigger was never called)

Hello everyone.
I don’t know if this is the right place to ask my question. (I apologize if it isn’t).

But before anyone asks why, here’s the background:

I use XFCE as my desktop manager, but for the file manager I really like Caja and never feel confortable with Thunar.

I’d like to be able to “open terminal here” in Caja. So I create a symbolic link:
ln -s /usr/bin/xfce4-terminal → /usr/bin/mate-terminal

This works very well. No problems here.

I decided to create a PKGBUILD that takes care of this for me
My PKGBUILD compiles fine but the post_install trigger is never called.

Here’s the code:

PKGBUILD:

pkgname=caja-xfce-terminal
pkgver=0.1
pkgrel=1
pkgdesc=""
arch=(any)
url=""
license=('NONE')
groups=("★ seigneurfuo: Paquets persos")
depends=('caja' 'xfce4-terminal')
provides=('mate-terminal')
source=("$pkgname.install")
md5sums=('SKIP')
install=$pkgname.install

caja-xfce-terminal.install:

post_install() {
    echo "Creating symbolic link: /usr/bin/xfce4-terminal -> /usr/bin/mate-terminal"
    ln -s /usr/bin/xfce4-terminal /usr/bin/mate-terminal
}

Does anyone have any ideas?

Thanks a lot.

Creating a PKGBUILD for a symlink is overkill, really. However, if it makes things easier for you, that’s fine.

Other than the empty items, the PKGBUILD looks good mostly. However, it also needs to conflict with mate-terminal.

provides=('mate-terminal')
conflicts=('mate-terminal')

Also groups and license are invalid.
Since you don’t checksum the install script, it is pointless to source it.
post_install only runs on install. Not on upgrade or reinstall.

You could probably just do ln -s /usr/bin/xfce4-terminal ~/.local/bin/mate-terminal

2 Likes

That’s probably the best solution. No need to create a PKGBUILD and one could still have mate-terminal installed with no conflicts.

1 Like

bonjour

other note:

  • remove keys source and md5sums
  • add post_remove() function in install file !!!

note: for post_remove() , ok this pkg can exists … (?)

1 Like