]> git.pld-linux.org Git - packages/file.git/blob - file.spec
add mime type for *.m3u files; rel 4
[packages/file.git] / file.spec
1 #
2 # Conditional build:
3 %bcond_without  python2         # don't build python-magic module for Python 2.x
4 %bcond_without  python3         # don't build python-magic module for Python 3.x
5 %bcond_without  static_libs     # don't build static libraries
6 %bcond_without  tests           # don't perform "make check"
7
8 Summary:        A utility for determining file types
9 Summary(cs.UTF-8):      Program pro zjišťování typu souborů
10 Summary(da.UTF-8):      Et værktøj til bestemmelse af filtyper
11 Summary(de.UTF-8):      Ein Befehl zur Bestimmung von Dateitypen
12 Summary(es.UTF-8):      Utilidad para determinar el tipo de fichero
13 Summary(fr.UTF-8):      Utilitaire permettant d'identifier des types de fichier
14 Summary(id.UTF-8):      Utility untuk menentukan tipe file
15 Summary(is.UTF-8):      Tól til þess að komast að tegund skráar
16 Summary(it.UTF-8):      Utility per determinare il tipo di file
17 Summary(ja.UTF-8):      ファイルの種類を判断するためのユーティリティ
18 Summary(ko.UTF-8):      파일 종류를 결정하는 유틸리티
19 Summary(nb.UTF-8):      Et verktøy for å bestemme filtyper
20 Summary(pl.UTF-8):      Polecenie określające rodzaj pliku
21 Summary(pt.UTF-8):      Um utilitário para determinar o tipo dos ficheiros
22 Summary(pt_BR.UTF-8):   Um utilitário para determinar tipos de arquivos
23 Summary(ru.UTF-8):      Утилита для определения типов файлов
24 Summary(sk.UTF-8):      Pomocný program pre určenie typu súboru
25 Summary(sl.UTF-8):      Pripomoček za ugotavljanje vrste datotek
26 Summary(sv.UTF-8):      Ett verktyg för att bestämma filtyper
27 Summary(tr.UTF-8):      Dosya türünü öğrenmek için bir araç
28 Summary(uk.UTF-8):      Утиліта для визначення типів файлів
29 Summary(zh_CN.UTF-8):   判定文件类型的工具。
30 Summary(zh_TW.UTF-8):   用於決定檔案類型的一個工具程式。
31 Name:           file
32 Version:        5.32
33 Release:        1
34 License:        distributable
35 Group:          Applications/File
36 Source0:        ftp://ftp.astron.com/pub/file/%{name}-%{version}.tar.gz
37 # Source0-md5:  4f2503752ff041895090ed6435610435
38 Source1:        http://ftp1.pld-linux.org/people/glen/%{name}-non-english-man-pages.tar.bz2
39 # Source1-md5:  6a45bcaefd19b94db36a1b2b7c5b806b
40 Source2:        %{name}-zisofs.magic
41 Source3:        %{name}-mscompress.magic
42 Source4:        %{name}-magic.mime-gen.awk
43 Patch0:         %{name}-selinux.patch
44 Patch1:         searchpath.patch
45 Patch2:         automake.patch
46 Patch4:         name-use-count.patch
47 URL:            http://www.darwinsys.com/file/
48 BuildRequires:  autoconf >= 2.50
49 BuildRequires:  automake
50 BuildRequires:  libtool >= 2:2.0
51 BuildRequires:  rpmbuild(macros) >= 1.710
52 %if %{with python2}
53 BuildRequires:  python-devel
54 BuildRequires:  python-modules
55 BuildRequires:  rpm-pythonprov
56 %endif
57 %if %{with python3}
58 BuildRequires:  python3-devel
59 BuildRequires:  python3-modules
60 BuildRequires:  rpm-pythonprov
61 %endif
62 BuildRequires:  zlib-devel
63 Requires(pretrans):     coreutils
64 Requires:       libmagic = %{version}-%{release}
65 Conflicts:      rpm-build < 4.4.1-9
66 Conflicts:      xdelta < 1.0.0
67 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
68
69 %description
70 This package is useful for finding out what type of file you are
71 looking at on your system. For example, if an fsck results in a file
72 being stored in lost+found, you can run file on it to find out if it's
73 safe to 'more' it or if it's a binary. It recognizes many file types,
74 including ELF binaries, system libraries, RPM packages, and many
75 different graphics formats.
76
77 %description -l cs.UTF-8
78 Příkaz file se používá pro identifikaci zadaného souboru podle jeho
79 obsahu. Je schopen identifikovat množství různých typů souborů včetně
80 binárních souborů ELF, systémových knihoven, RPM balíčků a různých
81 grafických formátů.
82
83 %description -l da.UTF-8
84 Programmet "file" bruges til at identificere filer baseret på indhold.
85 "file" kan identificere mange forskellige filtyper, inkl. ELF-filer,
86 systembiblioteker, RPM-pakker og billedfiler i forskellige formater.
87
88 %description -l de.UTF-8
89 Sie können dieses Paket verwenden, um zu bestimmen, welches Format
90 eine bestimmte Datei hat. Wird durch fsck eine Datei in lost+found
91 gespeichert, können Sie 'file' ausführen, um herauszufinden, ob Sie
92 sie mit 'more' einsehen können, oder ob es sich um ein Binärprogramm
93 handelt Das Programm erkennt u.a. ELF-Binärprogramme,
94 System-Libraries, RPM-Pakete und viele Grafikformate.
95
96 %description -l es.UTF-8
97 Este paquete es útil para descubrir que tipo de archivo estás buscando
98 en tu sistema. Por ejemplo, si fsck resulta un archivo que fue
99 almacenado en el "lost+found", tu puedes ejecutar file en él para
100 descubrir si es seguro leerlo con el "more" o si es un binario.
101 Reconoce varios tipos de archivos, incluyendo binarios ELF,
102 bibliotecas de sistema, paquetes RPM y varios formatos gráficos
103 diferentes.
104
105 %description -l fr.UTF-8
106 Ce paquetage sert à trouver le type du fichier que vous recherchez sur
107 votre système. Par exemple, si un fsck fait qu'un fichier a été stocké
108 dans lost+found, vous pouvez lancer file dessus pour savoir si on peut
109 faire un more, ou s'il s'agit d'un binaire. Il reconnaît de nombreux
110 types de fichiers dont les binaires ELF, les bibliothèques systèmes,
111 les paquetages RPM et de nombreux formats graphiques différents.
112
113 %description -l it.UTF-8
114 Il comando file è utilizzato per identificare il tipo di file in base
115 ai tipi di dati che contiene. File può identificare molti tipi di
116 file, tra cui i binari ELF, le librerie di sistema, i pacchetti RPM e
117 vari formati grafici.
118
119 %description -l ja.UTF-8
120 ファイルコマンドはファイルに含まれるデータの種類により個々のファイルを
121 見分けるために使われる。file は ELF バイナリ、システムライブラリ、 RPM
122 パッケージ、そして種々のグラフィックフォーマットを含む、多くの異なる
123 ファイルの種類を見分けることが可能である。
124
125 %description -l ko.UTF-8
126 파일에 저장된 자료 유형에 따라 파일을 식별하는 file 명령. File은 ELF
127 바이너리, 시스템 라이브러리, RPM 패키지와 다른 그래픽 유형을 포함한
128 여러 많은 파일 유형을 식별 가능합니다.
129
130 %description -l nb.UTF-8
131 Programmet "file" brukes for å identifisere filer basert på innhold.
132 "file" kan identifisere mange ulike filtyper, inkl. ELF-filer,
133 systembibliotek, RPM-pakker og bildefiler i ulike formater.
134
135 %description -l pl.UTF-8
136 Pakiet ten jest przydatny jeżeli chcesz rozpoznać typ plików w twoim
137 systemie. Na przykład jeżeli fsck zdeponuje jakieś pliki w katalogu
138 lost+found, możesz uruchomić file na zdeponowanym pliku i zobaczyć
139 jaki to jest typ pliku, jest to metoda bezpieczniejsza niż 'more', ze
140 względu na to, że to może być plik binarny. File potrafi rozpoznać
141 wiele typów plików np. binarny ELF, biblioteki systemowe, pakiety RPM
142 oraz wiele różnych formatów graficznych i dźwiękowych.
143
144 %description -l pt.UTF-8
145 O comando file é usado para identificar um ficheiro em particular de
146 acordo com o tipo de dados que contém. O file pode identificar vários
147 formatos de ficheiros, incluindo binários ELF, bibliotecas de sistema,
148 pacotes RPM e vários formatos gráficos diferentes.
149
150 %description -l pt_BR.UTF-8
151 Este pacote é útil para descobrir que tipo de arquivo você está
152 procurando em seu sistema. Por exemplo, se um fsck resulta em um
153 arquivo forem armazenado no "lost+found", você pode rodar file nele
154 para descobrir se é seguro lê-lo com o "more" ou se ele é um binário.
155 Ele reconhece vários tipos de arquivos, incluindo binários ELF,
156 bibliotecas de sistema, pacotes RPM e vários formatos gráficos
157 diferentes.
158
159 %description -l ru.UTF-8
160 Команда file используется для определения типа файла по данным, в нем
161 содержащимся. Она может определить множество разнообразных типов
162 файлов, включая бинарные файлы формата ELF, системные библиотеки,
163 пакеты RPM, различные графические форматы и много других.
164
165 %description -l sv.UTF-8
166 Kommandot file används för att identifera en fil vad avser vilken typ
167 av data filen innehåller. File kan identifiera många olika filtyper,
168 inklusive ELF-binärer, systembibliotek, RPM-paket och olika
169 grafikformat.
170
171 %description -l tr.UTF-8
172 file, bir dosyayı inceleyerek ne tür bir dosya olduğu konusunda size
173 bir fikir verebilir. Böylece uzantısından ve adından ne olduğunu
174 çıkaramadığınız bir dosyayı hangi yazılım ile kullanabileceğinize ya
175 da ne yapacağınıza karar verebilisiniz. file, temel dosya tiplerini,
176 çoğu grafik formatını, çalıştırılabilir dosyaları, sistem
177 kitaplıklarını vs. tanıyabilir.
178
179 %description -l uk.UTF-8
180 Команда file використовується для визначення типу файлу по даних, які
181 він містить. Вона може визначити велику кількість різноманітних типів
182 файлів, у тому числі бінарні файли формату ELF, системні бібліотеки,
183 пакети RPM, різноманітні графічні формати та багато інших.
184
185 %description -l zh_CN.UTF-8
186 file 命令用来根据文件中包含的数据类型来识别文件类型。 file
187 可以识别许多不同的文件类型,包括 ELF 二进制、系统 库、RPM
188 软件包、和不同的图形格式。
189
190 %description -l zh_TW.UTF-8
191 file 指令是根據檔案包含的資料類型來辨認檔案。 File
192 可以辨認許多不同的檔案類型, 包含 ELF binaries,系統函式庫,RPM
193 套件,以及不同的 圖像格式。
194
195 %package -n libmagic
196 Summary:        libmagic library
197 Summary(pl.UTF-8):      Biblioteka libmagic
198 Group:          Libraries
199
200 %description -n libmagic
201 Library of functions which operate on magic database file.
202
203 %description -n libmagic -l pl.UTF-8
204 Biblioteka funkcji operujących na pliku bazy danych magic.
205
206 %package -n libmagic-devel
207 Summary:        Header files for libmagic library
208 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki libmagic
209 Group:          Development/Libraries
210 Requires:       libmagic = %{version}-%{release}
211 Requires:       zlib-devel
212
213 %description -n libmagic-devel
214 Library of functions which operate on magic database file.
215
216 This package contains the header files needed to develop programs that
217 use these libmagic.
218
219 %description -n libmagic-devel -l pl.UTF-8
220 Biblioteka funkcji operujących na pliku bazy danych magic.
221
222 Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia programów
223 używających libmagic.
224
225 %package -n libmagic-static
226 Summary:        Static libmagic library
227 Summary(pl.UTF-8):      Statyczna biblioteka libmagic
228 Group:          Development/Libraries
229 Requires:       libmagic-devel = %{version}-%{release}
230
231 %description -n libmagic-static
232 Library of functions which operate on magic database file.
233
234 This package contains the static libmagic.
235
236 %description -n libmagic-static -l pl.UTF-8
237 Biblioteka funkcji operujących na pliku bazy danych magic.
238
239 Ten pakiet zawiera statyczną wersję biblioteki.
240
241 %package -n python-magic
242 Summary:        Python 2 bindings for libmagic
243 Summary(pl.UTF-8):      Wiązania Pythona 2 do biblioteki libmagic
244 Group:          Libraries/Python
245 Requires:       libmagic = %{version}-%{release}
246 Requires:       python-libs
247
248 %description -n python-magic
249 Python 2 bindings for libmagic.
250
251 %description -n python-magic -l pl.UTF-8
252 Wiązania Pythona 2 do biblioteki libmagic.
253
254 %package -n python3-magic
255 Summary:        Python 3 bindings for libmagic
256 Summary(pl.UTF-8):      Wiązania Pythona 3 do biblioteki libmagic
257 Group:          Libraries/Python
258 Requires:       libmagic = %{version}-%{release}
259 Requires:       python-libs
260
261 %description -n python3-magic
262 Python 3 bindings for libmagic.
263
264 %description -n python3-magic -l pl.UTF-8
265 Wiązania Pythona 3 do biblioteki libmagic.
266
267 %prep
268 %setup -q
269 %patch0 -p1
270 %patch1 -p1
271 %patch2 -p1
272 %patch4 -p1
273
274 %if "%{cc_version}" < "3.4"
275 %{__sed} -i -e 's,-Wextra,,' configure.ac
276 %endif
277
278 cp -p %{SOURCE3} magic/Magdir/mscompress
279 cp -p %{SOURCE2} magic/Magdir/zisofs
280
281 rm -f magic/Magdir/{*.orig,*~}
282
283 %if %{with python3}
284 cp -a python py3
285 %endif
286
287 %build
288 %{__libtoolize}
289 %{__aclocal}
290 %{__autoheader}
291 %{__autoconf}
292 %{__automake}
293 %configure \
294         --disable-silent-rules \
295         --enable-fsect-man5 \
296         %{?with_static_libs:--enable-static}
297
298 %{__make}
299
300 %if %{with python2}
301 cd python
302 %py_build
303 cd ..
304 %endif
305 %if %{with python3}
306 cd py3
307 %py3_build
308 cd ..
309 %endif
310
311 %if %{with tests}
312 %{__make} check
313 %endif
314
315 %install
316 rm -rf $RPM_BUILD_ROOT
317 install -d $RPM_BUILD_ROOT/%{_lib}
318
319 %{__make} install \
320         DESTDIR=$RPM_BUILD_ROOT
321
322 mv $RPM_BUILD_ROOT%{_libdir}/libmagic.so.* $RPM_BUILD_ROOT/%{_lib}
323 ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libmagic.so.*.*.*) \
324         $RPM_BUILD_ROOT%{_libdir}/libmagic.so
325
326 %if %{with python2}
327 cd python
328 %py_install
329 cd ..
330 %py_postclean
331 %endif
332
333 %if %{with python3}
334 cd py3
335 %py3_install
336 cd ..
337 %endif
338
339 awk -f %{SOURCE4} < $RPM_BUILD_ROOT%{_datadir}/misc/magic > $RPM_BUILD_ROOT%{_datadir}/misc/magic.mime
340 ln -s misc $RPM_BUILD_ROOT%{_datadir}/file
341
342 bzip2 -dc %{SOURCE1} | tar xf - -C $RPM_BUILD_ROOT%{_mandir}
343 %{__rm} $RPM_BUILD_ROOT%{_mandir}/README.file-non-english-man-pages
344 %{__rm} $RPM_BUILD_ROOT%{_mandir}/file-magic4.diff
345
346 %clean
347 rm -rf $RPM_BUILD_ROOT
348
349 %post   -n libmagic -p /sbin/ldconfig
350 %postun -n libmagic -p /sbin/ldconfig
351
352 %pretrans
353 # it used to be directory
354 if [ -d %{_datadir}/file -a ! -L %{_datadir}/file ]; then
355         mv -b %{_datadir}/file{,.dir}
356         ln -sn misc %{_datadir}/file
357 %banner -e %{name} <<EOF
358 Check %{_datadir}/file.dir for your own files and remove it when done.
359 EOF
360 fi
361
362 %files
363 %defattr(644,root,root,755)
364 %doc ChangeLog COPYING README
365 %attr(755,root,root) %{_bindir}/file
366 %{_datadir}/file
367 %{_datadir}/misc/magic
368 %{_datadir}/misc/magic.mgc
369 %{_datadir}/misc/magic.mime
370 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/magic
371 %{_mandir}/man1/file.1*
372 %{_mandir}/man5/magic.5*
373 %lang(de) %{_mandir}/de/man[15]/*
374 %lang(es) %{_mandir}/es/man[15]/*
375 %lang(fr) %{_mandir}/fr/man[15]/*
376 %lang(hu) %{_mandir}/hu/man[15]/*
377 %lang(it) %{_mandir}/it/man[15]/*
378 %lang(ja) %{_mandir}/ja/man[15]/*
379 %lang(nl) %{_mandir}/nl/man[15]/*
380 %lang(pl) %{_mandir}/pl/man[15]/*
381 %lang(pt_BR) %{_mandir}/pt_BR/man[15]/*
382
383 %files -n libmagic
384 %defattr(644,root,root,755)
385 %attr(755,root,root) /%{_lib}/libmagic.so.*.*.*
386 %attr(755,root,root) %ghost /%{_lib}/libmagic.so.1
387
388 %files -n libmagic-devel
389 %defattr(644,root,root,755)
390 %attr(755,root,root) %{_libdir}/libmagic.so
391 %{_libdir}/libmagic.la
392 %{_includedir}/magic.h
393 %{_mandir}/man3/libmagic.3*
394
395 %if %{with static_libs}
396 %files -n libmagic-static
397 %defattr(644,root,root,755)
398 %{_libdir}/libmagic.a
399 %endif
400
401 %if %{with python3}
402 %files -n python-magic
403 %defattr(644,root,root,755)
404 %doc python/README python/example.py
405 %{py_sitescriptdir}/magic.py[co]
406 %{py_sitescriptdir}/file_magic-*-py*.egg-info
407 %endif
408
409 %if %{with_python3}
410 %files -n python3-magic
411 %defattr(644,root,root,755)
412 %doc python/README python/example.py
413 %{py3_sitescriptdir}/magic.py
414 %{py3_sitescriptdir}/__pycache__/magic.*.py[co]
415 %{py3_sitescriptdir}/file_magic-*-py*.egg-info
416 %endif
This page took 0.066732 seconds and 3 git commands to generate.