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