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