+#
+# Conditional build:
+%bcond_without python # don't build python-magic module
+#
Summary: A utility for determining file types
Summary(cs): Program pro zji¹»ování typu souborù
Summary(da): Et værktøj til bestemmelse af filtyper
Summary(zh_CN): Åж¨ÎļþÀàÐ͵Ť¾ß¡£
Summary(zh_TW): ¥Î©ó¨M©wÀÉ®×Ãþ«¬ªº¤@Ó¤u¨ãµ{¦¡¡C
Name: file
-Version: 4.10
-Release: 1
+Version: 4.13
+Release: 3
License: distributable
Group: Applications/File
-Source0: ftp://ftp.astron.com/pub/%{name}/%{name}-%{version}.tar.gz
-# Source0-md5: c3cf1bda84a9d55896d4b7dd2caee68d
+Source0: ftp://ftp.astron.com/pub/file/%{name}-%{version}.tar.gz
+# Source0-md5: 2bfc0f878ee22e50441b68df2ccbb984
Source1: zisofs.magic
Source2: http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2
# Source2-md5: c157a183b64156f8baafaefd9cbf04c1
Patch0: %{name}-debian.patch
Patch1: %{name}-sparc.patch
Patch2: %{name}-ia64.patch
-Patch3: %{name}-mime-elf.patch
-Patch4: %{name}-unicode.patch
-Patch5: %{name}-readelf-fix.patch
+Patch3: %{name}-unicode.patch
+Patch4: %{name}-dicom.patch
+Patch5: %{name}-lmagic.patch
+Patch6: %{name}-python2.4.patch
+Patch7: %{name}-greedy-dump.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
+%if %{with python}
+BuildRequires: python-devel
+BuildRequires: python-modules
+%endif
Requires: libmagic = %{version}-%{release}
Conflicts: xdelta < 1.0.0
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
Ten pakiet zawiera statyczn± wersjê biblioteki.
+%package -n python-magic
+Summary: Python bindings for libmagic
+Summary(pl): Wi±zania Pythona dla libmagic
+Group: Libraries/Python
+Requires: libmagic = %{version}-%{release}
+%pyrequires_eq python-libs
+
+%description -n python-magic
+Python bindings for libmagic.
+
+%description -n python-magic -l pl
+Wi±zania Pythona dla libmagic.
+
%prep
%setup -q
%patch0 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
+%patch6 -p1
+%patch7 -p1
%build
%{__libtoolize}
%{__make}
+%if %{with python}
+cd python
+python setup.py build
+cd ..
+%endif
+
%install
rm -rf $RPM_BUILD_ROOT
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
+%if %{with python}
+cd python
+python setup.py install \
+ --root=$RPM_BUILD_ROOT \
+ --optimize=2
+cd ..
+%endif
+
install -D magic/magic.local $RPM_BUILD_ROOT%{_sysconfdir}/magic
cat %{SOURCE1} %{SOURCE3} >>$RPM_BUILD_ROOT%{_datadir}/file/magic
%files
%defattr(644,root,root,755)
+%doc ChangeLog LEGAL.NOTICE README
%attr(755,root,root) %{_bindir}/*
%{_datadir}/file
%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/magic
%files -n libmagic-static
%defattr(644,root,root,755)
%{_libdir}/lib*.a
+
+%if %{with python}
+%files -n python-magic
+%defattr(644,root,root,755)
+%attr(755,root,root) %{py_sitedir}/*.so
+%endif