]> git.pld-linux.org Git - packages/file.git/blobdiff - file.spec
- move libmagic to /{_lib}.
[packages/file.git] / file.spec
index 274e4a45aefcd724f21980596a1d21b48ff892d6..5bea540c6b3c51c82a155143d3e72af308ca4929 100644 (file)
--- a/file.spec
+++ b/file.spec
@@ -1,3 +1,8 @@
+#
+# Conditional build:
+%bcond_without python  # don't build python-magic module
+%bcond_without static_libs # don't build static libraries
+#
 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,26 +27,33 @@ Summary(uk):        
 Summary(zh_CN):        Åж¨ÎļþÀàÐ͵Ť¾ß¡£
 Summary(zh_TW):        ¥Î©ó¨M©wÀÉ®×Ãþ«¬ªº¤@­Ó¤u¨ãµ{¦¡¡C
 Name:          file
-Version:       4.10
-Release:       1
+Version:       4.15
+Release:       2
 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: 09a6603dadbe06e577e98a2547201fab
 Source1:       zisofs.magic
 Source2:       http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2
 # Source2-md5: c157a183b64156f8baafaefd9cbf04c1
 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
+Patch2:                %{name}-unicode.patch
+Patch3:                %{name}-dicom.patch
+Patch4:                %{name}-lmagic.patch
+Patch5:                %{name}-python2.4.patch
+Patch6:                %{name}-greedy-dump.patch
+Patch7:                %{name}-stdin-noclose.patch
 BuildRequires: autoconf
 BuildRequires: automake
 BuildRequires: libtool
+%if %{with python}
+BuildRequires: python-devel
+BuildRequires: python-modules
+%endif
 Requires:      libmagic = %{version}-%{release}
+Conflicts:     rpm-build < 4.4.1-9
 Conflicts:     xdelta < 1.0.0
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -217,6 +229,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 +250,8 @@ Ten pakiet zawiera statyczn
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
+%patch6 -p1
+%patch7 -p1
 
 %build
 %{__libtoolize}
@@ -233,16 +260,36 @@ Ten pakiet zawiera statyczn
 %{__autoconf}
 %{__automake}
 %configure \
-       --enable-fsect-man5
+       --enable-fsect-man5 \
+       %{!?with_static_libs:--enable-static=no}
 
 %{__make}
 
+%if %{with python}
+cd python
+python setup.py build
+cd ..
+%endif
+
 %install
 rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT/%{_lib}
 
 %{__make} install \
        DESTDIR=$RPM_BUILD_ROOT
 
+mv $RPM_BUILD_ROOT%{_libdir}/libmagic.so.*.* $RPM_BUILD_ROOT/%{_lib}
+ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib} ; echo libmagic.so.*.*) \
+        $RPM_BUILD_ROOT%{_libdir}/libmagic.so
+
+%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 +312,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
@@ -281,7 +329,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files -n libmagic
 %defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/lib*.so.*.*
+%attr(755,root,root) /%{_lib}/lib*.so.*.*
 
 %files -n libmagic-devel
 %defattr(644,root,root,755)
@@ -290,6 +338,14 @@ rm -rf $RPM_BUILD_ROOT
 %{_includedir}/magic.h
 %{_mandir}/man3/*
 
+%if %{with static_libs}
 %files -n libmagic-static
 %defattr(644,root,root,755)
 %{_libdir}/lib*.a
+%endif
+
+%if %{with python}
+%files -n python-magic
+%defattr(644,root,root,755)
+%attr(755,root,root) %{py_sitedir}/*.so
+%endif
This page took 0.105183 seconds and 4 git commands to generate.