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