# HG changeset patch # User John W. Eaton # Date 1531422415 14400 # Node ID a932bdccdef821c7009b16306cbceb49aa143eda # Parent 02766a14c461f706ae47ae639b78242dbe8914d9 check for version info in org.octave.Octave.appdata.xml for make dist * Makefile.am (DIST_HOOKS): Add appdata-dist-hook to the list. * etc/module.mk (APPDATA_XML_FILE): New variable. (appdata_DATA): Use it. (appdata-dist-hook): New rule. diff -r 02766a14c461 -r a932bdccdef8 Makefile.am --- a/Makefile.am Thu Jul 12 15:00:13 2018 -0400 +++ b/Makefile.am Thu Jul 12 15:06:55 2018 -0400 @@ -223,6 +223,7 @@ docs-dist-hook \ fix-file-perms-dist-hook \ hg-id-dist-hook \ + appdata-dist-hook \ icons-dist-hook \ scripts-dist-hook diff -r 02766a14c461 -r a932bdccdef8 etc/module.mk --- a/etc/module.mk Thu Jul 12 15:00:13 2018 -0400 +++ b/etc/module.mk Thu Jul 12 15:06:55 2018 -0400 @@ -38,9 +38,11 @@ appdatadir = $(datadir)/metainfo -appdata_DATA = \ +APPDATA_XML_FILE := \ %reldir%/icons/org.octave.Octave.appdata.xml +appdata_DATA = $(APPDATA_XML_FILE) + desktopdir = $(datadir)/applications desktop_DATA = \ @@ -103,6 +105,23 @@ $(ICOTOOL) --create --raw $(WINDOWS_PNG_ICONS) > $@-t && \ mv $@-t $@ +## Check that the release date and version number are in +## $(APPDATA_XML_FILE), but only for actual releases, which means +## we skip the test if the minor version number is 0 or the patch +## version number is not 0. + +appdata-dist-hook: + @test x"$(DIST_IGNORE_APPDATA_VERSION)" != x || \ + test $(OCTAVE_MINOR_VERSION) -eq 0 || \ + test $(OCTAVE_PATCH_VERSION) -ne 0 || \ + grep "" $(srcdir)/$(APPDATA_XML_FILE) > /dev/null || \ + { echo; \ + echo "Packaging distribution requires the version number in the $(APPDATA_XML_FILE)."; \ + echo "Please update first or pass DIST_IGNORE_APPDATA_VERSION=1."; \ + echo "Cannot package distribution!"; \ + echo; exit 1; } +.PHONY: appdata-dist-hook + install-data-local: install-icons uninstall-local: uninstall-icons