%global _hardened_build 1

Name:           uftp
Version:        5.0.1
Release:        1%{?dist}
Summary:        Encrypted UDP based FTP with multicast

License:        GPLv3
URL:            http://uftp-multicast.sourceforge.net/
Source0:        https://downloads.sourceforge.net/uftp-multicast/uftp-5.0.1.tar.gz

BuildRequires:  autoconf libtool
BuildRequires:  openssl-devel
#Requires:       

%description
UFTP is an encrypted multicast file transfer program, designed to securely,
reliably, and efficiently transfer files to multiple receivers simultaneously.
This is useful for distributing large files to a large number of receivers,
and is especially useful for data distribution over a satellite link (with two
way communication), where the inherent delay makes any TCP based communication
highly inefficient.  The multicast encryption scheme is based on TLS with
extensions to allow multiple receivers to share a common key.

UFTP also has the capability to communicate over disjoint networks separated
by one or more firewalls (NAT traversal) and without full end-to-end multicast
capability (multicast tunneling) through the use of a UFTP proxy server. 
These proxies also provide scalability by aggregating responses from a group
of receivers.


%prep
%autosetup


%build
export CFLAGS="%{optflags} -fpic"
export LDFLAGS="${LDFLAGS} -pie -z relro -z now"
%make_build


%install
rm -rf $RPM_BUILD_ROOT
%make_install


%files
%license LICENSE.txt
%doc ReadMe.txt Changes.txt

   /usr/bin/uftp
   /usr/bin/uftp_keymgt
   /usr/bin/uftpd
   /usr/bin/uftpproxyd
   /usr/share/man/man1/uftp.1.gz
   /usr/share/man/man1/uftp_keymgt.1.gz
   /usr/share/man/man1/uftpd.1.gz
   /usr/share/man/man1/uftpproxyd.1.gz

#   /usr/lib/debug/usr/bin/uftp-4.10-1.fc30.x86_64.debug
#   /usr/lib/debug/usr/bin/uftp_keymgt-4.10-1.fc30.x86_64.debug
#   /usr/lib/debug/usr/bin/uftpd-4.10-1.fc30.x86_64.debug
#   /usr/lib/debug/usr/bin/uftpproxyd-4.10-1.fc30.x86_64.debug


%changelog
* Thu Aug 18 2022 bta - 5.0.1-1
- New version.

* Mon Jan 10 2022 bta - 5.0-1
- New version.
- use distro optflags, ask for a hardened build.
- compile with -fpic, link with -pie.

* Thu Oct 10 2019 bta - 4.10-1
- Initial version