diff options
-rw-r--r-- | .SRCINFO | 35 | ||||
-rw-r--r-- | PKGBUILD | 69 | ||||
-rw-r--r-- | bamf-ubuntu.install | 31 | ||||
-rw-r--r-- | update-bamf-index.hook | 11 | ||||
-rw-r--r-- | update-bamf-index.pl | 31 | ||||
-rw-r--r-- | update-bamf-index.sh | 2 |
6 files changed, 179 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..2a25374b8563 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,35 @@ +# Generated by mksrcinfo v8 +# Mon Jan 8 17:23:31 UTC 2018 +pkgbase = bamf-ubuntu-bzr + pkgdesc = Application matching framework (development version with Canonical patches) + pkgver = r655 + pkgrel = 1 + url = https://launchpad.net/bamf + arch = i686 + arch = x86_64 + license = GPL + makedepends = bzr + makedepends = gnome-common + makedepends = gobject-introspection + makedepends = gtk-doc + makedepends = vala + depends = dbus-glib + depends = libgtop + depends = libwnck3 + depends = python2-lxml + depends = libdbusmenu-gtk3 + provides = bamf + provides = bamf-bzr + conflicts = bamf + conflicts = bamf-bzr + source = bzr+lp:bamf + source = update-bamf-index.hook + source = update-bamf-index.pl + source = update-bamf-index.sh + sha256sums = SKIP + sha256sums = 657cfb55f4202f938b11dc55b7674fb2e1accd2a65e6fbab1bd5886c909dd629 + sha256sums = 8988fead948f7584eaf18de9f73532bbc9804eba9332984a14ccca01466d9903 + sha256sums = 0599249f3654bb8e458db9b85f7fd53d41450833bc18462b3ccf950575d33265 + +pkgname = bamf-ubuntu-bzr + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..08c987d3de3a --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,69 @@ +# Maintainer: Que Quotion <quequotion@bugmenot.org> +# Contributor: SolarAquarion <solar@aquarion.arch> +# Contributor: Maxime Gauduin <alucryd@archlinux.org> +# Contributor: Xiao-Long Chen <chenxiaolong@cxl.epac.to> +# Contributor: dorkfish <dork.fish.wat@gmail.com> +# Contributor: György Balló <ballogy@freestart.hu> +# Contributor: thn81 <root@scrat> + +pkgname=bamf-ubuntu-bzr +pkgver=r655 +pkgrel=1 +pkgdesc='Application matching framework (development version with Canonical patches)' +arch=('i686' 'x86_64') +url='https://launchpad.net/bamf' +license=('GPL') +depends=('dbus-glib' 'libgtop' 'libwnck3' 'python2-lxml' 'libdbusmenu-gtk3') +makedepends=('bzr' 'gnome-common' 'gobject-introspection' 'gtk-doc' 'vala') +provides=(bamf{,-bzr}) +conflicts=(bamf{,-bzr}) +source=('bzr+lp:bamf' + update-bamf-index.hook + update-bamf-index.pl + update-bamf-index.sh) +sha256sums=('SKIP' + '657cfb55f4202f938b11dc55b7674fb2e1accd2a65e6fbab1bd5886c909dd629' + '8988fead948f7584eaf18de9f73532bbc9804eba9332984a14ccca01466d9903' + '0599249f3654bb8e458db9b85f7fd53d41450833bc18462b3ccf950575d33265') + +pkgver() { + cd bamf + + echo "r$(bzr revno)" +} + +prepare() { + cd bamf + + sed -i 's|^#!.*python$|#!/usr/bin/python2|' tests/gtester2xunit.py +} + +build() { + cd bamf + + export PYTHON=/usr/bin/python2 + + ./autogen.sh \ + --prefix='/usr' \ + --localstatedir='/var' \ + --libexecdir='/usr/lib' \ + --sysconfdir='/etc' \ + --disable-static + + make +} + +package() { + cd bamf + + make DESTDIR="${pkgdir}" install + + install -m755 ../update-bamf-index.pl "${pkgdir}"/usr/lib/bamf/ + install -m755 ../update-bamf-index.sh "${pkgdir}"/usr/lib/bamf/ + install -dm755 "${pkgdir}"/usr/share/libalpm/hooks/ + install -m644 ../update-bamf-index.hook "${pkgdir}"/usr/share/libalpm/hooks/ + + rm -rv "${pkgdir}"/usr/share/upstart/ +} + +# vim: ts=2 sw=2 et: diff --git a/bamf-ubuntu.install b/bamf-ubuntu.install new file mode 100644 index 000000000000..1dc976a9526e --- /dev/null +++ b/bamf-ubuntu.install @@ -0,0 +1,31 @@ +generate_index() { + if [[ ! -f usr/share/applications/bamf.index ]]; then + echo 'Generating initial BAMF index' + usr/lib/bamf/update-bamf-index.sh + fi +} + +disable_service() { + systemctl stop bamfwatcher &>/dev/null || : + systemctl disable bamfwatcher &>/dev/null || : +} + +post_install() { + generate_index +} + +post_upgrade() { + generate_index +} + +pre_upgrade() { + disable_service +} + +pre_remove() { + disable_service +} + +post_remove() { + rm -f usr/share/applications/bamf.index +} diff --git a/update-bamf-index.hook b/update-bamf-index.hook new file mode 100644 index 000000000000..d8baa71ae2d5 --- /dev/null +++ b/update-bamf-index.hook @@ -0,0 +1,11 @@ +[Trigger] +Type = File +Operation = Install +Operation = Upgrade +Operation = Remove +Target = usr/share/applications/*.desktop + +[Action] +Description = Updating BAMF index... +When = PostTransaction +Exec = /usr/lib/bamf/update-bamf-index.sh diff --git a/update-bamf-index.pl b/update-bamf-index.pl new file mode 100644 index 000000000000..6af14ebe2d8f --- /dev/null +++ b/update-bamf-index.pl @@ -0,0 +1,31 @@ +#!/usr/bin/perl + +# This is a copy of the perl script in bamfdaemon.postinst from Ubuntu's bamf +# packaging + +use File::Find; + +my $dir_name; + +sub strip_exec { + my $f = $_; + return unless $f =~ /\.desktop$/; + return unless ("$File::Find::dir" eq "$dir_name"); + my @lines; + open F, $f; + @lines = <F>; + close F; + my $in_desktop_entry = 0; + foreach (@lines) { + if (/^\[\s*(.+)\s*\]/) { + $in_desktop_entry = ($1 eq "Desktop Entry"); + } + if (/^Exec=(.+)$/ && $in_desktop_entry) { + print "$f\t$1\n"; + } + } +} + +$dir_name = $ARGV[-1]; +$dir_name = $1 if ($dir_name =~ /(.*)\/$/); +find (\&strip_exec, $dir_name); diff --git a/update-bamf-index.sh b/update-bamf-index.sh new file mode 100644 index 000000000000..d1e397964fd3 --- /dev/null +++ b/update-bamf-index.sh @@ -0,0 +1,2 @@ +#!/bin/bash +/usr/lib/bamf/update-bamf-index.pl /usr/share/applications/ > /usr/share/applications/bamf.index |