OBS User unknown 2007-12-05 23:11:22 +00:00 committed by Git OBS Bridge
parent e4bd01ee6a
commit 8305bf534a
5 changed files with 115 additions and 33 deletions

13
file-4.16-python.dif Normal file
View File

@ -0,0 +1,13 @@
--- python/setup.py
+++ python/setup.py 2006-02-10 09:51:18.000000000 +0100
@@ -3,8 +3,8 @@
magic_module = Extension('magic',
libraries = ['magic'],
- library_dirs = ['./','../','../src','/usr/lib/'],
- include_dirs = ['./','../','../src','/usr/include/'],
+ library_dirs = ['./','../','../src/.libs','/usr/lib/'],
+ include_dirs = ['./','../','../src/','/usr/include/'],
sources = ['py_magic.c'])
setup (name = 'Magic file extensions',

9
file-4.21-xcursor.dif Normal file
View File

@ -0,0 +1,9 @@
--- magic/Localstuff
+++ magic/Localstuff 2007-12-05 11:31:15.494119630 +0100
@@ -33,3 +33,6 @@
# File magic for Scribus, an Open Source Desktop Publishing system
0 string \<SCRIBUSUTF8\ Version Scribus Document
0 string \<SCRIBUSUTF8NEW\ Version Scribus Document
+
+# File magic for X11 cursor data files
+0 string Xcur\020\000 X11 cursor data

View File

@ -1,6 +1,6 @@
--- .pkgextract
+++ .pkgextract 2006-03-27 13:29:19.000000000 +0200
@@ -0,0 +1,14 @@
@@ -0,0 +1,15 @@
+patch -p0 -s --suffix=.misc < ../file-4.18-misc.dif
+patch -p0 -s --suffix=.pcp < ../file-4.12-pcp.dif
+patch -p0 -s --suffix=.exec < ../file-4.20-exec.dif
@ -15,6 +15,7 @@
+patch -p0 -s --suffix=.opt < ../file-4.21-option.dif
+patch -p0 -s --suffix=.scri < ../file-4.21-scribus.dif
+patch -p0 -s --suffix=.awk < ../file-4.21-awk.dif
+patch -p0 -s --suffix=.xcur < ../file-4.21-xcursor.dif
--- magic/Header
+++ magic/Header 2006-03-27 13:29:19.000000000 +0200
@@ -1,5 +1,7 @@

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Dec 5 12:11:32 CET 2007 - werner@suse.de
- Add X11 cursor magic to Localstuff (bug #346132)
- New package python-magic, the python API for the libmagic
-------------------------------------------------------------------
Fri Aug 31 17:32:04 CEST 2007 - werner@suse.de

117
file.spec
View File

@ -11,13 +11,16 @@
# norootforbuild
Name: file
BuildRequires: zlib-devel
URL: http://www.darwinsys.com/file/
BuildRequires: findutils zlib-devel
%if %suse_version > 1030
BuildRequires: python-devel
%endif
Url: http://www.darwinsys.com/file/
License: Other uncritical OpenSource License
Group: Productivity/File utilities
Autoreqprov: on
AutoReqProv: on
Version: 4.21
Release: 3
Release: 16
Summary: A Tool to Determine File Types
Source: ftp://ftp.astron.com/pub/file/file-%{version}.tar.bz2
Patch: file-%{version}.dif
@ -35,8 +38,12 @@ Patch11: file-4.21-reg_dos.dif
Patch12: file-4.21-option.dif
Patch13: file-4.21-scribus.dif
Patch14: file-4.21-awk.dif
Patch15: file-4.21-xcursor.dif
Patch20: file-4.16-mips.dif
Patch21: file-4.16-python.dif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%global _sysconfdir /etc
%global _miscdir %{_datadir}/misc
%description
With the file command, you can obtain information on the file type of a
@ -53,10 +60,10 @@ Authors:
%package -n file-devel
Summary: Include Files and Libraries mandatory for Development
Group: Productivity/File utilities
Group: Development/Libraries/Other
Provides: file:/usr/include/magic.h
Requires: file = %{version}-%{release}, zlib-devel
Autoreqprov: on
AutoReqProv: on
%description -n file-devel
This package contains all necessary include files and libraries needed
@ -69,6 +76,26 @@ Authors:
Mark Moraes <moraes@deshaw.com>
Christos Zoulas <christos@deshaw.com>
%if %suse_version > 1030
%package -n python-magic
Summary: Python module to use libmagic
Group: Development/Languages/Python
Requires: python-base = %{py_ver}
%description -n python-magic
This package contains the python binding that require the magic "file"
interface.
Authors:
--------
Mark Moraes <moraes@deshaw.com>
Christos Zoulas <christos@deshaw.com>
%endif
%prep
%setup -q
%patch1 -p0 -b .misc
@ -85,9 +112,13 @@ Authors:
%patch12 -p0 -b .opt
%patch13 -p0 -b .scri
%patch14 -p0 -b .awk
%patch15 -p0 -b .xcur
%ifarch mips
%patch20 -p0 -b .mips
%endif
%if %suse_version > 1030
%patch21 -p0 -b .python
%endif
%patch
%build
@ -100,41 +131,54 @@ aclocal
automake
autoconf
CFLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64 -DHOWMANY=69632 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -fPIC" \
./configure --prefix=/usr --datadir='${prefix}/share/misc' --mandir=%{_mandir} \
-libdir=%{_libdir} --sysconfdir=/etc --enable-fsect-man5
./configure --prefix=%{_prefix} --datadir=%{_miscdir} --mandir=%{_mandir} \
--libdir=%{_libdir} --sysconfdir=%{_sysconfdir} --enable-fsect-man5
make pkgdatadir='$(datadir)'
%if %suse_version > 1030
pushd python
python setup.py build
popd
%endif
%install
export LANG=POSIX
export LC_ALL=POSIX
make DESTDIR=$RPM_BUILD_ROOT install pkgdatadir='$(datadir)'
mkdir -p $RPM_BUILD_ROOT/etc
rm -f $RPM_BUILD_ROOT/etc/magic
echo '# Localstuff: file(1) magic(5) for locally observed files' > $RPM_BUILD_ROOT/etc/magic
echo '# global magic file is /usr/share/misc/magic(.mgc)' >> $RPM_BUILD_ROOT/etc/magic
#install -s dcore $RPM_BUILD_ROOT/usr/bin/
# Check the binary does not bail out:
LD_LIBRARY_PATH=${RPM_BUILD_ROOT}%{_libdir} \
${RPM_BUILD_ROOT}/usr/bin/file -m ${RPM_BUILD_ROOT}/usr/share/misc/magic \
${RPM_BUILD_ROOT}/usr/bin/file /usr/bin/* /%{_lib}/* /usr/%{_lib}/*
rm -rf %{buildroot}
mkdir %{buildroot}
mkdir %{buildroot}/etc
make DESTDIR=%{buildroot} install pkgdatadir='$(datadir)'
rm -vf %{buildroot}%{_sysconfdir}/magic
echo '# Localstuff: file(1) magic(5) for locally observed files' > %{buildroot}%{_sysconfdir}/magic
echo '# global magic file is %{_miscdir}/magic(.mgc)' >> %{buildroot}%{_sysconfdir}/magic
#install -s dcore %{buildroot}%{_bindir}
%if %suse_version > 1030
pushd python
python setup.py install --root=%{buildroot} \
--prefix=%{_prefix} \
--record-rpm=../python_files
popd
%endif
# Check out that the binary does not bail out:
LD_LIBRARY_PATH=%{buildroot}%{_libdir}
export LD_LIBRARY_PATH
find %{buildroot}%{_bindir}/file %{_bindir}/ /%{_lib}/ %{_libdir}/ | \
xargs %{buildroot}%{_bindir}/file -m %{buildroot}%{_miscdir}/magic
unset LD_LIBRARY_PATH
%clean
rm -rf $RPM_BUILD_ROOT
#%pre
#if test -L etc/magic; then
# rm -f etc/magic
#fi
%post -n file -p /sbin/ldconfig
%postun -n file -p /sbin/ldconfig
%files
%defattr (644,root,root,755)
%config(noreplace) /etc/magic
#/usr/bin/dcore
%attr(755,root,root) /usr/bin/file
%config(noreplace) %{_sysconfdir}/magic
#%{_bindir}/dcore
%attr(755,root,root) %{_bindir}/file
%{_libdir}/lib*.so.*
/usr/share/misc/magic
/usr/share/misc/magic.mgc
/usr/share/misc/magic.mime
/usr/share/misc/magic.mime.mgc
%{_miscdir}/magic
%{_miscdir}/magic.mgc
%{_miscdir}/magic.mime
%{_miscdir}/magic.mime.mgc
%attr(644,root,root) %{_mandir}/man1/file.1.gz
%attr(644,root,root) %{_mandir}/man5/magic.5.gz
@ -143,10 +187,19 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/lib*.a
%{_libdir}/lib*.la
%{_libdir}/lib*.so
/usr/include/magic.h
%{_includedir}/magic.h
%attr(644,root,root) %{_mandir}/man3/libmagic.3.gz
%if %suse_version > 1030
%files -n python-magic -f python_files
%defattr(-,root,root)
%doc python/README python/example.py
%endif
%changelog
* Wed Dec 05 2007 - werner@suse.de
- Add X11 cursor magic to Localstuff (bug #346132)
- New package python-magic, the python API for the libmagic
* Fri Aug 31 2007 - werner@suse.de
- Make regex for awk more robust to avoid conflict with PostScript,
thanks goes to Werner Lemberg for the report