8
0
Files
perl-File-Unpack/perl-File-Unpack.spec

211 lines
6.0 KiB
RPMSpec

#
# spec file for package perl-File-Unpack (Version 0.20)
#
# Copyright (c) 2010 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/
# See also http://wiki.opensuse.org/openSUSE:Packaging_Perl
# norootforbuild
Name: perl-File-Unpack
Version: 0.37
Release: 0%{?dist}
License: GPL+ or Artistic
Group: Development/Libraries/Perl
Summary: An aggressive archive file unpacker, based on mime-types
Source: http://search.cpan.org/CPAN/authors/id/J/JN/JNW/File-Unpack-%{version}.tar.bz2
Url: http://search.cpan.org/dist/File-Unpack
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
BuildRequires: perl(Test::More)
BuildRequires: perl(Test::Pod)
BuildRequires: perl(Test::Pod::Coverage)
BuildRequires: perl(Test::CheckManifest)
BuildRequires: perl(Carp)
BuildRequires: perl(Cwd)
BuildRequires: perl(File::Path)
BuildRequires: perl(File::Compare)
BuildRequires: perl(File::Temp)
BuildRequires: perl(File::LibMagic)
BuildRequires: perl(File::MimeInfo::Magic)
BuildRequires: perl-macros
%if 0%{?suse_version} > 1110
# SLES11 does does not have this:
BuildRequires: perl(Compress::Raw::Lzma)
%endif
BuildRequires: perl(Compress::Raw::Bzip2)
BuildRequires: perl(Compress::Raw::Zlib) >= 2.024
BuildRequires: perl(BSD::Resource)
BuildRequires: perl(Filesys::Statvfs)
BuildRequires: perl(String::ShellQuote)
BuildRequires: perl(JSON)
BuildRequires: perl(IPC::Run)
BuildRequires: perl(Text::Sprintf::Named)
# shared-mime-info is a dependency of perl-File-MimeInfo
# file is a dependency of perl-File-LibMagic
BuildRequires: shared-mime-info >= 0.60
BuildRequires: file >= 5.03, fdupes
Requires: perl(Carp)
Requires: perl(Cwd)
Requires: perl(File::Path)
Requires: perl(File::Temp)
Requires: perl(File::LibMagic)
Requires: perl(File::MimeInfo::Magic)
%if 0%{?suse_version} >= 1110
# SLES11 does does not have this:
Requires: perl(Compress::Raw::Lzma)
%endif
Requires: perl(Compress::Raw::Bzip2)
Requires: perl(Compress::Raw::Zlib)
# 2.024 is provided by perl-5.12.1 in 11.3
Requires: perl(Compress::Raw::Zlib) >= 2.024
Requires: perl(BSD::Resource)
Requires: perl(Filesys::Statvfs)
Requires: perl(String::ShellQuote)
Requires: perl(JSON)
Requires: perl(IPC::Run)
Requires: perl(Text::Sprintf::Named)
Requires: shared-mime-info >= 0.60
Requires: file >= 5.03
## refer to Unpack.pm:@builtin_mime_handlers and to the helper subdirectory
## to see what we might need:
# grep '# Requires: ' Unpack.pm helper/*
%if 0%{?suse_version} > 1110
# 11.1 and SLES11 say: unresolvable: nothing provides xz
BuildRequires: xz
%endif
%if 0%{?suse_version} > 1010
# SLES10 says: nothing provides poppler-tools
BuildRequires: poppler-tools
%endif
BuildRequires: cpio tar unzip rpm bzip2 sharutils binutils
## you may change the following into Recommends, if you cannot provide them.
Requires: gzip bzip2 cpio tar unzip rpm binutils poppler-tools
Requires: xz sharutils
Recommends: unrar
Requires: p7zip cabextract upx genisoimage
%{perl_requires}
Requires: file_unpack == %version
%description
File::Unpack is an unpacker for archive files
(bz2/gz/zip/tar/cpio/rpm/deb/cab/lzma/7z/rar/...) based on mime-types. We call
it aggressive, because it recursivly descends into any freshly unpacked
file, if it appears to be an archive itself. It also uncompresses files where
needed. The ultimate goal of File::Unpack is to extract as much readable text
(ascii or any other encoding) as possible. Most of the known archive file
formats are supported. It allows simple plugins to add more.
Authors:
--------
Juergen Weigert <jw@suse.de>
%package -n file_unpack
Summary: Command line tool to unpack anything
Requires: perl(File::Unpack) == %version
Group: Productivity/Archiving/Compression
BuildArch: noarch
%description -n file_unpack
/usr/bin/file_unpack is a trivial command line frontend that
ships with the File::Unpack perl module.
Authors:
--------
Juergen Weigert <jw@suse.de>
%prep
%setup -q -n File-Unpack-%{version}
%build
if [ -f Build.PL ]; then
%{__perl} Build.PL --installdirs vendor
else
%{__perl} Makefile.PL INSTALLDIRS=vendor
fi
if [ -f Build.PL ]; then
./Build build flags=%{?_smp_mflags}
else
%{__make} %{?_smp_mflags}
fi
%install
if [ -f Build.PL ]; then
./Build pure_install --destdir %{buildroot}
else
%{__make} pure_install PERL_INSTALL_ROOT=%{buildroot}
fi
install -D file_unpack.pl $RPM_BUILD_ROOT/usr/bin/file_unpack
install -d $RPM_BUILD_ROOT/usr/share/File-Unpack/helper/
install helper/* $RPM_BUILD_ROOT/usr/share/File-Unpack/helper/
%fdupes $RPM_BUILD_ROOT/usr/share/File-Unpack/
ln -s /usr/bin/file_unpack $RPM_BUILD_ROOT/usr/bin/unpack_file
## CAUTION: a line beginning with . is a macro-expanded by nroff.
echo .nf > file_unpack.1
perl -Iblib/lib file_unpack.pl --help >> file_unpack.1 && true
install -m0644 -D file_unpack.1 $RPM_BUILD_ROOT/%_mandir/man1/file_unpack.1
ln -s %_mandir/man1/file_unpack.1 $RPM_BUILD_ROOT/%_mandir/man1/unpack_file.1
rm -rf file_unpack.1
# FIXME: use ./Build install destdir=$RPM_BUILD_ROOT create_packlist=0
# maybe then we would not need to remove the .packlist files :-)
find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
find %{buildroot} -depth -type d -exec rmdir {} 2>/dev/null ';'
%{_fixperms} %{buildroot}/*
%perl_process_packlist
%perl_gen_filelist
%check
export RELEASE_TESTING=1
# echo >> MANIFEST.SKIP
# echo >> MANIFEST.SKIP ^PERCENT{name}\.files\$
if [ -f Build.PL ]; then
./Build test
else
%{__make} test
fi
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && %{__rm} -rf $RPM_BUILD_ROOT
%files -f %{name}.files
%defattr(-,root,root,-)
%doc README Changes
/usr/share/File-Unpack
/usr/share/File-Unpack/*
%files -n file_unpack
%defattr(-,root,root)
/usr/bin/file_unpack
/usr/bin/unpack_file
%doc %_mandir/man1/*
%changelog
* Tue Aug 24 2010 jw@suse.de
- initial SUSE packaging
- generated with cpan2dist (CPANPLUS::Dist::SUSE version 0.0.8)