Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37403380
en ru br
ALT Linux repos
S:5.45-alt1
D:4.20-alt5.1
5.0: 4.26-alt2
4.1: 4.20-alt5
4.0: 4.20-alt5
3.0: 4.13-alt1

Other repositories
Upstream:4.23

Group :: File tools
RPM: file

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Name: file
Version: 4.20
Release: alt5

Summary: A utility for determining file types
License: BSD-style
Group: File tools
Url: http://www.darwinsys.com/file/
Packager: Dmitry V. Levin <ldv at altlinux.org>

Summary(ru_RU.KOI8-R): Утилита для определения типов файлов
Requires: libmagic = %version-%release
BuildPreReq: zlib-devel

# ftp://ftp.astron.com/pub/file/file-%version.tar.gz

Source: file-%version.tar
Source1: magic.local

Patch: file-%version-%release.patch

%def_enable static

%description
The file command is used to identify a particular file according to the
type of data contained by the file.  file can identify many different
file types, including ELF binaries, system libraries, RPM packages, and
different graphics formats.

%package -n libmagic
Summary: Shared library for handling magic files
Group: System/Libraries

%description -n libmagic
This package contains shared library for handling magic files.

%package -n libmagic-devel
Summary: Development files to build applications that handle magic files
Group: Development/C
Requires: libmagic = %version-%release

%description -n libmagic-devel
This package contains development files to build applications that handle
magic files.

%package -n libmagic-devel-static
Summary: Static library to build statically linked applications that handle magic files
Group: Development/C
Requires: libmagic-devel = %version-%release

%description -n libmagic-devel-static
This package contains static library to build statically linked
applications that handle magic files.

%prep
%setup -q
%patch -p1

%build
autoreconf -fisv
%configure --enable-fsect-man5 %{subst_enable static}
grep -FZl sparc magic/Magdir/* |
xargs -r0 %__subst -p 's/sparc/SPARC/g' --
# SMP-incompatible build.
%make

%install
%makeinstall
install -pDm644 doc/magic.5 %buildroot%_man5dir/magic.5
install -pDm644 %_sourcedir/magic.local %buildroot%_sysconfdir/magic

# Test for correct identification of Perl modules

find /usr/*/perl5 -type f -name '*.p[lmh]' |
LD_LIBRARY_PATH=%buildroot%_libdir %buildroot%_bindir/file \
-m %buildroot%_datadir/file/magic -f - >test.out
grep -q ' [Pp]erl.* text' test.out
grep -v ' text' test.out && exit 1

# Provide %_datadir/magic/ for compatibility.

mkdir -p %buildroot%_datadir/magic
ln -s ../file/magic{,.mime} %buildroot%_datadir/magic/

%post -n libmagic -p %post_ldconfig
%postun -n libmagic -p %postun_ldconfig

%files
%config(noreplace) %_sysconfdir/magic
%_bindir/*
%_datadir/%name
%_datadir/magic
%_man1dir/*
%_man5dir/*
%doc ChangeLog LEGAL.NOTICE MAINT README

%files -n libmagic
%_libdir/*.so.*

%files -n libmagic-devel
%_libdir/*.so
%_includedir/*
%_man3dir/*

%if_enabled static
%files -n libmagic-devel-static
%_libdir/*.a
%endif

%changelog

Full changelog you can see here

 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin