]>
Commit | Line | Data |
---|---|---|
88832bb0 | 1 | # TODO |
79bc8705 ER |
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. | |
add02d74 ER |
4 | # |
5 | # Conditional build: | |
6 | %bcond_without tests # build without tests | |
85a34baf | 7 | %bcond_without doc # build documentation |
add02d74 | 8 | |
9759e33b | 9 | Summary: Shared MIME-info specification |
40138a8d | 10 | Summary(pl.UTF-8): Wspólna specyfikacja MIME-info |
50ff68c4 | 11 | Name: shared-mime-info |
52ba3b71 | 12 | Version: 2.2 |
b98e99b8 | 13 | Release: 1 |
941139bc | 14 | Epoch: 1 |
e9a24eb2 | 15 | License: GPL |
add02d74 | 16 | Group: Applications/Databases |
c91cba91 | 17 | Source0: https://gitlab.freedesktop.org/xdg/shared-mime-info/-/archive/%{version}/%{name}-%{version}.tar.bz2 |
52ba3b71 | 18 | # Source0-md5: 22574ee319c1690a058fbcfcbc4542d3 |
850818b7 | 19 | URL: https://www.freedesktop.org/wiki/Software/shared-mime-info |
e4b7e6ce | 20 | BuildRequires: docbook-dtd412-xml |
ff0a0e46 | 21 | BuildRequires: docbook-utils |
660e26e1 | 22 | BuildRequires: gettext-tools |
2adcb0f9 | 23 | BuildRequires: glib2-devel >= 1:2.18.0 |
425383e2 | 24 | BuildRequires: libxml2-devel >= 1:2.6.26 |
c91cba91 JP |
25 | BuildRequires: libxml2-progs |
26 | BuildRequires: meson >= 0.49.0 | |
27 | BuildRequires: ninja | |
26a0cfcf | 28 | BuildRequires: pkgconfig |
c91cba91 | 29 | BuildRequires: rpmbuild(macros) >= 1.736 |
77ea9487 | 30 | BuildRequires: tar >= 1:1.22 |
c91cba91 | 31 | BuildRequires: xmlto |
77ea9487 | 32 | BuildRequires: xz |
2adcb0f9 | 33 | Requires: glib2 >= 1:2.18.0 |
50ff68c4 | 34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
35 | ||
50ff68c4 | 36 | %description |
37 | This is the freedesktop.org shared MIME info database. | |
38 | ||
39 | Many programs and desktops use the MIME system to represent the types | |
40 | of files. Frequently, it is necessary to work out the correct MIME | |
41 | type for a file. This is generally done by examining the file's name | |
42 | or contents, and looking up the correct MIME type in a database. | |
43 | ||
44 | For interoperability, it is useful for different programs to use the | |
45 | same database so that different programs agree on the type of a file, | |
46 | and new rules for determining the type apply to all programs. | |
47 | ||
48 | This specification attempts to unify the type-guessing systems | |
49 | currently in use by GNOME, KDE and ROX. Only the name-to-type and | |
50 | contents-to-type mappings are covered by this spec; other MIME type | |
51 | information, such as the default handler for a particular type, or the | |
52 | icon to use to display it in a file manager, are not covered since | |
53 | these are a matter of style. | |
54 | ||
55 | In addition, freedesktop.org provides a shared database in this format | |
56 | to avoid inconsistencies between desktops. This database has been | |
57 | created by converting the existing KDE and GNOME databases to the new | |
58 | format and merging them together. | |
59 | ||
086e4d85 JR |
60 | %description -l pl.UTF-8 |
61 | To jest wspólna baza informacji MIME freedesktop.org. | |
50ff68c4 | 62 | |
086e4d85 JR |
63 | Wiele programów oraz pulpitów używa systemu MIME do reprezentacji |
64 | typów plików. Często, zachodzi potrzeba opracowania prawidłowego typu | |
65 | MIME dla pliku. Przeważnie jest to robione poprzez sprawdzenie nazwy | |
66 | lub zawartości pliku i znalezienie odpowiedniego typu MIME w bazie. | |
50ff68c4 | 67 | |
086e4d85 JR |
68 | W ramach współpracy, użytecznym jest używanie tej samej bazy przez |
69 | różne programy. Dzięki temu pozycja dodana do bazy realizowana jest we | |
50ff68c4 | 70 | wszystkich programach. |
71 | ||
086e4d85 JR |
72 | Ta specyfikacja ma za zadanie zunifikowanie systemów odpytujących o |
73 | typ używanych przez GNOME, KDE i ROX. W tym pakiecie zawarte są | |
74 | jedynie mapowania nazwa-typ i zawartość-typ. Inne informacje MIME, | |
75 | takie jak domyślna procedura obsługi dla poszczególnych typów, czy | |
76 | ikona używana podczas wyświetlania w zarządcy plików, nie są zawarte, | |
77 | gdyż zależą od gustu. | |
78 | ||
79 | Dlatego freedesktop.org udostępnia wspólne bazy w tym formacie aby | |
80 | uniknąć niekonsekwencji między pulpitami. Ta baza została stworzona | |
81 | poprzez konwersję istniejących baz KDE i GNOME do nowego formatu i | |
82 | połączenie ich. | |
50ff68c4 | 83 | |
79bc8705 | 84 | %package doc |
85a34baf JB |
85 | Summary: Shared MIME-info Database specification |
86 | Summary(pl.UTF-8): Specyfikacja Shared MIME-info Database | |
79bc8705 ER |
87 | Group: Documentation |
88 | ||
89 | %description doc | |
85a34baf | 90 | Shared MIME-info Database specification |
79bc8705 ER |
91 | |
92 | %description doc -l pl.UTF-8 | |
85a34baf JB |
93 | Specyfikacja Shared MIME-info Database (współdzielonej bazy danych |
94 | informacji MIME). | |
79bc8705 | 95 | |
50ff68c4 | 96 | %prep |
97 | %setup -q | |
50ff68c4 | 98 | |
99 | %build | |
c91cba91 JP |
100 | %meson build \ |
101 | -Dupdate-mimedb=false | |
102 | %ninja_build -C build | |
08512103 | 103 | |
c91cba91 | 104 | %{?with_tests:%ninja_test -C build} |
add02d74 | 105 | |
c91cba91 | 106 | %{?with_doc:db2html data/shared-mime-info-spec.xml} |
50ff68c4 | 107 | |
108 | %install | |
109 | rm -rf $RPM_BUILD_ROOT | |
c91cba91 | 110 | %ninja_install -C build |
50ff68c4 | 111 | |
add02d74 ER |
112 | # remove bogus translation files |
113 | # translations are already in the xml file installed | |
114 | %{__rm} -r $RPM_BUILD_ROOT%{_localedir} | |
0f82ad81 | 115 | |
79bc8705 | 116 | # convience symlink |
c91cba91 | 117 | %{?with_doc:ln -sf t1.html data/shared-mime-info-spec/index.html} |
79bc8705 ER |
118 | |
119 | # ghost generated files | |
120 | # see update-mime-database.c const char *media_types | |
121 | install -d $RPM_BUILD_ROOT%{_datadir}/mime/{application,audio,image,inode,message,model,multipart,text,video,x-content,x-epoc} | |
122 | # see specification, also grep -F .new update-mime-database.c | |
123 | touch $RPM_BUILD_ROOT%{_datadir}/mime/globs | |
124 | touch $RPM_BUILD_ROOT%{_datadir}/mime/globs2 | |
125 | touch $RPM_BUILD_ROOT%{_datadir}/mime/magic | |
126 | touch $RPM_BUILD_ROOT%{_datadir}/mime/XMLnamespaces | |
127 | touch $RPM_BUILD_ROOT%{_datadir}/mime/subclasses | |
128 | touch $RPM_BUILD_ROOT%{_datadir}/mime/aliases | |
129 | touch $RPM_BUILD_ROOT%{_datadir}/mime/types | |
130 | touch $RPM_BUILD_ROOT%{_datadir}/mime/generic-icons | |
131 | touch $RPM_BUILD_ROOT%{_datadir}/mime/icons | |
132 | touch $RPM_BUILD_ROOT%{_datadir}/mime/treemagic | |
133 | touch $RPM_BUILD_ROOT%{_datadir}/mime/mime.cache | |
134 | ||
11fc5c93 JB |
135 | %clean |
136 | rm -rf $RPM_BUILD_ROOT | |
137 | ||
e9a24eb2 | 138 | %post |
425383e2 | 139 | %update_mime_database |
140 | ||
141 | %preun | |
142 | # remove dirs and files created by update-mime-database | |
143 | if [ "$1" = "0" ]; then | |
add02d74 | 144 | %{__rm} -rf %{_datadir}/mime/* |
425383e2 | 145 | fi |
e9a24eb2 | 146 | |
425383e2 | 147 | %files |
50ff68c4 | 148 | %defattr(644,root,root,755) |
c91cba91 | 149 | %doc README.md NEWS |
425383e2 | 150 | %attr(755,root,root) %{_bindir}/update-mime-database |
67f0f1b4 MK |
151 | %dir %{_datadir}/mime |
152 | %dir %{_datadir}/mime/packages | |
425383e2 | 153 | %{_datadir}/mime/packages/freedesktop.org.xml |
2de56ea3 | 154 | %{_mandir}/man1/update-mime-database.1* |
77ea9487 | 155 | %{_npkgconfigdir}/shared-mime-info.pc |
c91cba91 JP |
156 | %{_datadir}/gettext/its/shared-mime-info.its |
157 | %{_datadir}/gettext/its/shared-mime-info.loc | |
79bc8705 ER |
158 | |
159 | # generated content | |
160 | %dir %{_datadir}/mime/application | |
161 | %dir %{_datadir}/mime/audio | |
162 | %dir %{_datadir}/mime/image | |
163 | %dir %{_datadir}/mime/inode | |
164 | %dir %{_datadir}/mime/message | |
165 | %dir %{_datadir}/mime/model | |
166 | %dir %{_datadir}/mime/multipart | |
167 | %dir %{_datadir}/mime/text | |
168 | %dir %{_datadir}/mime/video | |
169 | %dir %{_datadir}/mime/x-content | |
170 | %dir %{_datadir}/mime/x-epoc | |
171 | %ghost %{_datadir}/mime/globs | |
172 | %ghost %{_datadir}/mime/globs2 | |
173 | %ghost %{_datadir}/mime/magic | |
174 | %ghost %{_datadir}/mime/XMLnamespaces | |
175 | %ghost %{_datadir}/mime/subclasses | |
176 | %ghost %{_datadir}/mime/aliases | |
177 | %ghost %{_datadir}/mime/types | |
178 | %ghost %{_datadir}/mime/generic-icons | |
179 | %ghost %{_datadir}/mime/icons | |
180 | %ghost %{_datadir}/mime/treemagic | |
181 | %ghost %{_datadir}/mime/mime.cache | |
182 | ||
add02d74 | 183 | %if %{with doc} |
79bc8705 ER |
184 | %files doc |
185 | %defattr(644,root,root,755) | |
c91cba91 | 186 | %doc data/shared-mime-info-spec/* |
add02d74 | 187 | %endif |