diff --git a/pkg.info b/pkg.info index 66f1d91..01b79bb 100644 --- a/pkg.info +++ b/pkg.info @@ -1,9 +1,17 @@ name: desktop-file-utils description: CLI utilities for working with desktop entries -version: 0.28 +version: "0.28" +revision: 2 url: https://www.freedesktop.org/wiki/Software/desktop-file-utils/ license: GPL architecture: any -depends: ["glib"] -make_depends: ["meson"] type: source +depends: + - glib +make_depends: + - meson +downloads: + - url: https://www.freedesktop.org/software/desktop-file-utils/releases/desktop-file-utils-${BPM_PKG_VERSION}.tar.xz + extract_to: ${BPM_SOURCE} + extract_strip_components: 1 + checksum: 4401d4e231d842c2de8242395a74a395ca468cd96f5f610d822df33594898a70 diff --git a/source-files/update-desktop-database.bpmhook b/source-files/update-desktop-database.bpmhook new file mode 100644 index 0000000..aec0fc8 --- /dev/null +++ b/source-files/update-desktop-database.bpmhook @@ -0,0 +1,4 @@ +trigger_operations: ["install", "upgrade", "remove"] +target_type: "path" +targets: ["usr/share/applications/*.desktop"] +run: "/usr/bin/update-desktop-database --quiet" diff --git a/source.sh b/source.sh index f14f111..eacb5c0 100644 --- a/source.sh +++ b/source.sh @@ -2,31 +2,21 @@ # BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE # BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT -DOWNLOAD="https://www.freedesktop.org/software/desktop-file-utils/releases/desktop-file-utils-${BPM_PKG_VERSION}.tar.xz" -FILENAME="${DOWNLOAD##*/}" - -# The prepare function is executed in the root of the temp directory -# This function is used for downloading files and putting them into the correct location -prepare() { - wget "$DOWNLOAD" - tar -xvf "$FILENAME" --strip-components=1 -C "$BPM_SOURCE" -} - # The build function is executed in the source directory # This function is used to compile the source code build() { - mkdir build - cd build - - meson setup --prefix=/usr --buildtype=release .. - ninja + meson setup --prefix=/usr --buildtype=release build + meson compile -C build } # The package function is executed in the source directory # This function is used to move the compiled files into the output directory package() { - cd build - DESTDIR="$BPM_OUTPUT" ninja install + meson install -C build --destdir="$BPM_OUTPUT" + # Install BPM hook + install -Dm644 "$BPM_WORKDIR"/update-desktop-database.bpmhook "$BPM_OUTPUT"/var/lib/bpm/hooks/update-desktop-database.bpmhook + + # Install package license install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/desktop-file-utils/COPYING }