diff --git a/ports-mgmt/Makefile b/ports-mgmt/Makefile index a28c7229e54a..2de6e02f145d 100644 --- a/ports-mgmt/Makefile +++ b/ports-mgmt/Makefile @@ -1,86 +1,87 @@ COMMENT = Ports for managing, installing, and developing FreeBSD ports and packages + SUBDIR += appstream-generator SUBDIR += bsdadminscripts2 SUBDIR += caronade SUBDIR += create-rb-port SUBDIR += dialog4ports SUBDIR += dialog4ports-static SUBDIR += distilator SUBDIR += fallout SUBDIR += fastest_pkg SUBDIR += freebsd-bugzilla-cli SUBDIR += genpatch SUBDIR += genplist SUBDIR += hs-cabal2tuple SUBDIR += hs-panopticum SUBDIR += jailaudit SUBDIR += lsknobs SUBDIR += mkreadmes SUBDIR += modules2tuple SUBDIR += octopkg SUBDIR += p5-FreeBSD-Ports SUBDIR += p5-FreeBSD-Ports-INDEXhash SUBDIR += packagekit SUBDIR += packagekit-qt SUBDIR += pchecker SUBDIR += pkg SUBDIR += pkg-appstream SUBDIR += pkg-devel SUBDIR += pkg-graph SUBDIR += pkg-provides SUBDIR += pkg-rmleaf SUBDIR += pkg_cleanup SUBDIR += pkg_cutleaves SUBDIR += pkg_jail SUBDIR += pkg_replace SUBDIR += pkg_rmleaves SUBDIR += pkg_search SUBDIR += pkg_tree SUBDIR += pkgcompare SUBDIR += pkgs_which SUBDIR += port-authoring-tools SUBDIR += port-index-uniquifier SUBDIR += port-maintenance-tools SUBDIR += portal SUBDIR += portconf SUBDIR += portconfig SUBDIR += portdowngrade SUBDIR += portest SUBDIR += portfind SUBDIR += portfmt SUBDIR += portgraph SUBDIR += portgrep SUBDIR += portless SUBDIR += portlint SUBDIR += portmaster SUBDIR += portoptscli SUBDIR += portrac SUBDIR += ports-tools SUBDIR += portscout SUBDIR += portsdb SUBDIR += portsearch SUBDIR += portshaker SUBDIR += portshaker-config SUBDIR += portsnap SUBDIR += portsreinstall SUBDIR += porttools SUBDIR += porttree SUBDIR += portupdate-scan SUBDIR += portupgrade SUBDIR += portupgrade-devel SUBDIR += poudriere SUBDIR += poudriere-devel SUBDIR += poudriere-dsh2dsh SUBDIR += psearch SUBDIR += py-FreeBSD-ports SUBDIR += py-pnu-portstreelint SUBDIR += py-pytoport SUBDIR += py-skog SUBDIR += rc-subr-jail SUBDIR += reprise SUBDIR += sccache-overlay SUBDIR += submodules2tuple SUBDIR += synth SUBDIR += wanted-ports .include diff --git a/ports-mgmt/appstream-generator/Makefile b/ports-mgmt/appstream-generator/Makefile new file mode 100644 index 000000000000..6f8669cbc2c2 --- /dev/null +++ b/ports-mgmt/appstream-generator/Makefile @@ -0,0 +1,46 @@ +PORTNAME= appstream-generator +DISTVERSIONPREFIX= v +DISTVERSION= 0.9.1 +PORTREVISION= 1 +CATEGORIES= ports-mgmt + +MAINTAINER= arrowd@FreeBSD.org +COMMENT= Fast AppStream metadata generator +WWW= https://github.com/ximion/appstream-generator + +LICENSE= LGPL3 +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= girtod:lang/gir-to-d \ + ldc2:lang/ldc \ + xsltproc:textproc/libxslt \ + ${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl:textproc/docbook-xsl +LIB_DEPENDS= libappstream.so:devel/appstream \ + libappstream-compose.so:devel/appstream-compose \ + libcurl.so:ftp/curl \ + libglibd-2.0.so:devel/glibd \ + liblmdb.so:databases/lmdb \ + libphobos2-ldc-shared.so:lang/ldc + +USES= gnome libarchive meson pkgconfig + +USE_GNOME= glib20 + +USE_GITHUB= yes +GH_ACCOUNT= arrowd +GH_TAGNAME= 6645648126427ebdfe6debc45760ba8a351c3a5d + +OPTIONS_DEFINE= MANPAGES +MANPAGES_BUILD_DEPENDS= xsltproc:textproc/libxslt + +MESON_ARGS= -Ddownload-js=false -Dlocalbase=${LOCALBASE} -Drpmmd=false + +DATADIR= ${PREFIX}/share/appstream +OPTIONS_SUB= yes + +post-install: + cd ${WRKSRC}/data && \ + ${COPYTREE_SHARE} templates ${STAGEDIR}${DATADIR} + ${INSTALL_SCRIPT} ${PATCHDIR}/poudriere-hook-bulk.sh ${STAGEDIR}${DATADIR} + +.include diff --git a/ports-mgmt/appstream-generator/distinfo b/ports-mgmt/appstream-generator/distinfo new file mode 100644 index 000000000000..78f0c2bbc4a2 --- /dev/null +++ b/ports-mgmt/appstream-generator/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1729881137 +SHA256 (arrowd-appstream-generator-v0.9.1-6645648126427ebdfe6debc45760ba8a351c3a5d_GH0.tar.gz) = 9561d36f067650a84d6363a11795c4459fb8e460f56d1550b3303d2c45620177 +SIZE (arrowd-appstream-generator-v0.9.1-6645648126427ebdfe6debc45760ba8a351c3a5d_GH0.tar.gz) = 548743 diff --git a/ports-mgmt/appstream-generator/files/patch-contrib_setup_meson-install-templates.sh b/ports-mgmt/appstream-generator/files/patch-contrib_setup_meson-install-templates.sh new file mode 100644 index 000000000000..a05bbcd76a2d --- /dev/null +++ b/ports-mgmt/appstream-generator/files/patch-contrib_setup_meson-install-templates.sh @@ -0,0 +1,14 @@ +--- contrib/setup/meson-install-templates.sh.orig 2023-04-20 11:44:26 UTC ++++ contrib/setup/meson-install-templates.sh +@@ -3,6 +3,8 @@ cd "$MESON_SOURCE_ROOT" + + cd "$MESON_SOURCE_ROOT" + +-echo "Installing templates..." +-install -d "${DESTDIR}/${MESON_INSTALL_PREFIX}/share/appstream/templates" +-cp -dpru --no-preserve=ownership data/templates/* -t "${DESTDIR}/${MESON_INSTALL_PREFIX}/share/appstream/templates" ++# FreeBSD: We do this ourselves in the port ++ ++#echo "Installing templates..." ++#install -d "${DESTDIR}/${MESON_INSTALL_PREFIX}/share/appstream/templates" ++#cp -dpru --no-preserve=ownership data/templates/* -t "${DESTDIR}/${MESON_INSTALL_PREFIX}/share/appstream/templates" diff --git a/ports-mgmt/appstream-generator/files/poudriere-hook-bulk.sh b/ports-mgmt/appstream-generator/files/poudriere-hook-bulk.sh new file mode 100644 index 000000000000..805d9bab446a --- /dev/null +++ b/ports-mgmt/appstream-generator/files/poudriere-hook-bulk.sh @@ -0,0 +1,65 @@ +#!/bin/sh +# /usr/local/etc/poudriere.d/hooks/bulk.sh + +status="$1" +shift + +if [ "$status" != "done" ]; then + exit 0 +fi + +ASGEN_CMD=/usr/local/bin/appstream-generator +# The location for the generated data +# This should be persistent across "poudriere bulk" runs and be specific to +# the given jail-ports-set combination (i.e. have ${MASTERNAME} in the path) +ASGEN_WORKSPACE=/asgen/${MASTERNAME} +ARCH=$(uname -p) + +# PACKAGES ends with "/.latest", so we chop it first +if [ "$(basename ${PACKAGES})" == ".latest" ]; then + suite=$(basename $(dirname ${PACKAGES})) +else + suite=$(basename ${PACKAGES}) +fi + +asgen_config=$(cat< ${ASGEN_WORKSPACE}/asgen-config.json + +# Generate the metainfo +echo Running $ASGEN_CMD -w "${ASGEN_WORKSPACE}" run "$suite" +$ASGEN_CMD -w "${ASGEN_WORKSPACE}" run "$suite" + +# TODO: Upstream recommends running cleanup once in a week +$ASGEN_CMD -w "${ASGEN_WORKSPACE}" cleanup + +# Copy the metadata archive back to Poudriere repository root +cp "${ASGEN_WORKSPACE}/export/data/${suite}/default/Components-${ARCH}.xml.gz" "${PACKAGES}/AppStreamComponents.xml.gz" + +# Link media files +ln -s "${ASGEN_WORKSPACE}/export/media" "${PACKAGES}/media" + +# Make a symlink to follow Poudriere layout +if [ "$(basename ${PACKAGES})" == ".latest" ]; then + ln -fs .latest/AppStreamComponents.xml.gz ${PACKAGES}/../AppStreamComponents.xml.gz +fi + +exit 0 diff --git a/ports-mgmt/appstream-generator/pkg-descr b/ports-mgmt/appstream-generator/pkg-descr new file mode 100644 index 000000000000..b64963928e3e --- /dev/null +++ b/ports-mgmt/appstream-generator/pkg-descr @@ -0,0 +1,4 @@ +AppStream is an effort to provide additional metadata and unique IDs for all +software available in the package repository. This package contains the +server-side of the AppStream infrastructure, a tool to generate metadata from +FreeBSD packages. diff --git a/ports-mgmt/appstream-generator/pkg-plist b/ports-mgmt/appstream-generator/pkg-plist new file mode 100644 index 000000000000..bc5426035f66 --- /dev/null +++ b/ports-mgmt/appstream-generator/pkg-plist @@ -0,0 +1,27 @@ +bin/appstream-generator +%%DATADIR%%/asgen-hints.json +%%DATADIR%%/hicolor-theme-index.theme +%%DATADIR%%/poudriere-hook-bulk.sh +%%DATADIR%%/templates/debian/base.html +%%DATADIR%%/templates/debian/main.html +%%DATADIR%%/templates/debian/static/css/highlight.css +%%DATADIR%%/templates/debian/static/css/style.css +%%DATADIR%%/templates/debian/static/img +%%DATADIR%%/templates/debian/static/js +%%DATADIR%%/templates/default/base.html +%%DATADIR%%/templates/default/issues_index.html +%%DATADIR%%/templates/default/issues_page.html +%%DATADIR%%/templates/default/main.html +%%DATADIR%%/templates/default/metainfo_index.html +%%DATADIR%%/templates/default/metainfo_page.html +%%DATADIR%%/templates/default/section_page.html +%%DATADIR%%/templates/default/sections_index.html +%%DATADIR%%/templates/default/static/css/highlight.css +%%DATADIR%%/templates/default/static/css/style.css +%%DATADIR%%/templates/default/static/img/asgen.png +%%DATADIR%%/templates/default/static/img/cpt-nogui.png +%%DATADIR%%/templates/default/static/img/favicon.png +%%DATADIR%%/templates/default/static/img/no-image.png +%%DATADIR%%/templates/ubuntu +%%MANPAGES%%share/man/man1/appstream-generator.1.gz +share/metainfo/org.freedesktop.appstream.generator.metainfo.xml