File cone.spec of Package cone

# vim: set ts=4 sw=4 et:
#
# spec file for package cone
#
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name:           cone
Version:        1.15
Release:        0
Summary:        Text-based Email Client and Newsreader
License:        GPL-3.0-or-later
Group:          Productivity/Networking/Email/Clients
URL:            https://www.courier-mta.org/cone/
Source0:        https://downloads.sourceforge.net/courier/%{name}-%{version}.tar.bz2
Source1:        cone.desktop
Source2:        leaf.desktop
Source10:       https://downloads.sourceforge.net/courier/%{name}-%{version}.tar.bz2.sig
# Keyring downloaded from https://www.courier-mta.org/KEYS.bin#/%%{name}.keyring
Source11:       %{name}.keyring
BuildRequires:  courier-unicode-devel >= 2.1
BuildRequires:  gcc-c++
BuildRequires:  gpg2
BuildRequires:  libstdc++-devel
BuildRequires:  make
BuildRequires:  pkgconfig
BuildRequires:  procps
BuildRequires:  pkgconfig(libidn2) >= 2.0.5
BuildRequires:  pkgconfig(libpcre2-8)
BuildRequires:  pkgconfig(libxml-2.0)
BuildRequires:  pkgconfig(openssl)
Requires:       mailtool = %{version}-%{release}
Recommends:     leaf = %{version}-%{release}
%if 0%{?suse_version:1}
BuildRequires:  update-desktop-files
%endif
%if 0%{?suse_version} >= 1500
BuildRequires:  pkgconfig(ncurses)
%else
BuildRequires:  ncurses-devel
%endif

%description
Cone (COnsole Newsreader And Emailer) is a text-based email client.

It seamlessly handles multiple POP3 and IMAP accounts and local mail
folders. It is also a simple newsreader. It is designed to be foolproof enough
to be used by inexperienced users, but also offers advanced features for power
users.

%package -n mailtool
Summary:        Mailbox Processing Tool
Group:          Productivity/Networking/Email/Clients

%description -n mailtool
mailtool is a diagnostic utility for handling various operations on mailboxes.
mailtool's main uses include:
- display the list of folders in a mailbox;
- displaying list of messages in a mailbox;
- and copying mailboxes.

%package -n leaf
Summary:        Lightweight Editor of ASCII (and more) Files
Group:          Productivity/Text/Editors

%description -n leaf
leaf is a simple console text file editor, with paragraph word-wrapping and
spell checking.

leaf is based on the text editor in the Cone mail reader and composer. leaf
opens filename, position the cursor on the first line, or line n, if
specified.

This is not really the best editor for program sources. leaf is meant to be
used as a quick editor for writing short notes and memos.

As text is typed, words will automatically flow to wrap within a typical
80-character terminal display, even on larger display (due to leaf's heritage
as an editor for E-mail messages, which are traditionally formatted to fit an
80-character display). Word wrapping is "lazy": only long text lines are
wrapped. Short text lines are not folded together.

%prep
%setup -q

%build
%configure --with-notice=unicode
%make_build

%install
%make_install
mv "%{buildroot}%{_sysconfdir}/cone.dist" "%{buildroot}%{_sysconfdir}/cone"

install -D -m 0644 "%{SOURCE1}" "%{buildroot}%{_datadir}/applications/cone.desktop"
install -D -m 0644 "%{SOURCE2}" "%{buildroot}%{_datadir}/applications/leaf.desktop"
%if 0%{?suse_version:1}
%suse_update_desktop_file cone Network Email News
%suse_update_desktop_file leaf Utility TextEditor
%else
sed -i '/^Categories=/ s/^.*$/Categories=Network;Email;News/' "%{buildroot}%{_datadir}/applications/cone.desktop"
sed -i '/^Categories=/ s/^.*$/Categories=Utility;TextEditor/' "%{buildroot}%{_datadir}/applications/leaf.desktop"
%endif

%check
%make_build check

%files
%license COPYING*
%doc AUTHORS ChangeLog NEWS README
%config(noreplace) %{_sysconfdir}/cone
%{_bindir}/cone
%{_libexecdir}/cone
%{_datadir}/cone
%{_mandir}/man1/cone.1%{?ext_man}
%{_datadir}/applications/cone.desktop

%files -n mailtool
%license COPYING*
%doc AUTHORS ChangeLog NEWS
%{_bindir}/mailtool
%{_mandir}/man1/mailtool.1%{?ext_man}

%files -n leaf
%license COPYING*
%doc AUTHORS ChangeLog NEWS
%{_bindir}/leaf
%{_mandir}/man1/leaf.1%{?ext_man}
%{_datadir}/applications/leaf.desktop

%changelog
openSUSE Build Service is sponsored by