Package: doc-rfc
Version: 20230121-1
Severity: wishlist
Tags: patch
X-Debbugs-Cc: [email protected]

Hi,

doc-rfc currently ships entirely under non-free/doc, but a real subset
of its content is DFSG-free and doesn't need to be there.

RFC Editor "Independent Submission" stream documents (as opposed to
IETF-stream documents) are granted unlimited derivative-work rights
under BCP 78 Sec. 4.2a(c) -- a strictly more permissive grant than
IETF-stream documents, whose authors are only required to permit
derivative works for use within the IETF standards process (BCP 78
Sec. 3.3). This distinction, and the exact wording of both grants, is
already explained in doc-rfc's own debian/copyright under "Permissions
for Derivative Works" -- the DFSG-free content was already documented
in the source package, just never split out.

Attached is a patch that:

- Extends debian/makestatus.py to read each RFC's <stream> element
  (not just its status), and routes RFC4000-and-later Independent
  Submissions into a new "independent" category, overriding whatever
  status-based category they'd otherwise land in (stream-based
  copyright classification is orthogonal to IETF lifecycle status --
  an obsoleted Independent Submission keeps its rights grant).

- Adds a new doc-rfc-independent binary package in Section: doc
  (main), with matching .install/.doc-base/.lintian-overrides files,
  wired into the doc-rfc metapackage's Depends so installing doc-rfc
  still gets everything it did before, just split across an extra
  free package.

- Documents the split and its exact scope in debian/copyright.

The subset is narrowed conservatively, in two ways, both verified
against the actual RFC text rather than assumed from metadata:

1. Only RFC4000 and later. Earlier Independent Submissions predate the
   Trust Legal Provisions boilerplate and typically carry only an
   ambiguous "Distribution of this memo is unlimited" notice, which
   says nothing about derivative works.

2. Independent Submissions that invoke BCP 78 Sec. 5.2a's "No
   Derivative Works" option (which independent submitters, unlike
   IETF-stream authors, may request) are excluded even when
   RFC4000+. I grepped every RFC4000+ Independent Submission in this
   snapshot for the standard NDW sentence ("This document may not be
   modified, and derivative works of it may not be created, except to
   format it for publication as an RFC or to translate it into
   languages other than English.") rather than trusting the stream tag
   alone. Nine documents carry it and are excluded: RFC 5513, 5564,
   5830, 5831, 5832, 6013, 7425, 7868, and 8216. I also confirmed the
   remaining 303 all carry the standard unrestricted BCP 78 boilerplate
   (none are silently missing it).

Verified:
- debian/makestatus.py produces exactly 303 "independent" entries
  against this snapshot's rfc-index.xml, none of which are the 9 NDW
  documents above.
- Ran the real debian/makelinks.pl end-to-end: 1021 real files (303
  RFCs across .txt/.html/.pdf/.json) land under
  debian/tmp/usr/share/doc/RFC/independent, and the 9 NDW documents
  land in their original (non-free) category directories instead, as
  they should.
- debian/control parses cleanly via Dpkg::Control::Info (10 binary
  packages).
- Patch applies with zero errors against a fresh pristine 20230121-1
  source tree (dpkg-source -x + patch -p1).

I'd rather raise this for discussion than force a full
dpkg-buildpackage + lintian pass on a package split I haven't
discussed with you first -- happy to do that round (and a real
`.deb`-level lintian run) if this direction looks right to you.

Changes:
- debian/changelog (new entry)
- debian/control (new doc-rfc-independent package, Section: doc)
- debian/copyright (new section documenting the split's scope)
- debian/makestatus.py (stream-aware categorization)
- debian/doc-rfc-independent.install (new)
- debian/doc-rfc-independent.doc-base.independent (new)
- debian/doc-rfc-independent.lintian-overrides (new)

Thanks,
Stefan Andrei Ionut
diff -ruN '--exclude=.pc' a/debian/changelog b/debian/changelog
--- a/debian/changelog	2026-10-11 07:59:40.850482383 +0000
+++ b/debian/changelog	2026-10-11 08:00:04.398690251 +0000
@@ -1,3 +1,22 @@
+doc-rfc (20230121-2) UNRELEASED; urgency=medium
+
+  * Split out RFC Editor Independent Submission documents (RFC4000 and
+    later, excluding the few that invoke the "No Derivative Works"
+    option BCP 78 allows independent submitters to request) into a
+    new doc-rfc-independent binary package in main. These documents
+    carry an unlimited derivative-works grant under BCP 78 Sec.
+    4.2a(c), unlike the rest of this source package's content, which
+    only permits derivative works within the IETF standards process
+    (BCP 78 Sec. 3.3) and is therefore correctly non-free.
+  * debian/makestatus.py: classify by <stream> as well as status, so
+    qualifying Independent Submissions land in the new category
+    regardless of their IETF lifecycle status (current/historic/
+    obsoleted). Verified end-to-end: 303 RFCs (1021 files) correctly
+    isolated; the 9 RFCs that invoke NDW (5513, 5564, 5830, 5831,
+    5832, 6013, 7425, 7868, 8216) correctly stay out.
+
+ -- Stefan Andrei Ionut <[email protected]>  Sun, 11 Oct 2026 10:56:51 +0300
+
 doc-rfc (20230121-1) unstable; urgency=medium
 
   * New upstream version.
diff -ruN '--exclude=.pc' a/debian/control b/debian/control
--- a/debian/control	2026-10-11 07:59:40.850973427 +0000
+++ b/debian/control	2026-10-11 08:00:04.422495653 +0000
@@ -16,6 +16,7 @@
 Depends: ${misc:Depends},
  doc-rfc-experimental,
  doc-rfc-fyi-bcp,
+ doc-rfc-independent,
  doc-rfc-informational,
  doc-rfc-misc,
  doc-rfc-old-std,
@@ -277,3 +278,49 @@
  .
   * Obsoleted Experimental RFCs
   * Unclassified RFCs
+
+Package: doc-rfc-independent
+Section: doc
+Architecture: all
+Depends: ${misc:Depends}
+Replaces:
+ doc-rfc               (<< ${source:Version}),
+ doc-rfc-experimental  (<< ${source:Version}),
+ doc-rfc-fyi-bcp       (<< ${source:Version}),
+ doc-rfc-informational (<< ${source:Version}),
+ doc-rfc-misc          (<< ${source:Version}),
+ doc-rfc-old-std       (<< ${source:Version}),
+ doc-rfc-others        (<< ${source:Version}),
+ doc-rfc-std           (<< ${source:Version}),
+ doc-rfc-std-proposed  (<< ${source:Version}),
+Breaks:
+ doc-rfc               (<< ${source:Version}),
+ doc-rfc-experimental  (<< ${source:Version}),
+ doc-rfc-fyi-bcp       (<< ${source:Version}),
+ doc-rfc-informational (<< ${source:Version}),
+ doc-rfc-misc          (<< ${source:Version}),
+ doc-rfc-old-std       (<< ${source:Version}),
+ doc-rfc-others        (<< ${source:Version}),
+ doc-rfc-std           (<< ${source:Version}),
+ doc-rfc-std-proposed  (<< ${source:Version}),
+Description: RFC Editor Independent Submission documents (DFSG-free)
+ RFC (Request for Comments) documents are a series of technical and
+ organizational notes about the Internet. Most are edited by the
+ Internet Engineering Task Force (IETF), but a minority are published
+ directly by the RFC Editor as "Independent Submissions" -- not part
+ of the IETF standards process.
+ .
+ Unlike IETF-stream RFCs, whose authors are only required to permit
+ derivative works for use within the IETF standards process (BCP 78
+ Sec. 3.3), Independent Submission authors must grant unlimited
+ permission for derivative works, with attribution (BCP 78 Sec.
+ 4.2a(c)). This package ships exactly that subset: RFC4000-and-later
+ Independent Submissions, excluding the small number that opted out
+ via the "No Derivative Works" boilerplate BCP 78 permits independent
+ submitters to request (see debian/copyright).
+ .
+ Pre-RFC4000 independent submissions are intentionally excluded: they
+ predate the Trust Legal Provisions boilerplate and typically carry
+ only an ambiguous "distribution is unlimited" notice that does not
+ clearly grant derivative-work rights, so they remain packaged
+ alongside the rest of doc-rfc's non-free content instead.
diff -ruN '--exclude=.pc' a/debian/copyright b/debian/copyright
--- a/debian/copyright	2026-10-11 07:59:40.851243741 +0000
+++ b/debian/copyright	2026-10-11 08:00:04.399585563 +0000
@@ -194,3 +194,35 @@
 
        _________________________________________________________________
        _________________________________________________________________
+
+                 doc-rfc-independent packaging note (Debian)
+
+   The doc-rfc-independent binary package carries a subset of the
+   RFC Editor "Independent Submission" documents described above
+   under "Permissions for Derivative Works" (4b): those granted
+   unlimited derivative-work rights under BCP 78 Section 4.2a(c),
+   which is DFSG-free, unlike the restricted "within the IETF
+   standards process only" grant (4a) that the rest of this source
+   package's content carries.
+
+   The subset is narrowed two ways, both verified against the actual
+   published RFC text (not assumed from metadata alone):
+
+     * Only RFC4000 and later. Earlier Independent Submissions
+       predate the Trust Legal Provisions boilerplate and typically
+       carry only a "Distribution of this memo is unlimited" notice,
+       which is silent on derivative works -- not a confirmed free
+       grant.
+
+     * Independent Submissions that invoke BCP 78 Section 5.2a's
+       "No Derivative Works" (NDW) option -- which independent
+       submitters, unlike IETF-stream authors, may request -- are
+       excluded even when RFC4000+. As of this packaging, those are:
+       RFC 5513, 5564, 5830, 5831, 5832, 6013, 7425, 7868, and 8216,
+       each confirmed by grep for the standard NDW sentence ("This
+       document may not be modified, and derivative works of it may
+       not be created, except to format it for publication as an RFC
+       or to translate it into languages other than English.") in
+       the document body itself. This list should be re-verified
+       against any future rfc-index.xml update, since new Independent
+       Submissions can invoke NDW going forward.
diff -ruN '--exclude=.pc' a/debian/doc-rfc-independent.doc-base.independent b/debian/doc-rfc-independent.doc-base.independent
--- a/debian/doc-rfc-independent.doc-base.independent	1970-01-01 00:00:00.000000000 +0000
+++ b/debian/doc-rfc-independent.doc-base.independent	2026-10-11 08:00:04.400062670 +0000
@@ -0,0 +1,10 @@
+Document: rfc-independent
+Title: RFC Editor Independent Submissions
+Abstract: RFC Editor Independent Submissions (DFSG-free, unlimited derivative works granted)
+Section: Help/RFC
+
+Format: Text
+Files: /usr/share/doc/RFC/independent/*.txt.gz
+
+Format: PDF
+Files: /usr/share/doc/RFC/independent/*.pdf.gz
diff -ruN '--exclude=.pc' a/debian/doc-rfc-independent.install b/debian/doc-rfc-independent.install
--- a/debian/doc-rfc-independent.install	1970-01-01 00:00:00.000000000 +0000
+++ b/debian/doc-rfc-independent.install	2026-10-11 08:00:04.422947502 +0000
@@ -0,0 +1 @@
+usr/share/doc/RFC/independent
diff -ruN '--exclude=.pc' a/debian/doc-rfc-independent.lintian-overrides b/debian/doc-rfc-independent.lintian-overrides
--- a/debian/doc-rfc-independent.lintian-overrides	1970-01-01 00:00:00.000000000 +0000
+++ b/debian/doc-rfc-independent.lintian-overrides	2026-10-11 08:00:04.423288500 +0000
@@ -0,0 +1,3 @@
+# special case: each RFC has it's own copyright years, so we don't put the
+# years in debian/copyright, so lintian fails
+doc-rfc-independent binary: copyright-without-copyright-notice
diff -ruN '--exclude=.pc' a/debian/makestatus.py b/debian/makestatus.py
--- a/debian/makestatus.py	2026-10-11 07:59:40.870648616 +0000
+++ b/debian/makestatus.py	2026-10-11 08:00:04.423709280 +0000
@@ -18,6 +18,36 @@
 PUB = 'PUB'
 OLD = 'OLD'
 
+# DFSG split: RFC Editor "Independent Submission" stream documents carry
+# unlimited derivative-work rights under BCP 78 Sec. 4.2a(c) -- a strictly
+# more permissive grant than IETF-stream documents (restricted to use
+# "within the IETF standards process" per BCP 78 Sec. 3.3), which is why
+# independent-stream RFCs can ship in main while the rest of this source
+# package stays in non-free. Two things narrow this to a conservative
+# subset, both verified against the actual RFC text in this snapshot
+# rather than assumed from the stream tag alone:
+#
+# - MODERN_INDEPENDENT_MIN: pre-RFC4000-era documents (before ~2005)
+#   mostly predate the Trust Legal Provisions boilerplate entirely and
+#   only carry an ambiguous "Distribution of this memo is unlimited"
+#   line, which grants redistribution but says nothing about derivative
+#   works -- not a confirmed free grant, so they are conservatively left
+#   out and stay classified (and packaged) exactly as before.
+# - NDW_RESTRICTED: a small number of *modern* Independent Submissions
+#   explicitly opt out via the BCP 78 Sec. 5.2a "No Derivative Works"
+#   boilerplate (independent-stream authors may request this; see
+#   RFC5744/BCP78 Sec. 4.2a and Sec. 7.3). Found by grepping every
+#   RFC4000+ independent-stream document in this snapshot for the
+#   standard NDW sentence ("This document may not be modified, and
+#   derivative works of it may not be created, except to format it for
+#   publication as an RFC or to translate it into languages other than
+#   English."), not by trusting the stream tag alone -- RFC5744 itself
+#   (BCP 78/RFC5378's own update) merely *discusses* NDW boilerplate in
+#   prose and does NOT carry it, so a naive substring match on "NDW" or
+#   "derivative works" over-flags it; it is intentionally absent here.
+MODERN_INDEPENDENT_MIN = 4000
+NDW_RESTRICTED = {5513, 5564, 5830, 5831, 5832, 6013, 7425, 7868, 8216}
+
 def getDocId(entry):
   docid = entry.find('./index:doc-id', ns)
   if docid is None:
@@ -46,12 +76,17 @@
   obsoleted_by = entry.find('./index:obsoleted-by', ns)
   return obsoleted_by is not None
 
+def getStream(entry):
+  stream = entry.find('./index:stream', ns)
+  return stream.text if stream is not None else None
+
 print("Loading the rfc index...")
 
 index = ET.parse('../extra/rfc-index.xml')
 status = {}
 notissued = set()
 fyi = set()
+independent = set()
 maxrfc = -1
 minrfc = 1000
 
@@ -64,6 +99,9 @@
     PUB: getPubStatus(entry),
     OLD: isObsolete(entry),
   }
+  if (getStream(entry) == 'INDEPENDENT' and rfc_id >= MODERN_INDEPENDENT_MIN
+      and rfc_id not in NDW_RESTRICTED):
+    independent.add(rfc_id)
   maxrfc = max(maxrfc, rfc_id)
   minrfc = min(minrfc, rfc_id)
 
@@ -89,6 +127,13 @@
     now = status[rfc][NOW]
     category = ('for-your-information' if rfc in fyi else
       ('old/%s' % now if status[rfc][OLD] else now))
+    # Stream-based copyright classification is orthogonal to IETF
+    # standards-track lifecycle status (current/historic/obsoleted):
+    # an Independent Submission keeps its unlimited derivative-work
+    # grant regardless of whether it was later obsoleted, so this
+    # overrides whatever status-derived category was just computed.
+    if rfc in independent:
+      category = 'independent'
     print("%04d %-*s" % (rfc, len1, category), file=out)
 
 print("done.")

Reply via email to