+
+# -----------------------------------------------------------------------------
+# Installation/removal hooks
+#
+
+# Substitutions for INSTALL and DEINSTALL that handles package.cache.
+FILES_SUBST+= DISTNAME=${DISTNAME}
+
+# We don't want package.cache to be in the PLIST.
+post-install:
+ ${RM} -f ${DESTDIR:Q}${PREFIX:Q}/lib/${DISTNAME}/package.conf.d/package.cache
+
+
+# -----------------------------------------------------------------------------
+# PLIST
+#
+# We can't use static PLIST because the package installs some files
+# whose names are randomly generated, namely
+# lib/${PKGNAME}/package.conf.d/*.conf
+#
+
+# If we were lucky we could just use "PLIST_TYPE = dynamic", but the
+# feature has seemingly bitrotted.
+.include "../../mk/bsd.prefs.mk"
+.if empty(DESTDIR)
+PKG_FAIL_REASON+="This package can not be built without using DESTDIR.\
+You need to set USE_DESTDIR to \"yes\"."
+.else
+GENERATE_PLIST+= \
+ cd ${DESTDIR:Q}${PREFIX:Q} && \
+ ${FIND} * \( -type f -or -type l \) | ${SORT} -d;
+.endif
+
+
+# -----------------------------------------------------------------------------
+# Sanity checks
+#
+
+# There is an unused script which don't pass the portability test.