From a47bfafa064666c1601187f14463da212b39164c Mon Sep 17 00:00:00 2001
From: Utz-Uwe Haus <uhaus@cray.com>
Date: Tue, 21 Apr 2020 18:36:45 +0200
Subject: [PATCH] ensure yaml schema installation

---
 attributes/Makefile.am | 16 +++++++++++++++-
 docs/Makefile.am       | 14 +++++++-------
 2 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/attributes/Makefile.am b/attributes/Makefile.am
index 53dfd453..d4730e06 100644
--- a/attributes/Makefile.am
+++ b/attributes/Makefile.am
@@ -30,7 +30,8 @@
 #
 
 noinst_LTLIBRARIES = libattributes.la
-EXTRA_DIST=maestro-schema-schema.yaml maestro-core.yaml user.yaml ecmwf.yaml \
+YAML_FILES=maestro-schema-schema.yaml maestro-core.yaml user.yaml ecmwf.yaml 
+EXTRA_DIST=$(YAML_FILES) \
            schema_type_parse.peg schema_type_parse.c schema_type_parse.h 
 #BUILT_SOURCES = schema_type_parse.c schema_type_parse.h
 
@@ -60,3 +61,16 @@ validate: user.yaml ecmwf.yaml maestro-core.yaml maestro-schema-schema.yaml
 	yamale -s maestro-schema-schema.yaml --strict user.yaml
 	yamale -s maestro-schema-schema.yaml --strict ecmwf.yaml
 	yamale -s maestro-schema-schema.yaml --strict maestro-core.yaml
+
+
+install-data-local:
+	$(MKDIR_P) $(DESTDIR)$(datadir)/maestro/schemas
+	for f in $(YAML_FILES); do \
+		$(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(datadir)/maestro/schemas/; \
+        done
+uninstall-local:
+	for f in $(YAML_FILES); do \
+		rm  $(DESTDIR)$(datadir)/maestro/schemas/$$f; \
+        done
+	-rmdir $(DESTDIR)$(datadir)/maestro/schemas
+	-rmdir $(DESTDIR)$(datadir)/maestro
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 7bba1ff0..0e4ca5f5 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -57,21 +57,21 @@ clean-local:
 	-${RM} -r html latex man
 
 install-data-local:
-	$(MKDIR_P) $(DESTDIR)$(datadir)/$(PACKAGE)/html
+	$(MKDIR_P) $(DESTDIR)$(docdir)/html
 	for f in `find html -maxdepth 1 -type f `; do \
 		$(INSTALL_DATA) $(srcdir)/$$f \
-		$(DESTDIR)$(datadir)/$(PACKAGE)/html/; done
-	$(MKDIR_P) $(DESTDIR)$(datadir)/$(PACKAGE)/html/search
+		$(DESTDIR)$(docdir)/html/; done
+	$(MKDIR_P) $(DESTDIR)$(docdir)/html/search
 	for f in `find html/search -maxdepth 1 -type f `; do \
 		$(INSTALL_DATA) $(srcdir)/$$f \
-		$(DESTDIR)$(datadir)/$(PACKAGE)/html/search/; done
+		$(DESTDIR)$(docdir)/html/search/; done
 
 uninstall-local:
-	for f in `find $(DESTDIR)$(datadir)/$(PACKAGE)/html -type f `; do \
+	for f in `find $(DESTDIR)$(docdir)/html -type f `; do \
 		rm $$f; \
         done
-	-rmdir $(DESTDIR)$(datadir)/$(PACKAGE)/html/search
-	-rmdir $(DESTDIR)$(datadir)/$(PACKAGE)/html
+	-rmdir $(DESTDIR)$(docdir)/html/search
+	-rmdir $(DESTDIR)$(docdir)/html
 
 
 endif
-- 
GitLab