Package cjdns

Download cjdns.spec
%define _unpackaged_files_terminate_build 1

Name: cjdns
Version: 20.3
Release: alt1

Summary: Encrypted networking for regular people
License: GPLv3+
Group: Networking/Other

Source: %name-%version.tar
Patch1: %name-%version-alt.patch

# don't use libuv-devel since it uses bundled patched libuv to build static library
BuildRequires: nodejs python-devel gyp node-gyp /proc

Cjdns implements an encrypted IPv6 network using public key cryptography
for address allocation and a distributed hash table for routing.
This provides near zero-configuration networking without many of the security
and robustness issues that regular IPv4 and IPv6 networks have.

The service is off by default.

%package tools
Summary: Nodejs tools for cjdns
Group: Networking/Other
Requires: nodejs
Requires: %name = %EVR
BuildArch: noarch

%description tools
Nodejs tools for cjdns. Highlights:
peerStats          show current peer status
cjdnslog           display cjdroute log
cjdns-traceroute   trace route to cjdns IP
sessionStats       show current crypto sessions

%package python
Summary: Python tools for cjdns
Group: Networking/Other
Requires: python
Requires: %name = %EVR
BuildArch: noarch

%description python
Python tools for cjdns.

%package graph
Summary: Python tools for cjdns
Group: Networking/Other
Requires: %name-python = %EVR
Requires: python-module-networkx
BuildArch: noarch

%description graph
Python graphing tools for cjdns.

%patch1 -p1


mkdir -p %buildroot{%_sbindir,%_sysconfdir,%systemd_unitdir,%_exec_prefix/libexec/cjdns}
install -p -m755 cjdroute %buildroot%_sbindir/cjdroute
./cjdroute --genconf > %buildroot%_sysconfdir/cjdroute.conf
install -p -m644 contrib/systemd/cjdns*.service %buildroot%systemd_unitdir
install -pD -m755 cjdns.service %buildroot%_initdir/cjdns
install -p -m755 contrib/sh/ %buildroot%_exec_prefix/libexec/cjdns/run-cjdroute
mkdir -p %buildroot%_sysconfdir/cjdns/up.d

# install c and nodejs tools
mkdir -p %buildroot%_exec_prefix/libexec/cjdns/contrib
install -p publictoip6 privatetopublic mkpasswd makekeys randombytes sybilsim \
rm -f node_modules/nthen/.npmignore
cp -pr tools node_modules %buildroot%_exec_prefix/libexec/cjdns

install -p -m755 %buildroot%_exec_prefix/libexec/cjdns/cjdns-up

# symlinks for selected nodejs tools
mkdir -p %buildroot%_bindir
for t in peerStats sessionStats cjdnslog search dumpLinks dumptable \
         dumpRumorMill pathfinderTree pingAll; do
  ln -sf $(relative %_exec_prefix/libexec/cjdns/tools/$t %_bindir/$t) %buildroot%_bindir/$t
for t in traceroute; do
  ln -sf $(relative %_exec_prefix/libexec/cjdns/tools/$t %_bindir/cjdns-$t) %buildroot%_bindir/cjdns-$t

# symlinks for selected C tools that don't conflict with other packages
for t in publictoip6 randombytes makekeys; do
  ln -sf $(relative %_exec_prefix/libexec/cjdns/$t %_bindir/$t) %buildroot%_bindir/$t

# cjdns-online script
install -pm 755 contrib/systemd/ \

# man pages
mkdir -p %buildroot%_man5dir
install -pm 644 doc/man/cjdroute.conf.5 %buildroot%_man5dir

# install python tools that pull in networkx for graphing
cp -pr contrib/python %buildroot%_exec_prefix/libexec/cjdns

# These files are installed via doc and license
rm %buildroot%_exec_prefix/libexec/cjdns/python/
rm %buildroot%_exec_prefix/libexec/cjdns/python/cjdns-dynamic.conf
rm %buildroot%_exec_prefix/libexec/cjdns/python/cjdnsadmin/

# symlink python tools w/o conflict with nodejs tools or needing networkx
for t in trashroutes \
         getLinks ip6topk pktoip6 cjdnsa searches findnodes; do
  ln -sf $(relative %_exec_prefix/libexec/cjdns/python/$t %_bindir/$t) %buildroot%_bindir/$t

# symlink python tools that pull in networkx for graphing
for t in drawgraph dumpgraph graphStats; do
  ln -sf $(relative %_exec_prefix/libexec/cjdns/python/$t %_bindir/$t) %buildroot%_bindir/$t

/usr/sbin/groupadd -r -f cjdns ||:
/usr/sbin/useradd -g cjdns -c 'The cjdns daemon' \
        -d /dev/null -s /dev/null -r cjdns >/dev/null 2>&1 ||:

%ifarch %ix86
%set_verify_elf_method textrel=relaxed

%doc README_*.md
%doc contrib/doc/
%doc contrib/doc/
%doc contrib/doc/
%doc contrib/doc/
%doc contrib/doc/
%doc contrib/doc/
%doc contrib/doc/
%attr(0600,root,root) %config(noreplace) %_sysconfdir/cjdroute.conf
%dir %_exec_prefix/libexec/cjdns
%dir %_sysconfdir/cjdns
%dir %_sysconfdir/cjdns/up.d

%files tools
%doc contrib/doc/
%doc contrib/doc/
%doc contrib/doc/
%doc contrib/doc/
%doc contrib/doc/

%files python
%doc contrib/python/cjdnsadmin/
%doc contrib/python/ contrib/python/cjdns-dynamic.conf
%dir %_exec_prefix/libexec/cjdns/python

%files graph

* Wed May 15 2019 Aleksei Nikiforov <> 20.3-alt1
- Updated to upstream version 20.3.

* Tue Oct 16 2018 Aleksei Nikiforov <> 20.2-alt1
- Updated to upstream version 20.2.

* Wed Feb 28 2018 Aleksei Nikiforov <> 20.1-alt1
- Updated to upstream version 20.1.

* Wed Sep 20 2017 Aleksei Nikiforov <> 20-alt2
- Updated build dependencies.

* Tue Sep 19 2017 Aleksei Nikiforov <> 20-alt1
- Updated to upstream version 20.
- Built with support of %%ubt macro.

* Tue Jun 20 2017 Aleksei Nikiforov <> 19.1-alt1
- First build for ALT
Back to Top