Page MenuHomeFreeBSD

D32452.id.diff
No OneTemporary

D32452.id.diff

diff --git a/Keywords/shared-mime-info.ucl b/Keywords/shared-mime-info.ucl
deleted file mode 100644
--- a/Keywords/shared-mime-info.ucl
+++ /dev/null
@@ -1,9 +0,0 @@
-# MAINTAINER: gnome@FreeBSD.org
-
-actions: []
-post-install: <<EOD
- update-mime-database %D/%@ || true
-EOD
-post-deinstall: <<EOD
- update-mime-database %D/%@ || true
-EOD
diff --git a/Mk/Uses/shared-mime-info.mk b/Mk/Uses/shared-mime-info.mk
--- a/Mk/Uses/shared-mime-info.mk
+++ b/Mk/Uses/shared-mime-info.mk
@@ -13,8 +13,6 @@
IGNORE= USES=shared-mime-info does not require args
.endif
-BUILD_DEPENDS+= update-mime-database:misc/shared-mime-info
RUN_DEPENDS+= update-mime-database:misc/shared-mime-info
-PLIST_FILES+= "@shared-mime-info share/mime"
.endif
diff --git a/misc/shared-mime-info/Makefile b/misc/shared-mime-info/Makefile
--- a/misc/shared-mime-info/Makefile
+++ b/misc/shared-mime-info/Makefile
@@ -2,6 +2,7 @@
PORTNAME= shared-mime-info
DISTVERSION= 2.0
+PORTREVISION= 1
CATEGORIES= misc gnome
MAINTAINER= desktop@FreeBSD.org
@@ -14,7 +15,8 @@
itstool:textproc/itstool \
minixmlto:textproc/minixmlto
-USES= gettext gnome localbase meson pathfix pkgconfig shebangfix tar:xz
+USES= gettext gnome localbase meson pathfix pkgconfig shebangfix \
+ tar:xz trigger
CONFIGURE_ARGS= -Dupdate-mimedb=false \
-Dxdgmime-path=${WRKSRC}/src/xdgmime
USE_GNOME= glib20 libxml2
@@ -27,13 +29,8 @@
bash_CMD= /bin/sh
SHEBANG_FILES= ${WRKSRC}/data/freedesktop_generate.sh
-SUB_FILES= pkg-install
-SUB_LIST= MIMEDIRS="${MIMEDIRS:O:u}"
-
-MIMEDIRS= ${LOCALBASE}/share/mime \
- ${PREFIX}/share/mime
MIMESUBDIRS= application audio image inode message model multipart \
- packages text video x-epoc x-content
+ packages text video x-epoc x-content font
BINARY_ALIAS= xmlto=minixmlto
@@ -45,4 +42,9 @@
pre-configure:
cd ${WRKSRC}/src/xdgmime/src && ${SETENV} ${MAKE_ENV} ${GMAKE}
+post-install:
+ for dir in ${MIMESUBDIRS} ; do \
+ ${MKDIR} ${STAGEDIR}${PREFIX}/share/mime/$${dir} ; \
+ done
+
.include <bsd.port.mk>
diff --git a/misc/shared-mime-info/files/pkg-install.in b/misc/shared-mime-info/files/pkg-install.in
deleted file mode 100644
--- a/misc/shared-mime-info/files/pkg-install.in
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-case $2 in
-POST-INSTALL)
- for mdir in %%MIMEDIRS%%; do
- if [ -d ${mdir} ]; then
- %%PREFIX%%/bin/update-mime-database ${mdir}
- fi
- done
- exit 0
- ;;
-esac
diff --git a/misc/shared-mime-info/files/shared-mime-info.ucl.in b/misc/shared-mime-info/files/shared-mime-info.ucl.in
new file mode 100644
--- /dev/null
+++ b/misc/shared-mime-info/files/shared-mime-info.ucl.in
@@ -0,0 +1,27 @@
+path: "%%PREFIX%%/share/mime/packages"
+cleanup: {
+ type: lua
+ script: <<EOS
+local mimedir = "%%PREFIX%%/share/mime/"
+local files = { "XMLnamespaces", "aliases", "generic-icons", "globs", "globs2", "icons", "mime.cache", "subclasses", "treemagic", "types", "version"}
+for _,filename in pairs(files) do
+ local fpath = mimedir .. filename
+ local st = pkg.stat(fpath)
+ if st then
+ os.remove(fpath)
+ end
+end
+local res = pkg.readdir(mimedir)
+if #res == 0 then
+ os.remove(mimedir)
+end
+EOS
+}
+trigger: {
+ type: lua
+ sandbox: false
+ script: <<EOS
+print("Building the Shared MIME-Info database cache")
+pkg.exec({"%%PREFIX%%/bin/update-mime-database", "%%PREFIX%%/share/mime"})
+EOS
+}
diff --git a/misc/shared-mime-info/pkg-plist b/misc/shared-mime-info/pkg-plist
--- a/misc/shared-mime-info/pkg-plist
+++ b/misc/shared-mime-info/pkg-plist
@@ -79,27 +79,15 @@
share/locale/zh_HK/LC_MESSAGES/shared-mime-info.mo
share/locale/zh_TW/LC_MESSAGES/shared-mime-info.mo
share/mime/packages/freedesktop.org.xml
-@rmtry share/mime/XMLnamespaces
-@rmtry share/mime/aliases
-@rmtry share/mime/generic-icons
-@rmtry share/mime/globs
-@rmtry share/mime/globs2
-@rmtry share/mime/icons
-@rmtry share/mime/magic
-@rmtry share/mime/mime.cache
-@rmtry share/mime/subclasses
-@rmtry share/mime/treemagic
-@rmtry share/mime/types
-@rmtry share/mime/version
-@postunexec rm -fr %D/share/mime/x-epoc 2>/dev/null || true
-@postunexec rm -fr %D/share/mime/x-content 2>/dev/null || true
-@postunexec rm -fr %D/share/mime/video 2>/dev/null || true
-@postunexec rm -fr %D/share/mime/text 2>/dev/null || true
-@postunexec rm -fr %D/share/mime/multipart 2>/dev/null || true
-@postunexec rm -fr %D/share/mime/model 2>/dev/null || true
-@postunexec rm -fr %D/share/mime/message 2>/dev/null || true
-@postunexec rm -fr %D/share/mime/inode 2>/dev/null || true
-@postunexec rm -fr %D/share/mime/image 2>/dev/null || true
-@postunexec rm -fr %D/share/mime/font 2>/dev/null || true
-@postunexec rm -fr %D/share/mime/audio 2>/dev/null || true
-@postunexec rm -fr %D/share/mime/application 2>/dev/null || true
+@dir share/mime/x-epoc
+@dir share/mime/x-content
+@dir share/mime/video
+@dir share/mime/text
+@dir share/mime/multipart
+@dir share/mime/model
+@dir share/mime/message
+@dir share/mime/inode
+@dir share/mime/image
+@dir share/mime/font
+@dir share/mime/audio
+@dir share/mime/application

File Metadata

Mime Type
text/plain
Expires
Wed, Apr 22, 1:40 PM (7 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31982229
Default Alt Text
D32452.id.diff (4 KB)

Event Timeline