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