Description: Install OMF files at the right place
 The upstream build system puts OMF file under /usr/share/omf/gnucash-docs, but
 Yelp does not see them. If the OMF file is $foo-C.omf, Yelp wants it under
 /usr/share/omf/$foo.
Author: Sébastien Villemot <sebastien.villemot@ens.fr>
Bug-Debian: http://bugs.debian.org/464587
--- a/omf.make
+++ b/omf.make
@@ -26,7 +26,7 @@
 # 	Version: 0.1.2 (last updated: March 20, 2002)
 #
 
-omf_dest_dir=$(datadir)/omf/gnucash-docs
+omf_dest_dir=$(datadir)/omf
 scrollkeeper_localstate_dir = $(localstatedir)/scrollkeeper
 
 omf: omf_timestamp
@@ -40,17 +40,21 @@
 install-data-hook-omf:
 	$(mkinstalldirs) "$(DESTDIR)$(omf_dest_dir)"
 	for file in $(omffile); do \
-	$(INSTALL_DATA) "$$file.out" "$(DESTDIR)$(omf_dest_dir)/$$file"; \
-	done
-	@if test "x$(_ENABLE_SK)" = "xtrue"; then \
-	scrollkeeper-update -p "$(scrollkeeper_localstate_dir)" -o "$(DESTDIR)$(omf_dest_dir)"; \
-	fi;
+  omfdir="$(DESTDIR)$(omf_dest_dir)/`echo $$file | sed 's/-[^-]*\.omf$$//'`"; \
+	$(mkinstalldirs) "$$omfdir"; \
+	$(INSTALL_DATA) "$$file.out" "$$omfdir/$$file"; \
+	if test "x$(_ENABLE_SK)" = "xtrue"; then \
+	scrollkeeper-update -p "$(scrollkeeper_localstate_dir)" -o "$$omfdir"; \
+	fi; \
+  done;
 
 uninstall-local-omf:
-	@if test "x$(_ENABLE_SK)" == "xtrue"; then \
-	scrollkeeper-uninstall -p "$(scrollkeeper_localstate_dir)" "$(DESTDIR)$(omf_dest_dir)/$$file"; \
+	for file in $(omffile); do \
+  omfdir="$(DESTDIR)$(omf_dest_dir)/`echo $$file | sed 's/-[^-]*\.omf$$//'`"; \
+	if test "x$(_ENABLE_SK)" == "xtrue"; then \
+	scrollkeeper-uninstall -p "$(scrollkeeper_localstate_dir)" "$$omfdir/$$file"; \
 	fi; \
-	for file in $(srcdir)/*.omf; do \
-	  basefile=`echo $$file | sed -e  's,^.*/,,'`; \
-	  rm -f "$(DESTDIR)$(omf_dest_dir)/$$basefile"; \
-	done
+	rm -f "$$omfdir/$$file; \
+  rmdir "$$omfdir"; \
+  done;
+
