]>
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 |
db3feee3 ER |
31 | Version: 5.14 |
32 | Release: 1 | |
521d0b82 | 33 | License: distributable |
a8857009 | 34 | Group: Applications/File |
7fb84ed4 | 35 | Source0: ftp://ftp.astron.com/pub/file/%{name}-%{version}.tar.gz |
db3feee3 | 36 | # Source0-md5: c26625f1d6773ad4bc5a87c0e315632c |
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 |
1ddfea46 JB |
42 | Patch0: %{name}-sparc.patch |
43 | Patch1: %{name}-selinux.patch | |
44 | Patch2: searchpath.patch | |
45 | Patch3: automake.patch | |
49d7bd2c | 46 | Patch4: sticky-bit.patch |
b94947b2 | 47 | URL: http://www.darwinsys.com/file/ |
148db065 | 48 | BuildRequires: autoconf >= 2.50 |
f8bfd976 | 49 | BuildRequires: automake |
49d7bd2c | 50 | BuildRequires: libtool >= 2:2.0 |
7fb84ed4 | 51 | BuildRequires: rpmbuild(macros) >= 1.453 |
76e54b9c | 52 | %if %{with python} |
7abc2151 ER |
53 | BuildRequires: python-devel |
54 | BuildRequires: python-modules | |
09b88bf5 | 55 | BuildRequires: rpm-pythonprov |
76e54b9c | 56 | %endif |
49d7bd2c | 57 | BuildRequires: zlib-devel |
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} |
49d7bd2c | 205 | Requires: zlib-devel |
27de5dec | 206 | |
207 | %description -n libmagic-devel | |
208 | Library of functions which operate on magic database file. | |
209 | ||
210 | This package contains the header files needed to develop programs that | |
211 | use these libmagic. | |
212 | ||
87044beb JR |
213 | %description -n libmagic-devel -l pl.UTF-8 |
214 | Biblioteka funkcji operujących na pliku bazy danych magic. | |
4902119c | 215 | |
87044beb JR |
216 | Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia programów |
217 | używających libmagic. | |
4902119c | 218 | |
27de5dec | 219 | %package -n libmagic-static |
4902119c | 220 | Summary: Static libmagic library |
17c387d7 | 221 | Summary(pl.UTF-8): Statyczna biblioteka libmagic |
27de5dec | 222 | Group: Development/Libraries |
a272f0a4 | 223 | Requires: libmagic-devel = %{version}-%{release} |
27de5dec | 224 | |
225 | %description -n libmagic-static | |
226 | Library of functions which operate on magic database file. | |
227 | ||
228 | This package contains the static libmagic. | |
229 | ||
87044beb JR |
230 | %description -n libmagic-static -l pl.UTF-8 |
231 | Biblioteka funkcji operujących na pliku bazy danych magic. | |
4902119c | 232 | |
87044beb | 233 | Ten pakiet zawiera statyczną wersję biblioteki. |
4902119c | 234 | |
76e54b9c AF |
235 | %package -n python-magic |
236 | Summary: Python bindings for libmagic | |
17c387d7 | 237 | Summary(pl.UTF-8): Wiązania Pythona dla libmagic |
76e54b9c AF |
238 | Group: Libraries/Python |
239 | Requires: libmagic = %{version}-%{release} | |
5406107a | 240 | %pyrequires_eq python-libs |
76e54b9c AF |
241 | |
242 | %description -n python-magic | |
243 | Python bindings for libmagic. | |
244 | ||
87044beb JR |
245 | %description -n python-magic -l pl.UTF-8 |
246 | Wiązania Pythona dla libmagic. | |
89a87771 | 247 | |
3db42c15 | 248 | %prep |
7d7e9909 | 249 | %setup -q |
1ddfea46 | 250 | %patch0 -p1 |
6bcdf757 | 251 | %patch1 -p1 |
148db065 JB |
252 | %patch2 -p1 |
253 | %patch3 -p1 | |
7e53fd1f | 254 | %patch4 -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 \ |
a284f482 | 272 | --disable-silent-rules \ |
ae310f23 | 273 | --enable-fsect-man5 \ |
49d7bd2c | 274 | %{?with_static_libs:--enable-static} |
e855616e | 275 | |
9ee0e0b5 | 276 | %{__make} |
3db42c15 | 277 | |
76e54b9c AF |
278 | %if %{with python} |
279 | cd python | |
e3acf3ba | 280 | %{__python} setup.py build |
76e54b9c AF |
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 | ||
148db065 | 308 | awk -f %{SOURCE4} < $RPM_BUILD_ROOT%{_datadir}/misc/magic > $RPM_BUILD_ROOT%{_datadir}/misc/magic.mime |
e3acf3ba ER |
309 | ln -s misc $RPM_BUILD_ROOT%{_datadir}/file |
310 | ||
311 | bzip2 -dc %{SOURCE1} | tar xf - -C $RPM_BUILD_ROOT%{_mandir} | |
aa747f51 ER |
312 | %{__rm} $RPM_BUILD_ROOT%{_mandir}/README.file-non-english-man-pages |
313 | %{__rm} $RPM_BUILD_ROOT%{_mandir}/file-magic4.diff | |
b8b920bf | 314 | |
3db42c15 | 315 | %clean |
316 | rm -rf $RPM_BUILD_ROOT | |
317 | ||
27de5dec | 318 | %post -n libmagic -p /sbin/ldconfig |
319 | %postun -n libmagic -p /sbin/ldconfig | |
320 | ||
55ad3894 AM |
321 | %pretrans |
322 | # it used to be directory | |
b2cca602 | 323 | if [ -d %{_datadir}/file -a ! -L %{_datadir}/file ]; then |
55ad3894 | 324 | mv -b %{_datadir}/file{,.dir} |
9e4bf8c8 | 325 | ln -sn misc %{_datadir}/file |
55ad3894 | 326 | %banner -e %{name} <<EOF |
55c2baa7 | 327 | Check %{_datadir}/file.dir for your own files and remove it when done. |
55ad3894 AM |
328 | EOF |
329 | fi | |
330 | ||
3db42c15 | 331 | %files |
4f023001 | 332 | %defattr(644,root,root,755) |
bc21903a | 333 | %doc ChangeLog COPYING README |
09b88bf5 | 334 | %attr(755,root,root) %{_bindir}/file |
4902119c | 335 | %{_datadir}/file |
969ab84e SP |
336 | %{_datadir}/misc/magic |
337 | %{_datadir}/misc/magic.mgc | |
55ad3894 | 338 | %{_datadir}/misc/magic.mime |
4653b295 | 339 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/magic |
e3f0414c JB |
340 | %{_mandir}/man1/file.1* |
341 | %{_mandir}/man5/magic.5* | |
e2cdad8f | 342 | %lang(de) %{_mandir}/de/man[15]/* |
343 | %lang(es) %{_mandir}/es/man[15]/* | |
344 | %lang(fr) %{_mandir}/fr/man[15]/* | |
345 | %lang(hu) %{_mandir}/hu/man[15]/* | |
346 | %lang(it) %{_mandir}/it/man[15]/* | |
347 | %lang(ja) %{_mandir}/ja/man[15]/* | |
348 | %lang(nl) %{_mandir}/nl/man[15]/* | |
4b9ca3cc | 349 | %lang(pl) %{_mandir}/pl/man[15]/* |
ca0f057f | 350 | %lang(pt_BR) %{_mandir}/pt_BR/man[15]/* |
27de5dec | 351 | |
352 | %files -n libmagic | |
353 | %defattr(644,root,root,755) | |
09b88bf5 | 354 | %attr(755,root,root) /%{_lib}/libmagic.so.*.*.* |
f9961c0f | 355 | %attr(755,root,root) %ghost /%{_lib}/libmagic.so.1 |
27de5dec | 356 | |
357 | %files -n libmagic-devel | |
f7bf36fb | 358 | %defattr(644,root,root,755) |
09b88bf5 JB |
359 | %attr(755,root,root) %{_libdir}/libmagic.so |
360 | %{_libdir}/libmagic.la | |
cc7e8ae4 | 361 | %{_includedir}/magic.h |
f9961c0f | 362 | %{_mandir}/man3/libmagic.3* |
27de5dec | 363 | |
ae310f23 | 364 | %if %{with static_libs} |
27de5dec | 365 | %files -n libmagic-static |
366 | %defattr(644,root,root,755) | |
09b88bf5 | 367 | %{_libdir}/libmagic.a |
ae310f23 | 368 | %endif |
76e54b9c AF |
369 | |
370 | %if %{with python} | |
371 | %files -n python-magic | |
372 | %defattr(644,root,root,755) | |
7abc2151 ER |
373 | %doc python/README python/example.py |
374 | %if "%{py_ver}" > "2.4" | |
375 | %{py_sitescriptdir}/Magic_file_extensions-*.egg-info | |
376 | %endif | |
377 | %{py_sitescriptdir}/magic.py[co] | |
76e54b9c | 378 | %endif |