Speaking of the odt files in the documentation directory...

documentaion: add Makefile to generate pdfs from odt files

The odt files in the documentation directory are hard to consume
in that form. This adds a Makefile that generates pdfs from the
odt files, using the unoconv tool, based on the idea/github tree
https://github.com/jessfraz/apparmor-docs from
Jessica Frazelle <m...@jessfraz.com>.

That said, renaming the odt files to not have spaces would simplify this
a lot.

Signed-off-by: Steve Beattie <st...@nxnw.org>
---
 documentation/Makefile |   59 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

Index: b/documentation/Makefile
===================================================================
--- /dev/null
+++ b/documentation/Makefile
@@ -0,0 +1,59 @@
+# ----------------------------------------------------------------------
+#    Copyright (c) 2016 Canonical Ltd.
+#
+#    This program is free software; you can redistribute it and/or
+#    modify it under the terms of version 2 of the GNU General Public
+#    License published by the Free Software Foundation.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+# ----------------------------------------------------------------------
+NAME           = documentation
+all:
+COMMONDIR=../common/
+
+include $(COMMONDIR)/Make.rules
+
+all: docs
+
+# bleah, handling files with spaces is awful in make
+su= $(subst \ ,_,$1)
+us= $(subst _,\ ,$1)
+
+SOURCES:= AppArmor\ Developer\ 1\ -\ Kernel\ Notes.odt \
+          AppArmor\ Developer\ 2\ -\ policy\ layout\ and\ encoding.odt \
+          AppArmor\ Developer\ 3\ -\ HFA.odt \
+          AppArmor\ Developer\ 4\ -\ Policy\ compilation.odt \
+          AppArmor\ Developer\ 5\ -\ extending\ apparmor\ to\ userspace.odt \
+          AppArmor\ Policy.odt \
+          Techdoc\ -\ eHFA.odt
+
+_SOURCES=$(call su,$(SOURCES))
+DOCS:=$(_SOURCES:.odt=.pdf)
+
+.PHONY: docs
+docs: $(DOCS)
+
+
+# cannot figure out how to get make to honor the %.odt dependency correctly
+# so need to manually enter the list below
+%.pdf:
+       unoconv -v -f pdf --output "$@" $(call us,$(@:.pdf=.odt))
+
+AppArmor_Policy.pdf: AppArmor\ Policy.odt
+AppArmor_Developer_1_-_Kernel_Notes.pdf: AppArmor\ Developer\ 1\ -\ Kernel\ 
Notes.odt
+AppArmor_Developer_2_-_policy_layout_and_encoding.pdf: AppArmor\ Developer\ 2\ 
-\ policy\ layout\ and\ encoding.odt
+AppArmor_Developer_3_-_HFA.pdf: AppArmor\ Developer\ 3\ -\ HFA.odt
+AppArmor_Developer_4_-_Policy_compilation.pdf: AppArmor\ Developer\ 4\ -\ 
Policy\ compilation.odt
+AppArmor_Developer_5_-_extending_apparmor_to_userspace.pdf: AppArmor\ 
Developer\ 5\ -\ extending\ apparmor\ to\ userspace.odt
+Techdoc_-_eHFA.pdf: Techdoc\ -\ eHFA.odt
+
+.PHONY: clean
+ifndef VERBOSE
+.SILENT: clean
+endif
+clean:
+       rm -f *.pdf
+

-- 
Steve Beattie
<sbeat...@ubuntu.com>
http://NxNW.org/~steve/

Attachment: signature.asc
Description: PGP signature

-- 
AppArmor mailing list
AppArmor@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/apparmor

Reply via email to