From 9593268293452f316759b5064b57d76e5a0ec080 Mon Sep 17 00:00:00 2001 From: Emmanuel Seyman Date: Sun, 1 May 2016 18:14:04 +0200 Subject: [PATCH 1/3] backport patch to prevent email address encoding --- bugzilla-email-encode.patch | 50 +++++++++++++++++++++++++++++++++++++ bugzilla.spec | 13 +++++++++- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 bugzilla-email-encode.patch diff --git a/bugzilla-email-encode.patch b/bugzilla-email-encode.patch new file mode 100644 index 0000000..70c2953 --- /dev/null +++ b/bugzilla-email-encode.patch @@ -0,0 +1,50 @@ +diff --git a/Bugzilla/MIME.pm b/Bugzilla/MIME.pm +index 7b5843a..8c6c141 100644 +--- a/Bugzilla/MIME.pm ++++ b/Bugzilla/MIME.pm +@@ -13,9 +13,6 @@ use warnings; + + use parent qw(Email::MIME); + +-use Encode qw(encode); +-use Encode::MIME::Header; +- + sub new { + my ($class, $msg) = @_; + state $use_utf8 = Bugzilla->params->{'utf8'}; +@@ -79,20 +76,12 @@ sub as_string { + # MIME-Version must be set otherwise some mailsystems ignore the charset + $self->header_set('MIME-Version', '1.0') if !$self->header('MIME-Version'); + +- # Encode the headers correctly in quoted-printable ++ # Encode the headers correctly. + foreach my $header ($self->header_names) { + my @values = $self->header($header); +- # We don't recode headers that happen multiple times. +- next if scalar(@values) > 1; +- if (my $value = $values[0]) { +- utf8::decode($value) unless $use_utf8 && utf8::is_utf8($value); +- +- # avoid excessive line wrapping done by Encode. +- local $Encode::Encoding{'MIME-Q'}->{'bpl'} = 998; ++ map { utf8::decode($_) if defined($_) && !utf8::is_utf8($_) } @values; + +- my $encoded = encode('MIME-Q', $value); +- $self->header_set($header, $encoded); +- } ++ $self->header_str_set($header, @values); + } + + # Ensure the character-set and encoding is set correctly on single part +diff --git a/attachment.cgi b/attachment.cgi +index 5db8f59..40b0c9d 100755 +--- a/attachment.cgi ++++ b/attachment.cgi +@@ -26,6 +26,7 @@ use Bugzilla::Attachment::PatchReader; + use Bugzilla::Token; + + use Encode qw(encode find_encoding); ++use Encode::MIME::Header; # Required to alter Encode::Encoding{'MIME-Q'}. + + # For most scripts we don't make $cgi and $template global variables. But + # when preparing Bugzilla for mod_perl, this script used these diff --git a/bugzilla.spec b/bugzilla.spec index caf3a93..aff339d 100644 --- a/bugzilla.spec +++ b/bugzilla.spec @@ -6,7 +6,7 @@ URL: https://www.bugzilla.org/ Name: bugzilla Version: 5.0.2 Group: Applications/Publishing -Release: 2%{?dist} +Release: 3%{?dist} License: MPLv1.1 Source0: https://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-%{version}.tar.gz Source1: bugzilla-httpd-conf @@ -14,6 +14,8 @@ Source2: README.fedora.bugzilla Source3: bugzilla.cron-daily Patch0: bugzilla-rw-paths.patch Patch1: bugzilla-dnf.patch +# https://bugzilla.mozilla.org/show_bug.cgi?id=1246228 +Patch2: bugzilla-email-encode.patch BuildArch: noarch Requires: patchutils @@ -130,6 +132,12 @@ if [ -f Bugzilla/Install/Requirements.pm.orig ]; then : ERROR: Patch1 did not apply cleanly exit 1 fi +%patch2 -p1 +if [ -f Bugzilla/MIME.pm.orig ]; then + : ERROR: Patch2 did not apply cleanly + exit 1 +fi + # Remove bundled libs rm -rf lib/CGI* # Remove bundled binary files @@ -248,6 +256,9 @@ popd > /dev/null) %{bzinstallprefix}/bugzilla/contrib/Bugzilla.pm %changelog +* Sun May 01 2016 Emmanuel Seyman - 5.0.2-3 +- backport patch to prevent email address encoding + * Wed Feb 03 2016 Fedora Release Engineering - 5.0.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild From 27ac7e4dc286647b69c44f01560c2793970071a8 Mon Sep 17 00:00:00 2001 From: Emmanuel Seyman Date: Mon, 16 May 2016 22:35:36 +0200 Subject: [PATCH 2/3] Update to 5.0.3, dropping backported patch --- .gitignore | 1 + bugzilla-email-encode.patch | 50 ------------------------------------- bugzilla.spec | 14 ++++------- sources | 2 +- 4 files changed, 7 insertions(+), 60 deletions(-) delete mode 100644 bugzilla-email-encode.patch diff --git a/.gitignore b/.gitignore index 3d873aa..771d696 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ bugzilla-3.6.1.tar.gz /bugzilla-4.4.10.tar.gz /bugzilla-4.4.11.tar.gz /bugzilla-5.0.2.tar.gz +/bugzilla-5.0.3.tar.gz diff --git a/bugzilla-email-encode.patch b/bugzilla-email-encode.patch deleted file mode 100644 index 70c2953..0000000 --- a/bugzilla-email-encode.patch +++ /dev/null @@ -1,50 +0,0 @@ -diff --git a/Bugzilla/MIME.pm b/Bugzilla/MIME.pm -index 7b5843a..8c6c141 100644 ---- a/Bugzilla/MIME.pm -+++ b/Bugzilla/MIME.pm -@@ -13,9 +13,6 @@ use warnings; - - use parent qw(Email::MIME); - --use Encode qw(encode); --use Encode::MIME::Header; -- - sub new { - my ($class, $msg) = @_; - state $use_utf8 = Bugzilla->params->{'utf8'}; -@@ -79,20 +76,12 @@ sub as_string { - # MIME-Version must be set otherwise some mailsystems ignore the charset - $self->header_set('MIME-Version', '1.0') if !$self->header('MIME-Version'); - -- # Encode the headers correctly in quoted-printable -+ # Encode the headers correctly. - foreach my $header ($self->header_names) { - my @values = $self->header($header); -- # We don't recode headers that happen multiple times. -- next if scalar(@values) > 1; -- if (my $value = $values[0]) { -- utf8::decode($value) unless $use_utf8 && utf8::is_utf8($value); -- -- # avoid excessive line wrapping done by Encode. -- local $Encode::Encoding{'MIME-Q'}->{'bpl'} = 998; -+ map { utf8::decode($_) if defined($_) && !utf8::is_utf8($_) } @values; - -- my $encoded = encode('MIME-Q', $value); -- $self->header_set($header, $encoded); -- } -+ $self->header_str_set($header, @values); - } - - # Ensure the character-set and encoding is set correctly on single part -diff --git a/attachment.cgi b/attachment.cgi -index 5db8f59..40b0c9d 100755 ---- a/attachment.cgi -+++ b/attachment.cgi -@@ -26,6 +26,7 @@ use Bugzilla::Attachment::PatchReader; - use Bugzilla::Token; - - use Encode qw(encode find_encoding); -+use Encode::MIME::Header; # Required to alter Encode::Encoding{'MIME-Q'}. - - # For most scripts we don't make $cgi and $template global variables. But - # when preparing Bugzilla for mod_perl, this script used these diff --git a/bugzilla.spec b/bugzilla.spec index aff339d..fcc7b20 100644 --- a/bugzilla.spec +++ b/bugzilla.spec @@ -4,9 +4,9 @@ Summary: Bug tracking system URL: https://www.bugzilla.org/ Name: bugzilla -Version: 5.0.2 +Version: 5.0.3 Group: Applications/Publishing -Release: 3%{?dist} +Release: 1%{?dist} License: MPLv1.1 Source0: https://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-%{version}.tar.gz Source1: bugzilla-httpd-conf @@ -14,8 +14,6 @@ Source2: README.fedora.bugzilla Source3: bugzilla.cron-daily Patch0: bugzilla-rw-paths.patch Patch1: bugzilla-dnf.patch -# https://bugzilla.mozilla.org/show_bug.cgi?id=1246228 -Patch2: bugzilla-email-encode.patch BuildArch: noarch Requires: patchutils @@ -132,11 +130,6 @@ if [ -f Bugzilla/Install/Requirements.pm.orig ]; then : ERROR: Patch1 did not apply cleanly exit 1 fi -%patch2 -p1 -if [ -f Bugzilla/MIME.pm.orig ]; then - : ERROR: Patch2 did not apply cleanly - exit 1 -fi # Remove bundled libs rm -rf lib/CGI* @@ -256,6 +249,9 @@ popd > /dev/null) %{bzinstallprefix}/bugzilla/contrib/Bugzilla.pm %changelog +* Mon May 16 2016 Emmanuel Seyman - 5.0.3-1 +- Update to 5.0.3, dropping backported patch + * Sun May 01 2016 Emmanuel Seyman - 5.0.2-3 - backport patch to prevent email address encoding diff --git a/sources b/sources index fd424e6..e160adf 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -84e6a070d425846d55a1f926e883957e bugzilla-5.0.2.tar.gz +b78365742a85cd030c87af12c196e8e9 bugzilla-5.0.3.tar.gz From fefbbd93fc0e8869000a6e4f36874e0ecf97d45a Mon Sep 17 00:00:00 2001 From: Emmanuel Seyman Date: Mon, 18 Jul 2016 11:12:02 +0200 Subject: [PATCH 3/3] Add more build-requires && filter out optional modules Check for perl(JSON::RPC::Legacy::Server::CGI) instead of perl(JSON::RPC) Update to 5.0.3, dropping backported patch --- bugzilla-dnf.patch | 13 +++++++++++-- bugzilla.spec | 47 ++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 54 insertions(+), 6 deletions(-) diff --git a/bugzilla-dnf.patch b/bugzilla-dnf.patch index 78c1d18..8824d21 100644 --- a/bugzilla-dnf.patch +++ b/bugzilla-dnf.patch @@ -1,5 +1,14 @@ ---- bugzilla-4.01/Bugzilla/Install/Requirements.pm 2011-05-01 17:09:35.000000000 +0200 -+++ bugzilla-4.01-yum/Bugzilla/Install/Requirements.pm 2011-05-01 17:11:28.000000000 +0200 +--- bugzilla-5.0.3/Bugzilla/Install/Requirements.pm.orig 2016-11-13 11:03:43.977035344 +0100 ++++ bugzilla-5.0.3/Bugzilla/Install/Requirements.pm 2016-11-13 11:16:26.115320528 +0100 +@@ -304,7 +304,7 @@ sub OPTIONAL_MODULES { + }, + { + package => 'JSON-RPC', +- module => 'JSON::RPC', ++ module => 'JSON::RPC::Legacy::Server::CGI', + version => 0, + feature => ['jsonrpc', 'rest'], + }, @@ -648,7 +648,7 @@ if ($output && $check_results->{any_missing} && !ON_ACTIVESTATE && !$check_results->{hide_all}) diff --git a/bugzilla.spec b/bugzilla.spec index fcc7b20..d43f4bd 100644 --- a/bugzilla.spec +++ b/bugzilla.spec @@ -6,7 +6,7 @@ URL: https://www.bugzilla.org/ Name: bugzilla Version: 5.0.3 Group: Applications/Publishing -Release: 1%{?dist} +Release: 2%{?dist} License: MPLv1.1 Source0: https://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-%{version}.tar.gz Source1: bugzilla-httpd-conf @@ -42,12 +42,16 @@ BuildRequires: python-sphinx BuildRequires: texlive-collection-fontsrecommended BuildRequires: texlive-collection-latexrecommended BuildRequires: texlive-collection-basic -BuildRequires: texlive-upquote BuildRequires: tex-framed BuildRequires: tex-multirow BuildRequires: tex-threeparttable BuildRequires: tex-titlesec BuildRequires: tex-wrapfig +%if 0%{?fedora} +BuildRequires: texlive-capt-of.noarch +BuildRequires: texlive-eqparbox.noarch +BuildRequires: texlive-upquote +%endif %package doc Summary: Bugzilla documentation @@ -71,20 +75,50 @@ BuildRequires: python # mod_perl modules %global __requires_exclude %__requires_exclude|^perl\\(Apache2:: %global __requires_exclude %__requires_exclude|^perl\\(ModPerl:: +# installation of optional modules +%global __requires_exclude %__requires_exclude|^perl\\(Config\\)$ +%global __requires_exclude %__requires_exclude|^perl\\(CPAN\\)$ # authentification modules %global __requires_exclude %__requires_exclude|^perl\\(Authen::Radius\\)$ -%global __requires_exclude %__requires_exclude|^perl\\(Net::LDAP\\)$ +%global __requires_exclude %__requires_exclude|^perl\\(Net::LDAP # database modules %global __requires_exclude %__requires_exclude|^perl\\(DBD::Oracle\\)$ %global __requires_exclude %__requires_exclude|^perl\\(DBD::Pg\\)$ %global __requires_exclude %__requires_exclude|^perl\\(DBI::db\\)$ %global __requires_exclude %__requires_exclude|^perl\\(DBI::st\\)$ +# graphical reports and charts +%global __requires_exclude %__requires_exclude|^perl\\(Chart::Lines\\)$ +%global __requires_exclude %__requires_exclude|^perl\\(GD::Graph\\)$ +%global __requires_exclude %__requires_exclude|^perl\\(GD::Graph\\)$ +%global __requires_exclude %__requires_exclude|^perl\\(Template::Plugin::GD::Image\\)$ # inbound email modules %global __requires_exclude %__requires_exclude|^perl\\(Email::MIME::Attachment::Stripper\\)$ %global __requires_exclude %__requires_exclude|^perl\\(Email::Reply\\)$ +%global __requires_exclude %__requires_exclude|^perl\\(HTML::FormatText::WithLinks\\)$ +# automatic charset detection for text attachments +%global __requires_exclude %__requires_exclude|^perl\\(Encode +# sniff MIME type of attachments +%global __requires_exclude %__requires_exclude|^perl\\(File::MimeInfo::Magic\\)$ +%global __requires_exclude %__requires_exclude|^perl\\(IO::Scalar\\)$ +# mail queueing +%global __requires_exclude %__requires_exclude|^perl\\(TheSchwartz\\)$ +%global __requires_exclude %__requires_exclude|^perl\\(Daemon::Generic\\)$ +# smtp security +%global __requires_exclude %__requires_exclude|^perl\\(Authen::SASL\\)$ +%global __requires_exclude %__requires_exclude|^perl\\(Net::SMTP::SSL\\)$ # bug moving modules %global __requires_exclude %__requires_exclude|^perl\\(MIME::Parser\\)$ %global __requires_exclude %__requires_exclude|^perl\\(XML::Twig\\)$ +# update notifications +%global __requires_exclude %__requires_exclude|^perl\\(LWP::UserAgent\\)$ +# use html in product and group descriptions +%global __requires_exclude %__requires_exclude|^perl\\(HTML::Parser\\)$ +%global __requires_exclude %__requires_exclude|^perl\\(HTML::Scrubber\\)$ +# memcached support +%global __requires_exclude %__requires_exclude|^perl\\(Cache::Memcached\\)$ +# documentation +%global __requires_exclude %__requires_exclude|^perl\\(File::Copy::Recursive\\)$ +%global __requires_exclude %__requires_exclude|^perl\\(File::Which\\)$ # xml-rpc and json-rpc modules %global __requires_exclude %__requires_exclude|^perl\\(XMLRPC:: %global __requires_exclude %__requires_exclude|^perl\\(HTTP::Message\\)$ @@ -249,6 +283,11 @@ popd > /dev/null) %{bzinstallprefix}/bugzilla/contrib/Bugzilla.pm %changelog +* Sun Nov 27 2016 Emmanuel Seyman - 5.0.3-2 +- Check for perl(JSON::RPC::Legacy::Server::CGI) instead of perl(JSON::RPC) +- Add build requirements for texlive sub-packages +- Filter out more optional dependencies + * Mon May 16 2016 Emmanuel Seyman - 5.0.3-1 - Update to 5.0.3, dropping backported patch @@ -259,7 +298,7 @@ popd > /dev/null) - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Sat Jan 16 2016 Emmanuel Seyman - 5.0.2-1 -- Update to 5.0.2, with thnaks to Tuomo Soini (#1275609) +- Update to 5.0.2, with thanks to Tuomo Soini (#1275609) - Use dnf instead of yum when advising to install perl modules - Change documentation URL to bugzilla.readthedocs.org