2 # - *.pc file to -devel, however harmless due it's not pulling any extra deps
3 # - try to move generated files in /usr/share/mime to /var/cache/mime for FHS.
6 %bcond_without tests # build without tests
7 %bcond_without doc # build documentation
9 Summary: Shared MIME-info specification
10 Summary(pl.UTF-8): Wspólna specyfikacja MIME-info
11 Name: shared-mime-info
16 Group: Applications/Databases
17 Source0: https://gitlab.freedesktop.org/xdg/shared-mime-info/-/archive/%{version}/%{name}-%{version}.tar.bz2
18 # Source0-md5: 6bdad09c2223dec1b6ccc80459ebe51b
19 URL: https://www.freedesktop.org/wiki/Software/shared-mime-info
20 BuildRequires: docbook-dtd412-xml
21 BuildRequires: docbook-utils
22 BuildRequires: gettext-tools
23 BuildRequires: glib2-devel >= 1:2.18.0
24 BuildRequires: itstool
25 BuildRequires: libxml2-devel >= 1:2.6.26
26 BuildRequires: libxml2-progs
27 BuildRequires: meson >= 0.49.0
29 BuildRequires: pkgconfig
30 BuildRequires: rpmbuild(macros) >= 1.736
31 BuildRequires: tar >= 1:1.22
34 Requires: glib2 >= 1:2.18.0
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 This is the freedesktop.org shared MIME info database.
40 Many programs and desktops use the MIME system to represent the types
41 of files. Frequently, it is necessary to work out the correct MIME
42 type for a file. This is generally done by examining the file's name
43 or contents, and looking up the correct MIME type in a database.
45 For interoperability, it is useful for different programs to use the
46 same database so that different programs agree on the type of a file,
47 and new rules for determining the type apply to all programs.
49 This specification attempts to unify the type-guessing systems
50 currently in use by GNOME, KDE and ROX. Only the name-to-type and
51 contents-to-type mappings are covered by this spec; other MIME type
52 information, such as the default handler for a particular type, or the
53 icon to use to display it in a file manager, are not covered since
54 these are a matter of style.
56 In addition, freedesktop.org provides a shared database in this format
57 to avoid inconsistencies between desktops. This database has been
58 created by converting the existing KDE and GNOME databases to the new
59 format and merging them together.
61 %description -l pl.UTF-8
62 To jest wspólna baza informacji MIME freedesktop.org.
64 Wiele programów oraz pulpitów używa systemu MIME do reprezentacji
65 typów plików. Często, zachodzi potrzeba opracowania prawidłowego typu
66 MIME dla pliku. Przeważnie jest to robione poprzez sprawdzenie nazwy
67 lub zawartości pliku i znalezienie odpowiedniego typu MIME w bazie.
69 W ramach współpracy, użytecznym jest używanie tej samej bazy przez
70 różne programy. Dzięki temu pozycja dodana do bazy realizowana jest we
71 wszystkich programach.
73 Ta specyfikacja ma za zadanie zunifikowanie systemów odpytujących o
74 typ używanych przez GNOME, KDE i ROX. W tym pakiecie zawarte są
75 jedynie mapowania nazwa-typ i zawartość-typ. Inne informacje MIME,
76 takie jak domyślna procedura obsługi dla poszczególnych typów, czy
77 ikona używana podczas wyświetlania w zarządcy plików, nie są zawarte,
80 Dlatego freedesktop.org udostępnia wspólne bazy w tym formacie aby
81 uniknąć niekonsekwencji między pulpitami. Ta baza została stworzona
82 poprzez konwersję istniejących baz KDE i GNOME do nowego formatu i
86 Summary: Shared MIME-info Database specification
87 Summary(pl.UTF-8): Specyfikacja Shared MIME-info Database
91 Shared MIME-info Database specification
93 %description doc -l pl.UTF-8
94 Specyfikacja Shared MIME-info Database (współdzielonej bazy danych
102 -Dupdate-mimedb=false
103 %ninja_build -C build
105 %{?with_tests:%ninja_test -C build}
107 %{?with_doc:db2html data/shared-mime-info-spec.xml}
110 rm -rf $RPM_BUILD_ROOT
111 %ninja_install -C build
113 # remove bogus translation files
114 # translations are already in the xml file installed
115 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}
118 %{?with_doc:ln -sf t1.html data/shared-mime-info-spec/index.html}
120 # ghost generated files
121 # see update-mime-database.c const char *media_types
122 install -d $RPM_BUILD_ROOT%{_datadir}/mime/{application,audio,image,inode,message,model,multipart,text,video,x-content,x-epoc}
123 # see specification, also grep -F .new update-mime-database.c
124 touch $RPM_BUILD_ROOT%{_datadir}/mime/globs
125 touch $RPM_BUILD_ROOT%{_datadir}/mime/globs2
126 touch $RPM_BUILD_ROOT%{_datadir}/mime/magic
127 touch $RPM_BUILD_ROOT%{_datadir}/mime/XMLnamespaces
128 touch $RPM_BUILD_ROOT%{_datadir}/mime/subclasses
129 touch $RPM_BUILD_ROOT%{_datadir}/mime/aliases
130 touch $RPM_BUILD_ROOT%{_datadir}/mime/types
131 touch $RPM_BUILD_ROOT%{_datadir}/mime/generic-icons
132 touch $RPM_BUILD_ROOT%{_datadir}/mime/icons
133 touch $RPM_BUILD_ROOT%{_datadir}/mime/treemagic
134 touch $RPM_BUILD_ROOT%{_datadir}/mime/mime.cache
137 rm -rf $RPM_BUILD_ROOT
140 %update_mime_database
143 # remove dirs and files created by update-mime-database
144 if [ "$1" = "0" ]; then
145 %{__rm} -rf %{_datadir}/mime/*
149 %defattr(644,root,root,755)
151 %attr(755,root,root) %{_bindir}/update-mime-database
152 %dir %{_datadir}/mime
153 %dir %{_datadir}/mime/packages
154 %{_datadir}/mime/packages/freedesktop.org.xml
155 %{_mandir}/man1/update-mime-database.1*
156 %{_npkgconfigdir}/shared-mime-info.pc
157 %{_datadir}/gettext/its/shared-mime-info.its
158 %{_datadir}/gettext/its/shared-mime-info.loc
161 %dir %{_datadir}/mime/application
162 %dir %{_datadir}/mime/audio
163 %dir %{_datadir}/mime/image
164 %dir %{_datadir}/mime/inode
165 %dir %{_datadir}/mime/message
166 %dir %{_datadir}/mime/model
167 %dir %{_datadir}/mime/multipart
168 %dir %{_datadir}/mime/text
169 %dir %{_datadir}/mime/video
170 %dir %{_datadir}/mime/x-content
171 %dir %{_datadir}/mime/x-epoc
172 %ghost %{_datadir}/mime/globs
173 %ghost %{_datadir}/mime/globs2
174 %ghost %{_datadir}/mime/magic
175 %ghost %{_datadir}/mime/XMLnamespaces
176 %ghost %{_datadir}/mime/subclasses
177 %ghost %{_datadir}/mime/aliases
178 %ghost %{_datadir}/mime/types
179 %ghost %{_datadir}/mime/generic-icons
180 %ghost %{_datadir}/mime/icons
181 %ghost %{_datadir}/mime/treemagic
182 %ghost %{_datadir}/mime/mime.cache
186 %defattr(644,root,root,755)
187 %doc data/shared-mime-info-spec/*