File clatd.spec of Package clatd

# spec file for package clatd
# Copyright (c) 2018, Martin Hauke <>
# 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

Name:           clatd
Version:        1.4
Release:        0
Summary:        CLAT / SIIT-DC Edge Relay implementation for Linux
License:        MIT
Group:          Productivity/Networking/System
Source1:        clatd.conf
Patch0:         0001-nm-dispatcher-only-act-on-iface-up-down-events.patch
Patch1:         0002-Update-siit-dc-eam-I-D-references-to-RFC-numbers.patch
BuildRequires:  NetworkManager
BuildRequires:  perl
BuildRequires:  systemd-rpm-macros
Requires:       iproute2
Requires:       iptables
Requires:       perl
Requires:       tayga
Requires:       perl(File::Temp)
Requires:       perl(IO::Socket::INET6)
Requires:       perl(Net::DNS)
Requires:       perl(Net::IP)
BuildArch:      noarch

clatd implements the CLAT component of the 464XLAT network architecture
specified in RFC 6877. It allows an IPv6-only host to have IPv4
connectivity that is translated to IPv6 before being routed to an upstream
PLAT (which is typically a Stateful NAT64 operated by the ISP) and there
translated back to IPv4 before being routed to the IPv4 internet.

%setup -q
%patch0 -p1
%patch1 -p1

pod2man --name clatd --center "clatd - a CLAT implementation for Linux" --section 8 README.pod clatd.8
sed -i "s,%{_sbindir}/clatd,%{_sbindir}/clatd -c %{_sysconfdir}/clatd.conf," scripts/*

install -D -m 0755 clatd %{buildroot}%{_sbindir}/clatd
install -D -m 0644 clatd.8 %{buildroot}%{_mandir}/man8/clatd.8
install -D -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/clatd.conf
install -D -m 0755 scripts/clatd.networkmanager %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d/50-clatd
install -D -m 0644 scripts/clatd.systemd %{buildroot}%{_unitdir}/%{name}.service
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcclatd

%service_add_pre %{name}.service

%service_add_post %{name}.service

%service_del_preun %{name}.service

%service_del_postun %{name}.service

%license LICENCE
%doc README.pod
%config(noreplace) %{_sysconfdir}/clatd.conf