Use automake for www/ directory
authorDavid Woodhouse <David.Woodhouse@intel.com>
Wed, 28 Sep 2011 01:41:37 +0000 (02:41 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Wed, 28 Sep 2011 02:59:53 +0000 (03:59 +0100)
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Makefile.am
configure.ac
www/Makefile [deleted file]
www/Makefile.am [new file with mode: 0644]
www/images/Makefile.am [new file with mode: 0644]
www/inc/Makefile.am [new file with mode: 0644]
www/styles/Makefile.am [new file with mode: 0644]

index 51232d0..1945d43 100644 (file)
@@ -1,5 +1,8 @@
 
-SUBDIRS = www
+SUBDIRS =
+if BUILD_WWW
+SUBDIRS += www
+endif
 if USE_NLS
 SUBDIRS += po
 endif
index 012469f..29e35f5 100644 (file)
@@ -84,4 +84,13 @@ AC_CHECK_LIB(ssl, dtls1_stop_timer,
                  AC_DEFINE(HAVE_DTLS1_STOP_TIMER, [1], [OpenSSL has dtls1_stop_timer() function]),
                  ,,${OPENSSL_LIBS})
 
-AC_OUTPUT(Makefile openconnect.pc po/Makefile.in)
+AC_PATH_PROG(PYTHON, [python], [], $PATH:/bin:/usr/bin)
+if (test -n "${ac_cv_path_PYTHON}"); then
+   AC_SUBST(PYTHON, ${ac_cv_path_PYTHON})
+else
+   AC_MSG_NOTICE([Python not found; not building HTML pages])
+fi
+AM_CONDITIONAL(BUILD_WWW, [test -n "${ac_cv_path_PYTHON}"])
+                  
+AC_OUTPUT(Makefile openconnect.pc po/Makefile.in www/Makefile \
+         www/styles/Makefile www/inc/Makefile www/images/Makefile)
diff --git a/www/Makefile b/www/Makefile
deleted file mode 100644 (file)
index 4a6f907..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-CONV   = "./html.py"
-
-FTR_PAGES := csd.html features.html gui.html nonroot.html
-START_PAGES := building.html connecting.html manual.html started.html vpnc-script.html 
-MAIN_PAGES := changelog.html download.html index.html packages.html platforms.html
-TARGETS        = $(FTR_PAGES) $(START_PAGES) $(MAIN_PAGES)
-
-all: $(TARGETS)
-
-$(TARGETS): %.html: %.xml inc/*.tmpl menu1.xml
-       $(CONV) -f $< || (rm $@; exit 1)
-
-clean:
-       rm -f $(TARGETS) openconnect.8.inc
-
-$(FTR_PAGES): menu2-features.xml
-$(START_PAGES): menu2-started.xml
-$(MAIN_PAGES): menu2.xml
-
-manual.html: openconnect.8.inc
-openconnect.8.inc: ../openconnect.8
-       groff -t -K UTF-8 -mandoc -Txhtml $^ | sed -e '1,/<body>/d' -e '/<\/body>/,$$d' > $@
diff --git a/www/Makefile.am b/www/Makefile.am
new file mode 100644 (file)
index 0000000..a6eff38
--- /dev/null
@@ -0,0 +1,30 @@
+#
+
+SUBDIRS = styles inc images
+CONV   = "./html.py"
+
+FTR_PAGES = csd.html features.html gui.html nonroot.html
+START_PAGES = building.html connecting.html manual.html started.html vpnc-script.html 
+INDEX_PAGES = changelog.html download.html index.html packages.html platforms.html
+TOPLEVEL_PAGES = contribute.html mail.html technical.html
+
+ALL_PAGES = $(FTR_PAGES) $(START_PAGES) $(INDEX_PAGES) $(TOPLEVEL_PAGES)
+
+pkgdata_DATA = $(ALL_PAGES)
+
+.xml.html:
+       $(PYTHON) $(CONV) -f $< || (rm $@; exit 1)
+
+clean-local:
+       rm -f $(ALL_PAGES) openconnect.8.inc
+
+$(ALL_PAGES): menu1.xml inc/*.tmpl
+$(FTR_PAGES): menu2-features.xml
+$(START_PAGES): menu2-started.xml
+$(MAIN_PAGES): menu2.xml
+
+manual.html: openconnect.8.inc
+openconnect.8.inc: ../openconnect.8
+       groff -t -K UTF-8 -mandoc -Txhtml $^ | sed -e '1,/<body>/d' -e '/<\/body>/,$$d' > $@
+
+EXTRA_DIST = $(patsubst %.html,%.xml,$(ALL_PAGES)) menu1.xml menu2*.xml html.py
diff --git a/www/images/Makefile.am b/www/images/Makefile.am
new file mode 100644 (file)
index 0000000..1d50866
--- /dev/null
@@ -0,0 +1,3 @@
+imagesdir = $(pkgdatadir)/images
+dist_images_DATA = *.png *.svg
+
diff --git a/www/inc/Makefile.am b/www/inc/Makefile.am
new file mode 100644 (file)
index 0000000..ff0b008
--- /dev/null
@@ -0,0 +1,3 @@
+tmpldatadir = $(pkgdatadir)/inc
+dist_tmpldata_DATA = *.tmpl
+
diff --git a/www/styles/Makefile.am b/www/styles/Makefile.am
new file mode 100644 (file)
index 0000000..3fa5214
--- /dev/null
@@ -0,0 +1,3 @@
+stylesdatadir = $(pkgdatadir)/styles
+dist_stylesdata_DATA = main.css
+