]> git.pld-linux.org Git - packages/shared-mime-info.git/blame - shared-mime-info.spec
up to 2.2
[packages/shared-mime-info.git] / shared-mime-info.spec
CommitLineData
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 9Summary: Shared MIME-info specification
40138a8d 10Summary(pl.UTF-8): Wspólna specyfikacja MIME-info
50ff68c4 11Name: shared-mime-info
52ba3b71 12Version: 2.2
b98e99b8 13Release: 1
941139bc 14Epoch: 1
e9a24eb2 15License: GPL
add02d74 16Group: Applications/Databases
c91cba91 17Source0: https://gitlab.freedesktop.org/xdg/shared-mime-info/-/archive/%{version}/%{name}-%{version}.tar.bz2
52ba3b71 18# Source0-md5: 22574ee319c1690a058fbcfcbc4542d3
850818b7 19URL: https://www.freedesktop.org/wiki/Software/shared-mime-info
e4b7e6ce 20BuildRequires: docbook-dtd412-xml
ff0a0e46 21BuildRequires: docbook-utils
660e26e1 22BuildRequires: gettext-tools
2adcb0f9 23BuildRequires: glib2-devel >= 1:2.18.0
425383e2 24BuildRequires: libxml2-devel >= 1:2.6.26
c91cba91
JP
25BuildRequires: libxml2-progs
26BuildRequires: meson >= 0.49.0
27BuildRequires: ninja
26a0cfcf 28BuildRequires: pkgconfig
c91cba91 29BuildRequires: rpmbuild(macros) >= 1.736
77ea9487 30BuildRequires: tar >= 1:1.22
c91cba91 31BuildRequires: xmlto
77ea9487 32BuildRequires: xz
2adcb0f9 33Requires: glib2 >= 1:2.18.0
50ff68c4 34BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35
50ff68c4 36%description
37This is the freedesktop.org shared MIME info database.
38
39Many programs and desktops use the MIME system to represent the types
40of files. Frequently, it is necessary to work out the correct MIME
41type for a file. This is generally done by examining the file's name
42or contents, and looking up the correct MIME type in a database.
43
44For interoperability, it is useful for different programs to use the
45same database so that different programs agree on the type of a file,
46and new rules for determining the type apply to all programs.
47
48This specification attempts to unify the type-guessing systems
49currently in use by GNOME, KDE and ROX. Only the name-to-type and
50contents-to-type mappings are covered by this spec; other MIME type
51information, such as the default handler for a particular type, or the
52icon to use to display it in a file manager, are not covered since
53these are a matter of style.
54
55In addition, freedesktop.org provides a shared database in this format
56to avoid inconsistencies between desktops. This database has been
57created by converting the existing KDE and GNOME databases to the new
58format and merging them together.
59
086e4d85
JR
60%description -l pl.UTF-8
61To jest wspólna baza informacji MIME freedesktop.org.
50ff68c4 62
086e4d85
JR
63Wiele programów oraz pulpitów używa systemu MIME do reprezentacji
64typów plików. Często, zachodzi potrzeba opracowania prawidłowego typu
65MIME dla pliku. Przeważnie jest to robione poprzez sprawdzenie nazwy
66lub zawartości pliku i znalezienie odpowiedniego typu MIME w bazie.
50ff68c4 67
086e4d85
JR
68W ramach współpracy, użytecznym jest używanie tej samej bazy przez
69różne programy. Dzięki temu pozycja dodana do bazy realizowana jest we
50ff68c4 70wszystkich programach.
71
086e4d85
JR
72Ta specyfikacja ma za zadanie zunifikowanie systemów odpytujących o
73typ używanych przez GNOME, KDE i ROX. W tym pakiecie zawarte są
74jedynie mapowania nazwa-typ i zawartość-typ. Inne informacje MIME,
75takie jak domyślna procedura obsługi dla poszczególnych typów, czy
76ikona używana podczas wyświetlania w zarządcy plików, nie są zawarte,
77gdyż zależą od gustu.
78
79Dlatego freedesktop.org udostępnia wspólne bazy w tym formacie aby
80uniknąć niekonsekwencji między pulpitami. Ta baza została stworzona
81poprzez konwersję istniejących baz KDE i GNOME do nowego formatu i
82połączenie ich.
50ff68c4 83
79bc8705 84%package doc
85a34baf
JB
85Summary: Shared MIME-info Database specification
86Summary(pl.UTF-8): Specyfikacja Shared MIME-info Database
79bc8705
ER
87Group: Documentation
88
89%description doc
85a34baf 90Shared MIME-info Database specification
79bc8705
ER
91
92%description doc -l pl.UTF-8
85a34baf
JB
93Specyfikacja Shared MIME-info Database (współdzielonej bazy danych
94informacji 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
109rm -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
121install -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
123touch $RPM_BUILD_ROOT%{_datadir}/mime/globs
124touch $RPM_BUILD_ROOT%{_datadir}/mime/globs2
125touch $RPM_BUILD_ROOT%{_datadir}/mime/magic
126touch $RPM_BUILD_ROOT%{_datadir}/mime/XMLnamespaces
127touch $RPM_BUILD_ROOT%{_datadir}/mime/subclasses
128touch $RPM_BUILD_ROOT%{_datadir}/mime/aliases
129touch $RPM_BUILD_ROOT%{_datadir}/mime/types
130touch $RPM_BUILD_ROOT%{_datadir}/mime/generic-icons
131touch $RPM_BUILD_ROOT%{_datadir}/mime/icons
132touch $RPM_BUILD_ROOT%{_datadir}/mime/treemagic
133touch $RPM_BUILD_ROOT%{_datadir}/mime/mime.cache
134
11fc5c93
JB
135%clean
136rm -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
143if [ "$1" = "0" ]; then
add02d74 144 %{__rm} -rf %{_datadir}/mime/*
425383e2 145fi
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
This page took 0.12121 seconds and 4 git commands to generate.