-diff -uNr mbank-cli-20120215/mbank-cli mbank-cli-20120215.new/mbank-cli
---- mbank-cli-20120215/mbank-cli 2012-02-15 22:48:39.000000000 +0100
-+++ mbank-cli-20120215.new/mbank-cli 2012-02-23 14:40:56.453431641 +0100
-@@ -189,12 +189,12 @@
+diff -urN mbank-cli-1.2.2.orig/mbank-cli mbank-cli-1.2.2/mbank-cli
+--- mbank-cli-1.2.2.orig/mbank-cli 2014-10-25 12:19:48.139241025 +0200
++++ mbank-cli-1.2.2/mbank-cli 2014-10-25 12:20:41.925905849 +0200
+@@ -547,36 +547,7 @@
- sub lwp_init()
+ sub get_default_ca_path
{
-- my $ca_dir = $ENV{HTTPS_CA_DIR};
-- $ca_dir //= '/etc/ssl/certs/';
-+ my $ca_file = $ENV{HTTPS_CA_FILE};
-+ $ca_file //= '/etc/certs/ca-certificates.crt';
- map { delete $ENV{$_}; } grep(/^HTTPS_/, keys %ENV);
- $ENV{'HTTPS_VERSION'} = 3;
- $ENV{'HTTPS_DEBUG'} = 0;
-- $ENV{'HTTPS_CA_DIR'} = $ca_dir;
-+ $ENV{'HTTPS_CA_FILE'} = $ca_file;
- umask(umask() | 077);
- my $ua = new LWP::UserAgent(
- agent => 'Mozilla/5.0',
+- my ($name, @hashes) = @_;
+- my $filename = "$name.crt";
+- $filename =~ y/ /_/;
+- my $path = "/usr/share/ca-certificates/mozilla/$filename";
+- if (-r $path) {
+- return $path;
+- }
+- my $ssl_cert_dir = $ENV{SSL_CERT_DIR};
+- if (not defined($ssl_cert_dir) and $Net::SSLeay::VERSION >= 1.43) {
+- # https://www.openssl.org/docs/crypto/SSLeay_version.html
+- # SSLEAY_DIR == 5
+- my $openssl_info = Net::SSLeay::SSLeay_version(5);
+- my ($openssl_dir) = $openssl_info =~ m/\AOPENSSLDIR: "(.*)"\Z/;
+- if (defined($openssl_dir)) {
+- $ssl_cert_dir = "$openssl_dir/certs";
+- }
+- }
+- if (defined($ssl_cert_dir)) {
+- for my $hash (@hashes) {
+- $path = "$ssl_cert_dir/$hash.0";
+- # TODO: actually check if this is the certificate we want
+- # hash collisions are unlikely, but not impossible
+- -r $path or next;
+- my $rpath = readlink($path) or next;
+- $rpath =~ m{\A/}
+- or $rpath = "$ssl_cert_dir/$rpath";
+- return $rpath;
+- }
+- }
+- return "$FindBin::Bin/ca.crt";
++ return '/etc/certs/ca-certificates.crt';
+ }
+
+ # ===========================
+++ /dev/null
-diff -uNr mbank-cli-20120215/mbank-cli mbank-cli-20120215.new/mbank-cli
---- mbank-cli-20120215/mbank-cli 2012-02-15 22:48:39.000000000 +0100
-+++ mbank-cli-20120215.new/mbank-cli 2012-02-23 14:36:01.943098229 +0100
-@@ -70,8 +70,8 @@
-
- my $mbank_host = undef; # use set_country() to define
- my $mbank = undef; # use set_country() to define
--my $cookie_jar_file = './cookie-jar.txt';
--my $config_file = './mbank-cli.conf';
-+my $cookie_jar_file = "$ENV{ HOME }/.mbank-cli_cookie-jar.txt";
-+my $config_file = "$ENV{ HOME }/.mbank-cli.conf";
- my $http_read_size_hint = 1 << 20; # 1 MiB
-
- sub set_country($)
-@@ -302,7 +302,7 @@
- eval { $digest_module = Digest->new('SHA-1'); } if $@;
- $digest_module = Digest->new('MD5') if $@;
- }
-- user_error "Can't open the config file: $!" unless open my $config, '<', $config_file;
-+ user_error "Can't open the config file ($config_file): $!" unless open my $config, '<', $config_file;
- my $prev_digest = '';
- $main::digest_module->new();
- my $header = '';
--- /dev/null
+changeset: 715:41fa04634db2
+tag: tip
+user: Jakub Wilk <jwilk@jwilk.net>
+date: Sat Oct 25 19:59:32 2014 +0200
+summary: Always pass ssl_options to LWP >= 6.
+
+diff -r 78985f550841 -r 41fa04634db2 mbank-cli
+--- a/mbank-cli Sat Oct 25 19:53:40 2014 +0200
++++ b/mbank-cli Sat Oct 25 19:59:32 2014 +0200
+@@ -463,7 +463,8 @@
+ IO::Socket::SSL::set_args_filter_hack('use_defaults');
+ # TODO: Work around the bug also for earlier versions of
+ # IO::Socket::SSL, which don't support set_args_filter_hack().
+- } elsif ($LWP::UserAgent::VERSION >= 6) {
++ }
++ if ($LWP::UserAgent::VERSION >= 6) {
+ $ua->ssl_opts(
+ @ssl_options,
+ )
+
Summary: A command line interface to mBank
Summary(pl.UTF-8): Interfejs CLI do mBanku
Name: mbank-cli
-Version: 20140112
+Version: 1.2.2
Release: 1
+Epoch: 1
License: GPL v2
Group: Applications/Console
-Source0: http://mbank-cli.googlecode.com/files/%{name}-%{version}.tar.gz
-# Source0-md5: ed196f70dd78984925ae2f56fb31da3b
-Patch0: %{name}-defconf.patch
+Source0: https://bitbucket.org/jwilk/mbank-cli/downloads/%{name}-%{version}.tar.gz
+# Source0-md5: d7510c3084d4fb148d3723e3a0dd51d9
+Patch0: %{name}-ssl_opts.patch
Patch1: %{name}-ca.patch
URL: http://code.google.com/p/mbank-cli/
BuildRequires: perl-base >= 5.10
Requires: ca-certificates
Requires: perl(LWP::Protocol::https)
Requires: perl(Net::SSL)
+Requires: perl(Term::ReadLine::Gnu)
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)