]> git.pld-linux.org Git - packages/shared-mime-info.git/blob - shared-mime-info.spec
up to 2.2
[packages/shared-mime-info.git] / shared-mime-info.spec
1 # TODO
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.
4 #
5 # Conditional build:
6 %bcond_without  tests           # build without tests
7 %bcond_without  doc             # build documentation
8
9 Summary:        Shared MIME-info specification
10 Summary(pl.UTF-8):      Wspólna specyfikacja MIME-info
11 Name:           shared-mime-info
12 Version:        2.2
13 Release:        1
14 Epoch:          1
15 License:        GPL
16 Group:          Applications/Databases
17 Source0:        https://gitlab.freedesktop.org/xdg/shared-mime-info/-/archive/%{version}/%{name}-%{version}.tar.bz2
18 # Source0-md5:  22574ee319c1690a058fbcfcbc4542d3
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:  libxml2-devel >= 1:2.6.26
25 BuildRequires:  libxml2-progs
26 BuildRequires:  meson >= 0.49.0
27 BuildRequires:  ninja
28 BuildRequires:  pkgconfig
29 BuildRequires:  rpmbuild(macros) >= 1.736
30 BuildRequires:  tar >= 1:1.22
31 BuildRequires:  xmlto
32 BuildRequires:  xz
33 Requires:       glib2 >= 1:2.18.0
34 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35
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
60 %description -l pl.UTF-8
61 To jest wspólna baza informacji MIME freedesktop.org.
62
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.
67
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
70 wszystkich programach.
71
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.
83
84 %package doc
85 Summary:        Shared MIME-info Database specification
86 Summary(pl.UTF-8):      Specyfikacja Shared MIME-info Database
87 Group:          Documentation
88
89 %description doc
90 Shared MIME-info Database specification
91
92 %description doc -l pl.UTF-8
93 Specyfikacja Shared MIME-info Database (współdzielonej bazy danych
94 informacji MIME).
95
96 %prep
97 %setup -q
98
99 %build
100 %meson build \
101         -Dupdate-mimedb=false
102 %ninja_build -C build
103
104 %{?with_tests:%ninja_test -C build}
105
106 %{?with_doc:db2html data/shared-mime-info-spec.xml}
107
108 %install
109 rm -rf $RPM_BUILD_ROOT
110 %ninja_install -C build
111
112 # remove bogus translation files
113 # translations are already in the xml file installed
114 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}
115
116 # convience symlink
117 %{?with_doc:ln -sf t1.html data/shared-mime-info-spec/index.html}
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
135 %clean
136 rm -rf $RPM_BUILD_ROOT
137
138 %post
139 %update_mime_database
140
141 %preun
142 # remove dirs and files created by update-mime-database
143 if [ "$1" = "0" ]; then
144         %{__rm} -rf %{_datadir}/mime/*
145 fi
146
147 %files
148 %defattr(644,root,root,755)
149 %doc README.md NEWS
150 %attr(755,root,root) %{_bindir}/update-mime-database
151 %dir %{_datadir}/mime
152 %dir %{_datadir}/mime/packages
153 %{_datadir}/mime/packages/freedesktop.org.xml
154 %{_mandir}/man1/update-mime-database.1*
155 %{_npkgconfigdir}/shared-mime-info.pc
156 %{_datadir}/gettext/its/shared-mime-info.its
157 %{_datadir}/gettext/its/shared-mime-info.loc
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
183 %if %{with doc}
184 %files doc
185 %defattr(644,root,root,755)
186 %doc data/shared-mime-info-spec/*
187 %endif
This page took 0.093007 seconds and 3 git commands to generate.