From 1180249596c09353c7e093d7c025e627cf26e0ab Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 18 Nov 2011 01:18:12 +0000 Subject: Improve DOAP metadata. Add function to generate NEWS file from DOAP metadata. --- core.lv2/lv2-doap.ttl | 40 +++++++++++++++++++++++++++------------- core.lv2/wscript | 43 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 69 insertions(+), 14 deletions(-) diff --git a/core.lv2/lv2-doap.ttl b/core.lv2/lv2-doap.ttl index bbd093b..f01eadb 100644 --- a/core.lv2/lv2-doap.ttl +++ b/core.lv2/lv2-doap.ttl @@ -3,6 +3,19 @@ @prefix foaf: . @prefix rdfs: . + + a foaf:Person ; + foaf:name "Steve Harris" ; + foaf:homepage ; + rdfs:seeAlso . + + + a foaf:Person ; + foaf:name "David Robillard" ; + foaf:homepage ; + foaf:mbox ; + rdfs:seeAlso . + a doap:Project ; doap:license ; @@ -13,9 +26,10 @@ doap:programming-language "C" ; doap:release [ doap:revision "4.1" ; + dcs:blame ; dcs:changeset [ dcs:item [ - rdfs:label "Add lv2:extensionData and lv2:ExtensionData for plugins to indicate that they support some URI for LV2_Descriptor::extension_data." + rdfs:label "Add lv2:extensionData and lv2:ExtensionData for plugins to indicate that they support some URI for extension_data()." ] , [ rdfs:label "Remove lv2config in favour of the convention that extension bundles simply install headers to standard URI-like include paths." ] , [ @@ -26,6 +40,7 @@ doap:revision "4.0" ; doap:created "2011-03-18" ; doap:file-release ; + dcs:blame ; dcs:changeset [ dcs:item [ rdfs:label "Make doap:license suggested, but not required (for wrappers)." @@ -59,6 +74,7 @@ doap:revision "3.0" ; doap:created "2008-11-08" ; doap:file-release ; + dcs:blame ; dcs:changeset [ dcs:item [ rdfs:label "Require that serialisations refer to ports by symbol rather than index." @@ -71,16 +87,14 @@ ] , [ doap:revision "2.0" ; doap:created "2008-02-10" ; - doap:file-release + doap:file-release ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Initial packaging." + ] + ] ] ; - doap:maintainer [ - a foaf:Person ; - foaf:name "Steve Harris" ; - foaf:homepage ; - rdfs:seeAlso - ] , [ - a foaf:Person ; - foaf:name "David Robillard" ; - foaf:homepage ; - rdfs:seeAlso - ] . + doap:developer , + ; + doap:maintainer . diff --git a/core.lv2/wscript b/core.lv2/wscript index 2831a5e..d57985f 100644 --- a/core.lv2/wscript +++ b/core.lv2/wscript @@ -1,6 +1,5 @@ #!/usr/bin/env python import os -import sys from waflib.extras import autowaf as autowaf import waflib.Options as Options @@ -33,6 +32,48 @@ def configure(conf): autowaf.display_msg(conf, "LV2 bundle directory", conf.env['LV2DIR']) print('') +def write_news(bld): + import rdflib + import textwrap + from time import strftime, strptime + + doap = rdflib.Namespace('http://usefulinc.com/ns/doap#') + dcs = rdflib.Namespace('http://ontologi.es/doap-changeset#') + rdfs = rdflib.Namespace('http://www.w3.org/2000/01/rdf-schema#') + foaf = rdflib.Namespace('http://xmlns.com/foaf/0.1/') + rdf = rdflib.Namespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#') + + m = rdflib.ConjunctiveGraph() + m.parse('lv2-doap.ttl', format='n3') + spec = m.value(None, rdf.type, doap.Project) + + entries = {} + for r in m.triples([spec, doap.release, None]): + release = r[2] + revision = m.value(release, doap.revision, None) or '9999' + date = m.value(release, doap.created, None) or '9999-01-01' + blamee = m.value(release, dcs.blame, None) + changeset = m.value(release, dcs.changeset, None) + + entry = '%s (%s) stable;\n' % (APPNAME, revision) + + if changeset: + for i in m.triples([changeset, dcs.item, None]): + entry += '\n * ' + '\n '.join( + textwrap.wrap(m.value(i[2], rdfs.label, None), width=79)) + + entry += '\n\n -- %s <%s> %s\n\n' % ( + m.value(blamee, foaf.name, None), + m.value(blamee, foaf.mbox, None).replace('mailto:', ''), + strftime('%a, %d %b %Y %H:%M:%S +0000', strptime(date, '%Y-%m-%d'))) + + entries[revision] = entry + + news = open('NEWS', 'w') + for e in sorted(entries.keys(), reverse=True): + news.write(entries[e]) + news.close() + def build(bld): # Header "library" obj = bld(export_includes = ['.'], -- cgit v1.2.1