diff --git a/PKGBUILD b/PKGBUILD index e17cbb6..51e6d88 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -4,8 +4,11 @@ pkgname=needrestart url=https://github.com/liske/needrestart pkgdesc='Restart daemons after library updates.' pkgver=3.6 -pkgrel=1 -source=("needrestart-${pkgver}.tar.gz::https://github.com/liske/needrestart/archive/v${pkgver}.tar.gz") +pkgrel=2 +source=( + "needrestart-${pkgver}.tar.gz::https://github.com/liske/needrestart/archive/v${pkgver}.tar.gz" + 'needrestart.hook' +) arch=(any) license=('GPL') options=(!emptydirs) @@ -17,7 +20,7 @@ depends=(perl-module-find perl-libintl-perl ) optdepends=( - 'iucode-tool: for outdated microcode detection' + 'iucode-tool: for outdated microcode detection' ) build() { @@ -37,7 +40,10 @@ package() { unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps make DESTDIR="${pkgdir}" install - find "$pkgdir" -type d -empty -delete + + install -Dm444 "${srcdir}/needrestart.hook" \ + "${pkgdir}/usr/share/libalpm/hooks/needrestart.hook" } -sha256sums=('3dced40d6116287b163da018d57014b0b7cee04794a95f8602126e2c296ed1a7') +sha256sums=('3dced40d6116287b163da018d57014b0b7cee04794a95f8602126e2c296ed1a7' + 'e5c6696a281f5445a3b7e2b7d1055f9189a2c39d4940721aa0c2718780f15f63') diff --git a/needrestart.hook b/needrestart.hook new file mode 100644 index 0000000..7d206c7 --- /dev/null +++ b/needrestart.hook @@ -0,0 +1,10 @@ +[Trigger] +Operation = Upgrade +Type = Package +Target = * + +[Action] +Description = Check if daemons need restart after library/binary upgrades +Exec = /usr/bin/needrestart +When = PostTransaction +Depends = needrestart