2004-09-09 12:21:08 +00:00
|
|
|
Summary: Shared MIME information database
|
|
|
|
Name: shared-mime-info
|
2022-04-23 18:45:44 +00:00
|
|
|
Version: 2.2
|
2023-10-07 18:23:27 +00:00
|
|
|
Release: %autorelease
|
2023-10-07 18:23:17 +00:00
|
|
|
License: GPL-2.0-or-later
|
2004-09-09 12:21:08 +00:00
|
|
|
URL: http://freedesktop.org/Software/shared-mime-info
|
2022-04-23 18:45:44 +00:00
|
|
|
Source0: https://gitlab.freedesktop.org/xdg/shared-mime-info/-/archive/%{version}/shared-mime-info-%{version}.tar.bz2
|
2020-08-25 14:37:49 +00:00
|
|
|
|
|
|
|
Source1: mimeapps.list
|
2006-06-29 20:59:38 +00:00
|
|
|
|
2021-01-04 11:07:51 +00:00
|
|
|
%global xdgmime_commit de283fc430460b9b3a7e61432a6d273cd64cb102
|
|
|
|
# Tarball for https://gitlab.freedesktop.org/xdg/xdgmime/-/tree/%%{xdgmime_commit}
|
|
|
|
Source6: https://gitlab.freedesktop.org/xdg/xdgmime/-/archive/%{xdgmime_commit}/xdgmime-%{xdgmime_commit}.tar.bz2
|
2022-02-02 15:51:58 +00:00
|
|
|
# HACK in use of RPM_OPT_FLAGS into xdgmime build
|
|
|
|
Source7: shared-mime-info-2.1-CFLAGS.patch
|
2020-05-06 14:57:03 +00:00
|
|
|
|
2011-08-25 14:10:32 +00:00
|
|
|
# Work-around for https://bugs.freedesktop.org/show_bug.cgi?id=40354
|
|
|
|
Patch0: 0001-Remove-sub-classing-from-OO.o-mime-types.patch
|
|
|
|
|
2018-03-07 18:40:48 +00:00
|
|
|
BuildRequires: gcc
|
2004-09-09 12:21:08 +00:00
|
|
|
BuildRequires: libxml2-devel
|
2020-05-06 14:57:03 +00:00
|
|
|
BuildRequires: xmlto
|
2004-09-09 12:21:08 +00:00
|
|
|
BuildRequires: glib2-devel
|
2006-08-25 17:35:17 +00:00
|
|
|
BuildRequires: gettext
|
2019-09-11 12:08:27 +00:00
|
|
|
BuildRequires: itstool
|
2020-11-08 23:07:35 +00:00
|
|
|
BuildRequires: make
|
2020-05-06 14:57:03 +00:00
|
|
|
BuildRequires: meson
|
2020-11-08 23:05:12 +00:00
|
|
|
BuildRequires: git-core
|
2004-09-09 12:21:08 +00:00
|
|
|
|
2015-09-24 13:46:00 +00:00
|
|
|
# Disable pkgconfig autodep
|
|
|
|
%global __requires_exclude ^/usr/bin/pkg-config$
|
|
|
|
|
2004-09-09 12:21:08 +00:00
|
|
|
%description
|
|
|
|
This is the freedesktop.org shared MIME info database.
|
|
|
|
|
|
|
|
Many programs and desktops use the MIME system to represent the types of
|
|
|
|
files. Frequently, it is necessary to work out the correct MIME type for
|
|
|
|
a file. This is generally done by examining the file's name or contents,
|
|
|
|
and looking up the correct MIME type in a database.
|
|
|
|
|
|
|
|
%prep
|
2020-11-08 23:05:12 +00:00
|
|
|
%autosetup -S git_am
|
2022-04-23 18:45:44 +00:00
|
|
|
rmdir xdgmime
|
2020-05-06 14:57:03 +00:00
|
|
|
tar xjf %SOURCE6
|
2021-01-04 11:07:51 +00:00
|
|
|
mv xdgmime-%{xdgmime_commit}/ xdgmime/
|
2022-02-02 15:51:58 +00:00
|
|
|
patch -p1 < %SOURCE7
|
2008-10-29 21:02:20 +00:00
|
|
|
|
2004-09-09 12:21:08 +00:00
|
|
|
%build
|
2020-11-08 23:07:35 +00:00
|
|
|
%make_build -C xdgmime
|
2020-11-08 23:00:18 +00:00
|
|
|
# the updated mimedb is later owned as %%ghost to ensure proper file-ownership
|
|
|
|
# it also asserts it is possible to build it
|
2022-02-02 16:56:52 +00:00
|
|
|
%meson -Dupdate-mimedb=true
|
2020-05-06 14:57:03 +00:00
|
|
|
%meson_build
|
2004-09-09 12:21:08 +00:00
|
|
|
|
|
|
|
%install
|
2020-05-06 14:57:03 +00:00
|
|
|
%meson_install
|
2004-09-09 12:21:08 +00:00
|
|
|
|
2012-03-08 01:32:49 +00:00
|
|
|
find $RPM_BUILD_ROOT%{_datadir}/mime -type d \
|
|
|
|
| sed -e "s|^$RPM_BUILD_ROOT|%%dir |" > %{name}.files
|
|
|
|
find $RPM_BUILD_ROOT%{_datadir}/mime -type f -not -path "*/packages/*" \
|
|
|
|
| sed -e "s|^$RPM_BUILD_ROOT|%%ghost |" >> %{name}.files
|
|
|
|
|
2020-08-25 14:37:49 +00:00
|
|
|
# Support fallback/generic mimeapps.list (currently based on an old version of
|
|
|
|
# gnome-mimeapps.list), see:
|
2015-07-29 13:02:57 +00:00
|
|
|
# https://lists.fedoraproject.org/pipermail/devel/2015-July/212403.html
|
|
|
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1243049
|
2020-11-09 14:06:47 +00:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/applications
|
|
|
|
install -m 644 %SOURCE1 $RPM_BUILD_ROOT/%{_datadir}/applications/mimeapps.list
|
2015-07-29 13:02:57 +00:00
|
|
|
|
2008-12-15 13:03:25 +00:00
|
|
|
## remove bogus translation files
|
|
|
|
## translations are already in the xml file installed
|
|
|
|
rm -rf $RPM_BUILD_ROOT%{_datadir}/locale/*
|
2004-09-09 12:21:08 +00:00
|
|
|
|
2020-05-06 14:57:03 +00:00
|
|
|
%check
|
|
|
|
%meson_test
|
2011-10-24 18:55:45 +00:00
|
|
|
|
2008-12-15 13:03:25 +00:00
|
|
|
%post
|
2014-07-08 14:19:18 +00:00
|
|
|
/bin/touch --no-create %{_datadir}/mime/packages &>/dev/null ||:
|
2014-06-27 17:32:17 +00:00
|
|
|
|
2015-08-14 19:20:52 +00:00
|
|
|
%transfiletriggerin -- %{_datadir}/mime
|
2018-02-05 12:32:34 +00:00
|
|
|
update-mime-database -n %{_datadir}/mime &> /dev/null ||:
|
2015-08-14 19:20:52 +00:00
|
|
|
|
|
|
|
%transfiletriggerpostun -- %{_datadir}/mime
|
2018-02-05 12:32:34 +00:00
|
|
|
update-mime-database -n %{_datadir}/mime &> /dev/null ||:
|
2015-08-14 19:20:52 +00:00
|
|
|
|
2012-03-08 01:32:49 +00:00
|
|
|
%files -f %{name}.files
|
2014-08-05 13:05:42 +00:00
|
|
|
%license COPYING
|
2020-05-06 14:57:03 +00:00
|
|
|
%doc README.md NEWS HACKING.md data/shared-mime-info-spec.xml
|
2020-11-09 14:03:57 +00:00
|
|
|
%{_bindir}/update-mime-database
|
2012-03-08 01:32:49 +00:00
|
|
|
%{_datadir}/mime/packages/*
|
2015-07-29 13:02:57 +00:00
|
|
|
%{_datadir}/applications/mimeapps.list
|
2013-06-10 18:35:36 +00:00
|
|
|
# better to co-own this dir than to pull in pkgconfig
|
2013-06-09 00:36:59 +00:00
|
|
|
%dir %{_datadir}/pkgconfig
|
|
|
|
%{_datadir}/pkgconfig/shared-mime-info.pc
|
2020-11-09 14:03:57 +00:00
|
|
|
%{_mandir}/man*/update-mime-database.*
|
2020-05-06 14:57:03 +00:00
|
|
|
%{_datadir}/gettext/its/shared-mime-info.its
|
|
|
|
%{_datadir}/gettext/its/shared-mime-info.loc
|
2004-09-09 12:21:08 +00:00
|
|
|
|
|
|
|
%changelog
|
2023-10-07 18:23:27 +00:00
|
|
|
%autochangelog
|