# Detect the distribution in use %global __despace head -n 1 | tr -d '[:space:]' | sed -e 's/[(].*[)]//g' %global __lower4 cut -c 1-4 | tr '[:upper:]' '[:lower:]' %global __distfile %([ -f /etc/SuSE-release ] && echo /etc/SuSE-release || echo /etc/redhat-release) %global __distinit %(sed -e 's/ release .*//' -e 's/\\([A-Za-z]\\)[^ ]*/\\1/g' %{__distfile} | %{__despace} | %{__lower4}) %global __distvers %(sed -e 's/.* release \\([^. ]*\\).*/\\1/' %{__distfile} | %{__despace}) # Identify Alma, CentOS, CentOS Stream and Rocky Linux as rhel %if "%{__distinit}" == "a" || "%{__distinit}" == "c" || "%{__distinit}" == "cl" || "%{__distinit}" == "cs" || "%{__distinit}" == "rl" %global __distinit rhel %endif # Dist tag for Fedora is still "fc" %if "%{__distinit}" == "f" %global __distinit fc %endif # TODO: BR: perl(Proc::ProcessTable) when available Summary: Modules for parsing and creating MIME entities in Perl Name: perl-MIME-tools Epoch: 1 Version: 5.515 Release: 3.%{__distinit}%{__distvers} License: GPL-1.0-or-later OR Artistic-1.0-Perl URL: https://metacpan.org/release/MIME-tools Source0: https://cpan.metacpan.org/modules/by-module/MIME/MIME-tools-%{version}.tar.gz Patch0: MIME-tools-5.510-UTF8.patch BuildArch: noarch # ================ Module Build ====================== BuildRequires: coreutils BuildRequires: findutils BuildRequires: make BuildRequires: perl-generators BuildRequires: perl-interpreter BuildRequires: perl(ExtUtils::MakeMaker) BuildRequires: perl(FindBin) BuildRequires: perl(Pod::Man) # ================ Module Runtime ==================== BuildRequires: perl-MailTools >= 1.50 BuildRequires: perl(Carp) BuildRequires: perl(Convert::BinHex) BuildRequires: perl(Encode) BuildRequires: perl(Exporter) BuildRequires: perl(File::Path) >= 1 BuildRequires: perl(File::Spec) >= 0.6 BuildRequires: perl(File::Temp) >= 0.18 BuildRequires: perl(IO::File) >= 1.13 BuildRequires: perl(IO::Handle) BuildRequires: perl(IO::Select) BuildRequires: perl(Mail::Field) >= 1.05 BuildRequires: perl(Mail::Header) >= 1.06 BuildRequires: perl(Mail::Internet) >= 1.28 BuildRequires: perl(MIME::Base64) >= 3.03 BuildRequires: perl(MIME::QuotedPrint) BuildRequires: perl(version) # ================ Test Suite ======================== BuildRequires: perl(Cwd) BuildRequires: perl(Digest::MD5) BuildRequires: perl(Exporter) BuildRequires: perl(IO::Socket::INET) BuildRequires: perl(lib) BuildRequires: perl(Test::Deep) BuildRequires: perl(Test::More) BuildRequires: perl(Test::Pod) BuildRequires: perl(Test::Pod::Coverage) # ================ Dependencies ====================== %if 0%{?fedora} < 38 && 0%{?rhel} < 10 Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) %endif Requires: perl(Convert::BinHex) # Currently fails a couple of kwalitee tests BuildConflicts: perl(Test::Kwalitee) %description MIME-tools - modules for parsing (and creating!) MIME entities. Modules in this toolkit: Abstract message holder (file, scalar, etc.), OO interface for decoding MIME messages, an extracted and decoded MIME entity, Mail::Field subclasses for parsing fields, a parsed MIME header (Mail::Header subclass), parser and tool for building your own MIME parser, and utilities. %prep %setup -q -n MIME-tools-%{version} # Fix character encoding %patch -P 0 # The more useful examples will go in %%{_bindir} mkdir useful-examples mv examples/mime{dump,encode,explode,postcard,send} useful-examples/ %build perl Makefile.PL INSTALLDIRS=vendor make %{?_smp_mflags} %install make pure_install DESTDIR=%{buildroot} find %{buildroot} -type f -name .packlist -delete %{_fixperms} -c %{buildroot} # Put the more useful examples in %%{_bindir} install -d -m 755 %{buildroot}%{_bindir} install -d -m 755 %{buildroot}%{_mandir}/man1 cd useful-examples for ex in mime* do install -p -m 755 ${ex} %{buildroot}%{_bindir}/ pod2man ${ex} > %{buildroot}%{_mandir}/man1/${ex}.1 done cd - %check # POD Coverage test fails due to lots of undocumented routines TEST_POD_COVERAGE=0 make test %files %license COPYING %doc README ChangeLog # Adding examples introduces additional deps, but these are all satisfied by # perl, perl-MIME-tools, and perl-MailTools, which are all deps anyway. %doc examples/ %{perl_vendorlib}/MIME/ %{_bindir}/mimedump %{_bindir}/mimeencode %{_bindir}/mimeexplode %{_bindir}/mimepostcard %{_bindir}/mimesend %{_mandir}/man1/mimedump.1* %{_mandir}/man1/mimeencode.1* %{_mandir}/man1/mimeexplode.1* %{_mandir}/man1/mimepostcard.1* %{_mandir}/man1/mimesend.1* %{_mandir}/man3/MIME::Body.3* %{_mandir}/man3/MIME::Decoder.3* %{_mandir}/man3/MIME::Decoder::Base64.3* %{_mandir}/man3/MIME::Decoder::BinHex.3* %{_mandir}/man3/MIME::Decoder::Binary.3* %{_mandir}/man3/MIME::Decoder::Gzip64.3* %{_mandir}/man3/MIME::Decoder::NBit.3* %{_mandir}/man3/MIME::Decoder::QuotedPrint.3* %{_mandir}/man3/MIME::Decoder::UU.3* %{_mandir}/man3/MIME::Entity.3* %{_mandir}/man3/MIME::Field::ConTraEnc.3* %{_mandir}/man3/MIME::Field::ContDisp.3* %{_mandir}/man3/MIME::Field::ContType.3* %{_mandir}/man3/MIME::Field::ParamVal.3* %{_mandir}/man3/MIME::Head.3* %{_mandir}/man3/MIME::Parser.3* %{_mandir}/man3/MIME::Parser::Filer.3* %{_mandir}/man3/MIME::Parser::Reader.3* %{_mandir}/man3/MIME::Parser::Results.3* %{_mandir}/man3/MIME::Tools.3* %{_mandir}/man3/MIME::WordDecoder.3* %{_mandir}/man3/MIME::Words.3* %changelog * Sun Jan 19 2025 Paul Howarth - 1:5.515-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild * Sun Jul 21 2024 Paul Howarth - 1:5.515-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild * Fri Apr 26 2024 Paul Howarth - 1:5.515-1 - Update to 5.515 - Fix the "version" setting in META.yml (no functional changes) * Wed Feb 7 2024 Paul Howarth - 1:5.514-1 - Update to 5.514 - Move the guts of the ambiguous_content method to MIME::Head - Add MIME::Entity->ambiguous_content that returns true if this entity or any of its parts, recursively, has a MIME::Head whose ambiguous_content method returns true - Keep MIME::Parser->ambiguous_content as a cached version of the most recently parsed $entity->ambiguous_content - Add some missing files to MANIFEST * Fri Jan 26 2024 Paul Howarth - 1:5.513-1 - Update to 5.513 - Add MIME::Parser->ambiguous_content to indicate one of several types of ambiguous MIME content that could be security risks - Add the '@duplicate_parameters' pseudo-parameter to let caller detect duplicate MIME parameters on a MIME header * Tue Jan 9 2024 Paul Howarth - 1:5.512-1 - Update to 5.512 - Use much larger chunk sizes for Base-64 encoding, which reduces both encoding time and space overhead (CPAN RT#128400, CPAN RT#130110) * Wed Jan 3 2024 Paul Howarth - 1:5.511-1 - Update to 5.511 - Silence a warning if used with a development version of MIME::QuotedPrint (CPAN RT#149225, CPAN RT#150118) * Fri Jan 20 2023 Paul Howarth - 1:5.510-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Thu Jul 7 2022 Paul Howarth - 1:5.510-1 - Update to 5.510 - Update author contact info - Make code work in taint mode - Clarify MIME::Entity documentation - Use %%license unconditionally * Tue Mar 10 2020 Paul Howarth - 1:5.509-11 - Makefile.PL requires FindBin * Sat Jun 8 2019 Paul Howarth - 1:5.509-8 - Perl 5.30 rebuild * Fri Apr 27 2018 Paul Howarth - 1:5.509-2 - BR: perl-generators unconditionally - BR: perl-interpreter rather than perl * Thu Apr 6 2017 Paul Howarth - 1:5.509-1 - Update to 5.509 - Makefile.PL failed with no '.' in @INC (CPAN RT#120871) - Test t/Ref.t failed on Windows install (CPAN RT#118262) - MIME::Parser::parse_data() should check what it gets back (CPAN RT#119166) - Allow \r\n to be used as line-end delimiter when outputting MIME message (CPAN RT#119568) - Drop support for EOL distributions prior to F-13 - Drop BuildRoot: and Group: tags - Drop explicit buildroot cleaning in %%install section - Drop explicit %%clean section * Tue Aug 30 2016 Paul Howarth - 1:5.508-1 - Update to 5.508 - Fix test broken by Perl update (CPAN RT#113887) - BR: perl-generators where available * Fri Apr 22 2016 Paul Howarth - 1:5.507-2 - Work around behaviour change in MailTools > 2.14 (#1329082, CPAN RT#113887) - Simplify find command using -delete * Wed Sep 30 2015 Paul Howarth - 1:5.507-1 - Update to 5.507 - Fix parsing bug (CPAN RT#105455) - Fix typo that broke MIME::Body::incore->open() on Perl 5.20 * Mon Jun 29 2015 Paul Howarth - 1:5.506-3 - Perl 5.22 rebuild * Thu Apr 23 2015 Paul Howarth - 1:5.506-1 - Update to 5.506 - Update maintainer's name to "Dianne Skoll" - Use %%license where possible - Update UTF8 patch - Require perl(Convert::BinHex) to support BinHex-encoded mail * Tue Sep 16 2014 Paul Howarth - 1:5.505-3 - Perl 5.20 rebuild * Thu Nov 14 2013 Paul Howarth - 1:5.505-1 - Update to 5.505 - Fix documentation typos (CPAN RT#80473, CPAN RT#87783) - Fix broken test (CPAN RT#84668) - Don't run Kwalitee tests unless author or release tests are enabled (CPAN RT#87094) - Fix bug in header parsing that would fail to parse a header like: Content-Type: ; name="malware.zip" * Thu Jul 25 2013 Paul Howarth - 1:5.504-2 - Don't try to run the kwalitee test, as it fails a couple of kwalitee metrics with Test::Kwalitee 1.09 * Thu Jan 31 2013 Paul Howarth - 1:5.504-1 - Update to 5.504 - Fix encoding of MIME parameters that contain a quoted string: "like \"this" (CPAN RT#80433) - Suppress useless warnings from tests (CPAN RT#80679) - Fix long-standing bug in encode_mimewords that can break multi-byte encodings such as UTF-8 (CPAN RT#5462) * Thu Jul 12 2012 Paul Howarth - 1:5.503-2 - Classify buildreqs by usage - BR: perl(Carp), perl(Convert::BinHex), perl(Encode), perl(Exporter) and perl(IO::Select) for the module - BR: perl(Cwd), perl(Digest::MD5), perl(Exporter), perl(IO::Socket::INET) and perl(lib) for the test suite - Drop explicit perl(Convert::BinHex) requirement as it's auto-detected * Fri Jun 8 2012 Paul Howarth - 1:5.503-1 - Update to 5.503 - Avoid inappropriately untainting data (CPAN RT#67119) - Localise $\ to avoid parsing problems if it's set elsewhere (CPAN RT#71041) - Improve exorcising of filenames (CPAN RT#71677) - Fix potential race condition in t/Smtpsend.t (CPAN RT#68879) - Allow native I/O on File::Handle objects (CPAN RT#72538) - Add "recommends Convert::BinHex" clause to Makefile.PL (CPAN RT#72223) - Add module_name to Makefile.PL (CPAN RT#77138) - Fix "Uninitialized value" warning (CPAN RT#77190) - Don't run t/Smtpsend.t on systems that lack fork() (CPAN RT#77351) - Add "use strict" everywhere (CPAN RT#77582) - Don't need to remove empty directories from the buildroot - Drop %%defattr, redundant since rpm 4.4 - Require perl(Convert::BinHex) to support BinHex-encoded mail * Wed Oct 26 2011 Paul Howarth - 1:5.502-4 - Use patch rather than scripted iconv to fix character encoding - Use DESTDIR rather than PERL_INSTALL_ROOT - Nobody else likes macros for commands - Use %%{_fixperms} macro rather than our own chmod incantation - Explicitly specify all manpages in %%files list * Tue Jun 28 2011 Paul Howarth - 1:5.502-2 - Rebuild for perl 5.14.1 in Rawhide - Use DESTDIR rather than PERL_INSTALL_ROOT - Nobody else likes macros for commands - Fix dist tag for CentOS 6 and Scientific Linux * Tue Mar 8 2011 Paul Howarth - 1:5.502-1 - Update to 5.502 - Fix parsing bug (CPAN RT#66025) - Fix typo (CPAN RT#65387) - Fix unit tests on Perl 5.8.x (CPAN RT#66188) - Fix unit test failure on Win32 (CPAN RT#66286) * Thu Feb 17 2011 Paul Howarth - 1:5.501-1 - Update to 5.501 - Add build_requires 'Test::Deep'; to Makefile (CPAN RT#64659) - Fix spelling errors (CPAN RT#64610) - Fix double-decoding bug when decoding RFC-2231-encoded parameters (CPAN RT#65162) - Fix inappropriate inclusion of CR characters in parsed headers (CPAN RT#65681) - Document that MIME::WordDecoder is mostly deprecated - Document that MIME::Head->get(...) can include a trailing newline - Increase buffer size from 2kB to 8kB in MIME::Entity and MIME::Body (part of CPAN RT#65162) - This release by DSKOLL -> update source URL * Mon Jan 10 2011 Paul Howarth - 1:5.500-1 - Update to 5.500 - Cleanup: IO-Stringy is no longer used - Cleanup: remove auto_install from Makefile.PL - RT#22684: fix deadlock in filter() when invoking external programs such as gzip - RT#60931: if preamble is empty, make sure it's still empty after round-tripping through MIME::Entity - RT#63739: properly decode RFC2231 encodings in attachment filenames - New build requirements: - perl(IO::Handle) - perl(Mail::Field) >= 1.05 - perl(Mail::Header) >= 1.01 - perl(Mail::Internet) >= 1.0203 - perl(Test::Deep) - Unconditionally buildrequire perl(Test::Kwalitee) as it's in EPEL-6 - Drop buildreq perl(IO::Stringy) - The Makefile.PL --skipdeps option is no longer needed * Fri Jun 25 2010 Paul Howarth - 1:5.428-3 - Rebuild for perl 5.12.1 in Rawhide * Fri May 7 2010 Paul Howarth - 1:5.428-2 - Fix dist tag to work with RHEL6 Beta - Only BR: perl(Test::Kwalitee) in Fedora so we can build for RHEL-6 * Thu Apr 22 2010 Paul Howarth - 1:5.428-1 - Update to 5.428 - RT#56764: build release with a newer Module::Install - RT#52924: ensure we add <> around Content-id data - RT#48036: make mimesend example script a bit more useful - RT#43439: fix for parsing of doubled ; in multipart headers - RT#41632: if RFC-2231 and non-RFC-2231 params present, use only RFC-2231 - RT#40715: reference Encode::MIME::Header in docs - RT#39985: correct POD typos - Only bind to localhost in smtpsend test, not all interfaces - Specify --skipdeps in Makefile.PL invocation to prevent use of CPAN module - Buildreq perl(Test::Kwalitee) for additional test coverage * Sat Feb 27 2010 Paul Howarth - 1:5.427-3 - Dist tag for Rawhide no longer needs special-casing * Mon Sep 21 2009 Paul Howarth - 1:5.427-2 - Define RPM macros in global scope * Thu Nov 13 2008 Paul Howarth - 1:5.427-1 - Update to 5.427 - Add POD tests, coverage disabled because of lack of coverage from upstream - New upstream maintainer -> updated URL for source - Buildreq perl(File::Path) >= 1, perl(File::Spec) >= 0.6, perl(File::Temp) >= 0.18, perl(IO::File) >= 1.13, perl(IO::Stringy) >= 2.110, perl(MIME::Base64) >= 3.03 - Buildreq perl(Test::Pod) and perl(Test::Pod::Coverage) for test suite - Dispense with hacks for supporting builds with perl(MIME::Base64) < 3.03 - Only include README as %%doc, not README* - Dispense with provides filter, no longer neede * Thu Nov 13 2008 Paul Howarth - 1:5.420-5 - Tweak dist tag macros to work on current Rawhide with three-part releasenum * Fri Nov 30 2007 Paul Howarth - 1:5.420-4 - Clarify license as GPL version 1 or later, or Artistic (i.e. same as perl) - Buildrequire perl(Test::More) - Add note explaining why we're stuck at an old version - Install the more useful examples in %%{_bindir} (#201691) * Sun Mar 18 2007 Paul Howarth - 1:5.420-2 - Fix dist tag for development builds - Add buildreq perl(ExtUtils::MakeMaker) - Fix argument order for find with -depth - Define %%{__id_u} in a more portable way * Mon Mar 20 2006 Paul Howarth - 1:5.420-1 - Support build on CentOS - Update to 5.420 - Simplify provides-filter * Tue Jan 17 2006 Paul Howarth - 1:5.419-2 - Convert ChangeLog to UTF8 encoding - Don't provide perl(main) * Fri Dec 23 2005 Paul Howarth - 1:5.419-1 - Update to 5.419 - Simplify distribution-detection - Remove __perl_version and __perl_package macros for clarity - Unonditionally remove buildroot in %%clean & %%install - Don't use macros in paths for build-time commands, hardcode them instead * Tue Oct 4 2005 Paul Howarth - 1:5.418-1 - Update to 5.418 - Fix directory ownerships - Remove redundant find of empty .bs files - Remove redundant setting of optimization flags - Tidy up buildreqs * Wed May 25 2005 Paul Howarth - 1:5.417-3 - Rewrite spec file in (mainly) Fedora Extras style - Include full URL for source - Fix URL - Use MODULE_COMPAT dependency style and remove explicit perl dependency - Remove MANIFEST from %%doc - Use MIME::Base64 instead of MIME::XBase64 if it's sufficiently recent * Thu Jan 27 2005 Paul Howarth - 1:5.417-2 - Bumped epoch number to 1 so that this version appears to be more recent than the unmaintained beta version, 6.200_02, that is still widely available * Thu Jan 27 2005 Paul Howarth - 5.417-1 - Update to 5.417 * Thu Nov 11 2004 Paul Howarth - 5.415-1 - Update to 5.415 * Tue Oct 26 2004 Paul Howarth - 5.414-1 - Initial RPM build