diff --git a/sendxmpp-1.24-git20250721.patch b/sendxmpp-1.24-git20161113.patch similarity index 68% rename from sendxmpp-1.24-git20250721.patch rename to sendxmpp-1.24-git20161113.patch index 7ad098e..dd2fe47 100644 --- a/sendxmpp-1.24-git20250721.patch +++ b/sendxmpp-1.24-git20161113.patch @@ -1,97 +1,8 @@ -https://github.com/lhost/sendxmpp/compare/v1.24...fbc0ac5 +https://github.com/lhost/sendxmpp/compare/1.24...9186b8c ---- sendxmpp-1.24/data/sendxmpp.doap 1970-01-01 01:00:00.000000000 +0100 -+++ sendxmpp-1.24/data/sendxmpp.doap.git20250721 2025-08-10 19:15:56.113898702 +0200 -@@ -0,0 +1,51 @@ -+ -+ -+ -+ sendxmpp -+ sendxmpp -+ -+ 2004-11-17 -+ -+ Perl script to send XMPP messages -+ Simple script written in Perl to send XMPP messages -+ -+ -+ -+ -+ -+ -+ -+ en -+ -+ Perl -+ Linux -+ macOS -+ FreeBSD -+ OpenBSD -+ NetBSD -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ Lubomir Host -+ -+ 828a771064b09f14a2503dd3e8f8dc50e4aafb98 -+ -+ -+ -+ -+ -+ 1.24 -+ 2014-09-13 -+ -+ -+ -+ -+ -+ ---- sendxmpp-1.24/README 2014-09-13 23:23:08.000000000 +0200 -+++ sendxmpp-1.24/README.git20250721 2025-08-10 19:15:36.059739357 +0200 -@@ -3,7 +3,7 @@ - - sendxmpp is a perl-script to send XMPP (jabber) messages, similar to - what mail(1) does for mail. XMPP is an open, non-proprietary protocol --for instant messaging. See www.jabber.org for more information. -+for instant messaging. See https://xmpp.org/ for more information. - - sendxmpp was written by me, Dirk-Jan C. Binnema, and is available under - the term of the GNU General Public License v2. The hard work is done by -@@ -11,14 +11,7 @@ - sendxmpp to work. Current maintainer is Lubomir Host - - Obviously, you also need a jabber account; they are freely available --at jabber.org, but you can also install your own servers. -- --sendxmpp is already in use for monitoring remote servers (servers can --warn by sending xmpp-messages), and watching CVS commit messages --(developers are all connected to a XMPP-chatroom to which messages are --sent. -- --I am interested in hearing about other uses. -+at https://list.jabber.at/, but you can also install your own servers. - - Homepage: http://sendxmpp.hostname.sk - ---- sendxmpp-1.24/sendxmpp 2014-09-13 23:23:08.000000000 +0200 -+++ sendxmpp-1.24/sendxmpp.git20250721 2025-08-10 19:14:32.096231157 +0200 -@@ -21,6 +21,7 @@ - use Net::XMPP; - use Net::Domain; - use Getopt::Long; -+use POSIX qw( strftime ); - - use strict; - -@@ -28,7 +29,7 @@ +--- sendxmpp-1.24/sendxmpp 2014-09-13 23:23:08.000000000 +0200 ++++ sendxmpp-1.24/sendxmpp.git20161113 2020-08-08 00:10:22.488368180 +0200 +@@ -28,7 +28,7 @@ use open ':std'; # subroutines decls @@ -100,7 +11,7 @@ https://github.com/lhost/sendxmpp/compare/v1.24...fbc0ac5 sub xmpp_send ($$$$); sub xmpp_send_raw_xml($$); sub xmpp_send_message($$$$$$); -@@ -82,6 +83,7 @@ +@@ -82,6 +82,7 @@ $$cmdline{'no-tls-verify'} || $$config{'no-tls-verify'}, $$cmdline{'tls-ca-path'} || $$config{'tls-ca-path'} || '', $$cmdline{'ssl'}, @@ -108,7 +19,7 @@ https://github.com/lhost/sendxmpp/compare/v1.24...fbc0ac5 $$cmdline{'debug'}, $$cmdline{'sso'} ) or error_exit("cannot login: $!"); -@@ -102,7 +104,7 @@ +@@ -102,7 +103,7 @@ $txt .= $_ while (); } @@ -117,7 +28,7 @@ https://github.com/lhost/sendxmpp/compare/v1.24...fbc0ac5 } else { -@@ -115,7 +117,7 @@ +@@ -115,7 +116,7 @@ # line by line... while () { chomp; @@ -126,7 +37,7 @@ https://github.com/lhost/sendxmpp/compare/v1.24...fbc0ac5 } } -@@ -141,7 +143,7 @@ +@@ -141,7 +142,7 @@ error_exit ("$cfg_file must not be accessible by others") if ($mode & 0077); @@ -135,7 +46,7 @@ https://github.com/lhost/sendxmpp/compare/v1.24...fbc0ac5 or error_exit("cannot open $cfg_file for reading: $!"); my %config; -@@ -155,7 +157,7 @@ +@@ -155,7 +156,7 @@ #s/\#.*$//; # ignore comments in lines @@ -144,17 +55,16 @@ https://github.com/lhost/sendxmpp/compare/v1.24...fbc0ac5 $config{$1} = $2; } # Hugo van der Kooij has account with '#' as username -@@ -193,7 +195,8 @@ +@@ -193,7 +194,7 @@ unless (scalar(%config)); if ($DEBUG || $VERBOSE) { - while (my ($key,$val) = each %config) { + while (my ($key, $val) = each %config) { -+ $val ||= ""; debug_print ("config: '$key' => '$val'"); } } -@@ -211,7 +214,7 @@ +@@ -211,7 +212,7 @@ my ($subject, $file, $resource, $jserver, $port, $username, $password, $sso, $component, $message, $chatroom, $headline, $debug, $tls, $ssl, @@ -163,7 +73,7 @@ https://github.com/lhost/sendxmpp/compare/v1.24...fbc0ac5 $interactive, $help, $raw, $verbose ); $debug = 0; -@@ -232,6 +235,7 @@ +@@ -232,6 +233,7 @@ 'no-tls-verify|n' => \$no_tls_verify, 'tls-ca-path|a=s' => \$tls_ca_path, 'ssl|e' => \$ssl, @@ -171,7 +81,7 @@ https://github.com/lhost/sendxmpp/compare/v1.24...fbc0ac5 'interactive|i' => \$interactive, 'help|usage|h' => \$help, 'debug|d:i' => sub { $debug = $_[1] ? $_[1] : $debug + 1 }, -@@ -301,6 +305,7 @@ +@@ -301,6 +303,7 @@ 'no-tls-verify' => ($no_tls_verify or 0), 'tls-ca-path' => ($tls_ca_path or ''), 'ssl' => ($ssl or 0), @@ -179,7 +89,7 @@ https://github.com/lhost/sendxmpp/compare/v1.24...fbc0ac5 'debug' => ($debug or 0), 'verbose' => ($verbose or 0), 'raw' => ($raw or 0), -@@ -309,7 +314,7 @@ +@@ -309,7 +312,7 @@ ); if ($DEBUG || $VERBOSE) { @@ -188,7 +98,7 @@ https://github.com/lhost/sendxmpp/compare/v1.24...fbc0ac5 debug_print ("cmdline: '$key' => '$val'"); } } -@@ -319,12 +324,12 @@ +@@ -319,12 +322,12 @@ # # xmpp_login: login to the xmpp (jabber) server @@ -204,7 +114,7 @@ https://github.com/lhost/sendxmpp/compare/v1.24...fbc0ac5 my $cnx = new Net::XMPP::Client(debuglevel=>$debug); error_exit "could not create XMPP client object: $!" unless ($cnx); -@@ -343,27 +348,30 @@ +@@ -343,27 +346,30 @@ ssl_verify => $ssl_verify, ssl_ca_path => $tls_ca_path, ssl => $ssl, @@ -249,7 +159,7 @@ https://github.com/lhost/sendxmpp/compare/v1.24...fbc0ac5 delete $arghash->{port} unless $port; if ($arghash->{port}) { -@@ -374,7 +382,7 @@ +@@ -374,7 +380,7 @@ error_exit ("Could not connect to server '$host': ".($cnx->GetErrorCode()||$@)) unless @res; } @@ -258,7 +168,7 @@ https://github.com/lhost/sendxmpp/compare/v1.24...fbc0ac5 if ($comp) { my $sid = $cnx->{SESSION}->{id}; -@@ -385,7 +393,7 @@ +@@ -385,7 +391,7 @@ 'username' => $user, 'password' => $pw, 'resource' => $res); @@ -267,7 +177,7 @@ https://github.com/lhost/sendxmpp/compare/v1.24...fbc0ac5 return $cnx; } # }}} -@@ -426,20 +434,20 @@ +@@ -426,20 +432,20 @@ # # xmpp_send_raw_xml: send a raw XML packet @@ -292,14 +202,12 @@ https://github.com/lhost/sendxmpp/compare/v1.24...fbc0ac5 # sub xmpp_send_message ($$$$$$) { # {{{ -@@ -452,22 +460,21 @@ +@@ -452,16 +458,16 @@ 'subject' => $subject, 'body' => $msg); - xmpp_check_result('MessageSend',0,$cnx); + xmpp_check_result('MessageSend', 0, $cnx); -+ -+ debug_print("Recipient: '$rcpt'"); } # }}} # @@ -313,31 +221,21 @@ https://github.com/lhost/sendxmpp/compare/v1.24...fbc0ac5 + my ($cnx, $resource, $subject, $rcpt, $msg) = @_; # set the presence -- my $pres = new Net::XMPP::Presence; -- my $res = $pres->SetTo("$rcpt/$resource"); -- -- $cnx->Send($pres); -+ xmpp_send_raw_xml($cnx, ""); - - # create/send the message - my $groupmsg = new Net::XMPP::Message; -@@ -475,11 +482,12 @@ - body => $msg, + my $pres = new Net::XMPP::Presence; +@@ -476,10 +482,10 @@ type => 'groupchat'); -- $res = $cnx->Send($groupmsg); + $res = $cnx->Send($groupmsg); - xmpp_check_result ('Send',$res,$cnx); -+ my $res = $cnx->Send($groupmsg); + xmpp_check_result ('Send', $res, $cnx); # leave the group - $pres->SetPresence (Type=>'unavailable',To=>$rcpt); -+ my $pres = new Net::XMPP::Presence; + $pres->SetPresence (Type=>'unavailable', To=>$rcpt); } # }}} # -@@ -494,7 +502,7 @@ +@@ -494,7 +500,7 @@ my $cnx = shift; $cnx->Disconnect(); @@ -346,7 +244,7 @@ https://github.com/lhost/sendxmpp/compare/v1.24...fbc0ac5 } # }}} # -@@ -518,7 +526,7 @@ +@@ -518,7 +524,7 @@ } else { my $errmsg = $cnx->GetErrorCode() || '?'; @@ -355,20 +253,7 @@ https://github.com/lhost/sendxmpp/compare/v1.24...fbc0ac5 } } # }}} -@@ -536,8 +544,10 @@ - # input: [array of strings] - # - sub debug_print { # {{{ -- print STDERR "sendxmpp: " . (join ' ', @_) . "\n" -- if (@_ && ($DEBUG ||$VERBOSE)); -+ if (@_ && ($DEBUG ||$VERBOSE)) { -+ my $date_str = strftime("%Y-%m-%d %H:%M:%S", localtime); -+ print STDERR "$date_str sendxmpp: " . (join ' ', @_) . "\n" -+ } - } # }}} - - # -@@ -547,7 +557,7 @@ +@@ -547,7 +553,7 @@ # sub error_exit { # {{{ @@ -377,7 +262,7 @@ https://github.com/lhost/sendxmpp/compare/v1.24...fbc0ac5 print STDERR "$err\n"; xmpp_logout ($cnx) if ($cnx); -@@ -594,15 +604,15 @@ +@@ -594,15 +600,15 @@ =over @@ -396,7 +281,7 @@ https://github.com/lhost/sendxmpp/compare/v1.24...fbc0ac5 Use I instead of the one in the configuration file -@@ -610,35 +620,39 @@ +@@ -610,35 +616,39 @@ Instead of specifying username or password, attempt to use system level SSO (e.g. kerberos) if supported. @@ -444,7 +329,7 @@ https://github.com/lhost/sendxmpp/compare/v1.24...fbc0ac5 Backward compatibility option. You should use B<--message-type=headline> instead. Send a headline type message (not stored in offline messages) -@@ -646,35 +660,35 @@ +@@ -646,35 +656,35 @@ Set type of message. Supported types are: B. Default message type is B. Headline type message can be set also with B<--headline> option, see B<--headline> @@ -488,7 +373,7 @@ https://github.com/lhost/sendxmpp/compare/v1.24...fbc0ac5 Show debugging info while running. B: This will include passwords etc. so be careful with the output! Specify multiple times to increase debug level. -@@ -685,19 +699,19 @@ +@@ -685,19 +695,19 @@ You may define a 'F<~/.sendxmpprc>' file with the necessary data for your xmpp-account. Since version 1.24 the following format is supported: diff --git a/sendxmpp.spec b/sendxmpp.spec index 542bd52..626e0c1 100644 --- a/sendxmpp.spec +++ b/sendxmpp.spec @@ -1,16 +1,18 @@ -Summary: Perl script to send XMPP messages -Name: sendxmpp -Version: 1.24 -Release: 25%{?dist} -License: GPL-2.0-only -URL: https://sendxmpp.hostname.sk/ -Source: https://github.com/lhost/%{name}/archive/%{version}/%{name}-%{version}.tar.gz -Patch0: sendxmpp-1.24-git20250721.patch -BuildRequires: make -BuildRequires: perl-generators -BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 -BuildRequires: perl(Net::XMPP) -BuildArch: noarch +Summary: A Perl script to send XMPP messages +Name: sendxmpp +Version: 1.24 +Release: 12%{?dist} +License: GPLv2 +URL: https://sendxmpp.hostname.sk/ +Source: https://github.com/lhost/%{name}/archive/%{version}/%{name}-%{version}.tar.gz +Patch0: sendxmpp-1.24-git20161113.patch +BuildRequires: perl-generators +%if 0%{?rhel} && 0%{?rhel} <= 7 +BuildRequires: perl(ExtUtils::MakeMaker), findutils +%else +BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 +%endif +BuildArch: noarch %description Sendxmpp is a Perl script to send XMPP (Jabber) messages from the command @@ -18,7 +20,8 @@ line, similar to what mail(1) does for mail. Messages can be sent both to individual recipients and chat rooms. %prep -%autosetup -p1 +%setup -q +%patch0 -p1 -b .git20161113 %build perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 @@ -26,6 +29,9 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 %install %make_install +%if 0%{?rhel} && 0%{?rhel} <= 7 +find $RPM_BUILD_ROOT \( -name perllocal.pod -o -name .packlist \) -exec rm -f {} \; +%endif chmod -R u+w $RPM_BUILD_ROOT/* %files @@ -34,45 +40,6 @@ chmod -R u+w $RPM_BUILD_ROOT/* %{_mandir}/man1/%{name}.1* %changelog -* Fri Jul 17 2026 Fedora Release Engineering - 1.24-25 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild - -* Sat Jan 17 2026 Fedora Release Engineering - 1.24-24 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild - -* Sun Aug 10 2025 Robert Scheck 1.24-23 -- Upgrade to GIT 20250721 - -* Fri Jul 25 2025 Fedora Release Engineering - 1.24-22 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild - -* Sun Jan 19 2025 Fedora Release Engineering - 1.24-21 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild - -* Sat Jul 20 2024 Fedora Release Engineering - 1.24-20 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild - -* Sat Jan 27 2024 Fedora Release Engineering - 1.24-19 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Sat Jul 22 2023 Fedora Release Engineering - 1.24-18 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - -* Sat Jan 21 2023 Fedora Release Engineering - 1.24-17 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild - -* Sat Jul 23 2022 Fedora Release Engineering - 1.24-16 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - -* Sat Jan 22 2022 Fedora Release Engineering - 1.24-15 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Fri Jul 23 2021 Fedora Release Engineering - 1.24-14 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Wed Jan 27 2021 Fedora Release Engineering - 1.24-13 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - * Fri Aug 07 2020 Robert Scheck 1.24-12 - Added upstream patch to enable SRV record lookups by default and to fix support for virtual domain user names