[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#561456: "make get-orig-source" should use metadata from docbook



tags 561456 patch
thanks...

Hi Holger,

Le -10/01/-28163 15:59, Holger Levsen a écrit :

> the meta-data in the docbook output from wiki.d.o should be used by the 
> Makefile's get-orig-source target, to
> 
> - generate $DEBIAN_EDU_DOC_BUILDDATE (which should be renamed then too) on  
>   http://wiki.debian.org/DebianEdu/Documentation/$distro/AboutDebianEdu

I went a slightly different way, using <?dbtimestamp?> in order to add
the (localized) date at build time in the HTML too (it's already written
on the front page of the PDF). I'd love to write it the same way (in
plain text, not in numbers) in the HTML than in the PDF, but haven't
find yet how all this work ;-). I've removed the
$DEBIAN_EDU_DOC_BUILDDATE from the wiki, since it's mainly a PITA for
translations: the string was marked fuzzy every day…

> - suggest a list of copyright owners for
>   http://wiki.debian.org/DebianEdu/Documentation/$distro/CopyRight - I believe
>   suggesting is better then automatic generation, as not all edits are worth 
>   attribution.

The attached patch will allow to run “make update-copyright-dbk” to
produce the appropriate copyright.xml files, that can be amended (and
ultimately committed to the repository), and of course to use them at
build time (I only updated the needed targets to make it work for the
real build).

I put the built files (HTML and PDF) on my home server [0] (crappy
bandwidth alert) to offer a quick view of the result. For some files,
the result is quite fine [1], but when the holders list is huge [2], I
wouldn't use the same words…

	0: http://tilapin.org/ded/
	1: http://tilapin.org/ded/fr/rosegarden-manual.html
	2: http://tilapin.org/ded/de/debian-edu-squeeze-manual.html

Thus, not applying the patch but offer it publicly for discussions.

Please note that other DocBook tags (author, othercredit, etc.) could
also be used.

Regards

David

Index: documentation/Makefile.common
===================================================================
--- documentation/Makefile.common	(révision 76654)
+++ documentation/Makefile.common	(copie de travail)
@@ -19,6 +19,9 @@
 update-copyright:
 	../scripts/get_copyright $(path1) $(name)
 
+update-copyright-dbk:
+	../scripts/get_copyright $(path1) $(name) dbk
+
 status:
 	@for f in *.po ; do \
 		echo -n "$$f: "; \
@@ -31,10 +34,18 @@
 	# create localized XML files
 	po4a po4a.cfg
 
+	# add copyright to the XML file
+	COPYRIGHTEN=`sed -e '/^<\!-- START en -->/,/^<\!-- END en -->/P' -n copyright.xml` ; \
+	sed "/<\/article>/i<articleinfo>`echo $$COPYRIGHTEN`</articleinfo>" $(name).xml > $(name).en.xml
+
 	# build the English HTML version
-	$(XP) $(name).xml && mv index.html $(name).en.html
+	$(XP) $(name).en.xml && mv index.html $(name).en.html
+
 	# build the other HTML versions
 	-for f in $(LANGUAGES) ; do \
+		COPYRIGHTEN=`sed -e '/^<\!-- START en -->/,/^<\!-- END en -->/P' -n copyright.xml` ; \
+		COPYRIGHTTR=`sed -e "/^<\!-- START $$f -->/,/^<\!-- END $$f -->/P" -n copyright.xml` ; \
+		sed -i "/<\/article>/i<articleinfo>`echo $$COPYRIGHTEN $$COPYRIGHTTR`</articleinfo>" $(name).$$f.xml ; \
 		$(XP) $(name).$$f.xml && mv index.html $(name).$$f.html ; \
 	done
 else
@@ -64,7 +75,7 @@
 			if [ "$$f" = "en" ] ; then \
 			  mkdir -p $$LANGPATH/images/ ; \
 			  find images -maxdepth 1 -type f -exec cp \{\} $$LANGPATH/images/ \; ; \
-			  $(DBLATEX) -o $$LANGPATH/$(name).pdf $(name).xml ; \
+			  $(DBLATEX) -o $$LANGPATH/$(name).pdf $(name).en.xml ; \
 			else \
 			  	mkdir -p $$LANGPATH/images ; \
 			  	cd images ; \
Index: Makefile
===================================================================
--- Makefile	(révision 76654)
+++ Makefile	(copie de travail)
@@ -18,6 +18,11 @@
 		> debian/copyright
 	rm documentation/*/copyright.manual
 
+update-copyright-dbk:
+	$(MAKE) -C $(SRCDIR)/debian-edu-squeeze update-copyright-dbk
+	$(MAKE) -C $(SRCDIR)/rosegarden update-copyright-dbk
+	$(MAKE) -C $(SRCDIR)/audacity update-copyright-dbk
+
 status:
 	$(MAKE) -C $(SRCDIR)/debian-edu-squeeze status
 	$(MAKE) -C $(SRCDIR)/rosegarden status

Reply to: