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