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