# # spec file for package file (Version 4.20) # # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine # package are under the same license as the package itself. # # Please submit bugfixes or comments via http://bugs.opensuse.org/ # # norootforbuild Name: file BuildRequires: zlib-devel URL: http://www.darwinsys.com/file/ License: Other uncritical OpenSource License Group: Productivity/File utilities Autoreqprov: on Version: 4.20 Release: 13 Summary: A Tool to Determine File Types Source: ftp://ftp.astron.com/pub/file/file-%{version}.tar.bz2 Patch: file-%{version}.dif Patch1: file-4.18-misc.dif Patch2: file-4.12-pcp.dif Patch3: file-4.20-exec.dif Patch4: file-4.06-autoconf.dif Patch5: file-4.03-tex.dif Patch6: file-4.13-netware.dif Patch7: file-4.20-ssd.dif Patch8: file-4.20-xen.dif Patch9: file-4.18-elf.dif Patch10: file-4.18-printf.dif Patch11: file-4.20-reg_startend.dif Patch12: file-4.20-unused.dif Patch13: file-4.20-reg_dos.dif Patch14: file-4.20-option.dif Patch20: file-4.16-mips.dif BuildRoot: %{_tmppath}/%{name}-%{version}-build %description With the file command, you can obtain information on the file type of a specified file. File type recognition is controlled by the file /etc/magic, which contains the classification criteria. This command is used by apsfilter to permit automatic printing of different file types. Authors: -------- Mark Moraes Christos Zoulas %package -n file-devel Summary: Include Files and Libraries mandatory for Development Group: Productivity/File utilities Provides: file:/usr/include/magic.h Requires: file = %{version}-%{release}, zlib-devel Autoreqprov: on %description -n file-devel This package contains all necessary include files and libraries needed to develop applications that require the magic "file" interface. Authors: -------- Mark Moraes Christos Zoulas %prep %setup -q %patch1 -p0 -b .misc %patch2 -p0 -b .pcp %patch3 -p0 -b .exec %patch4 -p0 -b .conf %patch5 -p0 -b .tex %patch6 -p0 -b .ntwr %patch7 -p0 -b .ssd %patch8 -p0 -b .xen %patch9 -p0 -b .elf %patch10 -p0 -b .prtf %patch11 -p0 -b .rse %patch12 -p0 -b .unused %patch13 -p0 -b .reg %patch14 -p0 -b .opt %ifarch mips %patch20 -p0 -b .mips %endif %patch %build export LANG=POSIX export LC_ALL=POSIX rm -f Magdir/*,v Magdir/*~ rm -f ltcf-c.sh ltconfig ltmain.sh libtoolize --automake 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 make pkgdatadir='$(datadir)' %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}/* %clean rm -rf $RPM_BUILD_ROOT #%pre #if test -L etc/magic; then # rm -f etc/magic #fi %files %defattr (644,root,root,755) %config(noreplace) /etc/magic #/usr/bin/dcore %attr(755,root,root) /usr/bin/file %{_libdir}/lib*.so.* /usr/share/misc/magic /usr/share/misc/magic.mgc /usr/share/misc/magic.mime /usr/share/misc/magic.mime.mgc %attr(644,root,root) %{_mandir}/man1/file.1.gz %attr(644,root,root) %{_mandir}/man5/magic.5.gz %files -n file-devel %defattr (644,root,root,755) %{_libdir}/lib*.a %{_libdir}/lib*.la %{_libdir}/lib*.so /usr/include/magic.h %attr(644,root,root) %{_mandir}/man3/libmagic.3.gz %changelog * Mon May 14 2007 - werner@suse.de - More on DoS attack with regex (bug #263754) - Avoid crash on unknown option and enable option `-e' * Mon Apr 16 2007 - werner@suse.de - Avoid DoS attack with regex (bug #263754) * Thu Apr 05 2007 - werner@suse.de - Avoid trouble with variable/macro on ppc64 * Mon Mar 26 2007 - rguenther@suse.de - Add zlib-devel BuildRequires * Wed Mar 21 2007 - werner@suse.de - Update to file 4.20 due security reason CVE-2007-1536 (#256290) * Tue Mar 06 2007 - rguenther@suse.de - Fix order of changelog entries * Thu Nov 23 2006 - werner@suse.de - Initialize variable in elf patch * Wed Nov 22 2006 - werner@suse.de - Update to new file 4.18 * Includes most of our extensions (elf, fifo, softmagic) * Mon Jun 12 2006 - werner@suse.de - Reenable file to display process name from a core dump (#183685) * Mon Mar 27 2006 - werner@suse.de - Add Mono/.Net identfiers to msdos magics (bug #159708) * Fri Mar 24 2006 - werner@suse.de - Update to file version 4.17 * This version supports new key like `search' and `regex' * Port our patches to this version * Wed Jan 25 2006 - mls@suse.de - converted neededforbuild to BuildRequires * Mon Jan 16 2006 - werner@suse.de - Add Xen magics * Tue Dec 06 2005 - werner@suse.de - Add Structured Storage Entry for PageMaker to local (bug #134895) * Thu Oct 20 2005 - werner@suse.de - Update to file version 4.16 * Tue Aug 23 2005 - werner@suse.de - Fix broken cracklib magic (bug #106007) * Mon Jul 25 2005 - werner@suse.de - Update to new file 4.14 - Split of the development version as own package * Fri Jul 01 2005 - werner@suse.de - Even for netware the columns in the magic entry are seperated by tabs - Add cracklib magics (bug #93673) * Mon Jun 13 2005 - mmj@suse.de - Add primitive magic for detecting netware loadable modules (NLMs) - Don't remove buildroot before install - Don't strip binaries explicitly - %%doc is implied by %%man * Thu Mar 17 2005 - werner@suse.de - Be sure that the pipe/fifo patch works (bug #73644) * Thu Mar 10 2005 - werner@suse.de - Be able to use the -s option even on pipes (bug #71074) - Do not hang on sockets or pipes not opened on the write side * Fri Feb 18 2005 - werner@suse.de - Update to file 4.13 for fixes in handling of bzip2 and DOS files - Do not be fooled by minix filesystems magics on jpeg files * Fri Nov 26 2004 - werner@suse.de - Update to file 4.12, this may fix a security issue (bug #48576) * Tue Sep 28 2004 - werner@suse.de - Correct PCP entries (bug #46111) * Thu Sep 16 2004 - werner@suse.de - Read HOWMANY bytes even from a pipe (reported by max) * Thu Aug 26 2004 - werner@suse.de - Update to bugfix release 4.09 * Tue Aug 24 2004 - lmuelle@suse.de - Add -fPIC to the CFLAGS. * Wed May 26 2004 - werner@suse.de - Don't trap into string formats if integers are provided (#41209) * Mon May 24 2004 - werner@suse.de - Check for random data within ELF header (bug #40909) * Thu Feb 12 2004 - werner@suse.de - Add name offsets for CORE dumps even for 64bit ELF (bug #34461) * Tue Jan 20 2004 - werner@suse.de - Update to 4.07 * Mon Dec 15 2003 - werner@suse.de - Add workaround for new automake `feature' of ignoring man pages - Ensure that the correct break condition is returned if readelf past the end of the buffer (bug #33644). * Mon Dec 08 2003 - werner@suse.de - Update to 4.06 - Use /etc/magic:/usr/share/misc/magic as magic and move /etc/magic to a real configuration file for _local_ settings (bug #32725). * Sat Oct 18 2003 - kukuk@suse.de - Add patch to detect policy file for SE Linux - Build as normal user - Clean up build root * Mon Sep 29 2003 - werner@suse.de - Avoid endless loop due wrong alignment in old ELF binaries * Tue Sep 16 2003 - werner@suse.de - Extend buffer from 64kb upto 68kB to find ReiserFS (bug #30736) * Wed Jul 02 2003 - werner@suse.de - Use _libdir * Tue Jul 01 2003 - werner@suse.de - Update to file 4.03 * Thu Apr 17 2003 - coolo@suse.de - use BuildRoot * Tue Mar 04 2003 - werner@suse.de - Fix buffer overflow in elf detection * Tue Dec 17 2002 - olh@suse.de - use RPM_BUILD_ROOT, not BUILD_ROOT in testsuite * Mon Nov 11 2002 - ro@suse.de - fix deprecated multiline string literal (from longopt patch) * Tue Sep 17 2002 - ro@suse.de - removed bogus self-provides * Tue Jul 23 2002 - werner@suse.de - Add mySQL bytes to magic (bug #16138) * Fri Jun 07 2002 - olh@suse.de - don't change the union u in readelf.c:tryelf() on ppc64 * Mon Feb 04 2002 - werner@suse.de - Fix looking of manual page * Mon Feb 04 2002 - werner@suse.de - Add some magics for METAFONT format files - Add inofficial long options for LSB * Thu Dec 27 2001 - adrian@suse.de - fix file output for mips binaries. The old output broke several ltconfig scripts in other packages and was wrong anyway. - recompress tar ball with bz2 * Wed Dec 19 2001 - werner@suse.de - update to version 3.37 * Sat Jun 30 2001 - bk@suse.de - update to version 3.33 - don't change the union u in readelf.c:tryelf() on s390x. - option i: fix one-byte memory underallocation - strcat adds '\0' * Thu Jun 07 2001 - werner@suse.de - Autoconf and Elf header: make it work again * Fri May 04 2001 - werner@suse.de - Make symlink /etc/magic a relative one * Tue Jan 16 2001 - werner@suse.de - Change order to find WAVE and TTF data before G3, apple and macintosh data. - Change string detection of PFM data to bit comparision masking out the third bit to make raw G3 work. * Sun Dec 03 2000 - schwab@suse.de - Don't match against artificial null byte. - Fix resource leaks. * Tue Nov 28 2000 - aj@suse.de - Add LFS support. * Tue Nov 14 2000 - werner@suse.de - Correct version handling of Linux/i386 Kernel setup header * Mon Nov 13 2000 - werner@suse.de - Fix handling of Microsoft Access Database in comparision with Digifax-G3-File. * Tue Oct 03 2000 - kukuk@suse.de - fix inclusion of config.h - Add group tag * Thu Sep 28 2000 - werner@suse.de - Move Magdir changes into misc dif - Remove exectuable from text scripts * Fri Sep 15 2000 - werner@suse.de - Update to version 3.32 * Tue Jun 20 2000 - werner@suse.de - /usr/lib/magic -> /usr/share/misc/magic * Thu Feb 03 2000 - schwab@suse.de - Ignore SHT_DYNSYM sections when deciding whether object is stripped. * Fri Jan 28 2000 - schwab@suse.de - Fix int32 vs long problem. * Thu Jan 27 2000 - schwab@suse.de - Fix non-ascii literal characters in string - Specfile cleanup, get rid of Makefile.Linux - /usr/man -> /usr/share/man * Thu Nov 25 1999 - schwab@suse.de - Fix location of magic file. * Tue Nov 23 1999 - kukuk@suse.de - Update to version 3.27 - Add patches for SPARC * Mon Sep 13 1999 - bs@suse.de - ran old prepare_spec on spec file to switch to new prepare_spec. * Tue Aug 24 1999 - uli@suse.de - added -fsigned-char to CFLAGS (PPC) * Wed Nov 04 1998 - ro@suse.de - disabled dcore (won't build with glibc-2.0) * Thu Oct 01 1998 - ro@suse.de - update to 3.26 - hacked dcore.c to build with glibc-2.1 * Fri Oct 10 1997 - florian@suse.de - add some more entries to magic * Wed Jun 25 1997 - florian@suse.de - add additional entries to recognize LaTeX files * Tue May 27 1997 - florian@suse.de - add some additional entries from mgetty/vgetty - add additional entries for CLISP and GNU gettext from Bruno Haible * Wed Jan 22 1997 - florian@suse.de - update to version 3.22 * Thu Jan 02 1997 - florian@suse.de - recognise german umlauts as text: dirty hack, but also call "setlocale" for correctly installed systems... - add "dcore"-program to show some information about core-files * Thu Jan 02 1997 - florian@suse.de - update to version 3.21 - mv /etc/magic /usr/lib/magic (/etc/magic is still a symlink to new location) * Thu Jan 02 1997 - florian@suse.de - added missing entries for G3-fax (from mgetty source)