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