From fc4c4389a766829f3ca521fbf3101ceb80706f1e Mon Sep 17 00:00:00 2001 From: Stuart D. Gathman Date: Aug 03 2019 22:49:45 +0000 Subject: Fix man page build by patching a local copy of ronn --- diff --git a/cjdns.puts.patch b/cjdns.puts.patch new file mode 100644 index 0000000..0979f3c --- /dev/null +++ b/cjdns.puts.patch @@ -0,0 +1,26 @@ +diff -up ./node_modules/ronn/bin/ronn.js.puts ./node_modules/ronn/bin/ronn.js +--- ./node_modules/ronn/bin/ronn.js.puts 2019-08-03 18:32:03.560415945 -0400 ++++ ./node_modules/ronn/bin/ronn.js 2019-08-03 18:33:18.600372936 -0400 +@@ -2,7 +2,8 @@ + + var RONN_VERSION = "0.4.0"; + +-var sys = require('util'); ++var console = require('console'); ++var sys = { 'puts': console.log, 'debug': console.error }; + var fs = require('fs'); + var path = require('path'); + var opts = require('opts'); +diff -up ./node_modules/ronn/lib/ronn.js.puts ./node_modules/ronn/lib/ronn.js +--- ./node_modules/ronn/lib/ronn.js.puts 2019-08-03 18:32:11.703523935 -0400 ++++ ./node_modules/ronn/lib/ronn.js 2019-08-03 18:33:02.578184733 -0400 +@@ -4,7 +4,8 @@ + */ + + var md = require('markdown').markdown; +-var sys = require('util'); ++var console = require('console'); ++var sys = { 'puts': console.log, 'debug': console.error }; + + /* exports Ronn class + * usage : diff --git a/cjdns.spec b/cjdns.spec index c0cd415..bb68196 100644 --- a/cjdns.spec +++ b/cjdns.spec @@ -60,6 +60,14 @@ %global use_upstart 0 %endif +%if 0 && 0%{?fedora} > 30 +%global use_marked 1 +%global makeman marked-man +%else +%global use_marked 0 +%global makeman ../../ronn +%endif + # FIXME: Needs dependencies and install www dir someplace reasonable. %global with_admin 0 @@ -72,7 +80,7 @@ Name: cjdns # major version is cjdns protocol version: Version: 20.3 -Release: 4%{?dist} +Release: 5%{?dist} Summary: The privacy-friendly network without borders # cjdns is all GPLv3 except libuv which is MIT and BSD and ISC # cnacl is unused except when use_embedded is true @@ -81,6 +89,8 @@ URL: http://hyperboria.net/ Source0: https://github.com/cjdelisle/cjdns/archive/%{name}-v%{version}.tar.gz Source1: cjdns.README_Fedora.md Source2: cjdns.service +# nroff overlay for nodejs-marked +Source3: https://github.com/kapouer/marked-man/archive/0.7.0.tar.gz#/marked-man-0.7.0.tar.gz # Add targeted selinux policy Patch0: cjdns.selinux.patch # Allow python2.6 for build. Python is not used during the build @@ -137,8 +147,14 @@ Patch18: cjdns.libuv.patch Patch19: cjdns.fuzz.patch # patch to use /proc/sys/kernel/random/uuid instead of sysctl Patch20: cjdns.sysctl.patch +# Patch ronn to stop using deprecated util.puts and util.debug +Patch21: cjdns.puts.patch +%if %{use_marked} +BuildRequires: nodejs, nodejs-marked, python2 +%else BuildRequires: nodejs, nodejs-ronn, python2 +%endif # Automated package review hates explicit BR on make, but it *is* needed BuildRequires: make gcc @@ -240,6 +256,10 @@ Python peer graph tools for cjdns. cp %{SOURCE2} contrib/systemd +%if %{use_marked} +tar xvfz %{SOURCE3} +%endif + %if 0%{use_embedded} # disable CPU opt %else @@ -334,6 +354,12 @@ rm node_build/dependencies/cnacl/node_build/plans/*_AVX_plan.json #rm node_build/dependencies/cnacl/node_build/plans/x86_SSE2_plan.json %endif +%if !%{use_marked} +cp -r /usr/lib/node_modules/ronn node_modules +%patch21 -p1 -b .puts +ln -s node_modules/ronn/bin/ronn.js ronn +%endif + # FIXME: grep Version_CURRENT_PROTOCOL util/version/Version.h and # check that it matches major %%{version} @@ -431,12 +457,12 @@ cd contrib/doc for m in *.md; do case ${m%.md} in traceroute) M="1" - ronn-nodejs $m >%{buildroot}%{_mandir}/man$M/cjdns-${m%.md}.$M + %{makeman} $m >%{buildroot}%{_mandir}/man$M/cjdns-${m%.md}.$M continue ;; privatetopublic|sybilsim) M="8" ;; *) M="1" ;; esac - ronn-nodejs $m >%{buildroot}%{_mandir}/man$M/${m%.md}.$M + %{makeman} $m >%{buildroot}%{_mandir}/man$M/${m%.md}.$M done cd - @@ -609,6 +635,10 @@ fi %{_bindir}/graphStats %changelog +* Sat Aug 03 2019 Stuart Gathman - 20.3-5 +- Remove deprecated sysctl() call in getUUID (read from /proc/.../random/uuid) +- Patch a local copy of ronn to stop calling util.puts/util.debug + * Wed Jul 24 2019 Fedora Release Engineering - 20.3-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild