I have this code in my PKGBUILD
package() {
cd "$pkgname"
install -Dm755 ./lnScript.sh "$pkgdir/opt/pycharm-professional/bin/re
lnScript.sh"
install -Dm751 ./lnp.hook "$pkgdir/etc/pacman.d/hooks/lnp.hook"
cd /opt/pycharm-professional/bin
sudo patch --forward --strip=4 --input="${srcdir}/$pkgname/lnsh.pat
ch"
I need to reverse this patch when the user uninstalls the package because the original program does not belong to this package.
So, Is this possible to execute a script when is the user uninstalling an aur package?
You should get used to reading the Arch Wiki, Anyways It's Mentioned Here: https://wiki.archlinux.org/title/PKGBUILD
this is a sample
.installfile: