]> git.pld-linux.org Git - packages/file.git/blobdiff - file.spec
- greedy-dump.patch: if a file looks like both dump file and ELF, use the latter
[packages/file.git] / file.spec
index 274e4a45aefcd724f21980596a1d21b48ff892d6..d656fc3e8092109c64ba32f3101a6164520988c7 100644 (file)
--- a/file.spec
+++ b/file.spec
@@ -1,3 +1,7 @@
+#
+# 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
@@ -22,12 +26,12 @@ Summary(uk):        
 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
@@ -35,12 +39,18 @@ Source3:    %{name}-magic.mscompress
 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)
@@ -217,6 +227,19 @@ Biblioteka funkcji operuj
 
 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
@@ -225,6 +248,8 @@ Ten pakiet zawiera statyczn
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
+%patch6 -p1
+%patch7 -p1
 
 %build
 %{__libtoolize}
@@ -237,12 +262,26 @@ Ten pakiet zawiera statyczn
 
 %{__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
@@ -265,6 +304,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %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
@@ -293,3 +333,9 @@ rm -rf $RPM_BUILD_ROOT
 %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
This page took 0.045947 seconds and 4 git commands to generate.