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