gnucash-on-flatpak: New branch 'unstable'

John Ralls jralls at code.gnucash.org
Sun Apr 26 16:34:43 EDT 2020


New branch 'unstable' created at  https://github.com/Gnucash/gnucash-on-flatpak/commit/5bc66ebb (commit)


commit 5bc66ebbfdc1b976f72149563bef9d1331cd87f1
Author: John Ralls <jralls at ceridwen.us>
Date:   Sun Apr 26 13:29:22 2020 -0700

    Get gnucash tarballs from the unstable directory.

diff --git a/functions.sh b/functions.sh
index dd4c94e..111158b 100644
--- a/functions.sh
+++ b/functions.sh
@@ -152,7 +152,7 @@ function get_versions()
 
 function get_checksums()
 {
-  wget "http://downloads.sourceforge.net/gnucash/gnucash (stable)/${revision}/README.txt" -O "${base_dir}"/README.txt
+  wget "http://downloads.sourceforge.net/gnucash/gnucash (unstable)/${revision}/README.txt" -O "${base_dir}"/README.txt
   code_checksum=$(awk "/gnucash-${code_revision}.tar.bz2/ { print \$1;}" "${base_dir}"/README.txt)
   docs_checksum=$(awk "/gnucash-docs-${docs_revision}.tar.gz/ { print \$1;}" "${base_dir}"/README.txt)
 }
diff --git a/templates/gnucash-docs-source-tar.json.tpl b/templates/gnucash-docs-source-tar.json.tpl
index ee3fca7..0f745d4 100644
--- a/templates/gnucash-docs-source-tar.json.tpl
+++ b/templates/gnucash-docs-source-tar.json.tpl
@@ -1,5 +1,5 @@
 {
     "type": "archive",
-    "url": "http://downloads.sourceforge.net/gnucash/gnucash (stable)/${revision}/gnucash-docs-${docs_revision}.tar.gz",
+    "url": "http://downloads.sourceforge.net/gnucash/gnucash (unstable)/${revision}/gnucash-docs-${docs_revision}.tar.gz",
     "sha256": "${docs_checksum}"
 }
diff --git a/templates/gnucash-source-tar.json.tpl b/templates/gnucash-source-tar.json.tpl
index e26af14..6549f9a 100644
--- a/templates/gnucash-source-tar.json.tpl
+++ b/templates/gnucash-source-tar.json.tpl
@@ -1,5 +1,5 @@
 {
     "type": "archive",
-    "url": "http://downloads.sourceforge.net/gnucash/gnucash (stable)/${revision}/gnucash-${code_revision}.tar.bz2",
+    "url": "http://downloads.sourceforge.net/gnucash/gnucash (unstable)/${revision}/gnucash-${code_revision}.tar.bz2",
     "sha256": "${code_checksum}"
 }

commit c13403699dd11cfe54107593210d7790a6469707
Author: John Ralls <jralls at ceridwen.us>
Date:   Sun Apr 26 13:28:22 2020 -0700

    Swig is now a regular module.

diff --git a/org.gnucash.GnuCash.json b/org.gnucash.GnuCash.json
index 0a77c53..c63c145 100644
--- a/org.gnucash.GnuCash.json
+++ b/org.gnucash.GnuCash.json
@@ -33,6 +33,7 @@
     "modules/boost.json",
     "modules/googletest.json",
     "modules/perl.json",
+    "modules/swig.json",
     "./gnucash-extra-modules.json",
     {
         "name": "gnucash",
diff --git a/templates/gnucash-extra-modules-git.json.tpl b/templates/gnucash-extra-modules-git.json.tpl
index 25c9574..5189a8e 100644
--- a/templates/gnucash-extra-modules-git.json.tpl
+++ b/templates/gnucash-extra-modules-git.json.tpl
@@ -1,6 +1,3 @@
 {
-    "name": "gnucash-extra-modules",
-    "modules": [
-        "modules/swig.json"
-    ]
+    "name": "gnucash-extra-modules"
 }

commit c922f6ebee39894ec83768a7c5d7c439be90215c
Author: John Ralls <jralls at ceridwen.us>
Date:   Sun Apr 26 13:31:52 2020 -0700

    Upgrade boost to latest release, build for C++17.

diff --git a/modules/boost.json b/modules/boost.json
index 831dfe2..05442d0 100644
--- a/modules/boost.json
+++ b/modules/boost.json
@@ -4,13 +4,13 @@
     "sources": [
         {
             "type": "archive",
-            "url": "https://downloads.sourceforge.net/boost/boost/1.66.0/boost_1_66_0.tar.bz2",
-            "sha256": "5721818253e6a0989583192f96782c4a98eb6204965316df9f5ad75819225ca9"
+            "url": "https://downloads.sourceforge.net/boost/boost/1.72.0/boost_1_72_0.tar.bz2",
+            "sha256": "59c9b274bc451cf91a9ba1dd2c7fdcaf5d60b1b3aa83f2c9fa143417cc660722"
         }
     ],
     "build-commands": [
         "./bootstrap.sh --prefix=/app --with-libraries=locale,filesystem,system,date_time,regex",
         "./b2 headers",
-        "./b2 -j$FLATPAK_BUILDER_N_JOBS install variant=release --layout=system"
+        "./b2 -j$FLATPAK_BUILDER_N_JOBS install variant=release cxxstd=17 --layout=system"
     ]
 }

commit 4be864ef4c02d283fa1a3325c79dc650fd4dc079
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Apr 21 13:55:22 2020 +0200

    Update to xmlsec 1.2.29

diff --git a/modules/aqbanking.json b/modules/aqbanking.json
index 7c0a7a2..d1e13ab 100644
--- a/modules/aqbanking.json
+++ b/modules/aqbanking.json
@@ -15,8 +15,8 @@
             "sources": [
                 {
                     "type": "archive",
-                    "url": "https://www.aleksey.com/xmlsec/download/xmlsec1-1.2.26.tar.gz",
-                    "sha256": "8d8276c9c720ca42a3b0023df8b7ae41a2d6c5f9aa8d20ed1672d84cc8982d50"
+                    "url": "https://www.aleksey.com/xmlsec/download/xmlsec1-1.2.29.tar.gz",
+                    "sha256": "b1d1deba966019930f608d1f2b95c40ca3450f1393bcd3a3c001a8ba1d2839ab"
                 }
             ]
         },

commit ad1550e675f8c0550460c02b85439a8465f58e69
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Apr 21 13:21:15 2020 +0200

    If code and docs use different branches, store result in code's branch subdirectory

diff --git a/functions.sh b/functions.sh
index b4f9d52..dd4c94e 100644
--- a/functions.sh
+++ b/functions.sh
@@ -130,7 +130,12 @@ function prepare_repo()
   else
     echo "No tag detected, assuming development build"
     is_release="no"
-    remote_branch_dir=$repo_rev
+    # This function is run twice - once for code once for docs
+    # Only set remote_branch_dir if not yet set (in other words code's setting takes precedence)
+    if [[ -z $remote_branch_dir ]]
+    then
+      remote_branch_dir=$repo_rev
+    fi
     git reset --hard origin/$repo_rev
   fi
   popd

commit 2c8d3d1fa69e78b7f2d904d50df147a544f2891e
Author: Frank H. Ellenberger <frank.h.ellenberger at gmail.com>
Date:   Tue Apr 14 12:48:16 2020 +0200

    update aqbanking to 6.2.0beta
    
    several changes on almost all modules

diff --git a/modules/aqbanking.json b/modules/aqbanking.json
index 465475e..7c0a7a2 100644
--- a/modules/aqbanking.json
+++ b/modules/aqbanking.json
@@ -5,8 +5,8 @@
     "sources": [
         {
             "type": "archive",
-            "url": "https://www.aquamaniac.de/rdm/attachments/download/283/aqbanking-6.1.4.tar.gz",
-            "sha256": "f3c07a466de96e38b14df7b096304886c8b2b3921f41fd6ab47d3a6cd36431d9"
+            "url": "https://www.aquamaniac.de/rdm/attachments/download/321/aqbanking-6.2.0beta.tar.gz",
+            "sha256": "fa3552a2ff56393e75e0aa49f371c38af6517387a19721cde12f31692828e70c"
         }
     ],
     "modules": [

commit 3ca04f8f921b34058f843bc2c9687ae5786081c4
Author: Frank H. Ellenberger <frank.h.ellenberger at gmail.com>
Date:   Fri Apr 10 16:20:29 2020 +0200

    Update gwenhywfar to 5.3.0
    
    Added function GWEN_XmlFromDb(). This can now be used by AqBanking to
    create SEPA files using the XML imexporter.
    
    A few fixes.

diff --git a/modules/aqbanking.json b/modules/aqbanking.json
index d3fdd70..465475e 100644
--- a/modules/aqbanking.json
+++ b/modules/aqbanking.json
@@ -45,8 +45,8 @@
             "sources": [
                 {
                     "type": "archive",
-                    "url": "https://www.aquamaniac.de/rdm/attachments/download/256/gwenhywfar-5.2.0.tar.gz",
-                    "sha256": "ed8e1f81aa32c8c387cccb9d40390db31632be55bc41bd30bc27e3e45d4d2766"
+                    "url": "https://www.aquamaniac.de/rdm/attachments/download/319/gwenhywfar-5.3.0.tar.gz",
+                    "sha256": "3aec5982f5e136761863f4b6b12bbb4cd26b8ffb5f7553b58a48f72b6a4344a9"
                 }
             ]
         },

commit 96206c1bcd6eaed5c8bd68e0bed9525b16ad3b36
Author: John Ralls <jralls at ceridwen.us>
Date:   Sun Mar 29 11:29:00 2020 -0700

    Use sourceforge instead of bintray for boost.
    
    Because bintray returns 503 access forbidden for all boost tarballs.

diff --git a/modules/boost.json b/modules/boost.json
index 81386c5..831dfe2 100644
--- a/modules/boost.json
+++ b/modules/boost.json
@@ -4,7 +4,7 @@
     "sources": [
         {
             "type": "archive",
-            "url": "https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.bz2",
+            "url": "https://downloads.sourceforge.net/boost/boost/1.66.0/boost_1_66_0.tar.bz2",
             "sha256": "5721818253e6a0989583192f96782c4a98eb6204965316df9f5ad75819225ca9"
         }
     ],

commit afc2d15ff59c1f9b8fc174357c449e8d3809881d
Author: Frank H. Ellenberger <frank.h.ellenberger at gmail.com>
Date:   Tue Mar 24 23:17:50 2020 +0100

    Update to aqbanking-6.1.4
    
    Fixes on OFX, HBCI, and general (gwen_prefix)

diff --git a/modules/aqbanking.json b/modules/aqbanking.json
index 2eef082..d3fdd70 100644
--- a/modules/aqbanking.json
+++ b/modules/aqbanking.json
@@ -5,8 +5,8 @@
     "sources": [
         {
             "type": "archive",
-            "url": "https://www.aquamaniac.de/rdm/attachments/download/279/aqbanking-6.1.3.tar.gz",
-            "sha256": "dd35fd0161e8f71f6fb7a76efc375c61e44e98c5d1203e4401b792ceac683615"
+            "url": "https://www.aquamaniac.de/rdm/attachments/download/283/aqbanking-6.1.4.tar.gz",
+            "sha256": "f3c07a466de96e38b14df7b096304886c8b2b3921f41fd6ab47d3a6cd36431d9"
         }
     ],
     "modules": [

commit 77fc8511b1dbce5bd2b7985e05e452a7aeee5aae
Author: Frank H. Ellenberger <frank.h.ellenberger at gmail.com>
Date:   Tue Mar 24 18:46:43 2020 +0100

    Update to aqbanking-6.1.3
    
    Several fixes on AqHBCI and OFX

diff --git a/modules/aqbanking.json b/modules/aqbanking.json
index 8031fdf..2eef082 100644
--- a/modules/aqbanking.json
+++ b/modules/aqbanking.json
@@ -5,8 +5,8 @@
     "sources": [
         {
             "type": "archive",
-            "url": "https://www.aquamaniac.de/rdm/attachments/download/269/aqbanking-6.1.2.tar.gz",
-            "sha256": "0b54c70a8ab1bd5537d8b26d05a9e44db0600b64d8cbb63c34018dee11f67190"
+            "url": "https://www.aquamaniac.de/rdm/attachments/download/279/aqbanking-6.1.3.tar.gz",
+            "sha256": "dd35fd0161e8f71f6fb7a76efc375c61e44e98c5d1203e4401b792ceac683615"
         }
     ],
     "modules": [

commit 4d7c0b9702514e7e62dbf9a54d994f86fb6590bf
Author: Frank H. Ellenberger <frank.h.ellenberger at gmail.com>
Date:   Fri Mar 6 22:58:13 2020 +0100

    Update to aqbanking-6.1.2
    
    OFXDC: Fixed a bug concerning calls to AO_V2_SendAndReceive().

diff --git a/modules/aqbanking.json b/modules/aqbanking.json
index deed31e..8031fdf 100644
--- a/modules/aqbanking.json
+++ b/modules/aqbanking.json
@@ -5,8 +5,8 @@
     "sources": [
         {
             "type": "archive",
-            "url": "https://www.aquamaniac.de/rdm/attachments/download/266/aqbanking-6.1.1.tar.gz",
-            "sha256": "f472a28cd782555333d70b0ce50427ab5d44fd408109694163c3ba1633d96338"
+            "url": "https://www.aquamaniac.de/rdm/attachments/download/269/aqbanking-6.1.2.tar.gz",
+            "sha256": "0b54c70a8ab1bd5537d8b26d05a9e44db0600b64d8cbb63c34018dee11f67190"
         }
     ],
     "modules": [

commit d63cf68ebb024981e2d5b6b212c86c060ca479f6
Author: Frank H. Ellenberger <frank.h.ellenberger at gmail.com>
Date:   Mon Feb 24 21:50:28 2020 +0100

    Update to aqbanking-6.1.1

diff --git a/modules/aqbanking.json b/modules/aqbanking.json
index 43bc4b7..deed31e 100644
--- a/modules/aqbanking.json
+++ b/modules/aqbanking.json
@@ -5,8 +5,8 @@
     "sources": [
         {
             "type": "archive",
-            "url": "https://www.aquamaniac.de/rdm/attachments/download/258/aqbanking-6.1.0.tar.gz",
-            "sha256": "8e24bf201f488c1ff80dc44f32838bc6d66b0c92205d5f1e21219dca98c152d4"
+            "url": "https://www.aquamaniac.de/rdm/attachments/download/266/aqbanking-6.1.1.tar.gz",
+            "sha256": "f472a28cd782555333d70b0ce50427ab5d44fd408109694163c3ba1633d96338"
         }
     ],
     "modules": [

commit 7c8f19f48022447abc6f7a035e382d51565fd5a6
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Mon Feb 17 18:15:13 2020 +0100

    Add a note on relationship with our downstream flathub package repo.

diff --git a/README.md b/README.md
index 7ce31af..c0ba033 100644
--- a/README.md
+++ b/README.md
@@ -258,6 +258,32 @@ already due to the way cpanminus handles dependency resolution. The order in whi
 same-level dependencies are processed is not stable. A minor annoyance I can live with
 for now.
 
+## Flathub ##
+
+Flathub builds are derived from the gnucash-on-flatpak repository and will generally
+incorporate all changes made here as well with a few exceptions:
+
+- in gnucash-on-flatpak three files are autogenerated by build_package.sh:
+  - gnucash-source.json
+  - gnucash-docs-source.json
+  - gnucash-extra-modules.json
+  In the flathub source repository these are checked in source files.
+- the org.gnucash.GnuCash.json file is tweaked in the flathub source repository to
+  - pass a GNUCASH_BUILD_ID to the build and
+  - to override the gnucash.releases.xml file.
+
+The gnucash.releases.xml file lists package releases, that is versions
+of the flathub package. There can be more than one per gnucash release
+(for example to update aqbanking versions).
+There are a few commands that can help with generating this file:
+- `git describe --match=<major.minor>` can be used to produce the GNUCASH_BUILD_ID (just drop the -gxzy bit). Replace
+`<major.minor>` with the first tag in the gnucash release series (so not 3.8b-5, but 3.8b, or 3.9 not 3.9-7).
+For this to work, obviously these tags should be set on the commits that will be pushed to flathub.
+- `git log --date=short --format="<li>%ad - %s (%an)</li>" <major.minor-pkg>..HEAD` a short list of commits since
+the last tag ready to add in the releases file. In this case we are only interested in the changes since
+the last package release so replace `<major.minor-pkg>` with the most recent tag in the repo, so 3.8b-5
+rather than 3.8.
+
 ## TODO ##
 - try to build gnucash-docs as an extension instead of directly in the main flatpak
 

commit 32f019ff2a5e65190591981a1cbfc9cf59dc9898
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Mon Feb 17 15:35:32 2020 +0100

    More modularization
    
    Rearrange the manifest modules to minimize the variable parts.
    Only the source lines and module lines that differ between
    git and tar builds are split into separate template files.
    This should make it easier for the downstream flathub
    build to customize parts of the build.

diff --git a/.gitignore b/.gitignore
index 7863a52..673fcac 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,4 +2,6 @@ custom.sh
 code_last_rev
 docs_last_rev
 gnucash-flatpak.gpg
-gnucash.json
+gnucash-docs-source.json
+gnucash-extra-modules.json
+gnucash-source.json
diff --git a/build_package.sh b/build_package.sh
index 2f1d679..7c88834 100755
--- a/build_package.sh
+++ b/build_package.sh
@@ -131,7 +131,12 @@ then
   create_remote_dir "$host"/manifests
   create_remote_dir "$host"/manifests/$remote_branch_dir
   create_remote_dir "$host"/manifests/$remote_branch_dir/$fp_branch
-  rsync -a "$fp_git_dir"/org.gnucash.GnuCash.json "$fp_git_dir"/gnucash.json "$fp_git_dir"/modules "$host/manifests/$remote_branch_dir/$fp_branch"
+  rsync -a "$fp_git_dir"/org.gnucash.GnuCash.json \
+           "$fp_git_dir"/gnucash-source.json \
+           "$fp_git_dir"/gnucash-docs-source.json \
+           "$fp_git_dir"/gnucash-extra-modules.json \
+           "$fp_git_dir"/modules \
+           "$host/manifests/$remote_branch_dir/$fp_branch"
 
   echo "Synchronizing flatpak repository"
   rsync -a $fp_repo "$host"
diff --git a/functions.sh b/functions.sh
index 5cabe22..b4f9d52 100644
--- a/functions.sh
+++ b/functions.sh
@@ -177,19 +177,35 @@ function prepare_gpg()
 
 function create_manifest()
 {
-  echo "Writing org.gnucash.GnuCash.json manifest file"
+  echo "Configuring org.gnucash.GnuCash.json manifest module files"
 
   # Export environment variables used in the templates in order for envsubst to find them
   export code_repodir docs_repodir code_checksum docs_checksum revision code_revision docs_revision
 
-  gnucash_targets=
-  if [[ -f "$fp_git_dir"/templates/gnucash-targets-${build_type}.json.tpl ]]; then
-      # Note the variable names passed to envsubst:
-      # this limits the set of variables envsubst will effectively substitute
-      # We do this to prevent colisions with flatpak variables in the manifest
-      envsubst '$code_repodir $docs_repodir $code_revision $docs_revision $revision $code_checksum $docs_checksum' \
-                < "$fp_git_dir"/templates/gnucash-targets-${build_type}.json.tpl \
-                > "$fp_git_dir"/gnucash.json
+  # Note we explicitly pass a number of variable names to envsubst in
+  # the commands below. This limits the set of variables envsubst will
+  # effectively substitute
+  # We do this to prevent colisions with flatpak variables in the manifest
+  # and module files
+
+  rm -f "$fp_git_dir"/gnucash-source.json
+  if [[ -f "$fp_git_dir"/templates/gnucash-source-${build_type}.json.tpl ]]; then
+      envsubst '$code_repodir $code_revision $revision $code_checksum' \
+                < "$fp_git_dir"/templates/gnucash-source-${build_type}.json.tpl \
+                > "$fp_git_dir"/gnucash-source.json
+  fi
+
+  rm -f "$fp_git_dir"/gnucash-docs-source.json
+  if [[ -f "$fp_git_dir"/templates/gnucash-docs-source-${build_type}.json.tpl ]]; then
+      envsubst '$docs_repodir $docs_revision $revision $docs_checksum' \
+                < "$fp_git_dir"/templates/gnucash-docs-source-${build_type}.json.tpl \
+                > "$fp_git_dir"/gnucash-docs-source.json
+  fi
+
+  rm -f "$fp_git_dir"/gnucash-extra-modules.json
+  if [[ -f "$fp_git_dir"/templates/gnucash-extra-modules-${build_type}.json.tpl ]]; then
+      cp "$fp_git_dir"/templates/gnucash-extra-modules-${build_type}.json.tpl \
+         "$fp_git_dir"/gnucash-extra-modules.json
   fi
 }
 
diff --git a/org.gnucash.GnuCash.json b/org.gnucash.GnuCash.json
index 94f3219..0a77c53 100644
--- a/org.gnucash.GnuCash.json
+++ b/org.gnucash.GnuCash.json
@@ -33,6 +33,34 @@
     "modules/boost.json",
     "modules/googletest.json",
     "modules/perl.json",
-    "./gnucash.json"
+    "./gnucash-extra-modules.json",
+    {
+        "name": "gnucash",
+        "buildsystem": "cmake-ninja",
+        "config-opts": [
+            "-DBOOST_ROOT=/app"
+        ],
+        "cleanup": [
+            "/share/info",
+            "/share/doc/gnucash/*.csv",
+            "/share/doc/gnucash/*.qif",
+            "/share/doc/gnucash/*.gnucash",
+            "/share/doc/gnucash/ChangeLog*",
+            "/share/doc/gnucash/HACKING",
+            "/share/doc/gnucash/README*",
+            "/share/doc/gnucash/guile-hackers.txt",
+            "/share/doc/gnucash/projects.html"
+        ],
+        "sources": [
+            "./gnucash-source.json"
+        ]
+    },
+    {
+        "name": "gnucash-docs",
+        "buildsystem": "cmake-ninja",
+        "sources": [
+            "./gnucash-docs-source.json"
+        ]
+    }
   ]
 }
diff --git a/templates/gnucash-docs-source-git.json.tpl b/templates/gnucash-docs-source-git.json.tpl
new file mode 100644
index 0000000..c6e7441
--- /dev/null
+++ b/templates/gnucash-docs-source-git.json.tpl
@@ -0,0 +1,5 @@
+{
+    "type": "git",
+    "path": "${docs_repodir}",
+    "branch": "${docs_revision}"
+}
diff --git a/templates/gnucash-docs-source-tar.json.tpl b/templates/gnucash-docs-source-tar.json.tpl
new file mode 100644
index 0000000..ee3fca7
--- /dev/null
+++ b/templates/gnucash-docs-source-tar.json.tpl
@@ -0,0 +1,5 @@
+{
+    "type": "archive",
+    "url": "http://downloads.sourceforge.net/gnucash/gnucash (stable)/${revision}/gnucash-docs-${docs_revision}.tar.gz",
+    "sha256": "${docs_checksum}"
+}
diff --git a/templates/gnucash-extra-modules-git.json.tpl b/templates/gnucash-extra-modules-git.json.tpl
new file mode 100644
index 0000000..25c9574
--- /dev/null
+++ b/templates/gnucash-extra-modules-git.json.tpl
@@ -0,0 +1,6 @@
+{
+    "name": "gnucash-extra-modules",
+    "modules": [
+        "modules/swig.json"
+    ]
+}
diff --git a/templates/gnucash-extra-modules-tar.json.tpl b/templates/gnucash-extra-modules-tar.json.tpl
new file mode 100644
index 0000000..5189a8e
--- /dev/null
+++ b/templates/gnucash-extra-modules-tar.json.tpl
@@ -0,0 +1,3 @@
+{
+    "name": "gnucash-extra-modules"
+}
diff --git a/templates/gnucash-source-git.json.tpl b/templates/gnucash-source-git.json.tpl
new file mode 100644
index 0000000..4dcb40c
--- /dev/null
+++ b/templates/gnucash-source-git.json.tpl
@@ -0,0 +1,5 @@
+{
+    "type": "git",
+    "path": "${code_repodir}",
+    "branch": "${code_revision}"
+}
diff --git a/templates/gnucash-source-tar.json.tpl b/templates/gnucash-source-tar.json.tpl
new file mode 100644
index 0000000..e26af14
--- /dev/null
+++ b/templates/gnucash-source-tar.json.tpl
@@ -0,0 +1,5 @@
+{
+    "type": "archive",
+    "url": "http://downloads.sourceforge.net/gnucash/gnucash (stable)/${revision}/gnucash-${code_revision}.tar.bz2",
+    "sha256": "${code_checksum}"
+}
diff --git a/templates/gnucash-targets-git.json.tpl b/templates/gnucash-targets-git.json.tpl
deleted file mode 100644
index a3eca83..0000000
--- a/templates/gnucash-targets-git.json.tpl
+++ /dev/null
@@ -1,42 +0,0 @@
-{
-    "name": "gnucash-nightly-modules",
-    "modules": [
-        "modules/swig.json",
-        {
-            "name": "gnucash",
-            "buildsystem": "cmake-ninja",
-            "config-opts": [
-                "-DBOOST_ROOT=/app"
-            ],
-            "cleanup": [
-                "/share/info",
-                "/share/doc/gnucash/*.csv",
-                "/share/doc/gnucash/*.qif",
-                "/share/doc/gnucash/*.gnucash",
-                "/share/doc/gnucash/ChangeLog*",
-                "/share/doc/gnucash/HACKING",
-                "/share/doc/gnucash/README*",
-                "/share/doc/gnucash/guile-hackers.txt",
-                "/share/doc/gnucash/projects.html"
-            ],
-            "sources": [
-                {
-                    "type": "git",
-                    "path": "${code_repodir}",
-                    "branch": "${code_revision}"
-                }
-            ]
-        },
-        {
-            "name": "gnucash-docs",
-            "buildsystem": "cmake-ninja",
-            "sources": [
-                {
-                    "type": "git",
-                    "path": "${docs_repodir}",
-                    "branch": "${docs_revision}"
-                }
-            ]
-        }
-    ]
-}
diff --git a/templates/gnucash-targets-tar.json.tpl b/templates/gnucash-targets-tar.json.tpl
deleted file mode 100644
index 6a4c693..0000000
--- a/templates/gnucash-targets-tar.json.tpl
+++ /dev/null
@@ -1,42 +0,0 @@
-{
-    "name": "gnucash-release-modules",
-    "modules": [
-        {
-            "name": "gnucash",
-            "buildsystem": "cmake-ninja",
-            "config-opts": [
-                "-DBOOST_ROOT=/app"
-            ],
-            "cleanup": [
-                "/share/info",
-                "/share/doc/gnucash/*.csv",
-                "/share/doc/gnucash/*.qif",
-                "/share/doc/gnucash/*.gnucash",
-                "/share/doc/gnucash/ChangeLog*",
-                "/share/doc/gnucash/HACKING",
-                "/share/doc/gnucash/README*",
-                "/share/doc/gnucash/guile-hackers.txt",
-                "/share/doc/gnucash/projects.html"
-            ],
-            "sources": [
-                {
-                    "type": "archive",
-                    "url": "http://downloads.sourceforge.net/gnucash/gnucash (stable)/${revision}/gnucash-${code_revision}.tar.bz2",
-                    "sha256": "${code_checksum}"
-                }
-            ]
-        },
-        {
-            "name": "gnucash-docs",
-            "buildsystem": "cmake-ninja",
-            "sources": [
-                {
-                    "type": "archive",
-                    "url": "http://downloads.sourceforge.net/gnucash/gnucash (stable)/${revision}/gnucash-docs-${docs_revision}.tar.gz",
-                    "sha256": "${docs_checksum}"
-                }
-            ]
-        }
-    ]
-}
-

commit 762653ba3ede3e8f6a1577148c9006c5cbb45f0f
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sun Feb 16 21:36:39 2020 +0100

    Aqbanking dependency updates
    
    - aqbanking -> 6.1.0
    - gwenhywfar -> 5.2.0

diff --git a/modules/aqbanking.json b/modules/aqbanking.json
index b346c26..43bc4b7 100644
--- a/modules/aqbanking.json
+++ b/modules/aqbanking.json
@@ -5,8 +5,8 @@
     "sources": [
         {
             "type": "archive",
-            "url": "https://www.aquamaniac.de/rdm/attachments/download/243/aqbanking-6.0.2.tar.gz",
-            "sha256": "1d16f0a16ceb25ec7e8f8cfba6c21f64e18f5e4124f2144957958738fdb08158"
+            "url": "https://www.aquamaniac.de/rdm/attachments/download/258/aqbanking-6.1.0.tar.gz",
+            "sha256": "8e24bf201f488c1ff80dc44f32838bc6d66b0c92205d5f1e21219dca98c152d4"
         }
     ],
     "modules": [
@@ -45,8 +45,8 @@
             "sources": [
                 {
                     "type": "archive",
-                    "url": "https://www.aquamaniac.de/rdm/attachments/download/242/gwenhywfar-5.1.3.tar.gz",
-                    "sha256": "19b4f80994db8e00812879f908b33195d61b807dbe7cd8dc3dd0104f524b5976"
+                    "url": "https://www.aquamaniac.de/rdm/attachments/download/256/gwenhywfar-5.2.0.tar.gz",
+                    "sha256": "ed8e1f81aa32c8c387cccb9d40390db31632be55bc41bd30bc27e3e45d4d2766"
                 }
             ]
         },

commit e7eb8cfc997483cea19b64ed90752e0a2b4f147e
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sun Feb 16 19:45:46 2020 +0100

    Drop the comments about issues with flatpak-builder-tools
    
    flatpak-builder-tools has accepted all my PRs so the comments are no longer relevant.

diff --git a/README.md b/README.md
index 88d9bc4..7ce31af 100644
--- a/README.md
+++ b/README.md
@@ -243,26 +243,13 @@ the previous step will be inluded as source list of the finance-quote module.
 Keeping this separate allows us to easily update cpan dependencies in the future
 without interfering with other parts of the manifest.
 
-Step 2 was not without issues and it took me a while to successfully create
-the snippet. In short: the current flatpak-builder-tools cpan generator is
-fairly fragile.
-- It will fail to include certain modules (those that don't write
-an insallation line to perllocal.pod during installation). This happens for example
-with the `HTML::Tree` module
-- the entry found in perllocal.pod can't be mapped back to the module's distribution
-name in some cases, like with the `Date::Parse` module. It's distribution name is
-TimeDate, and the current script errors out on this.
-
-Long story short, my github fork https://github.com/gjanssens/flatpak-builder-tools
-has patches that allowed me to proceed. I have offered them upstream for inclusion.
-
-From there I:
-
-- installed the required perl modules on my (Fedora) system using
+Expressed in simple commands:
+
+- install the required perl modules on my (Fedora) system using
 `sudo dnf install 'perl(App::cpanminus)' 'perl(Getopt::Long::Descriptive)' 'perl(JSON::MaybeXS)' 'perl(LWP::UserAgent)' 'perl(MetaCPAN::Client)' 'perl(Pod::Simple::SimpleTree)'`
 as mentioned on the flatpak-builder-tools page
-- ran `./flatpak-cpan-generator.pl Date::Manip Finance::Quote`
-- copied the resulting `generated-sources.json` to `modules/finance-quote-sources.json`
+- run `./flatpak-cpan-generator.pl Date::Manip Finance::Quote`
+- copy the resulting `generated-sources.json` to `modules/finance-quote-sources.json`
 
 Note I have found the script to be not very version control friendly:
 `generated-sources.json` will change a lot between runs. It will have the exact same

commit 3be733d1d3dcf147eb5cd7252c7ea28137eaace4
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sun Feb 16 15:50:14 2020 +0100

    switch to cmake build system for gnucash-docs
    
    On a fast ssd the gnucash-docs step how becomes almost instantaneously.

diff --git a/templates/gnucash-targets-git.json.tpl b/templates/gnucash-targets-git.json.tpl
index c63815a..a3eca83 100644
--- a/templates/gnucash-targets-git.json.tpl
+++ b/templates/gnucash-targets-git.json.tpl
@@ -29,6 +29,7 @@
         },
         {
             "name": "gnucash-docs",
+            "buildsystem": "cmake-ninja",
             "sources": [
                 {
                     "type": "git",
diff --git a/templates/gnucash-targets-tar.json.tpl b/templates/gnucash-targets-tar.json.tpl
index 8d58bb8..6a4c693 100644
--- a/templates/gnucash-targets-tar.json.tpl
+++ b/templates/gnucash-targets-tar.json.tpl
@@ -28,6 +28,7 @@
         },
         {
             "name": "gnucash-docs",
+            "buildsystem": "cmake-ninja",
             "sources": [
                 {
                     "type": "archive",

commit d21b04cd56177f962571bc62b88a3050e18137c8
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sun Feb 16 14:04:09 2020 +0100

    Implement Finance::Quote support

diff --git a/README.md b/README.md
index 81f85cc..88d9bc4 100644
--- a/README.md
+++ b/README.md
@@ -225,9 +225,53 @@ similar housekeeping for all the flatpakref files, buildlogs and manifests.
 * The script will only build the packages if there are changes in the source
   repositories since the last build.
 
+## Finance::Quote ##
+
+Flatpaks don't ship perl, nor cpan. So enabling Finance::Quote support requires
+adding build rules for all of these in the flatpak manifest. This is a short
+summary of how this was done.
+
+1. Use https://github.com/flathub/io.github.Hexchat.Plugin.Perl/blob/master/io.github.Hexchat.Plugin.Perl.json
+as an example project to get perl built in flatpak. Note this cleans way
+too much of the perl installation (including the perl executable which we still need).
+
+2. Use https://github.com/flatpak/flatpak-builder-tools/tree/master/cpan to generate
+a manifest snippet with build for all the cpan modules required for Finance::Quote
+
+3. Add perl and finance-quote modules to our manifest. The snippet generated in
+the previous step will be inluded as source list of the finance-quote module.
+Keeping this separate allows us to easily update cpan dependencies in the future
+without interfering with other parts of the manifest.
+
+Step 2 was not without issues and it took me a while to successfully create
+the snippet. In short: the current flatpak-builder-tools cpan generator is
+fairly fragile.
+- It will fail to include certain modules (those that don't write
+an insallation line to perllocal.pod during installation). This happens for example
+with the `HTML::Tree` module
+- the entry found in perllocal.pod can't be mapped back to the module's distribution
+name in some cases, like with the `Date::Parse` module. It's distribution name is
+TimeDate, and the current script errors out on this.
+
+Long story short, my github fork https://github.com/gjanssens/flatpak-builder-tools
+has patches that allowed me to proceed. I have offered them upstream for inclusion.
+
+From there I:
+
+- installed the required perl modules on my (Fedora) system using
+`sudo dnf install 'perl(App::cpanminus)' 'perl(Getopt::Long::Descriptive)' 'perl(JSON::MaybeXS)' 'perl(LWP::UserAgent)' 'perl(MetaCPAN::Client)' 'perl(Pod::Simple::SimpleTree)'`
+as mentioned on the flatpak-builder-tools page
+- ran `./flatpak-cpan-generator.pl Date::Manip Finance::Quote`
+- copied the resulting `generated-sources.json` to `modules/finance-quote-sources.json`
+
+Note I have found the script to be not very version control friendly:
+`generated-sources.json` will change a lot between runs. It will have the exact same
+sources and dependencies, but they are shuffled around. Experiments indicate this is
+already due to the way cpanminus handles dependency resolution. The order in which
+same-level dependencies are processed is not stable. A minor annoyance I can live with
+for now.
+
 ## TODO ##
-- add finance::quote support
-- properly handle release builds (should be run from release tarball)
 - try to build gnucash-docs as an extension instead of directly in the main flatpak
 
 # Further Readings #
diff --git a/modules/finance-quote-sources.json b/modules/finance-quote-sources.json
new file mode 100644
index 0000000..0e8073e
--- /dev/null
+++ b/modules/finance-quote-sources.json
@@ -0,0 +1,497 @@
+[
+   {
+      "url": "https://cpan.metacpan.org/authors/id/S/SB/SBECK/Date-Manip-6.79.tar.gz",
+      "sha256": "71a8c42ce4edbd46a3ca2a17a7218ceed958cd7ad0dfeb79389f23d0f466943a",
+      "dest": "perl-libs/Date-Manip",
+      "type": "archive"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/C/CJ/CJM/IO-HTML-1.001.tar.gz",
+      "type": "archive",
+      "dest": "perl-libs/IO-HTML",
+      "sha256": "ea78d2d743794adc028bc9589538eb867174b4e165d7d8b5f63486e6b828e7e0"
+   },
+   {
+      "type": "archive",
+      "dest": "perl-libs/URI",
+      "sha256": "b2c98e1d50d6f572483ee538a6f4ccc8d9185f91f0073fd8af7390898254413e",
+      "url": "https://cpan.metacpan.org/authors/id/O/OA/OALDERS/URI-1.76.tar.gz"
+   },
+   {
+      "dest": "perl-libs/LWP-MediaTypes",
+      "type": "archive",
+      "sha256": "8f1bca12dab16a1c2a7c03a49c5e58cce41a6fec9519f0aadfba8dad997919d9",
+      "url": "https://cpan.metacpan.org/authors/id/O/OA/OALDERS/LWP-MediaTypes-6.04.tar.gz"
+   },
+   {
+      "sha256": "5c720fedb245122d073ea9c030aca24b06a615c71d40c46f832a8a1809354d81",
+      "dest": "perl-libs/TimeDate",
+      "type": "archive",
+      "url": "https://cpan.metacpan.org/authors/id/A/AT/ATOOMIC/TimeDate-2.31.tar.gz"
+   },
+   {
+      "sha256": "365d6294dfbd37ebc51def8b65b81eb79b3934ecbc95a2ec2d4d827efe6a922b",
+      "type": "archive",
+      "dest": "perl-libs/HTTP-Date",
+      "url": "https://cpan.metacpan.org/authors/id/O/OA/OALDERS/HTTP-Date-6.05.tar.gz"
+   },
+   {
+      "sha256": "176fa02771f542a4efb1dbc2a4c928e8f4391bf4078473bd6040d8f11adb0ec1",
+      "type": "archive",
+      "dest": "perl-libs/Encode-Locale",
+      "url": "https://cpan.metacpan.org/authors/id/G/GA/GAAS/Encode-Locale-1.05.tar.gz"
+   },
+   {
+      "sha256": "d060d170d388b694c58c14f4d13ed908a2807f0e581146cef45726641d809112",
+      "dest": "perl-libs/HTTP-Message",
+      "type": "archive",
+      "url": "https://cpan.metacpan.org/authors/id/O/OA/OALDERS/HTTP-Message-6.18.tar.gz"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/L/LE/LEONT/Module-Build-0.4231.tar.gz",
+      "type": "archive",
+      "dest": "perl-libs/Module-Build",
+      "sha256": "7e0f4c692c1740c1ac84ea14d7ea3d8bc798b2fb26c09877229e04f430b2b717"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/E/ET/ETHER/Try-Tiny-0.30.tar.gz",
+      "dest": "perl-libs/Try-Tiny",
+      "type": "archive",
+      "sha256": "da5bd0d5c903519bbf10bb9ba0cb7bcac0563882bcfe4503aee3fb143eddef6b"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/R/RJ/RJBS/Test-Fatal-0.014.tar.gz",
+      "sha256": "bcdcef5c7b2790a187ebca810b0a08221a63256062cfab3c3b98685d91d1cbb0",
+      "dest": "perl-libs/Test-Fatal",
+      "type": "archive"
+   },
+   {
+      "sha256": "adb17dac9e36cd011f5243881c9739417fd102fce760f8de4e9be4c7131108e2",
+      "type": "archive",
+      "dest": "perl-libs/HTML-Tagset",
+      "url": "https://cpan.metacpan.org/authors/id/P/PE/PETDANCE/HTML-Tagset-3.20.tar.gz"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/G/GA/GAAS/HTML-Parser-3.72.tar.gz",
+      "type": "archive",
+      "dest": "perl-libs/HTML-Parser",
+      "sha256": "ec28c7e1d9e67c45eca197077f7cdc41ead1bb4c538c7f02a3296a4bb92f608b"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/K/KE/KENTNL/HTML-Tree-5.07.tar.gz",
+      "dest": "perl-libs/HTML-Tree",
+      "type": "archive",
+      "sha256": "f0374db84731c204b86c1d5b90975fef0d30a86bd9def919343e554e31a9dbbf"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/B/BK/BKB/JSON-Parse-0.55.tar.gz",
+      "sha256": "dc9856dbc355114bcb0dc036bb632976b19b88d3a7ad59726f1fa917e7f5d256",
+      "dest": "perl-libs/JSON-Parse",
+      "type": "archive"
+   },
+   {
+      "type": "archive",
+      "dest": "perl-libs/Mozilla-CA",
+      "sha256": "f2cc9fbe119f756313f321e0d9f1fac0859f8f154ac9d75b1a264c1afdf4e406",
+      "url": "https://cpan.metacpan.org/authors/id/A/AB/ABH/Mozilla-CA-20180117.tar.gz"
+   },
+   {
+      "sha256": "f3ef1af108f27fef15ebec66479f251ce08aa49bd00b0462c9c80c86b4b6b32b",
+      "type": "archive",
+      "dest": "perl-libs/HTML-Element-Extended",
+      "url": "https://cpan.metacpan.org/authors/id/M/MS/MSISK/HTML-Element-Extended-1.18.tar.gz"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/M/MS/MSISK/HTML-TableExtract-2.15.tar.gz",
+      "type": "archive",
+      "dest": "perl-libs/HTML-TableExtract",
+      "sha256": "86c59c9d58da3ca174da5e62f5a0fb02f4da02b1b1e01df9e5d14bb65e4c3ecf"
+   },
+   {
+      "sha256": "2000da483c8471a0b61e06959e92a6fca7b9e40586d5c828de977d3d2081cfdd",
+      "dest": "perl-libs/Net-SSLeay",
+      "type": "archive",
+      "url": "https://cpan.metacpan.org/authors/id/C/CH/CHRISN/Net-SSLeay-1.88.tar.gz"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/S/SU/SULLR/IO-Socket-SSL-2.067.tar.gz",
+      "type": "archive",
+      "dest": "perl-libs/IO-Socket-SSL",
+      "sha256": "ef8842806d047cf56e2af64add4ed30b24547bcbb50e8df33cee0c54609af1c1"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/G/GA/GAAS/File-Listing-6.04.tar.gz",
+      "sha256": "1e0050fcd6789a2179ec0db282bf1e90fb92be35d1171588bd9c47d52d959cf5",
+      "dest": "perl-libs/File-Listing",
+      "type": "archive"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/O/OA/OALDERS/Net-HTTP-6.19.tar.gz",
+      "type": "archive",
+      "dest": "perl-libs/Net-HTTP",
+      "sha256": "52b76ec13959522cae64d965f15da3d99dcb445eddd85d2ce4e4f4df385b2fc4"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/G/GA/GAAS/WWW-RobotRules-6.02.tar.gz",
+      "type": "archive",
+      "dest": "perl-libs/WWW-RobotRules",
+      "sha256": "46b502e7a288d559429891eeb5d979461dd3ecc6a5c491ead85d165b6e03a51e"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/L/LE/LEONT/ExtUtils-Helpers-0.026.tar.gz",
+      "dest": "perl-libs/ExtUtils-Helpers",
+      "type": "archive",
+      "sha256": "de901b6790a4557cf4ec908149e035783b125bf115eb9640feb1bc1c24c33416"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/L/LE/LEONT/ExtUtils-Config-0.008.tar.gz",
+      "sha256": "ae5104f634650dce8a79b7ed13fb59d67a39c213a6776cfdaa3ee749e62f1a8c",
+      "dest": "perl-libs/ExtUtils-Config",
+      "type": "archive"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/L/LE/LEONT/ExtUtils-InstallPaths-0.012.tar.gz",
+      "type": "archive",
+      "dest": "perl-libs/ExtUtils-InstallPaths",
+      "sha256": "84735e3037bab1fdffa3c2508567ad412a785c91599db3c12593a50a1dd434ed"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/L/LE/LEONT/Module-Build-Tiny-0.039.tar.gz",
+      "dest": "perl-libs/Module-Build-Tiny",
+      "type": "archive",
+      "sha256": "7d580ff6ace0cbe555bf36b86dc8ea232581530cbeaaea09bccb57b55797f11c"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/O/OA/OALDERS/HTTP-Daemon-6.06.tar.gz",
+      "sha256": "fc03a161b54553f766457a4267e7066767f54ad01cacfe9a91d7caa2a0319bad",
+      "type": "archive",
+      "dest": "perl-libs/HTTP-Daemon"
+   },
+   {
+      "type": "archive",
+      "dest": "perl-libs/HTTP-Negotiate",
+      "sha256": "1c729c1ea63100e878405cda7d66f9adfd3ed4f1d6cacaca0ee9152df728e016",
+      "url": "https://cpan.metacpan.org/authors/id/G/GA/GAAS/HTTP-Negotiate-6.01.tar.gz"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/O/OA/OALDERS/HTTP-Cookies-6.08.tar.gz",
+      "dest": "perl-libs/HTTP-Cookies",
+      "type": "archive",
+      "sha256": "49ebb73576eb41063c04bc079477df094496deec805ae033f3be338c23c3af59"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/O/OA/OALDERS/libwww-perl-6.43.tar.gz",
+      "type": "archive",
+      "dest": "perl-libs/libwww-perl",
+      "sha256": "e9849d7ee6fd0e89cc999e63d7612c951afd6aeea6bc721b767870d9df4ac40d"
+   },
+   {
+      "dest": "perl-libs/LWP-Protocol-https",
+      "type": "archive",
+      "sha256": "522cc946cf84a1776304a5737a54b8822ec9e79b264d0ba0722a70473dbfb9e7",
+      "url": "https://cpan.metacpan.org/authors/id/O/OA/OALDERS/LWP-Protocol-https-6.07.tar.gz"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/L/LE/LEEJO/CGI-4.46.tar.gz",
+      "sha256": "788998ddc33ca382e5d7ce72c6c0ea1d8366c93067371fe2f14239ddea2e4298",
+      "dest": "perl-libs/CGI",
+      "type": "archive"
+   },
+   {
+      "type": "archive",
+      "dest": "perl-libs/Module-Runtime",
+      "sha256": "68302ec646833547d410be28e09676db75006f4aa58a11f3bdb44ffe99f0f024",
+      "url": "https://cpan.metacpan.org/authors/id/Z/ZE/ZEFRAM/Module-Runtime-0.016.tar.gz"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/D/DO/DOY/Dist-CheckConflicts-0.11.tar.gz",
+      "dest": "perl-libs/Dist-CheckConflicts",
+      "type": "archive",
+      "sha256": "ea844b9686c94d666d9d444321d764490b2cde2f985c4165b4c2c77665caedc4"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/H/HA/HAARG/Role-Tiny-2.001004.tar.gz",
+      "sha256": "92ba5712850a74102c93c942eb6e7f62f7a4f8f483734ed289d08b324c281687",
+      "dest": "perl-libs/Role-Tiny",
+      "type": "archive"
+   },
+   {
+      "sha256": "8a2c3b6ccc19328d5579d02a7d91285e2afd85d801f49d423a8eb16f323da4f8",
+      "dest": "perl-libs/MRO-Compat",
+      "type": "archive",
+      "url": "https://cpan.metacpan.org/authors/id/H/HA/HAARG/MRO-Compat-0.13.tar.gz"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/D/DO/DOY/Eval-Closure-0.14.tar.gz",
+      "sha256": "ea0944f2f5ec98d895bef6d503e6e4a376fea6383a6bc64c7670d46ff2218cad",
+      "type": "archive",
+      "dest": "perl-libs/Eval-Closure"
+   },
+   {
+      "sha256": "cd3c03ed547d3d42c61fa5814c98296139392e7971c092e09a431f2c9f5d6855",
+      "type": "archive",
+      "dest": "perl-libs/Devel-StackTrace",
+      "url": "https://cpan.metacpan.org/authors/id/D/DR/DROLSKY/Devel-StackTrace-2.04.tar.gz"
+   },
+   {
+      "sha256": "260e252f7367228c9b4e43ef50c0becb04c4781de660577b3086cc106c0028c0",
+      "type": "archive",
+      "dest": "perl-libs/XString",
+      "url": "https://cpan.metacpan.org/authors/id/A/AT/ATOOMIC/XString-0.002.tar.gz"
+   },
+   {
+      "type": "archive",
+      "dest": "perl-libs/Sub-Quote",
+      "sha256": "6e4e2af42388fa6d2609e0e82417de7cc6be47223f576592c656c73c7524d89d",
+      "url": "https://cpan.metacpan.org/authors/id/H/HA/HAARG/Sub-Quote-2.006006.tar.gz"
+   },
+   {
+      "type": "archive",
+      "dest": "perl-libs/Specio",
+      "sha256": "e4b988ce6383b076bf23e942313d1b8930779eb9954d87db994fe2baffd461f6",
+      "url": "https://cpan.metacpan.org/authors/id/D/DR/DROLSKY/Specio-0.45.tar.gz"
+   },
+   {
+      "dest": "perl-libs/Class-Data-Inheritable",
+      "type": "archive",
+      "sha256": "9967feceea15227e442ec818723163eb6d73b8947e31f16ab806f6e2391af14a",
+      "url": "https://cpan.metacpan.org/authors/id/T/TM/TMTM/Class-Data-Inheritable-0.08.tar.gz"
+   },
+   {
+      "sha256": "33f3fbf8b138d3b04ea4ec0ba83fb0df6ba898806bcf4ef393d4cafc1a23ee0d",
+      "type": "archive",
+      "dest": "perl-libs/Exception-Class",
+      "url": "https://cpan.metacpan.org/authors/id/D/DR/DROLSKY/Exception-Class-1.44.tar.gz"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/D/DR/DROLSKY/Params-ValidationCompiler-0.30.tar.gz",
+      "sha256": "dc5bee23383be42765073db284bed9fbd819d4705ad649c20b644452090d16cb",
+      "type": "archive",
+      "dest": "perl-libs/Params-ValidationCompiler"
+   },
+   {
+      "sha256": "45befdf0d95cbefe7c25a1daf293d85f780d6d2576146546e6828aad26e580f9",
+      "dest": "perl-libs/File-ShareDir-Install",
+      "type": "archive",
+      "url": "https://cpan.metacpan.org/authors/id/E/ET/ETHER/File-ShareDir-Install-0.13.tar.gz"
+   },
+   {
+      "sha256": "c15f1a12f0c2130c9efff3c2e1afe5887b08ccd033bd132186d1e7d5087fd66d",
+      "type": "archive",
+      "dest": "perl-libs/Module-Implementation",
+      "url": "https://cpan.metacpan.org/authors/id/D/DR/DROLSKY/Module-Implementation-0.09.tar.gz"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/E/ET/ETHER/Package-Stash-XS-0.29.tar.gz",
+      "sha256": "d3676ba94641e03d6a30e951f09266c4c3ca3f5b58aa7b314a67f28e419878aa",
+      "dest": "perl-libs/Package-Stash-XS",
+      "type": "archive"
+   },
+   {
+      "sha256": "c58ee8844df2dda38e3bf66fdf443439aaefaef1a33940edf2055f0afd223a7f",
+      "dest": "perl-libs/Package-Stash",
+      "type": "archive",
+      "url": "https://cpan.metacpan.org/authors/id/E/ET/ETHER/Package-Stash-0.38.tar.gz"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/V/VP/VPIT/Variable-Magic-0.62.tar.gz",
+      "sha256": "3f9a18517e33f006a9c2fc4f43f01b54abfe6ff2eae7322424f31069296b615c",
+      "dest": "perl-libs/Variable-Magic",
+      "type": "archive"
+   },
+   {
+      "sha256": "d535b7954d64da1ac1305b1fadf98202769e3599376854b2ced90c382beac056",
+      "type": "archive",
+      "dest": "perl-libs/Sub-Exporter-Progressive",
+      "url": "https://cpan.metacpan.org/authors/id/F/FR/FREW/Sub-Exporter-Progressive-0.001013.tar.gz"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/E/ET/ETHER/B-Hooks-EndOfScope-0.24.tar.gz",
+      "sha256": "03aa3dfe5d0aa6471a96f43fe8318179d19794d4a640708f0288f9216ec7acc6",
+      "dest": "perl-libs/B-Hooks-EndOfScope",
+      "type": "archive"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/R/RI/RIBASUSHI/namespace-clean-0.27.tar.gz",
+      "sha256": "8a10a83c3e183dc78f9e7b7aa4d09b47c11fb4e7d3a33b9a12912fd22e31af9d",
+      "dest": "perl-libs/namespace-clean",
+      "type": "archive"
+   },
+   {
+      "sha256": "068d272086514dd1e842b6a40b1bedbafee63900e5b08890ef6700039defad6f",
+      "dest": "perl-libs/Sub-Identify",
+      "type": "archive",
+      "url": "https://cpan.metacpan.org/authors/id/R/RG/RGARCIA/Sub-Identify-0.14.tar.gz"
+   },
+   {
+      "type": "archive",
+      "dest": "perl-libs/namespace-autoclean",
+      "sha256": "45ebd8e64a54a86f88d8e01ae55212967c8aa8fed57e814085def7608ac65804",
+      "url": "https://cpan.metacpan.org/authors/id/E/ET/ETHER/namespace-autoclean-0.29.tar.gz"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/P/PL/PLICEASE/Class-Inspector-1.36.tar.gz",
+      "sha256": "cc295d23a472687c24489d58226ead23b9fdc2588e522f0b5f0747741700694e",
+      "dest": "perl-libs/Class-Inspector",
+      "type": "archive"
+   },
+   {
+      "dest": "perl-libs/File-ShareDir",
+      "type": "archive",
+      "sha256": "59d90bfdf98c4656ff4173e62954ea8cf0de66565e35d108ecd7050596cb8328",
+      "url": "https://cpan.metacpan.org/authors/id/R/RE/REHSACK/File-ShareDir-1.116.tar.gz"
+   },
+   {
+      "sha256": "aa79746bd488b32aa4dbccccd05f1e5505642be013d8064a5d6f8a76a3c45d0b",
+      "dest": "perl-libs/DateTime-Locale",
+      "type": "archive",
+      "url": "https://cpan.metacpan.org/authors/id/D/DR/DROLSKY/DateTime-Locale-1.25.tar.gz"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/S/SH/SHAY/Class-Singleton-1.5.tar.gz",
+      "sha256": "38220d04f02e3a803193c2575a1644cce0b95ad4b95c19eb932b94e2647ef678",
+      "dest": "perl-libs/Class-Singleton",
+      "type": "archive"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/D/DR/DROLSKY/DateTime-TimeZone-2.38.tar.gz",
+      "type": "archive",
+      "dest": "perl-libs/DateTime-TimeZone",
+      "sha256": "0e5c99ef22471f4d262ac590ce5ce8177094d7a92f380d8eea6219f5a12dc0cd"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/D/DR/DROLSKY/DateTime-1.51.tar.gz",
+      "sha256": "de22da0de57a43a976322636d3a7474de4b1d6f37e044337123086cf94c16ec5",
+      "type": "archive",
+      "dest": "perl-libs/DateTime"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/M/MS/MSCHOUT/Text-Template-1.58.tar.gz",
+      "sha256": "0c465757782c4bfb9b17335307a8286771fd36ea04d259bc454ac63355f2a287",
+      "type": "archive",
+      "dest": "perl-libs/Text-Template"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/I/IS/ISHIGAKI/JSON-4.02.tar.gz",
+      "type": "archive",
+      "dest": "perl-libs/JSON",
+      "sha256": "444a88755a89ffa2a5424ab4ed1d11dca61808ebef57e81243424619a9e8627c"
+   },
+   {
+      "type": "archive",
+      "dest": "perl-libs/DateTime-Format-Strptime",
+      "sha256": "593c26466ed7a3d2cefe9215f1619666c5116bd3a551e0aa74b64a6353fcb50d",
+      "url": "https://cpan.metacpan.org/authors/id/D/DR/DROLSKY/DateTime-Format-Strptime-1.76.tar.gz"
+   },
+   {
+      "url": "https://cpan.metacpan.org/authors/id/M/MI/MIKO/Test-Toolbox-0.4.tar.gz",
+      "type": "archive",
+      "dest": "perl-libs/Test-Toolbox",
+      "sha256": "4020b5c7f3a15ac9b187d05dfd9816b8030ec0d4a47ff8373f7633bb614ebdc3"
+   },
+   {
+      "dest": "perl-libs/Number-Misc",
+      "type": "archive",
+      "sha256": "77b9b68c600a069cf16f4d8126ecb32151e6bcd34b0edb17b78adee689dc91d8",
+      "url": "https://cpan.metacpan.org/authors/id/M/MI/MIKO/Number-Misc-1.2.tar.gz"
+   },
+   {
+      "dest": "perl-libs/String-Util",
+      "type": "archive",
+      "sha256": "f49a94f37c146c55211e3f87f3271b74ae4eaee416a519144e923dc0b433fa2d",
+      "url": "https://cpan.metacpan.org/authors/id/M/MI/MIKO/String-Util-1.26.tar.gz"
+   },
+   {
+      "type": "archive",
+      "dest": "perl-libs/Finance-Quote",
+      "sha256": "95dbc4443ba656320b363c56625d04f379c943e202f60f40a2a35152b54bbf53",
+      "url": "https://cpan.metacpan.org/authors/id/E/EC/ECOCODE/Finance-Quote-1.49.tar.gz"
+   },
+   {
+      "dest-filename": "perl-libs/install.sh",
+      "commands": [
+         "set -e",
+         "function make_install {",
+         "    mod_dir=$1",
+         "    cd $mod_dir",
+         "    if [ -f 'Makefile.PL' ]; then",
+         "        perl Makefile.PL && make install",
+         "    elif [ -f 'Build.PL' ]; then",
+         "        perl Build.PL && ./Build && ./Build install",
+         "    else",
+         "        echo 'No Makefile.PL or Build.PL found. Do not know how to install this module'",
+         "        exit 1",
+         "    fi",
+         "}",
+         "(make_install perl-libs/Date-Manip)",
+         "(make_install perl-libs/IO-HTML)",
+         "(make_install perl-libs/URI)",
+         "(make_install perl-libs/LWP-MediaTypes)",
+         "(make_install perl-libs/TimeDate)",
+         "(make_install perl-libs/HTTP-Date)",
+         "(make_install perl-libs/Encode-Locale)",
+         "(make_install perl-libs/HTTP-Message)",
+         "(make_install perl-libs/Module-Build)",
+         "(make_install perl-libs/Try-Tiny)",
+         "(make_install perl-libs/Test-Fatal)",
+         "(make_install perl-libs/HTML-Tagset)",
+         "(make_install perl-libs/HTML-Parser)",
+         "(make_install perl-libs/HTML-Tree)",
+         "(make_install perl-libs/JSON-Parse)",
+         "(make_install perl-libs/Mozilla-CA)",
+         "(make_install perl-libs/HTML-Element-Extended)",
+         "(make_install perl-libs/HTML-TableExtract)",
+         "(make_install perl-libs/Net-SSLeay)",
+         "(make_install perl-libs/IO-Socket-SSL)",
+         "(make_install perl-libs/File-Listing)",
+         "(make_install perl-libs/Net-HTTP)",
+         "(make_install perl-libs/WWW-RobotRules)",
+         "(make_install perl-libs/ExtUtils-Helpers)",
+         "(make_install perl-libs/ExtUtils-Config)",
+         "(make_install perl-libs/ExtUtils-InstallPaths)",
+         "(make_install perl-libs/Module-Build-Tiny)",
+         "(make_install perl-libs/HTTP-Daemon)",
+         "(make_install perl-libs/HTTP-Negotiate)",
+         "(make_install perl-libs/HTTP-Cookies)",
+         "(make_install perl-libs/libwww-perl)",
+         "(make_install perl-libs/LWP-Protocol-https)",
+         "(make_install perl-libs/CGI)",
+         "(make_install perl-libs/Module-Runtime)",
+         "(make_install perl-libs/Dist-CheckConflicts)",
+         "(make_install perl-libs/Role-Tiny)",
+         "(make_install perl-libs/MRO-Compat)",
+         "(make_install perl-libs/Eval-Closure)",
+         "(make_install perl-libs/Devel-StackTrace)",
+         "(make_install perl-libs/XString)",
+         "(make_install perl-libs/Sub-Quote)",
+         "(make_install perl-libs/Specio)",
+         "(make_install perl-libs/Class-Data-Inheritable)",
+         "(make_install perl-libs/Exception-Class)",
+         "(make_install perl-libs/Params-ValidationCompiler)",
+         "(make_install perl-libs/File-ShareDir-Install)",
+         "(make_install perl-libs/Module-Implementation)",
+         "(make_install perl-libs/Package-Stash-XS)",
+         "(make_install perl-libs/Package-Stash)",
+         "(make_install perl-libs/Variable-Magic)",
+         "(make_install perl-libs/Sub-Exporter-Progressive)",
+         "(make_install perl-libs/B-Hooks-EndOfScope)",
+         "(make_install perl-libs/namespace-clean)",
+         "(make_install perl-libs/Sub-Identify)",
+         "(make_install perl-libs/namespace-autoclean)",
+         "(make_install perl-libs/Class-Inspector)",
+         "(make_install perl-libs/File-ShareDir)",
+         "(make_install perl-libs/DateTime-Locale)",
+         "(make_install perl-libs/Class-Singleton)",
+         "(make_install perl-libs/DateTime-TimeZone)",
+         "(make_install perl-libs/DateTime)",
+         "(make_install perl-libs/Text-Template)",
+         "(make_install perl-libs/JSON)",
+         "(make_install perl-libs/DateTime-Format-Strptime)",
+         "(make_install perl-libs/Test-Toolbox)",
+         "(make_install perl-libs/Number-Misc)",
+         "(make_install perl-libs/String-Util)",
+         "(make_install perl-libs/Finance-Quote)"
+      ],
+      "type": "script"
+   }
+]
diff --git a/modules/perl.json b/modules/perl.json
new file mode 100644
index 0000000..e3b1214
--- /dev/null
+++ b/modules/perl.json
@@ -0,0 +1,47 @@
+{
+    "name": "perl-with-finance-quote",
+    "modules": [
+        {
+            "name": "perl",
+            "no-autogen": true,
+            "config-opts": [
+                "-des",
+                "-Duseshrplib"
+            ],
+            "build-options": {
+                "cflags": "-fPIC",
+                "ldflags": "-fpic"
+            },
+            "sources": [
+                {
+                    "type": "archive",
+                    "url": "https://www.cpan.org/src/5.0/perl-5.28.0.tar.gz",
+                    "sha256": "7e929f64d4cb0e9d1159d4a59fc89394e27fa1f7004d0836ca0d514685406ea8"
+                },
+                {
+                    "type": "script",
+                    "dest-filename": "configure",
+                    "commands": [
+                        "exec ./configure.gnu $@"
+                    ]
+                }
+            ],
+            "post-install": [
+                "chmod -R u+w /app/lib/perl5"
+            ]
+        },
+        {
+            "name": "finance-quote",
+            "buildsystem": "simple",
+            "build-commands": [
+                "perl-libs/install.sh"
+            ],
+            "sources": [
+                "./finance-quote-sources.json"
+            ],
+            "post-install": [
+                "chmod -Rf u+w /app/lib/perl5/site_perl"
+            ]
+        }
+    ]
+}
diff --git a/org.gnucash.GnuCash.json b/org.gnucash.GnuCash.json
index b237958..94f3219 100644
--- a/org.gnucash.GnuCash.json
+++ b/org.gnucash.GnuCash.json
@@ -32,6 +32,7 @@
     "modules/aqbanking.json",
     "modules/boost.json",
     "modules/googletest.json",
+    "modules/perl.json",
     "./gnucash.json"
   ]
 }

commit dfdc5589781877aa6c6ec4307188da8701d5cf81
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Feb 15 16:50:05 2020 +0100

    Complete the manifest file modularization
    
    - instead of combining templates into the final manifest file use a common
      manifest file for all common modules
    - the modules that differ between tar or git builds will go into
      a dynamically generated module file gnucash.json
    - the common manifest file always includes this file
    
    Further, for easy lookup of which manifest and modules files were used
    to generate a given flatpak, also upload the used module files to
    the public download site. For example this can be used to quickly check
    what version of aqbanking was built into a given flatpak.
    As there are now more files to uplaod, store them in a subdirectory
    manifests/{maint,master,...}/<branch>/{manifestfile,modules}

diff --git a/.gitignore b/.gitignore
index b021a60..7863a52 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,4 +2,4 @@ custom.sh
 code_last_rev
 docs_last_rev
 gnucash-flatpak.gpg
-org.gnucash.GnuCash.json
+gnucash.json
diff --git a/build_package.sh b/build_package.sh
index 27fa55b..2f1d679 100755
--- a/build_package.sh
+++ b/build_package.sh
@@ -130,7 +130,8 @@ then
   echo "Uploading flatpak manifest 'org.gnucash.GnuCash-$fp_branch.json'"
   create_remote_dir "$host"/manifests
   create_remote_dir "$host"/manifests/$remote_branch_dir
-  rsync -a "$fp_git_dir"/org.gnucash.GnuCash.json "$host/manifests/$remote_branch_dir/org.gnucash.GnuCash-$fp_branch.json"
+  create_remote_dir "$host"/manifests/$remote_branch_dir/$fp_branch
+  rsync -a "$fp_git_dir"/org.gnucash.GnuCash.json "$fp_git_dir"/gnucash.json "$fp_git_dir"/modules "$host/manifests/$remote_branch_dir/$fp_branch"
 
   echo "Synchronizing flatpak repository"
   rsync -a $fp_repo "$host"
diff --git a/functions.sh b/functions.sh
index 9ca8768..5cabe22 100644
--- a/functions.sh
+++ b/functions.sh
@@ -187,17 +187,10 @@ function create_manifest()
       # Note the variable names passed to envsubst:
       # this limits the set of variables envsubst will effectively substitute
       # We do this to prevent colisions with flatpak variables in the manifest
-      gnucash_targets=$(envsubst '$code_repodir $docs_repodir $code_revision $docs_revision $revision $code_checksum $docs_checksum' \
-                        < "$fp_git_dir"/templates/gnucash-targets-${build_type}.json.tpl)
+      envsubst '$code_repodir $docs_repodir $code_revision $docs_revision $revision $code_checksum $docs_checksum' \
+                < "$fp_git_dir"/templates/gnucash-targets-${build_type}.json.tpl \
+                > "$fp_git_dir"/gnucash.json
   fi
-  export gnucash_targets
-
-  # Note the variable names passed to envsubst:
-  # this limits the set of variables envsubst will effectively substitute
-  # We do this to prevent colisions with flatpak variables in the manifest
-  envsubst '$gnucash_targets' \
-           < "$fp_git_dir"/templates/org.gnucash.GnuCash.json.tpl \
-           > "$fp_git_dir"/org.gnucash.GnuCash.json
 }
 
 function setup_sdk()
diff --git a/templates/org.gnucash.GnuCash.json.tpl b/org.gnucash.GnuCash.json
similarity index 97%
rename from templates/org.gnucash.GnuCash.json.tpl
rename to org.gnucash.GnuCash.json
index d28e4ce..b237958 100644
--- a/templates/org.gnucash.GnuCash.json.tpl
+++ b/org.gnucash.GnuCash.json
@@ -32,6 +32,6 @@
     "modules/aqbanking.json",
     "modules/boost.json",
     "modules/googletest.json",
-${gnucash_targets}
+    "./gnucash.json"
   ]
 }
diff --git a/templates/gnucash-targets-git.json.tpl b/templates/gnucash-targets-git.json.tpl
index ce1bb9b..c63815a 100644
--- a/templates/gnucash-targets-git.json.tpl
+++ b/templates/gnucash-targets-git.json.tpl
@@ -1,36 +1,41 @@
-    "modules/swig.json",
-    {
-      "name": "gnucash",
-      "buildsystem": "cmake-ninja",
-      "config-opts": [
-           "-DBOOST_ROOT=/app"
-      ],
-      "cleanup": [
-        "/share/info",
-        "/share/doc/gnucash/*.csv",
-        "/share/doc/gnucash/*.qif",
-        "/share/doc/gnucash/*.gnucash",
-        "/share/doc/gnucash/ChangeLog*",
-        "/share/doc/gnucash/HACKING",
-        "/share/doc/gnucash/README*",
-        "/share/doc/gnucash/guile-hackers.txt",
-        "/share/doc/gnucash/projects.html"
-      ],
-      "sources": [
+{
+    "name": "gnucash-nightly-modules",
+    "modules": [
+        "modules/swig.json",
         {
-          "type": "git",
-          "path": "${code_repodir}",
-          "branch": "${code_revision}"
-        }
-      ]
-    },
-    {
-      "name": "gnucash-docs",
-      "sources": [
+            "name": "gnucash",
+            "buildsystem": "cmake-ninja",
+            "config-opts": [
+                "-DBOOST_ROOT=/app"
+            ],
+            "cleanup": [
+                "/share/info",
+                "/share/doc/gnucash/*.csv",
+                "/share/doc/gnucash/*.qif",
+                "/share/doc/gnucash/*.gnucash",
+                "/share/doc/gnucash/ChangeLog*",
+                "/share/doc/gnucash/HACKING",
+                "/share/doc/gnucash/README*",
+                "/share/doc/gnucash/guile-hackers.txt",
+                "/share/doc/gnucash/projects.html"
+            ],
+            "sources": [
+                {
+                    "type": "git",
+                    "path": "${code_repodir}",
+                    "branch": "${code_revision}"
+                }
+            ]
+        },
         {
-          "type": "git",
-          "path": "${docs_repodir}",
-          "branch": "${docs_revision}"
+            "name": "gnucash-docs",
+            "sources": [
+                {
+                    "type": "git",
+                    "path": "${docs_repodir}",
+                    "branch": "${docs_revision}"
+                }
+            ]
         }
-      ]
-    }
+    ]
+}
diff --git a/templates/gnucash-targets-tar.json.tpl b/templates/gnucash-targets-tar.json.tpl
index 567b73f..8d58bb8 100644
--- a/templates/gnucash-targets-tar.json.tpl
+++ b/templates/gnucash-targets-tar.json.tpl
@@ -1,35 +1,41 @@
-    {
-      "name": "gnucash",
-      "buildsystem": "cmake-ninja",
-      "config-opts": [
-           "-DBOOST_ROOT=/app"
-      ],
-      "cleanup": [
-        "/share/info",
-        "/share/doc/gnucash/*.csv",
-        "/share/doc/gnucash/*.qif",
-        "/share/doc/gnucash/*.gnucash",
-        "/share/doc/gnucash/ChangeLog*",
-        "/share/doc/gnucash/HACKING",
-        "/share/doc/gnucash/README*",
-        "/share/doc/gnucash/guile-hackers.txt",
-        "/share/doc/gnucash/projects.html"
-      ],
-      "sources": [
-      {
-          "type": "archive",
-          "url": "http://downloads.sourceforge.net/gnucash/gnucash (stable)/${revision}/gnucash-${code_revision}.tar.bz2",
-          "sha256": "${code_checksum}"
-        }
-      ]
-    },
-    {
-      "name": "gnucash-docs",
-      "sources": [
+{
+    "name": "gnucash-release-modules",
+    "modules": [
+        {
+            "name": "gnucash",
+            "buildsystem": "cmake-ninja",
+            "config-opts": [
+                "-DBOOST_ROOT=/app"
+            ],
+            "cleanup": [
+                "/share/info",
+                "/share/doc/gnucash/*.csv",
+                "/share/doc/gnucash/*.qif",
+                "/share/doc/gnucash/*.gnucash",
+                "/share/doc/gnucash/ChangeLog*",
+                "/share/doc/gnucash/HACKING",
+                "/share/doc/gnucash/README*",
+                "/share/doc/gnucash/guile-hackers.txt",
+                "/share/doc/gnucash/projects.html"
+            ],
+            "sources": [
+                {
+                    "type": "archive",
+                    "url": "http://downloads.sourceforge.net/gnucash/gnucash (stable)/${revision}/gnucash-${code_revision}.tar.bz2",
+                    "sha256": "${code_checksum}"
+                }
+            ]
+        },
         {
-          "type": "archive",
-          "url": "http://downloads.sourceforge.net/gnucash/gnucash (stable)/${revision}/gnucash-docs-${docs_revision}.tar.gz",
-          "sha256": "${docs_checksum}"
+            "name": "gnucash-docs",
+            "sources": [
+                {
+                    "type": "archive",
+                    "url": "http://downloads.sourceforge.net/gnucash/gnucash (stable)/${revision}/gnucash-docs-${docs_revision}.tar.gz",
+                    "sha256": "${docs_checksum}"
+                }
+            ]
         }
-      ]
-    }
+    ]
+}
+

commit 30c9b0fd59bd858c6dbebbf9156a70b104d1cc51
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Feb 15 15:56:17 2020 +0100

    Cleanup - group all patches in a patches subdirectory

diff --git a/modules/libofx.json b/modules/libofx.json
index 04a80fa..33c956c 100644
--- a/modules/libofx.json
+++ b/modules/libofx.json
@@ -48,7 +48,7 @@
                 },
                 {
                     "type": "patch",
-                    "path": "../gengetopt-makefile.patch"
+                    "path": "../patches/gengetopt-makefile.patch"
                 },
                 {
                     "type": "script",
diff --git a/modules/mariadb.json b/modules/mariadb.json
index 94912b3..edb4ea7 100644
--- a/modules/mariadb.json
+++ b/modules/mariadb.json
@@ -59,10 +59,10 @@
                 {
                     "type": "patch",
                     "paths": [
-                        "../link-libs.patch",
-                        "../fix-install-dirs.patch",
-                        "../no-werror.patch",
-                        "../fix-build-flags.patch"
+                        "../patches/link-libs.patch",
+                        "../patches/fix-install-dirs.patch",
+                        "../patches/no-werror.patch",
+                        "../patches/fix-build-flags.patch"
                     ]
                 }
             ]
diff --git a/fix-build-flags.patch b/patches/fix-build-flags.patch
similarity index 100%
rename from fix-build-flags.patch
rename to patches/fix-build-flags.patch
diff --git a/fix-install-dirs.patch b/patches/fix-install-dirs.patch
similarity index 100%
rename from fix-install-dirs.patch
rename to patches/fix-install-dirs.patch
diff --git a/gengetopt-makefile.patch b/patches/gengetopt-makefile.patch
similarity index 100%
rename from gengetopt-makefile.patch
rename to patches/gengetopt-makefile.patch
diff --git a/link-libs.patch b/patches/link-libs.patch
similarity index 100%
rename from link-libs.patch
rename to patches/link-libs.patch
diff --git a/no-werror.patch b/patches/no-werror.patch
similarity index 100%
rename from no-werror.patch
rename to patches/no-werror.patch

commit 928f7927f320bb7c212cfc1543fcbe8fde8bd50b
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Feb 15 15:30:50 2020 +0100

    Continue modularization of manifest file

diff --git a/modules/aqbanking.json b/modules/aqbanking.json
index 7adb47f..b346c26 100644
--- a/modules/aqbanking.json
+++ b/modules/aqbanking.json
@@ -10,6 +10,33 @@
         }
     ],
     "modules": [
+        {
+            "name": "xmlsec",
+            "sources": [
+                {
+                    "type": "archive",
+                    "url": "https://www.aleksey.com/xmlsec/download/xmlsec1-1.2.26.tar.gz",
+                    "sha256": "8d8276c9c720ca42a3b0023df8b7ae41a2d6c5f9aa8d20ed1672d84cc8982d50"
+                }
+            ]
+        },
+        {
+            "name": "libpcsclite",
+            "config-opts": [
+                "--disable-libsystemd",
+                "--disable-serial",
+                "--disable-usb",
+                "--disable-libudev",
+                "--with-systemdsystemunitdir=no"
+            ],
+            "sources": [
+                {
+                    "type": "archive",
+                    "url": "https://pcsclite.apdu.fr/files/pcsc-lite-1.8.24.tar.bz2",
+                    "sha256": "b81864fa6a5ec776639c02ae89998955f7702a8d10e8b8f70023c5a599d97568"
+                }
+            ]
+        },
         {
             "name": "gwenhywfar",
             "config-opts": [
diff --git a/modules/boost.json b/modules/boost.json
new file mode 100644
index 0000000..81386c5
--- /dev/null
+++ b/modules/boost.json
@@ -0,0 +1,16 @@
+{
+    "name": "boost",
+    "buildsystem": "simple",
+    "sources": [
+        {
+            "type": "archive",
+            "url": "https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.bz2",
+            "sha256": "5721818253e6a0989583192f96782c4a98eb6204965316df9f5ad75819225ca9"
+        }
+    ],
+    "build-commands": [
+        "./bootstrap.sh --prefix=/app --with-libraries=locale,filesystem,system,date_time,regex",
+        "./b2 headers",
+        "./b2 -j$FLATPAK_BUILDER_N_JOBS install variant=release --layout=system"
+    ]
+}
diff --git a/modules/googletest.json b/modules/googletest.json
new file mode 100644
index 0000000..7385d6e
--- /dev/null
+++ b/modules/googletest.json
@@ -0,0 +1,12 @@
+{
+    "name": "googletest",
+    "buildsystem": "cmake-ninja",
+    "cleanup": ["*"],
+    "sources": [
+        {
+            "type": "archive",
+            "url": "https://github.com/google/googletest/archive/release-1.8.0.tar.gz",
+            "sha256": "58a6f4277ca2bc8565222b3bbd58a177609e9c488e8a72649359ba51450db7d8"
+        }
+    ]
+}
diff --git a/modules/libdbi.json b/modules/libdbi.json
new file mode 100644
index 0000000..4c2e802
--- /dev/null
+++ b/modules/libdbi.json
@@ -0,0 +1,51 @@
+{
+    "name": "libdbi-drivers",
+    "rm-configure": true,
+    "config-opts": [
+        "--disable-docs",
+        "--with-dbi-libdir=/app/lib/",
+        "--with-dbi-incdir=/app/include/",
+        "--with-mysql",
+        "--with-pgsql",
+        "--with-sqlite3"
+    ],
+    "cleanup": [
+        "/share",
+        "/var"
+    ],
+    "sources": [
+        {
+            "type": "archive",
+            "url": "http://downloads.sourceforge.net/project/libdbi-drivers/libdbi-drivers/libdbi-drivers-0.9.0/libdbi-drivers-0.9.0.tar.gz",
+            "sha256": "43d2eacd573a4faff296fa925dd97fbf2aedbf1ae35c6263478210c61004c854"
+        },
+        {
+            "type": "shell",
+            "commands": [
+                "rm -f config.guess"
+            ]
+        }
+    ],
+    "modules": [
+        {
+            "name": "libdbi",
+            "rm-configure": true,
+            "cleanup": [
+                "/share"
+            ],
+            "sources": [
+                {
+                    "type": "archive",
+                    "url": "http://downloads.sourceforge.net/project/libdbi/libdbi/libdbi-0.9.0/libdbi-0.9.0.tar.gz",
+                    "sha256": "dafb6cdca524c628df832b6dd0bf8fabceb103248edb21762c02d3068fca4503"
+                },
+                {
+                    "type": "shell",
+                    "commands": [
+                        "rm -f config.guess"
+                    ]
+                }
+            ]
+        }
+    ]
+}
diff --git a/modules/libofx.json b/modules/libofx.json
new file mode 100644
index 0000000..04a80fa
--- /dev/null
+++ b/modules/libofx.json
@@ -0,0 +1,63 @@
+{
+    "name": "libofx",
+    "no-parallel-make": true,
+    "config-opts": [
+        "--with-opensp-includes=/app/include/OpenSP",
+        "--with-opensp-libs=/lib"
+    ],
+    "sources": [
+        {
+            "type": "archive",
+            "url": "https://github.com/libofx/libofx/archive/0.9.14.tar.gz",
+            "sha256": "85a732efe3026e96fe1cf694ebdcf5d2c3b67adba85b9019abac44e7c43d8ce5"
+        }
+    ],
+    "modules": [
+        {
+            "name": "opensp",
+            "rm-configure": true,
+            "config-opts": [
+                "--disable-doc-build"
+            ],
+            "sources": [
+                {
+                    "type": "archive",
+                    "url": "https://downloads.sourceforge.net/project/openjade/opensp/1.5.2/OpenSP-1.5.2.tar.gz",
+                    "sha256": "57f4898498a368918b0d49c826aa434bb5b703d2c3b169beb348016ab25617ce"
+                },
+                {
+                    "type": "script",
+                    "dest-filename": "autogen.sh",
+                    "commands": [
+                        "autoreconf -vfi"
+                    ]
+                }
+            ]
+        },
+        {
+            "name": "gengetopt",
+            "config-opts": [
+                "--prefix=/app"
+            ],
+            "rm-configure": true,
+            "sources": [
+                {
+                    "type": "archive",
+                    "url": "https://ftp.gnu.org/gnu/gengetopt/gengetopt-2.22.6.tar.gz",
+                    "sha256": "30b05a88604d71ef2a42a2ef26cd26df242b41f5b011ad03083143a31d9b01f7"
+                },
+                {
+                    "type": "patch",
+                    "path": "../gengetopt-makefile.patch"
+                },
+                {
+                    "type": "script",
+                    "dest-filename": "autogen.sh",
+                    "commands": [
+                        "autoreconf -vfi"
+                    ]
+                }
+            ]
+        }
+    ]
+}
diff --git a/modules/mariadb.json b/modules/mariadb.json
new file mode 100644
index 0000000..94912b3
--- /dev/null
+++ b/modules/mariadb.json
@@ -0,0 +1,71 @@
+{
+    "name": "mariadb",
+    "buildsystem": "cmake",
+    "no-make-install": true,
+    "config-opts": [
+        "-DBUILD_CONFIG=mysql_release",
+        "-DWITH_INNOBASE_STORAGE_ENGINE=1",
+        "-DWITHOUT_ARCHIVE_STORAGE_ENGINE=1",
+        "-DWITHOUT_BLACKHOLE_STORAGE_ENGINE=1",
+        "-DWITHOUT_PARTITION_STORAGE_ENGINE=1",
+        "-DWITHOUT_TOKUDB=1",
+        "-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1",
+        "-DWITHOUT_FEDERATED_STORAGE_ENGINE=1",
+        "-DWITHOUT_PBXT_STORAGE_ENGINE=1"
+    ],
+    "post-install": [
+        "make -C libmysql install",
+        "make -C include install",
+        "install -Dm755 scripts/mysql_config /app/bin/mysql_config",
+        "install -Dm644 support-files/mariadb.pc /app/share/pkgconfig/mariadb.pc"
+    ],
+    "cleanup": [
+        "/bin/"
+    ],
+    "sources": [
+        {
+            "type": "archive",
+            "url": "http://ftp.hosteurope.de/mirror/archive.mariadb.org/mariadb-10.1.32/source/mariadb-10.1.32.tar.gz",
+            "sha256": "0e2aae6a6a190d07c8e36e87dd43377057fa82651ca3c583462563f3e9369096"
+        }
+    ],
+    "modules": [
+        {
+            "name": "jemalloc",
+            "cleanup": [
+                "/bin/",
+                "/share"
+            ],
+            "sources": [
+                {
+                    "type": "archive",
+                    "url": "https://github.com/jemalloc/jemalloc/releases/download/5.0.1/jemalloc-5.0.1.tar.bz2",
+                    "sha256": "4814781d395b0ef093b21a08e8e6e0bd3dab8762f9935bbfb71679b0dea7c3e9"
+                }
+            ]
+        },
+        {
+            "name": "libaio",
+            "no-autogen": true,
+            "make-install-args": [
+                "prefix=/app"
+            ],
+            "sources": [
+                {
+                    "type": "archive",
+                    "url": "http://ftp.de.debian.org/debian/pool/main/liba/libaio/libaio_0.3.110.orig.tar.gz",
+                    "sha256": "e019028e631725729376250e32b473012f7cb68e1f7275bfc1bbcdd0f8745f7e"
+                },
+                {
+                    "type": "patch",
+                    "paths": [
+                        "../link-libs.patch",
+                        "../fix-install-dirs.patch",
+                        "../no-werror.patch",
+                        "../fix-build-flags.patch"
+                    ]
+                }
+            ]
+        }
+    ]
+}
diff --git a/modules/postgresql.json b/modules/postgresql.json
new file mode 100644
index 0000000..3df47d2
--- /dev/null
+++ b/modules/postgresql.json
@@ -0,0 +1,20 @@
+{
+    "name": "postgresql",
+    "no-make-install": true,
+    "post-install": [
+        "make -C src/include install",
+        "make -C src/interfaces install",
+        "make -C src/bin/pg_config install"
+    ],
+    "cleanup": [
+        "/bin",
+        "/share"
+    ],
+    "sources": [
+        {
+            "type": "archive",
+            "url": "https://ftp.postgresql.org/pub/source/v9.6.8/postgresql-9.6.8.tar.bz2",
+            "sha256": "eafdb3b912e9ec34bdd28b651d00226a6253ba65036cb9a41cad2d9e82e3eb70"
+        }
+    ]
+}
diff --git a/templates/org.gnucash.GnuCash.json.tpl b/templates/org.gnucash.GnuCash.json.tpl
index a3247b7..d28e4ce 100644
--- a/templates/org.gnucash.GnuCash.json.tpl
+++ b/templates/org.gnucash.GnuCash.json.tpl
@@ -25,259 +25,13 @@
   ],
   "modules": [
     "modules/guile.json",
-    {
-      "name": "opensp",
-      "rm-configure": true,
-      "config-opts": [ "--disable-doc-build" ],
-      "sources": [
-          {
-              "type": "archive",
-              "url": "https://downloads.sourceforge.net/project/openjade/opensp/1.5.2/OpenSP-1.5.2.tar.gz",
-              "sha256": "57f4898498a368918b0d49c826aa434bb5b703d2c3b169beb348016ab25617ce"
-          },
-          {
-              "type": "script",
-              "dest-filename": "autogen.sh",
-              "commands": [
-                  "autoreconf -vfi"
-              ]
-          }
-      ]
-    },
-    {
-      "name": "gengetopt",
-      "config-opts": [
-          "--prefix=/app"
-          ],
-      "rm-configure": true,
-      "sources": [
-          {
-              "type": "archive",
-              "url": "https://ftp.gnu.org/gnu/gengetopt/gengetopt-2.22.6.tar.gz",
-              "sha256": "30b05a88604d71ef2a42a2ef26cd26df242b41f5b011ad03083143a31d9b01f7"
-          },
-          {
-              "type": "patch",
-              "path": "gengetopt-makefile.patch"
-          },
-          {
-              "type": "script",
-              "dest-filename": "autogen.sh",
-              "commands": [
-                  "autoreconf -vfi"
-              ]
-          }
-      ]
-    },
-    {
-      "name": "libofx",
-      "no-parallel-make": true,
-      "config-opts": [
-          "--with-opensp-includes=/app/include/OpenSP",
-          "--with-opensp-libs=/lib"
-          ],
-      "sources": [
-          {
-              "type": "archive",
-              "url": "https://github.com/libofx/libofx/archive/0.9.14.tar.gz",
-              "sha256": "85a732efe3026e96fe1cf694ebdcf5d2c3b67adba85b9019abac44e7c43d8ce5"
-          }
-      ]
-    },
-    {
-      "name": "jemalloc",
-      "cleanup": [
-        "/bin/",
-        "/share"
-      ],
-      "sources": [
-        {
-          "type": "archive",
-          "url": "https://github.com/jemalloc/jemalloc/releases/download/5.0.1/jemalloc-5.0.1.tar.bz2",
-          "sha256": "4814781d395b0ef093b21a08e8e6e0bd3dab8762f9935bbfb71679b0dea7c3e9"
-        }
-      ]
-    },
-    {
-      "name": "libaio",
-      "no-autogen": true,
-      "make-install-args": [
-        "prefix=/app"
-      ],
-      "sources": [
-        {
-          "type": "archive",
-          "url": "http://ftp.de.debian.org/debian/pool/main/liba/libaio/libaio_0.3.110.orig.tar.gz",
-          "sha256": "e019028e631725729376250e32b473012f7cb68e1f7275bfc1bbcdd0f8745f7e"
-        },
-        {
-          "type": "patch",
-          "paths": [
-            "link-libs.patch",
-            "fix-install-dirs.patch",
-            "no-werror.patch",
-            "fix-build-flags.patch"
-          ]
-        }
-      ]
-    },
-    {
-      "name": "mariadb",
-      "buildsystem": "cmake",
-      "no-make-install": true,
-      "config-opts": [
-        "-DBUILD_CONFIG=mysql_release",
-        "-DWITH_INNOBASE_STORAGE_ENGINE=1",
-        "-DWITHOUT_ARCHIVE_STORAGE_ENGINE=1",
-        "-DWITHOUT_BLACKHOLE_STORAGE_ENGINE=1",
-        "-DWITHOUT_PARTITION_STORAGE_ENGINE=1",
-        "-DWITHOUT_TOKUDB=1",
-        "-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1",
-        "-DWITHOUT_FEDERATED_STORAGE_ENGINE=1",
-        "-DWITHOUT_PBXT_STORAGE_ENGINE=1"
-      ],
-      "post-install": [
-        "make -C libmysql install",
-        "make -C include install",
-        "install -Dm755 scripts/mysql_config /app/bin/mysql_config",
-        "install -Dm644 support-files/mariadb.pc /app/share/pkgconfig/mariadb.pc"
-      ],
-      "cleanup": [
-        "/bin/"
-      ],
-      "sources": [
-        {
-          "type": "archive",
-          "url": "http://ftp.hosteurope.de/mirror/archive.mariadb.org/mariadb-10.1.32/source/mariadb-10.1.32.tar.gz",
-          "sha256": "0e2aae6a6a190d07c8e36e87dd43377057fa82651ca3c583462563f3e9369096"
-        }
-      ]
-    },
-    {
-      "name": "postgresql",
-      "no-make-install": true,
-      "post-install": [
-        "make -C src/include install",
-        "make -C src/interfaces install",
-        "make -C src/bin/pg_config install"
-      ],
-      "cleanup": [
-        "/bin",
-        "/share"
-      ],
-      "sources": [
-        {
-          "type": "archive",
-          "url": "https://ftp.postgresql.org/pub/source/v9.6.8/postgresql-9.6.8.tar.bz2",
-          "sha256": "eafdb3b912e9ec34bdd28b651d00226a6253ba65036cb9a41cad2d9e82e3eb70"
-        }
-      ]
-    },
-    {
-      "name": "libdbi",
-      "rm-configure": true,
-      "cleanup": [
-        "/share"
-      ],
-      "sources": [
-        {
-          "type": "archive",
-          "url": "http://downloads.sourceforge.net/project/libdbi/libdbi/libdbi-0.9.0/libdbi-0.9.0.tar.gz",
-          "sha256": "dafb6cdca524c628df832b6dd0bf8fabceb103248edb21762c02d3068fca4503"
-        },
-        {
-          "type": "shell",
-          "commands": [
-            "rm -f config.guess"
-          ]
-        }
-      ]
-    },
-    {
-      "name": "libdbi-drivers",
-      "rm-configure": true,
-      "config-opts": [
-        "--disable-docs",
-        "--with-dbi-libdir=/app/lib/",
-        "--with-dbi-incdir=/app/include/",
-        "--with-mysql",
-        "--with-pgsql",
-        "--with-sqlite3"
-      ],
-      "cleanup": [
-        "/share",
-        "/var"
-      ],
-      "sources": [
-        {
-          "type": "archive",
-          "url": "http://downloads.sourceforge.net/project/libdbi-drivers/libdbi-drivers/libdbi-drivers-0.9.0/libdbi-drivers-0.9.0.tar.gz",
-          "sha256": "43d2eacd573a4faff296fa925dd97fbf2aedbf1ae35c6263478210c61004c854"
-        },
-        {
-          "type": "shell",
-          "commands": [
-            "rm -f config.guess"
-          ]
-        }
-      ]
-    },
-    {
-      "name": "xmlsec",
-      "sources": [
-        {
-          "type": "archive",
-          "url": "https://www.aleksey.com/xmlsec/download/xmlsec1-1.2.26.tar.gz",
-          "sha256": "8d8276c9c720ca42a3b0023df8b7ae41a2d6c5f9aa8d20ed1672d84cc8982d50"
-        }
-      ]
-    },
-    {
-      "name": "libpcsclite",
-      "config-opts": [
-        "--disable-libsystemd",
-        "--disable-serial",
-        "--disable-usb",
-        "--disable-libudev",
-        "--with-systemdsystemunitdir=no"
-      ],
-      "sources": [
-        {
-          "type": "archive",
-          "url": "https://pcsclite.apdu.fr/files/pcsc-lite-1.8.24.tar.bz2",
-          "sha256": "b81864fa6a5ec776639c02ae89998955f7702a8d10e8b8f70023c5a599d97568"
-        }
-      ]
-    },
+    "modules/libofx.json",
+    "modules/mariadb.json",
+    "modules/postgresql.json",
+    "modules/libdbi.json",
     "modules/aqbanking.json",
-    {
-      "name": "boost",
-      "buildsystem": "simple",
-      "sources": [
-          {
-              "type": "archive",
-              "url": "https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.bz2",
-              "sha256": "5721818253e6a0989583192f96782c4a98eb6204965316df9f5ad75819225ca9"
-          }
-      ],
-      "build-commands": [
-          "./bootstrap.sh --prefix=/app --with-libraries=locale,filesystem,system,date_time,regex",
-          "./b2 headers",
-          "./b2 -j$FLATPAK_BUILDER_N_JOBS install variant=release --layout=system"
-        ]
-    },
-    {
-      "name": "googletest",
-      "buildsystem": "cmake-ninja",
-      "cleanup": ["*"],
-      "sources": [
-        {
-          "type": "archive",
-          "url": "https://github.com/google/googletest/archive/release-1.8.0.tar.gz",
-          "sha256": "58a6f4277ca2bc8565222b3bbd58a177609e9c488e8a72649359ba51450db7d8"
-        }
-      ]
-    },
+    "modules/boost.json",
+    "modules/googletest.json",
 ${gnucash_targets}
   ]
 }

commit 93053b963a2cf8f2665146cdfa9b083a0ecd0c3b
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Feb 15 14:21:24 2020 +0100

    extras-git really means swig
    
    So rename the module

diff --git a/modules/extra-deps-git.json b/modules/extra-deps-git.json
deleted file mode 100644
index 67d213a..0000000
--- a/modules/extra-deps-git.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
-    "name": "extra-deps-git",
-    "modules":
-    [
-        {
-            "name": "pcre",
-            "config-opts": [
-                "--enable-unicode-properties"
-            ],
-            "cleanup": ["*"],
-            "sources": [
-                {
-                    "type": "archive",
-                    "url": "http://prdownloads.sourceforge.net/pcre/pcre-8.42.tar.bz2",
-                    "sha256": "2cd04b7c887808be030254e8d77de11d3fe9d4505c39d4b15d2664ffe8bf9301"
-                }
-            ]
-        },
-        {
-            "name": "swig",
-            "config-opts": [
-                "-with-boost-libs=/app/lib",
-                "--without-alllang",
-                "--with-guile=/app/bin/guile",
-                "--with-guile-config=/app/bin/guile-config"
-            ],
-            "cleanup": ["*"],
-            "sources": [
-                {
-                    "type": "archive",
-                    "url": "http://prdownloads.sourceforge.net/swig/swig-3.0.12.tar.gz",
-                    "sha256": "7cf9f447ae7ed1c51722efc45e7f14418d15d7a1e143ac9f09a668999f4fc94d"
-                }
-            ]
-        }
-    ]
-}
diff --git a/modules/swig.json b/modules/swig.json
new file mode 100644
index 0000000..083680e
--- /dev/null
+++ b/modules/swig.json
@@ -0,0 +1,33 @@
+{
+    "name": "swig",
+    "config-opts": [
+        "-with-boost-libs=/app/lib",
+        "--without-alllang",
+        "--with-guile=/app/bin/guile",
+        "--with-guile-config=/app/bin/guile-config"
+    ],
+    "cleanup": ["*"],
+    "sources": [
+        {
+            "type": "archive",
+            "url": "http://prdownloads.sourceforge.net/swig/swig-3.0.12.tar.gz",
+            "sha256": "7cf9f447ae7ed1c51722efc45e7f14418d15d7a1e143ac9f09a668999f4fc94d"
+        }
+    ],
+    "modules": [
+        {
+            "name": "pcre",
+            "config-opts": [
+                "--enable-unicode-properties"
+            ],
+            "cleanup": ["*"],
+            "sources": [
+                {
+                    "type": "archive",
+                    "url": "http://prdownloads.sourceforge.net/pcre/pcre-8.42.tar.bz2",
+                    "sha256": "2cd04b7c887808be030254e8d77de11d3fe9d4505c39d4b15d2664ffe8bf9301"
+                }
+            ]
+        }
+    ]
+}
diff --git a/templates/gnucash-targets-git.json.tpl b/templates/gnucash-targets-git.json.tpl
index aca5c3c..ce1bb9b 100644
--- a/templates/gnucash-targets-git.json.tpl
+++ b/templates/gnucash-targets-git.json.tpl
@@ -1,4 +1,4 @@
-    "modules/extra-deps-git.json",
+    "modules/swig.json",
     {
       "name": "gnucash",
       "buildsystem": "cmake-ninja",

commit a1b97f6be9414ae2a2290ff81b1c455a716d079e
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Feb 15 14:10:55 2020 +0100

    Begin modularizing manifest file
    
    Group dependencies in separate module files for easier maintenance.
    In this initial commit the following bits have been moved to a separate
    module file
    - aqbanking and dependencies (gwenhywfar and libchipcard)
    - guile and dependencies (gc and libunistring)
    - build dependencies only needed for git builds
    
    More will follow in future commits

diff --git a/functions.sh b/functions.sh
index 16fa8d3..9ca8768 100644
--- a/functions.sh
+++ b/functions.sh
@@ -182,12 +182,6 @@ function create_manifest()
   # Export environment variables used in the templates in order for envsubst to find them
   export code_repodir docs_repodir code_checksum docs_checksum revision code_revision docs_revision
 
-  # In the functions below build_type selects the proper templates to initiate
-  # a git or a tar build. build_type is determined earlier in build_package.sh
-  extra_deps=
-  if [[ -f "$fp_git_dir"/templates/extra-deps-${build_type}.json.tpl ]]; then
-      extra_deps=$(cat "$fp_git_dir"/templates/extra-deps-${build_type}.json.tpl)
-  fi
   gnucash_targets=
   if [[ -f "$fp_git_dir"/templates/gnucash-targets-${build_type}.json.tpl ]]; then
       # Note the variable names passed to envsubst:
@@ -196,12 +190,12 @@ function create_manifest()
       gnucash_targets=$(envsubst '$code_repodir $docs_repodir $code_revision $docs_revision $revision $code_checksum $docs_checksum' \
                         < "$fp_git_dir"/templates/gnucash-targets-${build_type}.json.tpl)
   fi
-  export extra_deps gnucash_targets
+  export gnucash_targets
 
   # Note the variable names passed to envsubst:
   # this limits the set of variables envsubst will effectively substitute
   # We do this to prevent colisions with flatpak variables in the manifest
-  envsubst '$extra_deps $gnucash_targets' \
+  envsubst '$gnucash_targets' \
            < "$fp_git_dir"/templates/org.gnucash.GnuCash.json.tpl \
            > "$fp_git_dir"/org.gnucash.GnuCash.json
 }
diff --git a/modules/aqbanking.json b/modules/aqbanking.json
new file mode 100644
index 0000000..7adb47f
--- /dev/null
+++ b/modules/aqbanking.json
@@ -0,0 +1,37 @@
+
+{
+    "name": "aqbanking",
+    "no-parallel-make": true,
+    "sources": [
+        {
+            "type": "archive",
+            "url": "https://www.aquamaniac.de/rdm/attachments/download/243/aqbanking-6.0.2.tar.gz",
+            "sha256": "1d16f0a16ceb25ec7e8f8cfba6c21f64e18f5e4124f2144957958738fdb08158"
+        }
+    ],
+    "modules": [
+        {
+            "name": "gwenhywfar",
+            "config-opts": [
+                "--with-guis='gtk3'"
+            ],
+            "sources": [
+                {
+                    "type": "archive",
+                    "url": "https://www.aquamaniac.de/rdm/attachments/download/242/gwenhywfar-5.1.3.tar.gz",
+                    "sha256": "19b4f80994db8e00812879f908b33195d61b807dbe7cd8dc3dd0104f524b5976"
+                }
+            ]
+        },
+        {
+            "name": "libchipcard",
+            "sources": [
+                {
+                    "type": "archive",
+                    "url": "https://www.aquamaniac.de/rdm/attachments/download/229/libchipcard-5.1.5rc2.tar.gz",
+                    "sha256": "32d2f8fe39f7ecb236c0cce2605333ebff47338435e0bfdaf1d8141f9bc79b7a"
+                }
+            ]
+        }
+    ]
+}
diff --git a/modules/extra-deps-git.json b/modules/extra-deps-git.json
new file mode 100644
index 0000000..67d213a
--- /dev/null
+++ b/modules/extra-deps-git.json
@@ -0,0 +1,37 @@
+{
+    "name": "extra-deps-git",
+    "modules":
+    [
+        {
+            "name": "pcre",
+            "config-opts": [
+                "--enable-unicode-properties"
+            ],
+            "cleanup": ["*"],
+            "sources": [
+                {
+                    "type": "archive",
+                    "url": "http://prdownloads.sourceforge.net/pcre/pcre-8.42.tar.bz2",
+                    "sha256": "2cd04b7c887808be030254e8d77de11d3fe9d4505c39d4b15d2664ffe8bf9301"
+                }
+            ]
+        },
+        {
+            "name": "swig",
+            "config-opts": [
+                "-with-boost-libs=/app/lib",
+                "--without-alllang",
+                "--with-guile=/app/bin/guile",
+                "--with-guile-config=/app/bin/guile-config"
+            ],
+            "cleanup": ["*"],
+            "sources": [
+                {
+                    "type": "archive",
+                    "url": "http://prdownloads.sourceforge.net/swig/swig-3.0.12.tar.gz",
+                    "sha256": "7cf9f447ae7ed1c51722efc45e7f14418d15d7a1e143ac9f09a668999f4fc94d"
+                }
+            ]
+        }
+    ]
+}
diff --git a/modules/guile.json b/modules/guile.json
new file mode 100644
index 0000000..c3f2cc1
--- /dev/null
+++ b/modules/guile.json
@@ -0,0 +1,38 @@
+{
+    "name": "guile",
+    "sources": [
+        {
+            "type": "archive",
+            "url": "https://ftp.gnu.org/gnu/guile/guile-2.2.3.tar.xz",
+            "sha256": "8353a8849cd7aa77be66af04bd6bf7a6207440d2f8722e46672232bb9f0a4086"
+        }
+    ],
+    "modules": [
+        {
+            "name": "gc",
+            "cleanup": [
+                "/share"
+            ],
+            "sources": [
+                {
+                    "type": "archive",
+                    "url": "http://www.hboehm.info/gc/gc_source/gc-8.0.4.tar.gz",
+                    "sha256": "436a0ddc67b1ac0b0405b61a9675bca9e075c8156f4debd1d06f3a56c7cd289d"
+                }
+            ]
+        },
+        {
+            "name": "libunistring",
+            "cleanup": [
+                "/share"
+            ],
+            "sources": [
+                {
+                    "type": "archive",
+                    "url": "https://ftp.gnu.org/gnu/libunistring/libunistring-0.9.10.tar.xz",
+                    "sha256": "eb8fb2c3e4b6e2d336608377050892b54c3c983b646c561836550863003c05d7"
+                }
+            ]
+        }
+    ]
+}
diff --git a/templates/extra-deps-git.json.tpl b/templates/extra-deps-git.json.tpl
deleted file mode 100644
index 89540ff..0000000
--- a/templates/extra-deps-git.json.tpl
+++ /dev/null
@@ -1,31 +0,0 @@
-    {
-        "name": "pcre",
-        "config-opts": [
-            "--enable-unicode-properties"
-        ],
-        "cleanup": ["*"],
-        "sources": [
-        {
-            "type": "archive",
-            "url": "http://prdownloads.sourceforge.net/pcre/pcre-8.42.tar.bz2",
-            "sha256": "2cd04b7c887808be030254e8d77de11d3fe9d4505c39d4b15d2664ffe8bf9301"
-        }
-        ]
-    },
-    {
-      "name": "swig",
-      "config-opts": [
-            "-with-boost-libs=/app/lib",
-            "--without-alllang",
-            "--with-guile=/app/bin/guile",
-            "--with-guile-config=/app/bin/guile-config"
-      ],
-      "cleanup": ["*"],
-      "sources": [
-        {
-          "type": "archive",
-          "url": "http://prdownloads.sourceforge.net/swig/swig-3.0.12.tar.gz",
-          "sha256": "7cf9f447ae7ed1c51722efc45e7f14418d15d7a1e143ac9f09a668999f4fc94d"
-        }
-      ]
-    },
diff --git a/templates/gnucash-targets-git.json.tpl b/templates/gnucash-targets-git.json.tpl
index 17a2a33..aca5c3c 100644
--- a/templates/gnucash-targets-git.json.tpl
+++ b/templates/gnucash-targets-git.json.tpl
@@ -1,3 +1,4 @@
+    "modules/extra-deps-git.json",
     {
       "name": "gnucash",
       "buildsystem": "cmake-ninja",
diff --git a/templates/org.gnucash.GnuCash.json.tpl b/templates/org.gnucash.GnuCash.json.tpl
index dbfd339..a3247b7 100644
--- a/templates/org.gnucash.GnuCash.json.tpl
+++ b/templates/org.gnucash.GnuCash.json.tpl
@@ -24,42 +24,7 @@
     "/lib/pkgconfig"
   ],
   "modules": [
-    {
-      "name": "gc",
-      "cleanup": [
-        "/share"
-      ],
-      "sources": [
-        {
-          "type": "archive",
-          "url": "http://www.hboehm.info/gc/gc_source/gc-8.0.4.tar.gz",
-          "sha256": "436a0ddc67b1ac0b0405b61a9675bca9e075c8156f4debd1d06f3a56c7cd289d"
-        }
-      ]
-    },
-    {
-      "name": "libunistring",
-      "cleanup": [
-        "/share"
-      ],
-      "sources": [
-        {
-          "type": "archive",
-          "url": "https://ftp.gnu.org/gnu/libunistring/libunistring-0.9.10.tar.xz",
-          "sha256": "eb8fb2c3e4b6e2d336608377050892b54c3c983b646c561836550863003c05d7"
-        }
-      ]
-    },
-    {
-      "name": "guile",
-      "sources": [
-        {
-          "type": "archive",
-          "url": "https://ftp.gnu.org/gnu/guile/guile-2.2.3.tar.xz",
-          "sha256": "8353a8849cd7aa77be66af04bd6bf7a6207440d2f8722e46672232bb9f0a4086"
-        }
-      ]
-    },
+    "modules/guile.json",
     {
       "name": "opensp",
       "rm-configure": true,
@@ -284,40 +249,7 @@
         }
       ]
     },
-    {
-      "name": "gwenhywfar",
-      "config-opts": [
-        "--with-guis='gtk3'"
-      ],
-      "sources": [
-        {
-          "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/242/gwenhywfar-5.1.3.tar.gz",
-          "sha256": "19b4f80994db8e00812879f908b33195d61b807dbe7cd8dc3dd0104f524b5976"
-        }
-      ]
-    },
-    {
-      "name": "libchipcard",
-      "sources": [
-        {
-          "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/229/libchipcard-5.1.5rc2.tar.gz",
-          "sha256": "32d2f8fe39f7ecb236c0cce2605333ebff47338435e0bfdaf1d8141f9bc79b7a"
-        }
-      ]
-    },
-    {
-      "name": "aqbanking",
-      "no-parallel-make": true,
-      "sources": [
-        {
-          "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/243/aqbanking-6.0.2.tar.gz",
-          "sha256": "1d16f0a16ceb25ec7e8f8cfba6c21f64e18f5e4124f2144957958738fdb08158"
-        }
-      ]
-    },
+    "modules/aqbanking.json",
     {
       "name": "boost",
       "buildsystem": "simple",
@@ -346,7 +278,6 @@
         }
       ]
     },
-${extra_deps}
 ${gnucash_targets}
   ]
 }

commit 0061c192319f10e136792c89d12412fe5d2b2668
Author: Frank H. Ellenberger <frank.h.ellenberger at gmail.com>
Date:   Wed Jan 29 03:11:56 2020 +0100

    Update to aqbanking-6.0.2 and gwenhywfar-5.1.3
    
    Changes by modules:
    aqbanking-6.0.2: HBCI, Paypal
    aqbanking-6.0.1: OFX2

diff --git a/templates/org.gnucash.GnuCash.json.tpl b/templates/org.gnucash.GnuCash.json.tpl
index 5431507..dbfd339 100644
--- a/templates/org.gnucash.GnuCash.json.tpl
+++ b/templates/org.gnucash.GnuCash.json.tpl
@@ -292,8 +292,8 @@
       "sources": [
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/234/gwenhywfar-5.1.2.tar.gz",
-          "sha256": "e2eae2a50e83512664216230caebafbc170c5806a6f0130b00e44f2b6a5a5441"
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/242/gwenhywfar-5.1.3.tar.gz",
+          "sha256": "19b4f80994db8e00812879f908b33195d61b807dbe7cd8dc3dd0104f524b5976"
         }
       ]
     },
@@ -313,8 +313,8 @@
       "sources": [
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/235/aqbanking-6.0.0.tar.gz",
-          "sha256": "a07059da7ee67bc47dbcd6fed39af5047c6cd8596209b7325ed1c04b5ad6a707"
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/243/aqbanking-6.0.2.tar.gz",
+          "sha256": "1d16f0a16ceb25ec7e8f8cfba6c21f64e18f5e4124f2144957958738fdb08158"
         }
       ]
     },

commit b91d4d0a17ca972d1bee03149ffbc61db69f8201
Author: Frank H. Ellenberger <frank.h.ellenberger at gmail.com>
Date:   Fri Jan 17 21:23:57 2020 +0100

    Update to aqbanking-6.0.0 and gwenhywfar-5.1.2

diff --git a/templates/org.gnucash.GnuCash.json.tpl b/templates/org.gnucash.GnuCash.json.tpl
index d60d498..5431507 100644
--- a/templates/org.gnucash.GnuCash.json.tpl
+++ b/templates/org.gnucash.GnuCash.json.tpl
@@ -292,8 +292,8 @@
       "sources": [
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/233/gwenhywfar-5.1.1.tar.gz",
-          "sha256": "704348f0fc00ef2054647ef26d4d8e19931d24490a633f99bf056ccf2b17d78f"
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/234/gwenhywfar-5.1.2.tar.gz",
+          "sha256": "e2eae2a50e83512664216230caebafbc170c5806a6f0130b00e44f2b6a5a5441"
         }
       ]
     },
@@ -313,8 +313,8 @@
       "sources": [
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/232/aqbanking-5.99.45.tar.gz",
-          "sha256": "7e98f6eb817e6efe4a5f803af51781f7a6a8ae769a6c77ae324ed99033bd143f"
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/235/aqbanking-6.0.0.tar.gz",
+          "sha256": "a07059da7ee67bc47dbcd6fed39af5047c6cd8596209b7325ed1c04b5ad6a707"
         }
       ]
     },

commit 9c407024d6625f567982ac77982dbb89e68d9867
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Thu Jan 16 22:13:06 2020 +0100

    Add instructions for pruning older refs from the flatpak repo

diff --git a/README.md b/README.md
index 6023db9..81f85cc 100644
--- a/README.md
+++ b/README.md
@@ -180,6 +180,46 @@ files for all the release builds
 by the various flatpakref files or can be used to manually add a flatpak remote to your local
 flatpak environment.
 
+## Repository maintenance ##
+
+Over time the local repo will start to accumulate plenty of branches and you
+may want to drop those you no longer use.
+
+There is no single command to do so. However as a flatpak repo is an ostree
+repo under the hood we can use ostree commands to clean up.
+
+The first step is to get an overview of branches in the repo
+```bash
+cd <repo>
+flatpak repo --branches .
+```
+
+This will list the names of all known branches in the repo. Each branch matches
+one build.
+
+Assume we want to remove all maint nightly builds for gnucash development
+between 3.3 and 3.4. All these builds will have `maint-C3.3` in their name.
+So let's use a bit of bash code to filter all the refs matching that pattern
+and delete them.
+
+```bash
+for ref in $(ostree refs | grep maint-C3.3)
+do
+    ostree refs --delete $ref
+done
+flatpak build-update-repo --prune .
+```
+
+What this does is call `ostree refs` and filter its output to only return the
+refs that match `maint-C3.3`. Then the found refs will be passed one by one
+to `ostree refs --delete` to remove it from the ostree repo. This is not enough
+however. We still have to tell flatpak to rebuild the list of available refs.
+That's what the last command does. Adding `--prune` will also have it clear
+orphaned objects from the repo. Compare that to compacting a mailbox file.
+
+So far only the (ostree) repo part has been cleaned up. You may want to do
+similar housekeeping for all the flatpakref files, buildlogs and manifests.
+
 ## Notes ##
 
 * The script will only build the packages if there are changes in the source

commit b2079858d7473da816b1bd631f3d882035afc031
Author: Frank H. Ellenberger <frank.h.ellenberger at gmail.com>
Date:   Thu Jan 16 20:23:34 2020 +0100

    Update gwenhywfar to 5.1.1
    
    Should fix the problem with Cortal Consors sending a problematic HIPINS
    segment.

diff --git a/templates/org.gnucash.GnuCash.json.tpl b/templates/org.gnucash.GnuCash.json.tpl
index 2fee5f6..d60d498 100644
--- a/templates/org.gnucash.GnuCash.json.tpl
+++ b/templates/org.gnucash.GnuCash.json.tpl
@@ -292,8 +292,8 @@
       "sources": [
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/231/gwenhywfar-5.1.0.tar.gz",
-          "sha256": "ccdee7c7a0a5e1f3f55bab86a55d713acf20f0f80ef33a8abd0b69d29d8f9c2a"
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/233/gwenhywfar-5.1.1.tar.gz",
+          "sha256": "704348f0fc00ef2054647ef26d4d8e19931d24490a633f99bf056ccf2b17d78f"
         }
       ]
     },

commit 4154fb7c66830873dc580d2befd5bd1e8b9e7281
Author: Frank H. Ellenberger <frank.h.ellenberger at gmail.com>
Date:   Mon Jan 13 03:41:10 2020 +0100

    Update to aqBanking-5.99.45, gwenhywfar-5.1.0, libchipcard-5.1.5rc2

diff --git a/templates/org.gnucash.GnuCash.json.tpl b/templates/org.gnucash.GnuCash.json.tpl
index 0d2f1bf..2fee5f6 100644
--- a/templates/org.gnucash.GnuCash.json.tpl
+++ b/templates/org.gnucash.GnuCash.json.tpl
@@ -292,8 +292,8 @@
       "sources": [
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/223/gwenhywfar-4.99.25rc9.tar.gz",
-          "sha256": "783eb770df1b62aa55ccc5a23d38403c0ca8d1a450901fc8c3697bf7013a9a93"
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/231/gwenhywfar-5.1.0.tar.gz",
+          "sha256": "ccdee7c7a0a5e1f3f55bab86a55d713acf20f0f80ef33a8abd0b69d29d8f9c2a"
         }
       ]
     },
@@ -302,8 +302,8 @@
       "sources": [
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/221/libchipcard-5.1.4rc1.tar.gz",
-          "sha256": "d93cbde9584d1f02f8d80cc76117a9d60506f873221bc5a3c788eec130cd2fd0"
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/229/libchipcard-5.1.5rc2.tar.gz",
+          "sha256": "32d2f8fe39f7ecb236c0cce2605333ebff47338435e0bfdaf1d8141f9bc79b7a"
         }
       ]
     },
@@ -313,8 +313,8 @@
       "sources": [
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/224/aqbanking-5.99.44beta.tar.gz",
-          "sha256": "abf1da7f4c0b6b83f7622351de4677bc4ec00b52a0cc9b2e556f14cfc743f2b1"
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/232/aqbanking-5.99.45.tar.gz",
+          "sha256": "7e98f6eb817e6efe4a5f803af51781f7a6a8ae769a6c77ae324ed99033bd143f"
         }
       ]
     },

commit 9e470487c7043ba41f153ad9ac5ad1083d5c770d
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Mon Dec 30 12:47:36 2019 +0100

    Drop a bit of old, commented-out code

diff --git a/functions.sh b/functions.sh
index ad782b4..16fa8d3 100644
--- a/functions.sh
+++ b/functions.sh
@@ -140,15 +140,7 @@ function get_versions()
 {
   echo "Extracting version numbers for package $package"
   pushd "${repodir}"
-  # code uses cmake, docs is still on autotools...
-  #if [ -e CMakeLists.txt ]
-  #then
-  #  gc_version=$(grep '(PACKAGE_VERSION ' CMakeLists.txt | perl -pe 's/.*([0-9]+\.[0-9]+).*\)/$1/ge')
-  #else
-  #  gc_version=$(grep AC_INIT configure.ac | perl -pe 's/.*([0-9]+\.[0-9]+).*\)/$1/ge')
-  #fi
   gc_commit=$(git reflog | head -n1 | awk '{print $1}')
-  #gc_full_version=${gc_version}-nightly.git.${gc_commit}
   gc_full_version=$(git describe)
   popd
 }

commit 1af2580dae391db2589d52671940d5c65cd7427f
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Mon Dec 30 12:42:36 2019 +0100

    Fine tune build script to handle releases where release tags for gnucash and gnucash-docs differ
    
    For example there can be a gnucash 3.8b tag with a gnucash-docs 3.8 tag.
    The way to invoke the script for this is
    build-package.sh -r3.8 -c3.8b -d3.8
    or even
    build-package.sh -r3.8 -c3.8b
    
    The value of -r serves as both
    - the default for -c and -d
    - the sourceforge directory name containing the tarballs.
    
    So the main constraint for release tarballs now is that the tarballs must live
    in the same sourceforge directory.
    
    Notes:
    * if the release tag is the same for gnucash, gnucash-docs and the directory
    (the ideal case), the command can be simplified even more:
    build-package.sh -r3.7
    * for development (nightly) builds the directory restriction doesn't apply. For
    such builds you are free to use -c, -d and -r as you see fit. -r only serves
    as default for -c and -d in that scenario.

diff --git a/build_package.sh b/build_package.sh
index 4ac7df4..27fa55b 100755
--- a/build_package.sh
+++ b/build_package.sh
@@ -36,11 +36,17 @@ revision=maint
 . "$fp_git_dir"/functions.sh
 
 # Parse command line options
-while getopts "hr:" o; do
+while getopts "hr:c:d:" o; do
     case "${o}" in
         r)
             revision=${OPTARG}
             ;;
+        c)
+            code_revision=${OPTARG}
+            ;;
+        d)
+            docs_revision=${OPTARG}
+            ;;
         h)
             usage
             ;;
@@ -51,6 +57,8 @@ while getopts "hr:" o; do
 done
 
 is_release="undecided"
+code_revision=${code_revision:-${revision}}
+docs_revision=${docs_revision:-${revision}}
 
 # Set up logging
 local_log_dir="$base_dir/logs"
@@ -72,7 +80,7 @@ trap cleanup ERR
 # Check for new commits in code
 package=${code_package}
 repodir=${code_repodir}
-prepare_repo
+prepare_repo ${code_revision}
 get_versions
 
 code_curr_rev=${gc_commit}
@@ -81,22 +89,22 @@ code_full_version=${gc_full_version}
 # Check for new commits in docs
 package=${docs_package}
 repodir=${docs_repodir}
-prepare_repo
+prepare_repo ${docs_revision}
 get_versions
 
 docs_curr_rev=${gc_commit}
 docs_full_version=${gc_full_version}
 
-# Simplify flatpak package version if code and docs are on the same full_version
-# In practice this only happens when a tag is checked out, so as the code
-# is currently written this means it only happens for release builds
-if [[ "$code_full_version" == "$docs_full_version" ]]
+# Compose the default branch name to use in the flatpak repo
+fp_branch="$revision-C$code_full_version-D$docs_full_version"
+
+# Release builds start from tarballs and need checksums for the manifest
+if [[ "${is_release}" == "yes" ]]
 then
-    fp_branch="$code_full_version"
     build_type=tar
+    fp_branch="$revision"
     get_checksums
 else
-    fp_branch="$revision-C$code_full_version-D$docs_full_version"
     build_type=git
 fi
 
diff --git a/functions.sh b/functions.sh
index 2194c16..ad782b4 100644
--- a/functions.sh
+++ b/functions.sh
@@ -10,15 +10,48 @@ function cleanup()
 function usage()
 {
   {
-    echo "Usage: $0 [-r <revision>] [-u <remote>]"
+    echo "Usage: $0 [-c <revision>] [-d <revision>] [-r <revision>]"
     echo "       $0 -h"
     echo
     echo "-h          display this help message"
     echo
+    echo "-c revision gnucash git revision to build. Can be a branch or a tag."
+    echo "            Default: whatever is set with -r or 'maint' if -' was not specified"
+    echo "-d revision gnucash-docs git revision to build. Can be a branch or a tag."
+    echo "            Default: whatever is set with -r or 'maint' if -' was not specified"
     echo "-r revision git revision to build. Can be a branch or a tag."
-    echo "            Note this branch or tag should exist in both the gnucash"
-    echo "            and the gnucash-docs repository used for this build."
+    echo "            Can be used in multiple ways: if -c or -d options are omitted"
+    echo "            the value of -r is used as default instead."
+    echo "            If both -c and -d refer to a release tag, the value of -r will be used"
+    echo "            additionally as name of the directory that holds the release tarballs"
+    echo "            on sourceforge. This allows to handle situations where this directory name"
+    echo "            is different from the release tarball versions."
     echo "            Default: 'maint'"
+    echo
+    echo "Examples:"
+    echo
+    echo "  $0 -r master"
+    echo
+    echo "    Create a development flatpak for the current master branches of gnucash and gnucash-docs"
+    echo
+    echo "  $0 -r 3.7"
+    echo
+    echo "    Create a release flatpak for the gnucash 3.7. This will look for tarballs on sourceforge"
+    echo "    for gnucash 3.7 and gnucash-docs 3.7 in directory 3.7"
+    echo
+    echo "  $0 -r 3.8 -c3.8b"
+    echo
+    echo "    Create a release flatpak with tarballs taken from sourceforge"
+    echo "    for gnucash 3.8 and gnucash-docs 3.8b in directory 3.8"
+    echo
+    echo "Note:"
+    echo "  If you want to create a release flatpak, you will always want to set at least -r."
+    echo "  That tells the scripts in which sourceforge directory to look for tarballs."
+    echo "  If the tarballs have slightly different version numbers (due to release process internals)"
+    echo "  you can add -c or -d to specify those."
+    echo "  For development builds (that is, from git) you are free to mix and match"
+    echo "  the 3 options as you see fit. In this case -r only serves as a default value"
+    echo "  for the other two."
   } 1>&2
   exit 1
 }
@@ -72,22 +105,33 @@ function upload_build_log()
   fi
 }
 
+# Updates repo to repo_rev
+# Then checks whether repo_rev is a tag
+# If not a tag, reset repo to repo_rev
+# Caller should pass repo_rev as first parameter
 function prepare_repo()
 {
+  repo_rev=$1
   pushd "${repodir}"
   echo "Update repository $repodir"
   git fetch
-  git checkout $revision
-  if git tag | grep -q "^$revision\$"
+  git checkout $repo_rev
+  if git tag | grep -q "^$repo_rev\$"
   then
     echo "Detected a tag (release) build"
-    is_release="yes"
-    remote_branch_dir="releases"
+    if [[ "${is_release}" == "no" ]]
+    then
+        echo "However a previously checked repository is not set up for release builds. Falling back to development build."
+        remote_branch_dir=$repo_rev
+    else
+        is_release="yes"
+        remote_branch_dir="releases"
+    fi
   else
     echo "No tag detected, assuming development build"
     is_release="no"
-    remote_branch_dir=$revision
-    git reset --hard origin/$revision
+    remote_branch_dir=$repo_rev
+    git reset --hard origin/$repo_rev
   fi
   popd
 }
@@ -112,8 +156,8 @@ function get_versions()
 function get_checksums()
 {
   wget "http://downloads.sourceforge.net/gnucash/gnucash (stable)/${revision}/README.txt" -O "${base_dir}"/README.txt
-  code_checksum=$(awk "/gnucash-${revision}.tar.bz2/ { print \$1;}" "${base_dir}"/README.txt)
-  docs_checksum=$(awk "/gnucash-docs-${revision}.tar.gz/ { print \$1;}" "${base_dir}"/README.txt)
+  code_checksum=$(awk "/gnucash-${code_revision}.tar.bz2/ { print \$1;}" "${base_dir}"/README.txt)
+  docs_checksum=$(awk "/gnucash-docs-${docs_revision}.tar.gz/ { print \$1;}" "${base_dir}"/README.txt)
 }
 
 function prepare_gpg()
@@ -144,7 +188,7 @@ function create_manifest()
   echo "Writing org.gnucash.GnuCash.json manifest file"
 
   # Export environment variables used in the templates in order for envsubst to find them
-  export code_repodir docs_repodir code_checksum docs_checksum revision
+  export code_repodir docs_repodir code_checksum docs_checksum revision code_revision docs_revision
 
   # In the functions below build_type selects the proper templates to initiate
   # a git or a tar build. build_type is determined earlier in build_package.sh
@@ -157,7 +201,7 @@ function create_manifest()
       # Note the variable names passed to envsubst:
       # this limits the set of variables envsubst will effectively substitute
       # We do this to prevent colisions with flatpak variables in the manifest
-      gnucash_targets=$(envsubst '$code_repodir $docs_repodir $revision $code_checksum $docs_checksum' \
+      gnucash_targets=$(envsubst '$code_repodir $docs_repodir $code_revision $docs_revision $revision $code_checksum $docs_checksum' \
                         < "$fp_git_dir"/templates/gnucash-targets-${build_type}.json.tpl)
   fi
   export extra_deps gnucash_targets
diff --git a/templates/gnucash-targets-git.json.tpl b/templates/gnucash-targets-git.json.tpl
index 84e1aa3..17a2a33 100644
--- a/templates/gnucash-targets-git.json.tpl
+++ b/templates/gnucash-targets-git.json.tpl
@@ -19,7 +19,7 @@
         {
           "type": "git",
           "path": "${code_repodir}",
-          "branch": "${revision}"
+          "branch": "${code_revision}"
         }
       ]
     },
@@ -29,7 +29,7 @@
         {
           "type": "git",
           "path": "${docs_repodir}",
-          "branch": "${revision}"
+          "branch": "${docs_revision}"
         }
       ]
     }
diff --git a/templates/gnucash-targets-tar.json.tpl b/templates/gnucash-targets-tar.json.tpl
index 8ecff76..567b73f 100644
--- a/templates/gnucash-targets-tar.json.tpl
+++ b/templates/gnucash-targets-tar.json.tpl
@@ -18,7 +18,7 @@
       "sources": [
       {
           "type": "archive",
-          "url": "http://downloads.sourceforge.net/gnucash/gnucash (stable)/${revision}/gnucash-${revision}.tar.bz2",
+          "url": "http://downloads.sourceforge.net/gnucash/gnucash (stable)/${revision}/gnucash-${code_revision}.tar.bz2",
           "sha256": "${code_checksum}"
         }
       ]
@@ -28,7 +28,7 @@
       "sources": [
         {
           "type": "archive",
-          "url": "http://downloads.sourceforge.net/gnucash/gnucash-docs/gnucash-docs-${revision}.tar.gz",
+          "url": "http://downloads.sourceforge.net/gnucash/gnucash (stable)/${revision}/gnucash-docs-${docs_revision}.tar.gz",
           "sha256": "${docs_checksum}"
         }
       ]

commit 5dce91011499b80d9295aac80a310811b80eac07
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Mon Dec 30 10:00:02 2019 +0100

    Update to gnome runtime 3.34

diff --git a/templates/org.gnucash.GnuCash.json.tpl b/templates/org.gnucash.GnuCash.json.tpl
index 2ac6081..0d2f1bf 100644
--- a/templates/org.gnucash.GnuCash.json.tpl
+++ b/templates/org.gnucash.GnuCash.json.tpl
@@ -1,7 +1,7 @@
 {
   "app-id": "org.gnucash.GnuCash",
   "runtime": "org.gnome.Platform",
-  "runtime-version": "3.32",
+  "runtime-version": "3.34",
   "sdk": "org.gnome.Sdk",
   "command": "gnucash",
   "copy-icon": true,

commit 9f1944351b1bd970ee4be0b3d740579a016d199e
Author: Frank H. Ellenberger <frank.h.ellenberger at gmail.com>
Date:   Fri Nov 15 04:13:19 2019 +0100

    Update to: aqbanking-5.99.44beta, ...
    
    gwenhywfar-4.99.25rc9, libchipcard-5.1.4rc1

diff --git a/templates/org.gnucash.GnuCash.json.tpl b/templates/org.gnucash.GnuCash.json.tpl
index 52a1957..2ac6081 100644
--- a/templates/org.gnucash.GnuCash.json.tpl
+++ b/templates/org.gnucash.GnuCash.json.tpl
@@ -292,8 +292,8 @@
       "sources": [
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/210/gwenhywfar-4.99.24rc8.tar.gz",
-          "sha256": "212bc70066347ebf824c0ad35977789657523fb66faa6c4e3b0a6d0bc1303c1f"
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/223/gwenhywfar-4.99.25rc9.tar.gz",
+          "sha256": "783eb770df1b62aa55ccc5a23d38403c0ca8d1a450901fc8c3697bf7013a9a93"
         }
       ]
     },
@@ -302,8 +302,8 @@
       "sources": [
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/138/libchipcard-5.1.3beta.tar.gz",
-          "sha256": "11daac6e924f850162b51979cc9926fdd849d2b587aff518f755b3cc8448a592"
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/221/libchipcard-5.1.4rc1.tar.gz",
+          "sha256": "d93cbde9584d1f02f8d80cc76117a9d60506f873221bc5a3c788eec130cd2fd0"
         }
       ]
     },
@@ -313,8 +313,8 @@
       "sources": [
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/215/aqbanking-5.99.43beta.tar.gz",
-          "sha256": "ce0840616c1050588bca69bc08913bd5b5dc1ca8567207efde617cd496fa42b0"
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/224/aqbanking-5.99.44beta.tar.gz",
+          "sha256": "abf1da7f4c0b6b83f7622351de4677bc4ec00b52a0cc9b2e556f14cfc743f2b1"
         }
       ]
     },

commit 6b3349d495ac8bde05fde5e361c74467d70bf233
Author: Frank H. Ellenberger <frank.h.ellenberger at gmail.com>
Date:   Tue Oct 22 07:10:41 2019 +0200

    Several improvements of README.md
    
    Add a few links,
    use syntaxhighlight,
    flatpak run --command=sh

diff --git a/README.md b/README.md
index d9f6277..6023db9 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 # Build environment to build a flatpak version of GnuCash #
 
-This repository contains code to allow building a flatpak version of GnuCash.
+This repository contains code to allow building a [flatpak](https://flatpak.org/) version of GnuCash.
 
 Again: these packages are not release quality for several reasons:
 
@@ -35,22 +35,22 @@ flatpak/src
 ```
 
 2. Navigate into flatpak/src
-```
+```bash
 cd flatpak/src
 ```
 
 3. Clone this repo:
-```
+```bash
 git clone https://github.com/Gnucash/gnucash-on-flatpak gnucash-on-flatpak.git
 ```
 
 4. Clone the gnucash repo
-```
+```bash
 git clone https://github.com/Gnucash/gnucash gnucash.git
 ```
 
 5. Clone the gnucash-docs repo
-```
+```bash
 git clone https://github.com/Gnucash/gnucash-docs gnucash-docs.git
 ```
 
@@ -59,25 +59,26 @@ git clone https://github.com/Gnucash/gnucash-docs gnucash-docs.git
    a location other than the defaults).
 
 7. Navigate back to the base directory (flatpak in our set up)
-```
+```bash
 cd ..
 ```
 
 8. Build the flatpak using the build_package.sh command. If no options are set this command
 will build the maint branch of your gnucash and gnucash-docs repositories.
-```
+```bash
 ./src/gnucash-on-flatpak.git/build_package.sh
 ```
 
 9. On successful completion you will now have a flatpak repo named "repo" in the flatpak
-base directory. You can install and run gnucash from this directory using the typical flatpak
+base directory. You can **install** and **run** gnucash from this directory using the typical flatpak
 commands:
+```bash
+flatpak --user remote-add --no-gpg-verify gnc-testing-repo repo   # only once required
+flatpak --user install gnc-testing-repo org.gnucash.GnuCash       # after each build
+flatpak run org.gnucash.GnuCash                                   # as often as you like
+# or open a shell to use included comand line tools like 'aqbanking-cli':
+flatpak run --command=sh org.gnucash.GnuCash
 ```
-$ flatpak --user remote-add --no-gpg-verify gnc-testing-repo repo
-$ flatpak --user install gnc-testing-repo org.gnucash.GnuCash
-$ flatpak run org.gnucash.GnuCash
-```
-
 Note one has to specify --no-gpg-verify because the builds are not signed.
 
 ## Flatpak branches ##
@@ -110,13 +111,13 @@ For example
 ```
 
 With these long flatpak branch branch names it's possible to refer back exactly to the
-commits in the git repositories that were used to build this flatpak from. The commit
-hash refs are the bit after the -g. In the example above the code was built from commit
-a20a803c8 and the docs from commit c817132. The rest of the description give a relative
-indication of the freshness of each branch. "C3.2-290" means the code commit was 290 commits
-more recent than the 3.2 tag in the gnucash repository. "D3.2-21" means the docs commit was
-21 commits more recent than the 3.2 tag in the gnucash-docs repository. The exact numbers
-are not important. But C3.2-312 would be a more recent build than C3.2-290. So these
+commits in the git repositories that were used to build this flatpak from.
+* The **commit hash** refs are the bit after the -g. In the example above the code was built from commit
+a20a803c8 and the docs from commit c817132.
+* The rest of the description give a **relative indication** of the freshness of each branch:
+  * "C3.2-290" means the **code** commit was 290 commits more recent than the 3.2 tag in the gnucash repository.
+  * "D3.2-21" means the **docs** commit was 21 commits more recent than the 3.2 tag in the gnucash-docs repository.
+The exact numbers are not important. But C3.2-312 would be a more recent build than C3.2-290. So these
 numbers are used to sort builds by how recent they are (in terms of how recent the source
 is they were built from).
 
@@ -147,7 +148,7 @@ typically an http(s) url or if only for local use an absolute file:///path uri.
 If both gpg signing and remote repository are configured, the build script will automatically
 generate a gnucash-xyz.flatpakref file for each build. This file encapsulates all information
 to easily install a gnucash nightly flatpak in one single command:
-```
+```bash
 flatpak install --from gnucash-xyz.flatpakref
 ```
 This can only be set up if a GPG key and a public remote site are available.
@@ -189,4 +190,6 @@ flatpak environment.
 - properly handle release builds (should be run from release tarball)
 - try to build gnucash-docs as an extension instead of directly in the main flatpak
 
-
+# Further Readings #
+- [Flatpak’s documentation](http://docs.flatpak.org/en/latest/)
+- [Flathub App Submission](https://github.com/flathub/flathub/wiki/App-Submission)

commit 50cbfffb96682761425536bd918d5929561c3b66
Author: Frank H. Ellenberger <frank.h.ellenberger at gmail.com>
Date:   Mon Oct 21 21:05:26 2019 +0200

    update aqbanking to 5.99.43beta

diff --git a/templates/org.gnucash.GnuCash.json.tpl b/templates/org.gnucash.GnuCash.json.tpl
index 15b7673..52a1957 100644
--- a/templates/org.gnucash.GnuCash.json.tpl
+++ b/templates/org.gnucash.GnuCash.json.tpl
@@ -313,8 +313,8 @@
       "sources": [
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/211/aqbanking-5.99.42beta.tar.gz",
-          "sha256": "634d3dce1c6a3667983ae4bc995f60535e406b907fab8830c0971b1f0e90ab1d"
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/215/aqbanking-5.99.43beta.tar.gz",
+          "sha256": "ce0840616c1050588bca69bc08913bd5b5dc1ca8567207efde617cd496fa42b0"
         }
       ]
     },

commit 418d87308a7e24f2b8d1a966daf09cbcc358d062
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Oct 21 11:26:08 2019 -0700

    Upgrade Gwenhywfar & AQBanking to latest test releases.

diff --git a/templates/org.gnucash.GnuCash.json.tpl b/templates/org.gnucash.GnuCash.json.tpl
index dfe556f..15b7673 100644
--- a/templates/org.gnucash.GnuCash.json.tpl
+++ b/templates/org.gnucash.GnuCash.json.tpl
@@ -292,8 +292,8 @@
       "sources": [
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/202/gwenhywfar-4.99.22rc6.tar.gz",
-          "sha256": "b1d2caa219fb6d284d8b5147d64b6ed0de0e6b3557445b3b4ca88f2eaefb9b19"
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/210/gwenhywfar-4.99.24rc8.tar.gz",
+          "sha256": "212bc70066347ebf824c0ad35977789657523fb66faa6c4e3b0a6d0bc1303c1f"
         }
       ]
     },
@@ -313,8 +313,8 @@
       "sources": [
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/203/aqbanking-5.99.40beta.tar.gz",
-          "sha256": "6a5071efcca80d4fc6680e9e6bb82965924a99fb01f64dd67ce47a413c6617ca"
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/211/aqbanking-5.99.42beta.tar.gz",
+          "sha256": "634d3dce1c6a3667983ae4bc995f60535e406b907fab8830c0971b1f0e90ab1d"
         }
       ]
     },

commit 1e1b40767e3a80a4d1257af9f567e87410203fd3
Author: John Ralls <jralls at ceridwen.us>
Date:   Sat Oct 12 14:17:26 2019 -0700

    Update AQBanking and Gwenhywfar betas to the latest releases.

diff --git a/templates/org.gnucash.GnuCash.json.tpl b/templates/org.gnucash.GnuCash.json.tpl
index 2b51904..dfe556f 100644
--- a/templates/org.gnucash.GnuCash.json.tpl
+++ b/templates/org.gnucash.GnuCash.json.tpl
@@ -292,8 +292,8 @@
       "sources": [
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/160/gwenhywfar-4.99.18rc2.tar.gz",
-          "sha256": "dc5d16e72785825341eeac116f4e58fe1a0886041f0b57ec300fea198857a73d"
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/202/gwenhywfar-4.99.22rc6.tar.gz",
+          "sha256": "b1d2caa219fb6d284d8b5147d64b6ed0de0e6b3557445b3b4ca88f2eaefb9b19"
         }
       ]
     },
@@ -313,8 +313,8 @@
       "sources": [
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/162/aqbanking-5.99.35beta.tar.gz",
-          "sha256": "2ee215a376a7f68296057ea3debdc5d07d49bac0007d781a579f4a183facd936"
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/203/aqbanking-5.99.40beta.tar.gz",
+          "sha256": "6a5071efcca80d4fc6680e9e6bb82965924a99fb01f64dd67ce47a413c6617ca"
         }
       ]
     },

commit 4cba1eda417db8f41e05aa69557e9e124f9a5c98
Author: Frank H. Ellenberger <fellen at users.noreply.github.com>
Date:   Thu Sep 26 23:28:47 2019 +0200

    Update to AqBanking 5.99.35beta, Gwenhywfar 4.99.18rc2

diff --git a/templates/org.gnucash.GnuCash.json.tpl b/templates/org.gnucash.GnuCash.json.tpl
index 919fa8e..2b51904 100644
--- a/templates/org.gnucash.GnuCash.json.tpl
+++ b/templates/org.gnucash.GnuCash.json.tpl
@@ -292,8 +292,8 @@
       "sources": [
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/156/gwenhywfar-4.99.17rc1.tar.gz",
-          "sha256": "367d39ba0729be6d1feb49a7e7565fa6da50778000be860bfc25fcdca5f14031"
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/160/gwenhywfar-4.99.18rc2.tar.gz",
+          "sha256": "dc5d16e72785825341eeac116f4e58fe1a0886041f0b57ec300fea198857a73d"
         }
       ]
     },
@@ -313,8 +313,8 @@
       "sources": [
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/157/aqbanking-5.99.34beta.tar.gz",
-          "sha256": "d89192887f5b075139e51b72779bb88d22f3e7cb209bb72062fa1f6fc77ec0c6"
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/162/aqbanking-5.99.35beta.tar.gz",
+          "sha256": "2ee215a376a7f68296057ea3debdc5d07d49bac0007d781a579f4a183facd936"
         }
       ]
     },

commit 7d8066da5b46a096631f117a42b3068623fdf353
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Wed Sep 25 16:35:29 2019 +0200

    Update gwenhywfar and aqbanking
    
    gwen: 4.99.17rc1
    aqb: 5.99.34beta

diff --git a/templates/org.gnucash.GnuCash.json.tpl b/templates/org.gnucash.GnuCash.json.tpl
index 286924f..919fa8e 100644
--- a/templates/org.gnucash.GnuCash.json.tpl
+++ b/templates/org.gnucash.GnuCash.json.tpl
@@ -292,8 +292,8 @@
       "sources": [
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/140/gwenhywfar-4.99.16beta.tar.gz",
-          "sha256": "730530d479f8b425e0f47330342e3b08688699d925a214ab4f24ca49cb5cbf68"
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/156/gwenhywfar-4.99.17rc1.tar.gz",
+          "sha256": "367d39ba0729be6d1feb49a7e7565fa6da50778000be860bfc25fcdca5f14031"
         }
       ]
     },
@@ -313,8 +313,8 @@
       "sources": [
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/145/aqbanking-5.99.33beta.tar.gz",
-          "sha256": "4eaafe8a1442a0462f736c1be7c91de6f7db8669e884d990986f911b6520cd22"
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/157/aqbanking-5.99.34beta.tar.gz",
+          "sha256": "d89192887f5b075139e51b72779bb88d22f3e7cb209bb72062fa1f6fc77ec0c6"
         }
       ]
     },

commit 80f1760b94e6d8d2d4b9ba1e0661b5c3d32f1646
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sun Sep 22 22:24:55 2019 +0200

    Update to most recent gwenhywfar and aqbanking betas

diff --git a/templates/org.gnucash.GnuCash.json.tpl b/templates/org.gnucash.GnuCash.json.tpl
index 48ecafa..286924f 100644
--- a/templates/org.gnucash.GnuCash.json.tpl
+++ b/templates/org.gnucash.GnuCash.json.tpl
@@ -292,8 +292,8 @@
       "sources": [
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/136/gwenhywfar-4.99.15beta.tar.gz",
-          "sha256": "2a78b26f556688ad8f40c8727a8ec54c214746981ab83b539bd6a175f99d9878"
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/140/gwenhywfar-4.99.16beta.tar.gz",
+          "sha256": "730530d479f8b425e0f47330342e3b08688699d925a214ab4f24ca49cb5cbf68"
         }
       ]
     },
@@ -313,8 +313,8 @@
       "sources": [
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/134/aqbanking-5.99.30beta.tar.gz",
-          "sha256": "6bea8f8b9159c95e71bd6cc19f26b7d3347bcd5a62903f542cebeb19c835534b"
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/145/aqbanking-5.99.33beta.tar.gz",
+          "sha256": "4eaafe8a1442a0462f736c1be7c91de6f7db8669e884d990986f911b6520cd22"
         }
       ]
     },

commit 19a3417277dddec6eb7357a123277e25594edb5b
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Sep 21 17:30:35 2019 +0200

    Use flathub as repo to download runtimes from
    
    It appears gnome has removed their own stable runtime repo

diff --git a/templates/gnucash.flatpakref.tpl b/templates/gnucash.flatpakref.tpl
index 19e052e..d1fb019 100644
--- a/templates/gnucash.flatpakref.tpl
+++ b/templates/gnucash.flatpakref.tpl
@@ -2,4 +2,4 @@
 Title=GnuCash
 Name=org.gnucash.GnuCash
 IsRuntime=false
-RuntimeRepo=https://sdk.gnome.org/gnome.flatpakrepo
+RuntimeRepo=https://dl.flathub.org/repo/flathub.flatpakrepo

commit dd594f99937772efc8785d85a692d6383f41a0b3
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Sep 21 17:29:59 2019 +0200

    Remove pcsc socket again
    
    It's not supported by older flatpak versions, like the one
    used for the nightly builds.
    Users can enable this socket themselves using
    'flatpak override --user --socket=pcsc org.gnucash.GnuCash'

diff --git a/templates/org.gnucash.GnuCash.json.tpl b/templates/org.gnucash.GnuCash.json.tpl
index b97e8b0..48ecafa 100644
--- a/templates/org.gnucash.GnuCash.json.tpl
+++ b/templates/org.gnucash.GnuCash.json.tpl
@@ -11,7 +11,6 @@
   "finish-args": [
     "--socket=wayland",
     "--socket=x11",
-    "--socket=pcsc",
     "--share=ipc",
     "--share=network",
     "--filesystem=home",

commit 1570d58ae0f330abfa8d10bf8a325a5a568516bd
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Thu Sep 19 13:04:18 2019 +0200

    Add support for libchipcard and the pcsc socket
    
    Several banks have 2 factor authentication these days, which
    often makes use of smartcards

diff --git a/templates/org.gnucash.GnuCash.json.tpl b/templates/org.gnucash.GnuCash.json.tpl
index b2e2e0f..b97e8b0 100644
--- a/templates/org.gnucash.GnuCash.json.tpl
+++ b/templates/org.gnucash.GnuCash.json.tpl
@@ -10,7 +10,9 @@
   "rename-appdata-file": "gnucash.appdata.xml",
   "finish-args": [
     "--socket=wayland",
-    "--socket=x11", "--share=ipc",
+    "--socket=x11",
+    "--socket=pcsc",
+    "--share=ipc",
     "--share=network",
     "--filesystem=home",
     "--filesystem=xdg-run/dconf", "--filesystem=~/.config/dconf:ro",
@@ -266,10 +268,27 @@
         }
       ]
     },
+    {
+      "name": "libpcsclite",
+      "config-opts": [
+        "--disable-libsystemd",
+        "--disable-serial",
+        "--disable-usb",
+        "--disable-libudev",
+        "--with-systemdsystemunitdir=no"
+      ],
+      "sources": [
+        {
+          "type": "archive",
+          "url": "https://pcsclite.apdu.fr/files/pcsc-lite-1.8.24.tar.bz2",
+          "sha256": "b81864fa6a5ec776639c02ae89998955f7702a8d10e8b8f70023c5a599d97568"
+        }
+      ]
+    },
     {
       "name": "gwenhywfar",
       "config-opts": [
-        "--with-guis=''"
+        "--with-guis='gtk3'"
       ],
       "sources": [
         {
@@ -279,6 +298,16 @@
         }
       ]
     },
+    {
+      "name": "libchipcard",
+      "sources": [
+        {
+          "type": "archive",
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/138/libchipcard-5.1.3beta.tar.gz",
+          "sha256": "11daac6e924f850162b51979cc9926fdd849d2b587aff518f755b3cc8448a592"
+        }
+      ]
+    },
     {
       "name": "aqbanking",
       "no-parallel-make": true,

commit 2a35399528da51346eb884934b7f3532a9953cfb
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Thu Sep 19 11:33:26 2019 +0200

    Bump gwenhywfar and aqbanking to most recent betas
    
    This allows German users to test the newer PSD2 features

diff --git a/templates/org.gnucash.GnuCash.json.tpl b/templates/org.gnucash.GnuCash.json.tpl
index f83e765..b2e2e0f 100644
--- a/templates/org.gnucash.GnuCash.json.tpl
+++ b/templates/org.gnucash.GnuCash.json.tpl
@@ -274,8 +274,8 @@
       "sources": [
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/108/gwenhywfar-4.20.2.tar.gz",
-          "sha256": "0f4fd92351c8a11f053aa482fc5c459499db3dc78dd8bb469e878890ef3d3270"
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/136/gwenhywfar-4.99.15beta.tar.gz",
+          "sha256": "2a78b26f556688ad8f40c8727a8ec54c214746981ab83b539bd6a175f99d9878"
         }
       ]
     },
@@ -285,8 +285,8 @@
       "sources": [
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/107/aqbanking-5.8.2.tar.gz",
-          "sha256": "93ca523fe175e72042db75f8c3fc6255ab058cf82caf52796e15f030809fb15e"
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/134/aqbanking-5.99.30beta.tar.gz",
+          "sha256": "6bea8f8b9159c95e71bd6cc19f26b7d3347bcd5a62903f542cebeb19c835534b"
         }
       ]
     },

commit 9f057f916a561bf4adcb48acf092c788b361a20c
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Thu Sep 19 11:32:28 2019 +0200

    Refine cleanup of the gnucash module
    
    Remove additional files that serve no purpose for a flatpak target audience

diff --git a/templates/gnucash-targets-git.json.tpl b/templates/gnucash-targets-git.json.tpl
index 5c7a7d5..84e1aa3 100644
--- a/templates/gnucash-targets-git.json.tpl
+++ b/templates/gnucash-targets-git.json.tpl
@@ -6,10 +6,14 @@
       ],
       "cleanup": [
         "/share/info",
-        "/share/doc/*.qif",
-        "/share/doc/*.gnucash",
-        "/share/doc/ChangLog*",
-        "/share/doc/README*"
+        "/share/doc/gnucash/*.csv",
+        "/share/doc/gnucash/*.qif",
+        "/share/doc/gnucash/*.gnucash",
+        "/share/doc/gnucash/ChangeLog*",
+        "/share/doc/gnucash/HACKING",
+        "/share/doc/gnucash/README*",
+        "/share/doc/gnucash/guile-hackers.txt",
+        "/share/doc/gnucash/projects.html"
       ],
       "sources": [
         {
diff --git a/templates/gnucash-targets-tar.json.tpl b/templates/gnucash-targets-tar.json.tpl
index 3865687..8ecff76 100644
--- a/templates/gnucash-targets-tar.json.tpl
+++ b/templates/gnucash-targets-tar.json.tpl
@@ -6,10 +6,14 @@
       ],
       "cleanup": [
         "/share/info",
-        "/share/doc/*.qif",
-        "/share/doc/*.gnucash",
-        "/share/doc/ChangLog*",
-        "/share/doc/README*"
+        "/share/doc/gnucash/*.csv",
+        "/share/doc/gnucash/*.qif",
+        "/share/doc/gnucash/*.gnucash",
+        "/share/doc/gnucash/ChangeLog*",
+        "/share/doc/gnucash/HACKING",
+        "/share/doc/gnucash/README*",
+        "/share/doc/gnucash/guile-hackers.txt",
+        "/share/doc/gnucash/projects.html"
       ],
       "sources": [
       {

commit 83b41e286affb1bb557f3e61de603b28e7974acc
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Wed Sep 11 18:05:47 2019 +0200

    Be more selective in cleaning up the doc directory
    
    We do require AUTHORS, DOCUMENTERS and LICENSE files for the about dialog to work properly.

diff --git a/templates/gnucash-targets-git.json.tpl b/templates/gnucash-targets-git.json.tpl
index a4088d3..5c7a7d5 100644
--- a/templates/gnucash-targets-git.json.tpl
+++ b/templates/gnucash-targets-git.json.tpl
@@ -6,7 +6,10 @@
       ],
       "cleanup": [
         "/share/info",
-        "/share/doc"
+        "/share/doc/*.qif",
+        "/share/doc/*.gnucash",
+        "/share/doc/ChangLog*",
+        "/share/doc/README*"
       ],
       "sources": [
         {
diff --git a/templates/gnucash-targets-tar.json.tpl b/templates/gnucash-targets-tar.json.tpl
index f8ae9f5..3865687 100644
--- a/templates/gnucash-targets-tar.json.tpl
+++ b/templates/gnucash-targets-tar.json.tpl
@@ -6,7 +6,10 @@
       ],
       "cleanup": [
         "/share/info",
-        "/share/doc"
+        "/share/doc/*.qif",
+        "/share/doc/*.gnucash",
+        "/share/doc/ChangLog*",
+        "/share/doc/README*"
       ],
       "sources": [
       {

commit a711a435f09e7856ada80ebddf830b56b3b0b005
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Wed Sep 11 18:04:57 2019 +0200

    Let flatpak itself decide when a build is neede
    
    It's much smarter at this than my simple 'the branch already exists' test.
    Flatpak knows it has to rebuild if any of the manifest parameters changes as well.
    So it's now easier to trigger a rebuild if a branch already exists

diff --git a/build_package.sh b/build_package.sh
index e39df96..4ac7df4 100755
--- a/build_package.sh
+++ b/build_package.sh
@@ -100,18 +100,6 @@ else
     build_type=git
 fi
 
-echo "Checking for existing build of revision $fp_branch"
-# The command below will print an error on first run as the repo doesn't exist yet
-# You can safely ignore the error message
-if flatpak repo $fp_repo --branches | grep -q "/$fp_branch[[:space:]]"
-then
-    echo "Nothing to do: build already in repo"
-    upload_build_log
-    exit 0
-else
-    echo "Branch $fp_branch not found in repo, starting build"
-fi
-
 # Set up gpg
 prepare_gpg
 # Create the flatpak manifest

commit ca1014470eb1bb8560e9683571345d20d185d93f
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Aug 27 23:13:34 2019 +0200

    update to gwenhywfar 4.20.2 and aqbanking 5.8.2

diff --git a/templates/org.gnucash.GnuCash.json.tpl b/templates/org.gnucash.GnuCash.json.tpl
index 4f31a77..f83e765 100644
--- a/templates/org.gnucash.GnuCash.json.tpl
+++ b/templates/org.gnucash.GnuCash.json.tpl
@@ -274,8 +274,8 @@
       "sources": [
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/10/gwenhywfar-4.20.0.tar.gz",
-          "sha256": "5a88daabba1388f9528590aab5de527a12dd44a7da4572ce48469a29911b0fb0"
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/108/gwenhywfar-4.20.2.tar.gz",
+          "sha256": "0f4fd92351c8a11f053aa482fc5c459499db3dc78dd8bb469e878890ef3d3270"
         }
       ]
     },
@@ -285,8 +285,8 @@
       "sources": [
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/105/aqbanking-5.8.1.tar.gz",
-          "sha256": "af063a75ba401de3538f41cca0c7001950086b3e2d4f190ffe3ddfeea1b08454"
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/107/aqbanking-5.8.2.tar.gz",
+          "sha256": "93ca523fe175e72042db75f8c3fc6255ab058cf82caf52796e15f030809fb15e"
         }
       ]
     },

commit 7cc0dbb308edfe693ac0c50bf6d1af91f6af9ac2
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Aug 20 19:26:55 2019 +0200

    Create a flatpakrepo file for easier installation of the nightlies repo

diff --git a/build_package.sh b/build_package.sh
index d5f1e17..e39df96 100755
--- a/build_package.sh
+++ b/build_package.sh
@@ -118,6 +118,8 @@ prepare_gpg
 create_manifest
 # Create the flatpakref file
 create_flatpakref
+# Create the flatpakrepo file
+create_flatpakrepo
 
 # Prepare build environment by installing the correct sdk
 setup_sdk
@@ -144,6 +146,14 @@ then
     create_remote_dir "$host"/$remote_branch_dir
     rsync -a "$fp_ref_dir_local"/$fp_ref_file "$host"/$remote_branch_dir
   fi
+
+  # Upload the flatpakrepo file if we created one
+  if [[ -n "$fp_repo_file" ]]
+  then
+    echo "Uploading flatpakref file '$fp_repo_file'"
+    create_remote_dir "$host"
+    rsync -a "$fp_repo_dir_local"/$fp_repo_file "$host"
+  fi
 fi
 
 upload_build_log
diff --git a/functions.sh b/functions.sh
index 2151361..2194c16 100644
--- a/functions.sh
+++ b/functions.sh
@@ -202,3 +202,21 @@ function create_flatpakref()
     fp_ref_file=""
   fi
 }
+
+function create_flatpakrepo()
+{
+    fp_repo_file=gnucash-nightlies.flatpakrepo
+    if [[ -n "$host_public" ]] || [[ -n "$gpg_key" ]]
+        then
+        echo "Writing $fp_repo_file"
+        fp_repo_dir_local="$base_dir"/flatpakrefs
+        mkdir -p "$fp_repo_dir_local"
+        cp "$fp_git_dir"/templates/gnucash-nightlies.flatpakrepo.tpl "$fp_repo_dir_local"/$fp_repo_file
+        echo "Url=$host_public/$fp_repo" >> "$fp_repo_dir_local"/$fp_repo_file
+        echo "GPGKey=$gpg_key64" >> "$fp_repo_dir_local"/$fp_repo_file
+    else
+        echo "Mandatory variable 'host_public' or 'gpg_key' is not set."
+        echo "Skipping generation of $fp_repo_file"
+        fp_repo_file=""
+    fi
+}
diff --git a/templates/gnucash-nightlies.flatpakrepo.tpl b/templates/gnucash-nightlies.flatpakrepo.tpl
new file mode 100644
index 0000000..33c5b4c
--- /dev/null
+++ b/templates/gnucash-nightlies.flatpakrepo.tpl
@@ -0,0 +1,6 @@
+[Flatpak Repo]
+Title=GnuCash Nightlies
+Homepage=https://gnucash.org/
+Comment=Repository for GnuCash nightly builds
+Description=Repository for GnuCash nightly builds
+Icon=https://raw.githubusercontent.com/Gnucash/gnucash/3.6/data/pixmaps/hicolor/scalable/apps/gnucash-icon.svg

commit 293284ec4b3afc4726fbb824d8a404b9f4a62347
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Fri Aug 16 18:58:22 2019 +0200

    Update to gnome sdk 3.2

diff --git a/templates/org.gnucash.GnuCash.json.tpl b/templates/org.gnucash.GnuCash.json.tpl
index 5a034e1..4f31a77 100644
--- a/templates/org.gnucash.GnuCash.json.tpl
+++ b/templates/org.gnucash.GnuCash.json.tpl
@@ -1,7 +1,7 @@
 {
   "app-id": "org.gnucash.GnuCash",
   "runtime": "org.gnome.Platform",
-  "runtime-version": "3.30",
+  "runtime-version": "3.32",
   "sdk": "org.gnome.Sdk",
   "command": "gnucash",
   "copy-icon": true,

commit 42f89eb7290e2fd8bdf22e6cee162383185bd37d
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Fri Aug 16 16:33:39 2019 +0200

    ignore gpg key

diff --git a/.gitignore b/.gitignore
index e233c2e..b021a60 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
 custom.sh
 code_last_rev
 docs_last_rev
+gnucash-flatpak.gpg
 org.gnucash.GnuCash.json

commit c8456c72780c1fbb3508af566d776a9e6474b8b2
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Fri Aug 16 16:25:45 2019 +0200

    Import recent updates from flathub/org.gnucash.GnuCash
    
    These
    - update the gnome sdk/runtime to 3.30
    - update gc to 8.0.4 to use the compiler's built-in atomic support
    - add patches to fix libaio build on i386
    - enable parallel builds on boost

diff --git a/fix-build-flags.patch b/fix-build-flags.patch
new file mode 100644
index 0000000..c5b01a9
--- /dev/null
+++ b/fix-build-flags.patch
@@ -0,0 +1,79 @@
+Description: Honour user build flags
+ CPPFLAGS, CFLAGS and LDFLAGS are user flags, which we need to preserve, any
+ required flag that the build system needs, has to be set in some other flag
+ so that the build will succeed even of the user flags are passed.
+Author: Guillem Jover <guillem at debian.org>
+Origin: vendor
+Forwarded: no
+Last-Update: 2014-10-09
+
+
+---
+ harness/Makefile |    7 +++++--
+ src/Makefile     |   18 +++++++++---------
+ 2 files changed, 14 insertions(+), 11 deletions(-)
+
+--- a/harness/Makefile
++++ b/harness/Makefile
+@@ -6,13 +6,16 @@ PROGS:=$(PARTPROGS) $(EXTRAPROGS)
+ HARNESS_SRCS:=main.c
+ # io_queue.c
+ 
+-CFLAGS+=-Wall -I../src -g -O
++MK_CPPFLAGS:=-I../src
++CFLAGS=-Wall -g -O
+ #-lpthread -lrt
++MK_CFLAGS=$(CFLAGS)
++MK_LDFLAGS=main.c ../src/libaio.a $(LDFLAGS)
+ 
+ all: $(PROGS)
+ 
+ $(PROGS): %.p: %.t $(HARNESS_SRCS)
+-	$(CC) $(CFLAGS) -DTEST_NAME=\"$<\" -o $@ main.c ../src/libaio.a
++	$(CC) $(MK_CPPFLAGS) $(MK_CFLAGS) -DTEST_NAME=\"$<\" -o $@ $(MK_LDFLAGS)
+ 
+ clean:
+ 	rm -f $(PROGS) *.o runtests.out rofile wofile rwfile
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -4,12 +4,12 @@ includedir=$(prefix)/include
+ libdir=$(prefix)/lib
+ libdevdir=$(prefix)/lib
+ 
+-CFLAGS ?= -g -fomit-frame-pointer -O2
+-CFLAGS += -nostdlib -nostartfiles -Wall -I. -fPIC
+-SO_CFLAGS=-shared $(CFLAGS)
+-L_CFLAGS=$(CFLAGS)
+-LINK_FLAGS=-Wl,--as-needed -lgcc -lc
+-LINK_FLAGS+=$(LDFLAGS)
++MK_CPPFLAGS=-I.
++MK_CFLAGS=-nostdlib -nostartfiles -fomit-frame-pointer -fPIC $(CFLAGS)
++CFLAGS=-Wall -g -O2
++SO_CFLAGS=-shared $(MK_CFLAGS)
++L_CFLAGS=$(MK_CFLAGS)
++MK_LDFLAGS=-Wl,--as-needed -lgcc -lc $(LDFLAGS)
+ 
+ soname=libaio.so.1
+ minor=0
+@@ -39,10 +39,10 @@ libaio_sobjs := $(patsubst %.c,%.os,$(li
+ $(libaio_objs) $(libaio_sobjs): libaio.h vsys_def.h
+ 
+ %.os: %.c
+-	$(CC) $(SO_CFLAGS) -c -o $@ $<
++	$(CC) $(MK_CPPFLAGS) $(SO_CFLAGS) -c -o $@ $<
+ 
+ %.ol: %.c
+-	$(CC) $(L_CFLAGS) -c -o $@ $<
++	$(CC) $(MK_CPPFLAGS) $(L_CFLAGS) -c -o $@ $<
+ 
+ AR ?= ar
+ RANLIB ?= ranlib
+@@ -52,7 +52,7 @@ libaio.a: $(libaio_objs)
+ 	$(RANLIB) libaio.a
+ 
+ $(libname): $(libaio_sobjs) libaio.map
+-	$(CC) $(SO_CFLAGS) -Wl,--version-script=libaio.map -Wl,-soname=$(soname) -o $@ $(libaio_sobjs) $(LINK_FLAGS)
++	$(CC) $(SO_CFLAGS) -Wl,--version-script=libaio.map -Wl,-soname=$(soname) -o $@ $(libaio_sobjs) $(MK_LDFLAGS)
+ 
+ install: $(all_targets)
+ 	install -D -m 644 libaio.h $(DESTDIR)$(includedir)/libaio.h
diff --git a/fix-install-dirs.patch b/fix-install-dirs.patch
new file mode 100644
index 0000000..18368a5
--- /dev/null
+++ b/fix-install-dirs.patch
@@ -0,0 +1,68 @@
+Description: Fix installation of shared vs static libraries
+Author: Guillem Jover <guillem at debian.org>
+Origin: vendor
+Forwarded: no
+Last-Update: 2007-09-11
+
+
+---
+ Makefile     |    9 ++++++++-
+ src/Makefile |   12 +++++++-----
+ 2 files changed, 15 insertions(+), 6 deletions(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -5,9 +5,11 @@ RELEASE=$(shell awk '/Release:/ { print
+ CVSTAG = $(NAME)_$(subst .,-,$(VERSION))_$(subst .,-,$(RELEASE))
+ RPMBUILD=$(shell `which rpmbuild >&/dev/null` && echo "rpmbuild" || echo "rpm")
+ 
++DESTDIR=
+ prefix=/usr
+ includedir=$(prefix)/include
+ libdir=$(prefix)/lib
++libdevdir=$(prefix)/lib
+ 
+ default: all
+ 
+@@ -15,7 +17,12 @@ all:
+ 	@$(MAKE) -C src
+ 
+ install:
+-	@$(MAKE) -C src install prefix=$(prefix) includedir=$(includedir) libdir=$(libdir)
++	@$(MAKE) -C src install \
++	  DESTDIR=$(DESTDIR) \
++	  prefix=$(prefix) \
++	  includedir=$(includedir) \
++	  libdir=$(libdir) \
++	  libdevdir=$(libdevdir)
+ 
+ check:
+ 	@$(MAKE) -C harness check
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -1,6 +1,8 @@
++DESTDIR=
+ prefix=/usr
+ includedir=$(prefix)/include
+ libdir=$(prefix)/lib
++libdevdir=$(prefix)/lib
+ 
+ CFLAGS ?= -g -fomit-frame-pointer -O2
+ CFLAGS += -nostdlib -nostartfiles -Wall -I. -fPIC
+@@ -53,11 +55,11 @@ $(libname): $(libaio_sobjs) libaio.map
+ 	$(CC) $(SO_CFLAGS) -Wl,--version-script=libaio.map -Wl,-soname=$(soname) -o $@ $(libaio_sobjs) $(LINK_FLAGS)
+ 
+ install: $(all_targets)
+-	install -D -m 644 libaio.h $(includedir)/libaio.h
+-	install -D -m 644 libaio.a $(libdir)/libaio.a
+-	install -D -m 755 $(libname) $(libdir)/$(libname)
+-	ln -sf $(libname) $(libdir)/$(soname)
+-	ln -sf $(libname) $(libdir)/libaio.so
++	install -D -m 644 libaio.h $(DESTDIR)$(includedir)/libaio.h
++	install -D -m 644 libaio.a $(DESTDIR)$(libdevdir)/libaio.a
++	install -D -m 755 $(libname) $(DESTDIR)$(libdir)/$(libname)
++	ln -sf $(libdir)/$(libname) $(DESTDIR)$(libdir)/$(soname)
++	ln -sf $(libdir)/$(libname) $(DESTDIR)$(libdevdir)/libaio.so
+ 
+ $(libaio_objs): libaio.h
+ 
diff --git a/link-libs.patch b/link-libs.patch
new file mode 100644
index 0000000..5be59a3
--- /dev/null
+++ b/link-libs.patch
@@ -0,0 +1,29 @@
+Description: Link against libgcc and libc to avoid unresolved symbols
+ We need to link agaisnt -lgcc, on at least hppa.
+ .
+ We also link against -lc and -Wl,--as-needed, this way we pull the
+ required fortified functions from the internal libc_nonshared.a, but
+ do not link against the shared library because we do not use any of
+ its symbols.
+Author: Guillem Jover <guillem at debian.org>
+Origin: vendor
+Bug-Debian: 764509
+Forwarded: no
+Last-Update: 2014-10-09
+
+
+---
+ src/Makefile |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -6,7 +6,7 @@ CFLAGS ?= -g -fomit-frame-pointer -O2
+ CFLAGS += -nostdlib -nostartfiles -Wall -I. -fPIC
+ SO_CFLAGS=-shared $(CFLAGS)
+ L_CFLAGS=$(CFLAGS)
+-LINK_FLAGS=
++LINK_FLAGS=-Wl,--as-needed -lgcc -lc
+ LINK_FLAGS+=$(LDFLAGS)
+ 
+ soname=libaio.so.1
diff --git a/no-werror.patch b/no-werror.patch
new file mode 100644
index 0000000..a61260a
--- /dev/null
+++ b/no-werror.patch
@@ -0,0 +1,24 @@
+Description: Fix FTBFS with newer gcc 4.6
+ Using -Werror on a released project is in general not a good idea, as changes
+ in the toolchain and environment can trigger unexpected build failures.
+Author: Guillem Jover <guillem at debian.org>
+Origin: vendor
+Forwarded: no
+Last-Update: 2014-10-09
+
+
+---
+ harness/Makefile |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/harness/Makefile
++++ b/harness/Makefile
+@@ -6,7 +6,7 @@ PROGS:=$(PARTPROGS) $(EXTRAPROGS)
+ HARNESS_SRCS:=main.c
+ # io_queue.c
+ 
+-CFLAGS+=-Wall -Werror -I../src -g -O
++CFLAGS+=-Wall -I../src -g -O
+ #-lpthread -lrt
+ 
+ all: $(PROGS)
diff --git a/templates/org.gnucash.GnuCash.json.tpl b/templates/org.gnucash.GnuCash.json.tpl
index 0b67de8..5a034e1 100644
--- a/templates/org.gnucash.GnuCash.json.tpl
+++ b/templates/org.gnucash.GnuCash.json.tpl
@@ -1,7 +1,7 @@
 {
   "app-id": "org.gnucash.GnuCash",
   "runtime": "org.gnome.Platform",
-  "runtime-version": "3.28",
+  "runtime-version": "3.30",
   "sdk": "org.gnome.Sdk",
   "command": "gnucash",
   "copy-icon": true,
@@ -9,6 +9,7 @@
   "rename-desktop-file": "gnucash.desktop",
   "rename-appdata-file": "gnucash.appdata.xml",
   "finish-args": [
+    "--socket=wayland",
     "--socket=x11", "--share=ipc",
     "--share=network",
     "--filesystem=home",
@@ -30,8 +31,8 @@
       "sources": [
         {
           "type": "archive",
-          "url": "http://www.hboehm.info/gc/gc_source/gc-7.6.4.tar.gz",
-          "sha256": "b94c1f2535f98354811ee644dccab6e84a0cf73e477ca03fb5a3758fb1fecd1c"
+          "url": "http://www.hboehm.info/gc/gc_source/gc-8.0.4.tar.gz",
+          "sha256": "436a0ddc67b1ac0b0405b61a9675bca9e075c8156f4debd1d06f3a56c7cd289d"
         }
       ]
     },
@@ -133,16 +134,24 @@
     },
     {
       "name": "libaio",
-      "buildsystem": "simple",
-      "build-commands": [
-        "make",
-        "make prefix=/app install"
+      "no-autogen": true,
+      "make-install-args": [
+        "prefix=/app"
       ],
       "sources": [
         {
           "type": "archive",
           "url": "http://ftp.de.debian.org/debian/pool/main/liba/libaio/libaio_0.3.110.orig.tar.gz",
           "sha256": "e019028e631725729376250e32b473012f7cb68e1f7275bfc1bbcdd0f8745f7e"
+        },
+        {
+          "type": "patch",
+          "paths": [
+            "link-libs.patch",
+            "fix-install-dirs.patch",
+            "no-werror.patch",
+            "fix-build-flags.patch"
+          ]
         }
       ]
     },
@@ -263,23 +272,6 @@
         "--with-guis=''"
       ],
       "sources": [
-        {
-          "type": "script",
-          "dest-filename": "libgcrypt-config",
-          "commands": [
-            "case $1 in",
-            "--version) pkg-config --modversion libgcrypt ;;",
-            "--libs) echo $(pkg-config --libs libgcrypt) -lgpg-error ;;",
-            "*) pkg-config $* libgcrypt",
-            "esac"
-          ]
-        },
-        {
-          "type": "shell",
-          "commands": [
-            "install -Dm755 libgcrypt-config /app/bin/libgcrypt-config"
-          ]
-        },
         {
           "type": "archive",
           "url": "https://www.aquamaniac.de/rdm/attachments/download/10/gwenhywfar-4.20.0.tar.gz",
@@ -311,7 +303,7 @@
       "build-commands": [
           "./bootstrap.sh --prefix=/app --with-libraries=locale,filesystem,system,date_time,regex",
           "./b2 headers",
-          "./b2 install variant=release --layout=system"
+          "./b2 -j$FLATPAK_BUILDER_N_JOBS install variant=release --layout=system"
         ]
     },
     {

commit ecbe72018ebeef052c478eedcd83005cb448bd81
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Fri Aug 16 16:18:49 2019 +0200

    Drop ktoblzcheck and update aqbanking
    
    ktoblzcheck is no longer used
    aqbanking -> 5.8.1 to support new European bank regulations

diff --git a/templates/org.gnucash.GnuCash.json.tpl b/templates/org.gnucash.GnuCash.json.tpl
index 7a0d016..0b67de8 100644
--- a/templates/org.gnucash.GnuCash.json.tpl
+++ b/templates/org.gnucash.GnuCash.json.tpl
@@ -257,16 +257,6 @@
         }
       ]
     },
-    {
-      "name": "ktoblzcheck",
-      "sources": [
-        {
-          "type": "archive",
-          "url": "http://downloads.sourceforge.net/project/ktoblzcheck/ktoblzcheck-1.49.tar.gz",
-          "sha256": "e8971bc6689ea72b174c194bd43ba2c0b65112b0c3f9fd2371562e0c3ab57d29"
-        }
-      ]
-    },
     {
       "name": "gwenhywfar",
       "config-opts": [
@@ -303,7 +293,7 @@
       "sources": [
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/5/aqbanking-5.8.1.tar.gz",
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/105/aqbanking-5.8.1.tar.gz",
           "sha256": "af063a75ba401de3538f41cca0c7001950086b3e2d4f190ffe3ddfeea1b08454"
         }
       ]

commit 8bfcb38097cce775f94bd2e27713124f0eb5fe17
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Wed Aug 14 18:00:44 2019 +0200

    Update libofx to 0.9.14

diff --git a/templates/org.gnucash.GnuCash.json.tpl b/templates/org.gnucash.GnuCash.json.tpl
index 8aed886..7a0d016 100644
--- a/templates/org.gnucash.GnuCash.json.tpl
+++ b/templates/org.gnucash.GnuCash.json.tpl
@@ -112,8 +112,8 @@
       "sources": [
           {
               "type": "archive",
-              "url": "https://github.com/libofx/libofx/archive/0.9.12.tar.gz",
-              "sha256": "0288d0166b3e60e8ebbdcf4ac54b034082820d856a09912b748f2aec9b247130"
+              "url": "https://github.com/libofx/libofx/archive/0.9.14.tar.gz",
+              "sha256": "85a732efe3026e96fe1cf694ebdcf5d2c3b67adba85b9019abac44e7c43d8ce5"
           }
       ]
     },

commit 79d15d59968f88479d4b088b6757a07667347530
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Wed Aug 14 17:54:20 2019 +0200

    Update aqbanking to 5.8.1

diff --git a/build_package.sh b/build_package.sh
index 58fa375..d5f1e17 100755
--- a/build_package.sh
+++ b/build_package.sh
@@ -147,3 +147,5 @@ then
 fi
 
 upload_build_log
+
+# Note: command to get revision only tags sorted by increasing rev numbers: git tag --list '[0-9].*' --sort=v:refname
diff --git a/templates/org.gnucash.GnuCash.json.tpl b/templates/org.gnucash.GnuCash.json.tpl
index c94c896..8aed886 100644
--- a/templates/org.gnucash.GnuCash.json.tpl
+++ b/templates/org.gnucash.GnuCash.json.tpl
@@ -303,8 +303,8 @@
       "sources": [
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/5/aqbanking-5.7.8.tar.gz",
-          "sha256": "16f86e4cc49a9eaaa8dfe3206607e627873208bce45a70030c3caea9b5afc768"
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/5/aqbanking-5.8.1.tar.gz",
+          "sha256": "af063a75ba401de3538f41cca0c7001950086b3e2d4f190ffe3ddfeea1b08454"
         }
       ]
     },

commit d65c3638f875dfae320e3b841ad085e8dabb346e
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Jan 15 22:12:01 2019 +0100

    Cope with different column separator written by different versions of flatpak
    
    Older versions use a space to separate columns, newer versions use tab.
    [[:space:]] covers both of them in one grep call. And no need for -P any more.

diff --git a/build_package.sh b/build_package.sh
index 4f00718..58fa375 100755
--- a/build_package.sh
+++ b/build_package.sh
@@ -103,7 +103,7 @@ fi
 echo "Checking for existing build of revision $fp_branch"
 # The command below will print an error on first run as the repo doesn't exist yet
 # You can safely ignore the error message
-if flatpak repo $fp_repo --branches | grep -qP "/$fp_branch\t"
+if flatpak repo $fp_repo --branches | grep -q "/$fp_branch[[:space:]]"
 then
     echo "Nothing to do: build already in repo"
     upload_build_log

commit 2dde4ce9b86220d620f286d1fbb25fc29b6c10fb
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Jan 15 18:02:59 2019 +0100

    Additional remote directory work
    
    - Put creation of remote directories in a function for better code readability
    - Only create remote directories at the point they will be effectively used
    - Create branch-based subdirectories for the manifest files as well.

diff --git a/build_package.sh b/build_package.sh
index f7eb378..4f00718 100755
--- a/build_package.sh
+++ b/build_package.sh
@@ -59,14 +59,9 @@ time_stamp=$(date +%Y-%m-%d-%H-%M-%S)
 log_file="build-$revision-$time_stamp.log"
 exec > >(tee "$local_log_dir/$log_file") 2>&1
 
-if [[ -n "$host" ]]
-then
-  # Bootstrap initial directory structure on the host
-  # This will be a noop if the structure already exists
-  rsync -a --exclude='*' "$local_log_dir"/ "$host"
-  rsync -a --exclude='*' "$local_log_dir"/ "$host"/build-logs
-  rsync -a --exclude='*' "$local_log_dir"/ "$host"/manifests
-fi
+# Create the base directory on the host where all generated files will be uploaded to.
+# This will be a noop if either no host is set or the directory already exists
+create_remote_dir "$host"
 
   # Upload inital build log so everyone knows the build has started
 echo "Starting flatpak build run for $revision"
@@ -134,27 +129,20 @@ flatpak-builder $gpg_parms --repo=$fp_repo --force-clean --default-branch="$fp_b
 # Optional code to upload
 if [[ -n "$host" ]]
 then
-  echo "Uploading flatpak manifest 'org.gnucash.GnuCash-$fp_branch.json' and synchronizing repository"
-  rsync -a "$fp_git_dir"/org.gnucash.GnuCash.json "$host/manifests/org.gnucash.GnuCash-$fp_branch.json"
+  echo "Uploading flatpak manifest 'org.gnucash.GnuCash-$fp_branch.json'"
+  create_remote_dir "$host"/manifests
+  create_remote_dir "$host"/manifests/$remote_branch_dir
+  rsync -a "$fp_git_dir"/org.gnucash.GnuCash.json "$host/manifests/$remote_branch_dir/org.gnucash.GnuCash-$fp_branch.json"
+
+  echo "Synchronizing flatpak repository"
   rsync -a $fp_repo "$host"
 
   # Upload the flatpak ref file if we created one
   if [[ -n "$fp_ref_file" ]]
   then
-    # Create required directory on the remote
-    mkdir fake
-    if [[ "$is_release" = "yes" ]]
-    then
-      rsync -a fake/ "$host"/releases
-      fp_ref_dir_remote="$host"/releases
-    else
-      rsync -a fake/ "$host"/$revision
-      fp_ref_dir_remote="$host"/$revision
-    fi
-    rmdir fake
-
     echo "Uploading flatpakref file '$fp_ref_file'"
-    rsync -a "$fp_ref_dir_local"/$fp_ref_file "$fp_ref_dir_remote"
+    create_remote_dir "$host"/$remote_branch_dir
+    rsync -a "$fp_ref_dir_local"/$fp_ref_file "$host"/$remote_branch_dir
   fi
 fi
 
diff --git a/functions.sh b/functions.sh
index b192db3..2151361 100644
--- a/functions.sh
+++ b/functions.sh
@@ -23,34 +23,43 @@ function usage()
   exit 1
 }
 
+# This function will create a remote directory
+# It will only run if $host is configured.
+# Note it assumes the parent directory exists and it won't
+# create intermediate subdirectories if that is not the case
+function create_remote_dir()
+{
+  if [[ -n "$host" ]]
+  then
+    # For this hack $base_dir is just an arbitrary existing directory
+    # It doesn't matter which one
+    # No files will be copied from it anyway because of the exclude parameter
+    rsync -a --exclude='*' "$base_dir"/ "$1"
+  fi
+}
+
 function upload_build_log()
 {
   if [[ -n "$host" ]]
   then
     echo "Uploading log file '$log_file'"
-    if [[ "$is_release" = "undecided" ]]
+    create_remote_dir "$host"/build-logs
+    if [[ -z "$remote_branch_dir" ]]
     then
       # We don't know the build type yet, so we can't determine
       # the final remote directory to store it
-      # So let's just store it in the top-level
-      # This happens for the initial upload or very early failures
+      # So let's just store it in the top-level so we have a trace
+      # of the build start or very early failures
       rsync -a "$local_log_dir/$log_file" "$host"/build-logs
     else
-      # Ah, now we can determine the final path...
-      if [[ "$is_release" = "yes" ]]
-      then
-        remote_log_dir="releases"
-      else
-        remote_log_dir=$revision
-      fi
-      # In addition group per month to keep the logs manageable
+      # Now the subdirectory to store the log file is is known
+      # In addition group per month to simplify navigation even more
       month_part=$(date +%Y-%m)
 
-      # Hack to ensure all intermediate directories exist
-      rsync -a --exclude='*' "$local_log_dir"/ "$host"/build-logs/$remote_log_dir
-      rsync -a --exclude='*' "$local_log_dir"/ "$host"/build-logs/$remote_log_dir/$month_part
+      create_remote_dir "$host"/build-logs/$remote_branch_dir
+      create_remote_dir "$host"/build-logs/$remote_branch_dir/$month_part
 
-      rsync -a "$local_log_dir/$log_file" "$host"/build-logs/$remote_log_dir/$month_part
+      rsync -a "$local_log_dir/$log_file" "$host"/build-logs/$remote_branch_dir/$month_part
 
       # Finally remove the initially start build log uploaded earlier
       # Disable fatal error handling though to prevent the complete script from exiting
@@ -73,9 +82,11 @@ function prepare_repo()
   then
     echo "Detected a tag (release) build"
     is_release="yes"
+    remote_branch_dir="releases"
   else
     echo "No tag detected, assuming development build"
     is_release="no"
+    remote_branch_dir=$revision
     git reset --hard origin/$revision
   fi
   popd

commit c3dca42c1cb20621ea50f9936eb7ad8dda40906a
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Jan 15 17:30:13 2019 +0100

    Upload log files to subdirectories to keep browse lists relatively short
    
    Unfortunately at the initial upload we can't determine the proper path yet.
    So that first upload still happens to the base build_logs directory.
    If the log is later uploaded to the proper subdirectory that initial
    upload will be deleted again.

diff --git a/build_package.sh b/build_package.sh
index a4649af..f7eb378 100755
--- a/build_package.sh
+++ b/build_package.sh
@@ -50,23 +50,22 @@ while getopts "hr:" o; do
     esac
 done
 
-is_release="no"
+is_release="undecided"
 
 # Set up logging
-mkdir -p "$base_dir/logs"
+local_log_dir="$base_dir/logs"
+mkdir -p "$local_log_dir"
 time_stamp=$(date +%Y-%m-%d-%H-%M-%S)
-log_file="$base_dir/logs/build-$revision-$time_stamp.log"
-exec > >(tee "$log_file") 2>&1
+log_file="build-$revision-$time_stamp.log"
+exec > >(tee "$local_log_dir/$log_file") 2>&1
 
 if [[ -n "$host" ]]
 then
   # Bootstrap initial directory structure on the host
   # This will be a noop if the structure already exists
-  mkdir fake
-  rsync -a fake/ "$host"
-  rsync -a fake/ "$host"/build-logs
-  rsync -a fake/ "$host"/manifests
-  rmdir fake
+  rsync -a --exclude='*' "$local_log_dir"/ "$host"
+  rsync -a --exclude='*' "$local_log_dir"/ "$host"/build-logs
+  rsync -a --exclude='*' "$local_log_dir"/ "$host"/manifests
 fi
 
   # Upload inital build log so everyone knows the build has started
diff --git a/functions.sh b/functions.sh
index c8fbe2b..b192db3 100644
--- a/functions.sh
+++ b/functions.sh
@@ -28,7 +28,38 @@ function upload_build_log()
   if [[ -n "$host" ]]
   then
     echo "Uploading log file '$log_file'"
-    rsync -a "$log_file" "$host"/build-logs
+    if [[ "$is_release" = "undecided" ]]
+    then
+      # We don't know the build type yet, so we can't determine
+      # the final remote directory to store it
+      # So let's just store it in the top-level
+      # This happens for the initial upload or very early failures
+      rsync -a "$local_log_dir/$log_file" "$host"/build-logs
+    else
+      # Ah, now we can determine the final path...
+      if [[ "$is_release" = "yes" ]]
+      then
+        remote_log_dir="releases"
+      else
+        remote_log_dir=$revision
+      fi
+      # In addition group per month to keep the logs manageable
+      month_part=$(date +%Y-%m)
+
+      # Hack to ensure all intermediate directories exist
+      rsync -a --exclude='*' "$local_log_dir"/ "$host"/build-logs/$remote_log_dir
+      rsync -a --exclude='*' "$local_log_dir"/ "$host"/build-logs/$remote_log_dir/$month_part
+
+      rsync -a "$local_log_dir/$log_file" "$host"/build-logs/$remote_log_dir/$month_part
+
+      # Finally remove the initially start build log uploaded earlier
+      # Disable fatal error handling though to prevent the complete script from exiting
+      # if no early build log exists
+      echo "Removing initial startup build log uploaded earlier"
+      set +ex
+      rsync -rv --delete --include="$log_file" --exclude='*' "$base_dir"/ "$host"/build-logs/
+      set -ex
+    fi
   fi
 }
 
@@ -44,6 +75,7 @@ function prepare_repo()
     is_release="yes"
   else
     echo "No tag detected, assuming development build"
+    is_release="no"
     git reset --hard origin/$revision
   fi
   popd

commit 529f7fe14710ac916217c9220917fe6451e234eb
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Mon Jan 14 16:34:59 2019 +0100

    Remove the whole post-install section
    
    The uppercase issue has also been fixed so the sed invocation has become a noop.

diff --git a/templates/gnucash-targets-git.json.tpl b/templates/gnucash-targets-git.json.tpl
index 61db6fb..a4088d3 100644
--- a/templates/gnucash-targets-git.json.tpl
+++ b/templates/gnucash-targets-git.json.tpl
@@ -8,9 +8,6 @@
         "/share/info",
         "/share/doc"
       ],
-      "post-install": [
-        "sed -i 's/org.gnucash.Gnucash/org.gnucash.GnuCash/g' /app/share/metainfo/*.xml"
-      ],
       "sources": [
         {
           "type": "git",
diff --git a/templates/gnucash-targets-tar.json.tpl b/templates/gnucash-targets-tar.json.tpl
index e8ea0b3..f8ae9f5 100644
--- a/templates/gnucash-targets-tar.json.tpl
+++ b/templates/gnucash-targets-tar.json.tpl
@@ -8,9 +8,6 @@
         "/share/info",
         "/share/doc"
       ],
-      "post-install": [
-        "sed -i 's/org.gnucash.Gnucash/org.gnucash.GnuCash/g' /app/share/metainfo/*.xml"
-      ],
       "sources": [
       {
           "type": "archive",

commit c4d7a36b1f4918c1365fe8217385d11f9974ae3a
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Mon Jan 14 15:42:20 2019 +0100

    As of GnuCash 3.4, the appdata file is stored in /app/share/metainfo instead of /app/share/appdata

diff --git a/templates/gnucash-targets-git.json.tpl b/templates/gnucash-targets-git.json.tpl
index 8a3388b..61db6fb 100644
--- a/templates/gnucash-targets-git.json.tpl
+++ b/templates/gnucash-targets-git.json.tpl
@@ -9,7 +9,7 @@
         "/share/doc"
       ],
       "post-install": [
-        "sed -i 's/org.gnucash.Gnucash/org.gnucash.GnuCash/g' /app/share/appdata/*.xml"
+        "sed -i 's/org.gnucash.Gnucash/org.gnucash.GnuCash/g' /app/share/metainfo/*.xml"
       ],
       "sources": [
         {
diff --git a/templates/gnucash-targets-tar.json.tpl b/templates/gnucash-targets-tar.json.tpl
index 30c7bab..e8ea0b3 100644
--- a/templates/gnucash-targets-tar.json.tpl
+++ b/templates/gnucash-targets-tar.json.tpl
@@ -9,7 +9,7 @@
         "/share/doc"
       ],
       "post-install": [
-        "sed -i 's/org.gnucash.Gnucash/org.gnucash.GnuCash/g' /app/share/appdata/*.xml"
+        "sed -i 's/org.gnucash.Gnucash/org.gnucash.GnuCash/g' /app/share/metainfo/*.xml"
       ],
       "sources": [
       {

commit 41bc68e390006e8e5b935c4ab8251db86e16e501
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Thu Nov 15 14:07:12 2018 +0100

    Let b2 decide for itself how many jobs to run in parallel

diff --git a/templates/org.gnucash.GnuCash.json.tpl b/templates/org.gnucash.GnuCash.json.tpl
index b74c6c0..c94c896 100644
--- a/templates/org.gnucash.GnuCash.json.tpl
+++ b/templates/org.gnucash.GnuCash.json.tpl
@@ -321,7 +321,7 @@
       "build-commands": [
           "./bootstrap.sh --prefix=/app --with-libraries=locale,filesystem,system,date_time,regex",
           "./b2 headers",
-          "./b2 -j$FLATPAK_BUILDER_N_JOBS install variant=release --layout=system"
+          "./b2 install variant=release --layout=system"
         ]
     },
     {

commit beee64d47150e1fe27bb68cf865bd3b053868076
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Wed Nov 14 19:44:32 2018 +0100

    gwen tar got moved by Martin one more time for consistency

diff --git a/templates/org.gnucash.GnuCash.json.tpl b/templates/org.gnucash.GnuCash.json.tpl
index dc4f7f5..b74c6c0 100644
--- a/templates/org.gnucash.GnuCash.json.tpl
+++ b/templates/org.gnucash.GnuCash.json.tpl
@@ -292,7 +292,7 @@
         },
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/rdm/attachments/download/8/gwenhywfar-4.20.0.tar.gz",
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/10/gwenhywfar-4.20.0.tar.gz",
           "sha256": "5a88daabba1388f9528590aab5de527a12dd44a7da4572ce48469a29911b0fb0"
         }
       ]

commit 805baed5cf6524e023bec7c02f713ecb1cd6f2c5
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Wed Nov 14 17:58:58 2018 +0100

    Use new download urls for gwenhywfar and aqbanking
    
    These new urls don't require a dest-filename to be specified. Hence
    our adapted manifest file will also work to build the flatpak on
    F25's version of flatpak-builder.

diff --git a/templates/org.gnucash.GnuCash.json.tpl b/templates/org.gnucash.GnuCash.json.tpl
index f1101cc..dc4f7f5 100644
--- a/templates/org.gnucash.GnuCash.json.tpl
+++ b/templates/org.gnucash.GnuCash.json.tpl
@@ -292,8 +292,7 @@
         },
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/sites/download/download.php?package=01&release=208&file=02&dummy=gwenhywfar-4.20.0.tar.gz",
-          "dest-filename": "gwenhywfar.tar.gz",
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/8/gwenhywfar-4.20.0.tar.gz",
           "sha256": "5a88daabba1388f9528590aab5de527a12dd44a7da4572ce48469a29911b0fb0"
         }
       ]
@@ -304,8 +303,7 @@
       "sources": [
         {
           "type": "archive",
-          "url": "https://www.aquamaniac.de/sites/download/download.php?package=03&release=217&file=02&dummy=aqbanking-5.7.8.tar.gz",
-          "dest-filename": "aqbanking.tar.gz",
+          "url": "https://www.aquamaniac.de/rdm/attachments/download/5/aqbanking-5.7.8.tar.gz",
           "sha256": "16f86e4cc49a9eaaa8dfe3206607e627873208bce45a70030c3caea9b5afc768"
         }
       ]

commit 5dc6e234ed5db5d9087efdc8835726d60b7050e7
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Mon Nov 12 10:49:00 2018 +0100

    Use sha256 everywhere

diff --git a/templates/extra-deps-git.json.tpl b/templates/extra-deps-git.json.tpl
index f23e338..89540ff 100644
--- a/templates/extra-deps-git.json.tpl
+++ b/templates/extra-deps-git.json.tpl
@@ -8,7 +8,7 @@
         {
             "type": "archive",
             "url": "http://prdownloads.sourceforge.net/pcre/pcre-8.42.tar.bz2",
-            "sha1": "df0d1c2ff04c359220cb902539a6e134af4497f4"
+            "sha256": "2cd04b7c887808be030254e8d77de11d3fe9d4505c39d4b15d2664ffe8bf9301"
         }
         ]
     },
@@ -25,7 +25,7 @@
         {
           "type": "archive",
           "url": "http://prdownloads.sourceforge.net/swig/swig-3.0.12.tar.gz",
-          "sha1": "5cc1af41d041e4cc609580b99bb3dcf720effa25"
+          "sha256": "7cf9f447ae7ed1c51722efc45e7f14418d15d7a1e143ac9f09a668999f4fc94d"
         }
       ]
     },

commit a66738cf2c2a5b5dab6723d47934e4c4653101c3
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sun Nov 11 12:27:01 2018 +0100

    Add system dependencies to README

diff --git a/README.md b/README.md
index 5a87b3b..d9f6277 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,19 @@ Again: these packages are not release quality for several reasons:
    make dist(check) on the source repository.
 
 However, now that it's clearly stated the packages are meant purely for
-testing unreleased features, here's how to use these scripts. In the following recipe
+testing unreleased features, here's how to use these scripts.
+
+# System dependencies #
+
+To use the scripts in this repository you need the following packages installed on your system:
+
+- flatpak
+- flatpak-builder
+- gettext (for envsubst)
+- perl
+
+# Build recipe #
+In the following recipe
 we will use "flatpak" as the **base directory** in which everything will happen.
 
 1. Create the following directory structure

commit 8c8909c9e27cae2cace20ac5dea3072c86b5b255
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sun Nov 11 12:26:41 2018 +0100

    Besides the sdk, the runtime needs to be installed as well

diff --git a/functions.sh b/functions.sh
index 6ff6a1a..c8fbe2b 100644
--- a/functions.sh
+++ b/functions.sh
@@ -133,10 +133,12 @@ function setup_sdk()
     flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
 
     # Extract the required sdk from the config file
-    sdk_ver=$(perl -lne 'm|"runtime-version".*"(.*)"|g&&print "$1"' "$fp_git_dir"/org.gnucash.GnuCash.json)
+    runtime_base=$(perl -lne 'm|"runtime".*"(.*)"|g&&print "$1"' "$fp_git_dir"/org.gnucash.GnuCash.json)
+    runtime_ver=$(perl -lne 'm|"runtime-version".*"(.*)"|g&&print "$1"' "$fp_git_dir"/org.gnucash.GnuCash.json)
     sdk_base=$(perl -lne 'm|"sdk".*"(.*)"|g&&print "$1"' "$fp_git_dir"/org.gnucash.GnuCash.json)
-    sdk=$sdk_base//$sdk_ver
-    flatpak install --user flathub $sdk
+    runtime=$runtime_base//$runtime_ver
+    sdk=$sdk_base//$runtime_ver
+    flatpak install -y --user flathub $sdk $runtime
 }
 
 function create_flatpakref()

commit 4e13f710c5ac860f0d14232d413dea7ffda4e4d4
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sun Nov 11 11:31:11 2018 +0100

    Add code to install required sdk

diff --git a/README.md b/README.md
index e785d35..5a87b3b 100644
--- a/README.md
+++ b/README.md
@@ -16,14 +16,6 @@ However, now that it's clearly stated the packages are meant purely for
 testing unreleased features, here's how to use these scripts. In the following recipe
 we will use "flatpak" as the **base directory** in which everything will happen.
 
-0. Install the flathub repository. This repo will provide the gnome-sdk our
-flatpak configuration is based on.
-```
-flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
-```
-[The flathub website](https://flatpak.org/setup/) has additional pointers
-for setting this up on various distributions.
-
 1. Create the following directory structure
 ```
 flatpak
diff --git a/build_package.sh b/build_package.sh
index af53c6b..a4649af 100755
--- a/build_package.sh
+++ b/build_package.sh
@@ -125,6 +125,9 @@ create_manifest
 # Create the flatpakref file
 create_flatpakref
 
+# Prepare build environment by installing the correct sdk
+setup_sdk
+
 # Start all necessary builds in parallel
 echo "Creating new flatpak [gnucash=$code_full_version, gnucash-docs=$docs_full_version]"
 flatpak-builder $gpg_parms --repo=$fp_repo --force-clean --default-branch="$fp_branch" build "$fp_git_dir"/org.gnucash.GnuCash.json
diff --git a/functions.sh b/functions.sh
index 54eb4be..6ff6a1a 100644
--- a/functions.sh
+++ b/functions.sh
@@ -127,6 +127,18 @@ function create_manifest()
            > "$fp_git_dir"/org.gnucash.GnuCash.json
 }
 
+function setup_sdk()
+{
+    echo "Configuring flathub repository"
+    flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
+
+    # Extract the required sdk from the config file
+    sdk_ver=$(perl -lne 'm|"runtime-version".*"(.*)"|g&&print "$1"' "$fp_git_dir"/org.gnucash.GnuCash.json)
+    sdk_base=$(perl -lne 'm|"sdk".*"(.*)"|g&&print "$1"' "$fp_git_dir"/org.gnucash.GnuCash.json)
+    sdk=$sdk_base//$sdk_ver
+    flatpak install --user flathub $sdk
+}
+
 function create_flatpakref()
 {
   fp_ref_file=gnucash-$fp_branch.flatpakref

commit 7dedcc76701c13b1344a7fe76378bcb4d74efd70
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Nov 10 15:21:12 2018 +0100

    Fix a few typos in the readme file

diff --git a/README.md b/README.md
index 3441408..e785d35 100644
--- a/README.md
+++ b/README.md
@@ -79,7 +79,7 @@ Note one has to specify --no-gpg-verify because the builds are not signed.
 ## Flatpak branches ##
 
 The build script will try to avoid double work. For that it will check the commit hashes
-for the given revision (maint by default of not revision is passed to the build script).
+for the given revision (maint by default if no revision is passed to the build script).
 If a build already exists for the combination of the gnucash and gnucash-docs commit hashes
 no new build will be started.
 
@@ -96,7 +96,7 @@ For example
 ```
 For non-release builds (like from 'maint') the branch name will be based on the git branch name
 and git descriptions of the respective commits. The git descriptions are obtained using the
-**git describe** command. So tne full branch name becomes
+**git describe** command. So the full branch name becomes
 ```
 /app/org.gnucash.GnuCash/<arch>/<git branch>-C<code-desc>-D<docs-desc>
 ```
@@ -140,7 +140,7 @@ typically an http(s) url or if only for local use an absolute file:///path uri.
 
 ## Flatpakref files ##
 
-If both gpg signing and remote repository are configure, the build script will automatically
+If both gpg signing and remote repository are configured, the build script will automatically
 generate a gnucash-xyz.flatpakref file for each build. This file encapsulates all information
 to easily install a gnucash nightly flatpak in one single command:
 ```

commit 4d9b6182d2225f7beeca7c61f6ed71e86bb6f358
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Nov 10 15:20:55 2018 +0100

    Add instruction to install flathub first.
    
    It's become rule 0, the one too obvious to mention...

diff --git a/README.md b/README.md
index 2ba67af..3441408 100644
--- a/README.md
+++ b/README.md
@@ -16,6 +16,14 @@ However, now that it's clearly stated the packages are meant purely for
 testing unreleased features, here's how to use these scripts. In the following recipe
 we will use "flatpak" as the **base directory** in which everything will happen.
 
+0. Install the flathub repository. This repo will provide the gnome-sdk our
+flatpak configuration is based on.
+```
+flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
+```
+[The flathub website](https://flatpak.org/setup/) has additional pointers
+for setting this up on various distributions.
+
 1. Create the following directory structure
 ```
 flatpak

commit 869d0350ba3a7ae13ac0f496c6e68d1338fa6c5c
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Nov 10 13:53:25 2018 +0100

    Ensure variable fp_ref_file is defined before using it in an error message

diff --git a/functions.sh b/functions.sh
index 945d263..54eb4be 100644
--- a/functions.sh
+++ b/functions.sh
@@ -129,10 +129,9 @@ function create_manifest()
 
 function create_flatpakref()
 {
-  fp_ref_file=""
+  fp_ref_file=gnucash-$fp_branch.flatpakref
   if [[ -n "$host_public" ]] || [[ -n "$gpg_key" ]]
   then
-    fp_ref_file=gnucash-$fp_branch.flatpakref
     echo "Writing $fp_ref_file"
     fp_ref_dir_local="$base_dir"/flatpakrefs
     mkdir -p "$fp_ref_dir_local"
@@ -143,5 +142,6 @@ function create_flatpakref()
   else
     echo "Mandatory variable 'host_public' or 'gpg_key' is not set."
     echo "Skipping generation of $fp_ref_file"
+    fp_ref_file=""
   fi
 }

commit 04f0ef26c2acdc36c6f12ae098ffac9726cdf0e5
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Sep 25 22:17:35 2018 +0200

    Assume tag builds are release builds and make those build from release tarball
    
    The resulting org.gnucash.GnuCash.json can be pushed to flathub later on to publish our releases on that platform as well

diff --git a/build_package.sh b/build_package.sh
index 35b499a..af53c6b 100755
--- a/build_package.sh
+++ b/build_package.sh
@@ -99,8 +99,11 @@ docs_full_version=${gc_full_version}
 if [[ "$code_full_version" == "$docs_full_version" ]]
 then
     fp_branch="$code_full_version"
+    build_type=tar
+    get_checksums
 else
     fp_branch="$revision-C$code_full_version-D$docs_full_version"
+    build_type=git
 fi
 
 echo "Checking for existing build of revision $fp_branch"
diff --git a/functions.sh b/functions.sh
index cfff364..945d263 100644
--- a/functions.sh
+++ b/functions.sh
@@ -66,6 +66,13 @@ function get_versions()
   popd
 }
 
+function get_checksums()
+{
+  wget "http://downloads.sourceforge.net/gnucash/gnucash (stable)/${revision}/README.txt" -O "${base_dir}"/README.txt
+  code_checksum=$(awk "/gnucash-${revision}.tar.bz2/ { print \$1;}" "${base_dir}"/README.txt)
+  docs_checksum=$(awk "/gnucash-docs-${revision}.tar.gz/ { print \$1;}" "${base_dir}"/README.txt)
+}
+
 function prepare_gpg()
 {
   # gpg_parms will hold optional gpg parameters passed to flatpak commands later on
@@ -94,19 +101,21 @@ function create_manifest()
   echo "Writing org.gnucash.GnuCash.json manifest file"
 
   # Export environment variables used in the templates in order for envsubst to find them
-  export code_repodir docs_repodir revision
+  export code_repodir docs_repodir code_checksum docs_checksum revision
 
+  # In the functions below build_type selects the proper templates to initiate
+  # a git or a tar build. build_type is determined earlier in build_package.sh
   extra_deps=
-  if [[ -f "$fp_git_dir"/templates/extra-deps-git.json.tpl ]]; then
-    extra_deps=$(cat "$fp_git_dir"/templates/extra-deps-git.json.tpl)
+  if [[ -f "$fp_git_dir"/templates/extra-deps-${build_type}.json.tpl ]]; then
+      extra_deps=$(cat "$fp_git_dir"/templates/extra-deps-${build_type}.json.tpl)
   fi
   gnucash_targets=
-  if [[ -f "$fp_git_dir"/templates/extra-deps-git.json.tpl ]]; then
+  if [[ -f "$fp_git_dir"/templates/gnucash-targets-${build_type}.json.tpl ]]; then
       # Note the variable names passed to envsubst:
       # this limits the set of variables envsubst will effectively substitute
       # We do this to prevent colisions with flatpak variables in the manifest
-      gnucash_targets=$(envsubst '$code_repodir $docs_repodir $revision' \
-                        < "$fp_git_dir"/templates/gnucash-targets-git.json.tpl)
+      gnucash_targets=$(envsubst '$code_repodir $docs_repodir $revision $code_checksum $docs_checksum' \
+                        < "$fp_git_dir"/templates/gnucash-targets-${build_type}.json.tpl)
   fi
   export extra_deps gnucash_targets
 
diff --git a/templates/gnucash-targets-tar.json.tpl b/templates/gnucash-targets-tar.json.tpl
new file mode 100644
index 0000000..30c7bab
--- /dev/null
+++ b/templates/gnucash-targets-tar.json.tpl
@@ -0,0 +1,31 @@
+    {
+      "name": "gnucash",
+      "buildsystem": "cmake-ninja",
+      "config-opts": [
+           "-DBOOST_ROOT=/app"
+      ],
+      "cleanup": [
+        "/share/info",
+        "/share/doc"
+      ],
+      "post-install": [
+        "sed -i 's/org.gnucash.Gnucash/org.gnucash.GnuCash/g' /app/share/appdata/*.xml"
+      ],
+      "sources": [
+      {
+          "type": "archive",
+          "url": "http://downloads.sourceforge.net/gnucash/gnucash (stable)/${revision}/gnucash-${revision}.tar.bz2",
+          "sha256": "${code_checksum}"
+        }
+      ]
+    },
+    {
+      "name": "gnucash-docs",
+      "sources": [
+        {
+          "type": "archive",
+          "url": "http://downloads.sourceforge.net/gnucash/gnucash-docs/gnucash-docs-${revision}.tar.gz",
+          "sha256": "${docs_checksum}"
+        }
+      ]
+    }

commit 092cdeb6410aa320c4f0bc8faca8c7f2130f9214
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Sep 25 18:36:46 2018 +0200

    Split manifest template and use envsubst to recompose it

diff --git a/functions.sh b/functions.sh
index cd07933..cfff364 100644
--- a/functions.sh
+++ b/functions.sh
@@ -92,11 +92,30 @@ function prepare_gpg()
 function create_manifest()
 {
   echo "Writing org.gnucash.GnuCash.json manifest file"
-  cp "$fp_git_dir"/templates/org.gnucash.GnuCash.json.tpl "$fp_git_dir"/org.gnucash.GnuCash.json
-  perl -pi -e "s!{code_repo}!$code_repodir!" "$fp_git_dir"/org.gnucash.GnuCash.json
-  perl -pi -e "s!{docs_repo}!$docs_repodir!" "$fp_git_dir"/org.gnucash.GnuCash.json
-  perl -pi -e "s!{code_branch}!$revision!" "$fp_git_dir"/org.gnucash.GnuCash.json
-  perl -pi -e "s!{docs_branch}!$revision!" "$fp_git_dir"/org.gnucash.GnuCash.json
+
+  # Export environment variables used in the templates in order for envsubst to find them
+  export code_repodir docs_repodir revision
+
+  extra_deps=
+  if [[ -f "$fp_git_dir"/templates/extra-deps-git.json.tpl ]]; then
+    extra_deps=$(cat "$fp_git_dir"/templates/extra-deps-git.json.tpl)
+  fi
+  gnucash_targets=
+  if [[ -f "$fp_git_dir"/templates/extra-deps-git.json.tpl ]]; then
+      # Note the variable names passed to envsubst:
+      # this limits the set of variables envsubst will effectively substitute
+      # We do this to prevent colisions with flatpak variables in the manifest
+      gnucash_targets=$(envsubst '$code_repodir $docs_repodir $revision' \
+                        < "$fp_git_dir"/templates/gnucash-targets-git.json.tpl)
+  fi
+  export extra_deps gnucash_targets
+
+  # Note the variable names passed to envsubst:
+  # this limits the set of variables envsubst will effectively substitute
+  # We do this to prevent colisions with flatpak variables in the manifest
+  envsubst '$extra_deps $gnucash_targets' \
+           < "$fp_git_dir"/templates/org.gnucash.GnuCash.json.tpl \
+           > "$fp_git_dir"/org.gnucash.GnuCash.json
 }
 
 function create_flatpakref()
diff --git a/templates/extra-deps-git.json.tpl b/templates/extra-deps-git.json.tpl
new file mode 100644
index 0000000..f23e338
--- /dev/null
+++ b/templates/extra-deps-git.json.tpl
@@ -0,0 +1,31 @@
+    {
+        "name": "pcre",
+        "config-opts": [
+            "--enable-unicode-properties"
+        ],
+        "cleanup": ["*"],
+        "sources": [
+        {
+            "type": "archive",
+            "url": "http://prdownloads.sourceforge.net/pcre/pcre-8.42.tar.bz2",
+            "sha1": "df0d1c2ff04c359220cb902539a6e134af4497f4"
+        }
+        ]
+    },
+    {
+      "name": "swig",
+      "config-opts": [
+            "-with-boost-libs=/app/lib",
+            "--without-alllang",
+            "--with-guile=/app/bin/guile",
+            "--with-guile-config=/app/bin/guile-config"
+      ],
+      "cleanup": ["*"],
+      "sources": [
+        {
+          "type": "archive",
+          "url": "http://prdownloads.sourceforge.net/swig/swig-3.0.12.tar.gz",
+          "sha1": "5cc1af41d041e4cc609580b99bb3dcf720effa25"
+        }
+      ]
+    },
diff --git a/templates/gnucash-targets-git.json.tpl b/templates/gnucash-targets-git.json.tpl
new file mode 100644
index 0000000..8a3388b
--- /dev/null
+++ b/templates/gnucash-targets-git.json.tpl
@@ -0,0 +1,31 @@
+    {
+      "name": "gnucash",
+      "buildsystem": "cmake-ninja",
+      "config-opts": [
+           "-DBOOST_ROOT=/app"
+      ],
+      "cleanup": [
+        "/share/info",
+        "/share/doc"
+      ],
+      "post-install": [
+        "sed -i 's/org.gnucash.Gnucash/org.gnucash.GnuCash/g' /app/share/appdata/*.xml"
+      ],
+      "sources": [
+        {
+          "type": "git",
+          "path": "${code_repodir}",
+          "branch": "${revision}"
+        }
+      ]
+    },
+    {
+      "name": "gnucash-docs",
+      "sources": [
+        {
+          "type": "git",
+          "path": "${docs_repodir}",
+          "branch": "${revision}"
+        }
+      ]
+    }
diff --git a/templates/org.gnucash.GnuCash.json.tpl b/templates/org.gnucash.GnuCash.json.tpl
index e9828c6..f1101cc 100644
--- a/templates/org.gnucash.GnuCash.json.tpl
+++ b/templates/org.gnucash.GnuCash.json.tpl
@@ -338,67 +338,7 @@
         }
       ]
     },
-    {
-        "name": "pcre",
-        "config-opts": [
-            "--enable-unicode-properties"
-        ],
-        "cleanup": ["*"],
-        "sources": [
-        {
-            "type": "archive",
-            "url": "http://prdownloads.sourceforge.net/pcre/pcre-8.42.tar.bz2",
-            "sha1": "df0d1c2ff04c359220cb902539a6e134af4497f4"
-        }
-        ]
-    },
-    {
-      "name": "swig",
-      "config-opts": [
-            "-with-boost-libs=/app/lib",
-            "--without-alllang",
-            "--with-guile=/app/bin/guile",
-            "--with-guile-config=/app/bin/guile-config"
-      ],
-      "cleanup": ["*"],
-      "sources": [
-        {
-          "type": "archive",
-          "url": "http://prdownloads.sourceforge.net/swig/swig-3.0.12.tar.gz",
-          "sha1": "5cc1af41d041e4cc609580b99bb3dcf720effa25"
-        }
-      ]
-    },
-    {
-      "name": "gnucash",
-      "buildsystem": "cmake-ninja",
-      "config-opts": [
-           "-DBOOST_ROOT=/app"
-      ],
-      "cleanup": [
-        "/share/info",
-        "/share/doc"
-      ],
-      "post-install": [
-        "sed -i 's/org.gnucash.Gnucash/org.gnucash.GnuCash/g' /app/share/appdata/*.xml"
-      ],
-      "sources": [
-        {
-          "type": "git",
-          "path": "{code_repo}",
-          "branch": "{code_branch}"
-        }
-      ]
-    },
-    {
-      "name": "gnucash-docs",
-      "sources": [
-        {
-          "type": "git",
-          "path": "{docs_repo}",
-          "branch": "{docs_branch}"
-        }
-      ]
-    }
+${extra_deps}
+${gnucash_targets}
   ]
 }

commit 1dc20f9afcabb7ae4be5f4a2f9e9267c6b4d3bbb
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Sep 25 18:06:40 2018 +0200

    Move template files into their own separate directory

diff --git a/functions.sh b/functions.sh
index 062df17..cd07933 100644
--- a/functions.sh
+++ b/functions.sh
@@ -92,7 +92,7 @@ function prepare_gpg()
 function create_manifest()
 {
   echo "Writing org.gnucash.GnuCash.json manifest file"
-  cp "$fp_git_dir"/org.gnucash.GnuCash.json.tpl "$fp_git_dir"/org.gnucash.GnuCash.json
+  cp "$fp_git_dir"/templates/org.gnucash.GnuCash.json.tpl "$fp_git_dir"/org.gnucash.GnuCash.json
   perl -pi -e "s!{code_repo}!$code_repodir!" "$fp_git_dir"/org.gnucash.GnuCash.json
   perl -pi -e "s!{docs_repo}!$docs_repodir!" "$fp_git_dir"/org.gnucash.GnuCash.json
   perl -pi -e "s!{code_branch}!$revision!" "$fp_git_dir"/org.gnucash.GnuCash.json
@@ -108,7 +108,7 @@ function create_flatpakref()
     echo "Writing $fp_ref_file"
     fp_ref_dir_local="$base_dir"/flatpakrefs
     mkdir -p "$fp_ref_dir_local"
-    cp "$fp_git_dir"/gnucash.flatpakref.tpl "$fp_ref_dir_local"/$fp_ref_file
+    cp "$fp_git_dir"/templates/gnucash.flatpakref.tpl "$fp_ref_dir_local"/$fp_ref_file
     echo "Branch=$fp_branch"         >> "$fp_ref_dir_local"/$fp_ref_file
     echo "Url=$host_public/$fp_repo" >> "$fp_ref_dir_local"/$fp_ref_file
     echo "GPGKey=$gpg_key64" >> "$fp_ref_dir_local"/$fp_ref_file
diff --git a/gnucash.flatpakref.tpl b/templates/gnucash.flatpakref.tpl
similarity index 100%
rename from gnucash.flatpakref.tpl
rename to templates/gnucash.flatpakref.tpl
diff --git a/org.gnucash.GnuCash.json.tpl b/templates/org.gnucash.GnuCash.json.tpl
similarity index 100%
rename from org.gnucash.GnuCash.json.tpl
rename to templates/org.gnucash.GnuCash.json.tpl

commit 06accf61fcd18b68a658dad10911c2e70bbcd7e7
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Thu Sep 20 21:43:26 2018 +0200

    Fix build script name

diff --git a/build_periodic.sh b/build_package.sh
similarity index 100%
rename from build_periodic.sh
rename to build_package.sh

commit 42bcdf989977e7b3ac6a129f9fa4e2b793e372ba
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Sep 18 15:21:52 2018 +0200

    Update todo list

diff --git a/README.md b/README.md
index c1c7ff7..2ba67af 100644
--- a/README.md
+++ b/README.md
@@ -175,5 +175,6 @@ flatpak environment.
 ## TODO ##
 - add finance::quote support
 - properly handle release builds (should be run from release tarball)
+- try to build gnucash-docs as an extension instead of directly in the main flatpak
 
 

commit 59e4e71bd1eafdabbf40e0db9fd9ebabb94dac08
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Sep 18 14:42:24 2018 +0200

    Drop rsync verbosity again. Instead write a log message indicating the actions when relevant
    
    rsync -v is way too verbose for a normal log file

diff --git a/build_periodic.sh b/build_periodic.sh
index 0e819a4..35b499a 100755
--- a/build_periodic.sh
+++ b/build_periodic.sh
@@ -63,9 +63,9 @@ then
   # Bootstrap initial directory structure on the host
   # This will be a noop if the structure already exists
   mkdir fake
-  rsync -av fake/ "$host"
-  rsync -av fake/ "$host"/build-logs
-  rsync -av fake/ "$host"/manifests
+  rsync -a fake/ "$host"
+  rsync -a fake/ "$host"/build-logs
+  rsync -a fake/ "$host"/manifests
   rmdir fake
 fi
 
@@ -129,8 +129,9 @@ flatpak-builder $gpg_parms --repo=$fp_repo --force-clean --default-branch="$fp_b
 # Optional code to upload
 if [[ -n "$host" ]]
 then
-  rsync -av "$fp_git_dir"/org.gnucash.GnuCash.json "$host/manifests/org.gnucash.GnuCash-$fp_branch.json"
-  rsync -av $fp_repo "$host"
+  echo "Uploading flatpak manifest 'org.gnucash.GnuCash-$fp_branch.json' and synchronizing repository"
+  rsync -a "$fp_git_dir"/org.gnucash.GnuCash.json "$host/manifests/org.gnucash.GnuCash-$fp_branch.json"
+  rsync -a $fp_repo "$host"
 
   # Upload the flatpak ref file if we created one
   if [[ -n "$fp_ref_file" ]]
@@ -139,15 +140,16 @@ then
     mkdir fake
     if [[ "$is_release" = "yes" ]]
     then
-      rsync -av fake/ "$host"/releases
+      rsync -a fake/ "$host"/releases
       fp_ref_dir_remote="$host"/releases
     else
-      rsync -av fake/ "$host"/$revision
+      rsync -a fake/ "$host"/$revision
       fp_ref_dir_remote="$host"/$revision
     fi
     rmdir fake
 
-    rsync -av "$fp_ref_dir_local"/$fp_ref_file "$fp_ref_dir_remote"
+    echo "Uploading flatpakref file '$fp_ref_file'"
+    rsync -a "$fp_ref_dir_local"/$fp_ref_file "$fp_ref_dir_remote"
   fi
 fi
 
diff --git a/functions.sh b/functions.sh
index 2fa44da..062df17 100644
--- a/functions.sh
+++ b/functions.sh
@@ -27,7 +27,8 @@ function upload_build_log()
 {
   if [[ -n "$host" ]]
   then
-    rsync -av "$log_file" "$host"/build-logs
+    echo "Uploading log file '$log_file'"
+    rsync -a "$log_file" "$host"/build-logs
   fi
 }
 
@@ -81,7 +82,8 @@ function prepare_gpg()
 
     if [[ -n "$host" ]]
     then
-      rsync -av "$base_dir"/gnucash-flatpak.gpg "$host"
+      echo "Uploading GPG public key 'gnucash-flatpak.gpg'"
+      rsync -a "$base_dir"/gnucash-flatpak.gpg "$host"
     fi
     gpg_key64=$(base64 "$base_dir"/gnucash-flatpak.gpg | tr -d '\n')
   fi

commit 3ceab5f65443dc8754bb711cb6600aaab4b4dbbf
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Sep 18 14:28:17 2018 +0200

    Enable code signing and flatpakref file creation
    
    Code signing is a prerequisite to creating flatpakref files.
    The latter are the most interesting artefact of this build as
    they allow users to install a gnucash nightly with one single command:
    flatpak install --from <path-to-flatpakref-file>
    There will be such a file for each successful flatpak build
    in the respective branch directories (maint, master, releases,...)

diff --git a/README.md b/README.md
index 3cbf246..c1c7ff7 100644
--- a/README.md
+++ b/README.md
@@ -55,6 +55,7 @@ cd ..
 will build the maint branch of your gnucash and gnucash-docs repositories.
 ```
 ./src/gnucash-on-flatpak.git/build_package.sh
+```
 
 9. On successful completion you will now have a flatpak repo named "repo" in the flatpak
 base directory. You can install and run gnucash from this directory using the typical flatpak
@@ -78,16 +79,23 @@ For new combinations it will start a new build and add it in the flatpak reposit
 the user to select a specific build, each new build will be stored with a unique branch name.
 
 For release builds (that is, builds starting from a tag) the branch will be
-```/app/org.gnucash.GnuCash/<arch>/<tag>```
+```
+/app/org.gnucash.GnuCash/<arch>/<tag>
+```
 For example
-```/app/org/gnucash.GnuCash/x86_64/3.2```
-
+```
+/app/org/gnucash.GnuCash/x86_64/3.2
+```
 For non-release builds (like from 'maint') the branch name will be based on the git branch name
 and git descriptions of the respective commits. The git descriptions are obtained using the
 **git describe** command. So tne full branch name becomes
-```/app/org.gnucash.GnuCash/<arch>/<git branch>-C<code-desc>-D<docs-desc>```
+```
+/app/org.gnucash.GnuCash/<arch>/<git branch>-C<code-desc>-D<docs-desc>
+```
 For example
-```/app/org/gnucash.GnuCash/x86_64/maint-C3.2-290-ga20a803c8-D3.2-21-gc817132```
+```
+/app/org/gnucash.GnuCash/x86_64/maint-C3.2-290-ga20a803c8-D3.2-21-gc817132
+```
 
 With these long flatpak branch branch names it's possible to refer back exactly to the
 commits in the git repositories that were used to build this flatpak from. The commit
@@ -100,6 +108,65 @@ are not important. But C3.2-312 would be a more recent build than C3.2-290. So t
 numbers are used to sort builds by how recent they are (in terms of how recent the source
 is they were built from).
 
+## Repo and build signing ##
+
+If you want the repository and its builds to be signed, you can provide a gpg fingerprint
+via gpg_key in custom.sh. The build script will use this key to sign the build artefacts.
+If the gpg key is not stored in a location searched by default by the gpg tools, your can
+also pass a gpg_dir directory to tell the build script where to find the gpg key.
+
+Note: if your key is protected with a passphrase, you will be prompted for this passphrase
+during build. Keep this in mind if you intend to configure automated builds.
+
+## Synchronizing with a remote repository ##
+
+This is the primary use case for these scripts: build locally and then push the new builds to
+a remote repository so others can download and install these flatpaks.
+
+To enable this, two additional parameters should be set in custom.sh: host and host_public.
+The first (host) is how the build script can reach the remote location. This can be any
+valid rsync path spec, such as a local path or a path in the form user at host:path.
+
+The second (host_public) is where you expect guests to find the final flatpak repo. This is
+typically an http(s) url or if only for local use an absolute file:///path uri.
+
+## Flatpakref files ##
+
+If both gpg signing and remote repository are configure, the build script will automatically
+generate a gnucash-xyz.flatpakref file for each build. This file encapsulates all information
+to easily install a gnucash nightly flatpak in one single command:
+```
+flatpak install --from gnucash-xyz.flatpakref
+```
+This can only be set up if a GPG key and a public remote site are available.
+
+## Directory layout of a remote repository ##
+
+The remote repository will be structured as follows:
+```
+<remote_uri>
+<remote_uri>/build-logs/
+<remote_uri>/gnucash-flatpak.gpg
+<remote_uri>/<branch1>
+<remote_uri>/<branch2>
+...
+<remote_uri>/manifests
+<remote_uri>/releases
+<remote_uri>/repo
+```
+
+* **build-logs** will contain logs generated for each build
+* **gnucash-flatpak.gpg** is the public key of the gpg key used to sign the repository
+* **<branchx>** for each (git) branch in the gnucash and gnucash-docs a build was ever started
+a directroy <branchx> will be created. This directory will contain the flatpakref files for
+all the builds on that branch.
+* **releases** like the <branchx> directories, except this directory will contain the flatpakref
+files for all the release builds
+* **manifests** contains the flatpak manifest files used for each build
+* **repo** the flatpak repository for all the flatpak builds. This repository will be referenced
+by the various flatpakref files or can be used to manually add a flatpak remote to your local
+flatpak environment.
+
 ## Notes ##
 
 * The script will only build the packages if there are changes in the source
@@ -108,6 +175,5 @@ is they were built from).
 ## TODO ##
 - add finance::quote support
 - properly handle release builds (should be run from release tarball)
-- sign builds
 
 
diff --git a/build_periodic.sh b/build_periodic.sh
index 062dbb8..0e819a4 100755
--- a/build_periodic.sh
+++ b/build_periodic.sh
@@ -9,8 +9,11 @@ default_code_package=gnucash
 default_docs_package=gnucash-docs
 default_code_repodir="${default_base_dir}"/src/${default_code_package}.git
 default_docs_repodir="${default_base_dir}"/src/${default_docs_package}.git
-default_revision=maint
 default_fp_repo=repo
+host=
+host_public=
+gpg_key=
+gpg_dir=
 
 # Read options set via custom.sh
 if [ -f "$fp_git_dir"/custom.sh ]
@@ -29,19 +32,15 @@ fp_repo=${fp_repo=$default_fp_repo}
 
 # Preset defaults for options that can be passed via the command line
 revision=maint
-host=
 
 . "$fp_git_dir"/functions.sh
 
 # Parse command line options
-while getopts "hr:u:" o; do
+while getopts "hr:" o; do
     case "${o}" in
         r)
             revision=${OPTARG}
             ;;
-        u)
-            host=${OPTARG}
-            ;;
         h)
             usage
             ;;
@@ -74,6 +73,8 @@ fi
 echo "Starting flatpak build run for $revision"
 upload_build_log
 
+trap cleanup ERR
+
 # Check for new commits in code
 package=${code_package}
 repodir=${code_repodir}
@@ -97,47 +98,57 @@ docs_full_version=${gc_full_version}
 # is currently written this means it only happens for release builds
 if [[ "$code_full_version" == "$docs_full_version" ]]
 then
-    flatpak_branch="$code_full_version"
+    fp_branch="$code_full_version"
 else
-    flatpak_branch="$revision-C$code_full_version-D$docs_full_version"
+    fp_branch="$revision-C$code_full_version-D$docs_full_version"
 fi
 
-echo "Checking for existing build of revision $flatpak_branch"
+echo "Checking for existing build of revision $fp_branch"
 # The command below will print an error on first run as the repo doesn't exist yet
 # You can safely ignore the error message
-if flatpak repo $fp_repo --branches | grep -qP "/$flatpak_branch\t"
+if flatpak repo $fp_repo --branches | grep -qP "/$fp_branch\t"
 then
     echo "Nothing to do: build already in repo"
     upload_build_log
     exit 0
 else
-    echo "Branch $flatpak_branch not found in repo, starting build"
+    echo "Branch $fp_branch not found in repo, starting build"
 fi
 
+# Set up gpg
+prepare_gpg
 # Create the flatpak manifest
 create_manifest
+# Create the flatpakref file
+create_flatpakref
 
 # Start all necessary builds in parallel
 echo "Creating new flatpak [gnucash=$code_full_version, gnucash-docs=$docs_full_version]"
-flatpak-builder --repo=$fp_repo --force-clean --default-branch="$flatpak_branch" build "$fp_git_dir"/org.gnucash.GnuCash.json
+flatpak-builder $gpg_parms --repo=$fp_repo --force-clean --default-branch="$fp_branch" build "$fp_git_dir"/org.gnucash.GnuCash.json
 
 # Optional code to upload
 if [[ -n "$host" ]]
 then
-  mkdir fake
-  if [[ "$is_release" = "yes" ]]
+  rsync -av "$fp_git_dir"/org.gnucash.GnuCash.json "$host/manifests/org.gnucash.GnuCash-$fp_branch.json"
+  rsync -av $fp_repo "$host"
+
+  # Upload the flatpak ref file if we created one
+  if [[ -n "$fp_ref_file" ]]
   then
-    rsync -av fake/ "$host"/releases
-    fp_ref_dir="$host"/releases
-  else
-    rsync -av fake/ "$host"/$revision
-    fp_ref_dir="$host"/$revision
+    # Create required directory on the remote
+    mkdir fake
+    if [[ "$is_release" = "yes" ]]
+    then
+      rsync -av fake/ "$host"/releases
+      fp_ref_dir_remote="$host"/releases
+    else
+      rsync -av fake/ "$host"/$revision
+      fp_ref_dir_remote="$host"/$revision
+    fi
+    rmdir fake
+
+    rsync -av "$fp_ref_dir_local"/$fp_ref_file "$fp_ref_dir_remote"
   fi
-  rmdir fake
-
-  rsync -av "$fp_git_dir"/org.gnucash.GnuCash.json "$host/manifests/org.gnucash.GnuCash-$flatpak_branch.json"
-  rsync -av $fp_repo "$host"
-  # Upload the flatpak ref file  -- todo
 fi
 
 upload_build_log
diff --git a/custom.sh-sample b/custom.sh-sample
index 4c163f0..d904223 100644
--- a/custom.sh-sample
+++ b/custom.sh-sample
@@ -24,3 +24,24 @@
 # Target flatpak repository in which the builds will be stored
 # This a local repository.
 #fp_repo=repo
+
+# Parameters used for signing the repo and builds
+# The fingerprint of the key to use:
+#gpg_key=
+# The directory where keys are stored. If left empty
+# the key is searched for in the system default gpg locations
+#gpg_dir=
+
+# An optional remote location to upload the local build results to.
+# This comes in two parts:
+# - "host" is how the build server sees this remote location.
+# - "host_public" is how external guests can reach this upload location
+#
+# host can take any form understood by the rsync tool:
+# - a local path
+# - an ssh host spec in the form user at host:path
+# If unset uploading will be skipped completely
+#
+# host_public is either an http(s) url or a local file:///abs_path uri
+#host=
+#host_public=
diff --git a/functions.sh b/functions.sh
index 4abb788..2fa44da 100644
--- a/functions.sh
+++ b/functions.sh
@@ -1,3 +1,12 @@
+function cleanup()
+{
+  if [[ -n "$host" ]]
+  then
+    upload_build_log
+  fi
+  exit
+}
+
 function usage()
 {
   {
@@ -10,12 +19,6 @@ function usage()
     echo "            Note this branch or tag should exist in both the gnucash"
     echo "            and the gnucash-docs repository used for this build."
     echo "            Default: 'maint'"
-    echo
-    echo "-u remote   an optional remote location to upload the local build results to."
-    echo "            This spec can take any form understood by the rsync tool:"
-    echo "            a local path or an ssh host spec in the form user at host:port/path"
-    echo "            If unset uploading will be skipped"
-    echo "            Default: unset"
   } 1>&2
   exit 1
 }
@@ -62,6 +65,28 @@ function get_versions()
   popd
 }
 
+function prepare_gpg()
+{
+  # gpg_parms will hold optional gpg parameters passed to flatpak commands later on
+  gpg_parms=""
+  if [[ -n "$gpg_key" ]]
+  then
+    gpg_parms="--gpg-sign=$gpg_key"
+    if [[ -n "$gpg_dir" ]]
+    then
+      gpg_home="--homedir=$gpg_dir"
+      gpg_parms="--gpg-homedir=$gpg_dir $gpg_parms"
+    fi
+    gpg2 "$gpg_home" --export $gpg_key > "$base_dir"/gnucash-flatpak.gpg
+
+    if [[ -n "$host" ]]
+    then
+      rsync -av "$base_dir"/gnucash-flatpak.gpg "$host"
+    fi
+    gpg_key64=$(base64 "$base_dir"/gnucash-flatpak.gpg | tr -d '\n')
+  fi
+}
+
 function create_manifest()
 {
   echo "Writing org.gnucash.GnuCash.json manifest file"
@@ -71,3 +96,22 @@ function create_manifest()
   perl -pi -e "s!{code_branch}!$revision!" "$fp_git_dir"/org.gnucash.GnuCash.json
   perl -pi -e "s!{docs_branch}!$revision!" "$fp_git_dir"/org.gnucash.GnuCash.json
 }
+
+function create_flatpakref()
+{
+  fp_ref_file=""
+  if [[ -n "$host_public" ]] || [[ -n "$gpg_key" ]]
+  then
+    fp_ref_file=gnucash-$fp_branch.flatpakref
+    echo "Writing $fp_ref_file"
+    fp_ref_dir_local="$base_dir"/flatpakrefs
+    mkdir -p "$fp_ref_dir_local"
+    cp "$fp_git_dir"/gnucash.flatpakref.tpl "$fp_ref_dir_local"/$fp_ref_file
+    echo "Branch=$fp_branch"         >> "$fp_ref_dir_local"/$fp_ref_file
+    echo "Url=$host_public/$fp_repo" >> "$fp_ref_dir_local"/$fp_ref_file
+    echo "GPGKey=$gpg_key64" >> "$fp_ref_dir_local"/$fp_ref_file
+  else
+    echo "Mandatory variable 'host_public' or 'gpg_key' is not set."
+    echo "Skipping generation of $fp_ref_file"
+  fi
+}
diff --git a/gnucash.flatpakref.tpl b/gnucash.flatpakref.tpl
new file mode 100644
index 0000000..19e052e
--- /dev/null
+++ b/gnucash.flatpakref.tpl
@@ -0,0 +1,5 @@
+[Flatpak Ref]
+Title=GnuCash
+Name=org.gnucash.GnuCash
+IsRuntime=false
+RuntimeRepo=https://sdk.gnome.org/gnome.flatpakrepo

commit bab57f6c026dc8cebcfc4ae5d8e12697c129e0be
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Sep 18 11:31:07 2018 +0200

    Update README
    
    - complete usage instructions
    - document flatpak branch naming conventions
    - update todo list

diff --git a/README.md b/README.md
index 045a7c7..3cbf246 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,8 @@ Again: these packages are not release quality for several reasons:
    make dist(check) on the source repository.
 
 However, now that it's clearly stated the packages are meant purely for
-testing unreleased features, here's how to use these scripts.
+testing unreleased features, here's how to use these scripts. In the following recipe
+we will use "flatpak" as the **base directory** in which everything will happen.
 
 1. Create the following directory structure
 ```
@@ -42,17 +43,62 @@ git clone https://github.com/Gnucash/gnucash-docs gnucash-docs.git
 ```
 
 6. If needed copy custom.sh-sample to custom.sh and override the variables
-   found in there are desired/needed (for example if your repos are in 
-   another location than default, or using non-default names/branches).
+   found in there are desired/needed (for example if your repos are in
+   a location other than the defaults).
 
-7. Navigate into root directory
+7. Navigate back to the base directory (flatpak in our set up)
 ```
 cd ..
 ```
 
-8. Build the application using the following command and add the fresh build into a local flatpak repository
+8. Build the flatpak using the build_package.sh command. If no options are set this command
+will build the maint branch of your gnucash and gnucash-docs repositories.
 ```
-flatpak-builder --repo=repo --force-clean build src/gnucash-on-flatpak.git/org.gnucash.GnuCash.json
+./src/gnucash-on-flatpak.git/build_package.sh
+
+9. On successful completion you will now have a flatpak repo named "repo" in the flatpak
+base directory. You can install and run gnucash from this directory using the typical flatpak
+commands:
+```
+$ flatpak --user remote-add --no-gpg-verify gnc-testing-repo repo
+$ flatpak --user install gnc-testing-repo org.gnucash.GnuCash
+$ flatpak run org.gnucash.GnuCash
+```
+
+Note one has to specify --no-gpg-verify because the builds are not signed.
+
+## Flatpak branches ##
+
+The build script will try to avoid double work. For that it will check the commit hashes
+for the given revision (maint by default of not revision is passed to the build script).
+If a build already exists for the combination of the gnucash and gnucash-docs commit hashes
+no new build will be started.
+
+For new combinations it will start a new build and add it in the flatpak repository. To allow
+the user to select a specific build, each new build will be stored with a unique branch name.
+
+For release builds (that is, builds starting from a tag) the branch will be
+```/app/org.gnucash.GnuCash/<arch>/<tag>```
+For example
+```/app/org/gnucash.GnuCash/x86_64/3.2```
+
+For non-release builds (like from 'maint') the branch name will be based on the git branch name
+and git descriptions of the respective commits. The git descriptions are obtained using the
+**git describe** command. So tne full branch name becomes
+```/app/org.gnucash.GnuCash/<arch>/<git branch>-C<code-desc>-D<docs-desc>```
+For example
+```/app/org/gnucash.GnuCash/x86_64/maint-C3.2-290-ga20a803c8-D3.2-21-gc817132```
+
+With these long flatpak branch branch names it's possible to refer back exactly to the
+commits in the git repositories that were used to build this flatpak from. The commit
+hash refs are the bit after the -g. In the example above the code was built from commit
+a20a803c8 and the docs from commit c817132. The rest of the description give a relative
+indication of the freshness of each branch. "C3.2-290" means the code commit was 290 commits
+more recent than the 3.2 tag in the gnucash repository. "D3.2-21" means the docs commit was
+21 commits more recent than the 3.2 tag in the gnucash-docs repository. The exact numbers
+are not important. But C3.2-312 would be a more recent build than C3.2-290. So these
+numbers are used to sort builds by how recent they are (in terms of how recent the source
+is they were built from).
 
 ## Notes ##
 
@@ -60,9 +106,8 @@ flatpak-builder --repo=repo --force-clean build src/gnucash-on-flatpak.git/org.g
   repositories since the last build.
 
 ## TODO ##
-- complete instructions as the code evolves
-- goal is to make a wrapper around flatpak-builder that will automatically trigger
-  new builds only when any of the source repos changes
-- finance::quote support is missing still
+- add finance::quote support
+- properly handle release builds (should be run from release tarball)
+- sign builds
 
 

commit 5eb574e9dbb337cd2bfa69839917755d33c590bc
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Sep 18 10:55:07 2018 +0200

    Make rsync more verbose so its output appears in the logs

diff --git a/build_periodic.sh b/build_periodic.sh
index 5d14869..062dbb8 100755
--- a/build_periodic.sh
+++ b/build_periodic.sh
@@ -64,9 +64,9 @@ then
   # Bootstrap initial directory structure on the host
   # This will be a noop if the structure already exists
   mkdir fake
-  rsync -a fake/ "$host"
-  rsync -a fake/ "$host"/build-logs
-  rsync -a fake/ "$host"/manifests
+  rsync -av fake/ "$host"
+  rsync -av fake/ "$host"/build-logs
+  rsync -av fake/ "$host"/manifests
   rmdir fake
 fi
 
@@ -127,16 +127,16 @@ then
   mkdir fake
   if [[ "$is_release" = "yes" ]]
   then
-    rsync -a fake/ "$host"/releases
+    rsync -av fake/ "$host"/releases
     fp_ref_dir="$host"/releases
   else
-    rsync -a fake/ "$host"/$revision
+    rsync -av fake/ "$host"/$revision
     fp_ref_dir="$host"/$revision
   fi
   rmdir fake
 
-  rsync -a "$fp_git_dir"/org.gnucash.GnuCash.json "$host/manifests/org.gnucash.GnuCash-$flatpak_branch.json"
-  rsync -a $fp_repo "$host"
+  rsync -av "$fp_git_dir"/org.gnucash.GnuCash.json "$host/manifests/org.gnucash.GnuCash-$flatpak_branch.json"
+  rsync -av $fp_repo "$host"
   # Upload the flatpak ref file  -- todo
 fi
 
diff --git a/functions.sh b/functions.sh
index 1cfe635..4abb788 100644
--- a/functions.sh
+++ b/functions.sh
@@ -24,7 +24,7 @@ function upload_build_log()
 {
   if [[ -n "$host" ]]
   then
-    rsync -a "$log_file" "$host"/build-logs
+    rsync -av "$log_file" "$host"/build-logs
   fi
 }
 

commit 3d4d42c4264ea2dac04375c818765ff6e0ade6d4
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Sep 18 10:54:04 2018 +0200

    Precreate remote directory structure
    
    In addition
    - detect tag builds and consider them release builds
      this still needs future improvements as release builds should really be from tarball
    - upload final build log also when no build is initiated
      otherwise it will look like the build didn't finish

diff --git a/build_periodic.sh b/build_periodic.sh
index ad2cb0c..5d14869 100755
--- a/build_periodic.sh
+++ b/build_periodic.sh
@@ -51,18 +51,29 @@ while getopts "hr:u:" o; do
     esac
 done
 
+is_release="no"
+
 # Set up logging
 mkdir -p "$base_dir/logs"
 time_stamp=$(date +%Y-%m-%d-%H-%M-%S)
 log_file="$base_dir/logs/build-$revision-$time_stamp.log"
 exec > >(tee "$log_file") 2>&1
 
-echo "Starting flatpak build run for $revision"
 if [[ -n "$host" ]]
 then
-  rsync -a "$log_file" "$host"/build-logs
+  # Bootstrap initial directory structure on the host
+  # This will be a noop if the structure already exists
+  mkdir fake
+  rsync -a fake/ "$host"
+  rsync -a fake/ "$host"/build-logs
+  rsync -a fake/ "$host"/manifests
+  rmdir fake
 fi
 
+  # Upload inital build log so everyone knows the build has started
+echo "Starting flatpak build run for $revision"
+upload_build_log
+
 # Check for new commits in code
 package=${code_package}
 repodir=${code_repodir}
@@ -97,6 +108,7 @@ echo "Checking for existing build of revision $flatpak_branch"
 if flatpak repo $fp_repo --branches | grep -qP "/$flatpak_branch\t"
 then
     echo "Nothing to do: build already in repo"
+    upload_build_log
     exit 0
 else
     echo "Branch $flatpak_branch not found in repo, starting build"
@@ -112,6 +124,20 @@ flatpak-builder --repo=$fp_repo --force-clean --default-branch="$flatpak_branch"
 # Optional code to upload
 if [[ -n "$host" ]]
 then
-  rsync -a "$log_file" "$host"/build-logs
-  rsync -a $fp_repo "$host"/$fp_repo
+  mkdir fake
+  if [[ "$is_release" = "yes" ]]
+  then
+    rsync -a fake/ "$host"/releases
+    fp_ref_dir="$host"/releases
+  else
+    rsync -a fake/ "$host"/$revision
+    fp_ref_dir="$host"/$revision
+  fi
+  rmdir fake
+
+  rsync -a "$fp_git_dir"/org.gnucash.GnuCash.json "$host/manifests/org.gnucash.GnuCash-$flatpak_branch.json"
+  rsync -a $fp_repo "$host"
+  # Upload the flatpak ref file  -- todo
 fi
+
+upload_build_log
diff --git a/functions.sh b/functions.sh
index d0395f6..1cfe635 100644
--- a/functions.sh
+++ b/functions.sh
@@ -20,6 +20,14 @@ function usage()
   exit 1
 }
 
+function upload_build_log()
+{
+  if [[ -n "$host" ]]
+  then
+    rsync -a "$log_file" "$host"/build-logs
+  fi
+}
+
 function prepare_repo()
 {
   pushd "${repodir}"
@@ -29,6 +37,7 @@ function prepare_repo()
   if git tag | grep -q "^$revision\$"
   then
     echo "Detected a tag (release) build"
+    is_release="yes"
   else
     echo "No tag detected, assuming development build"
     git reset --hard origin/$revision

commit abc86db0bc001baa6e72b8438a63ee720b39f0b3
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Sep 18 09:59:10 2018 +0200

    Set revision and upload host as command line options of the script
    
    And add code to perform the uploads if a remote host is specified

diff --git a/build_periodic.sh b/build_periodic.sh
index c391f33..ad2cb0c 100755
--- a/build_periodic.sh
+++ b/build_periodic.sh
@@ -2,7 +2,7 @@
 set -e
 #set -x
 
-# Set up default parameters
+# Preset defaults for options that can be set via custom.sh
 fp_git_dir="$(dirname "$0")"
 default_base_dir="$(realpath -L "$fp_git_dir/../..")"
 default_code_package=gnucash
@@ -12,29 +12,56 @@ default_docs_repodir="${default_base_dir}"/src/${default_docs_package}.git
 default_revision=maint
 default_fp_repo=repo
 
-# Read user parameter settings
+# Read options set via custom.sh
 if [ -f "$fp_git_dir"/custom.sh ]
 then
   . "$fp_git_dir"/custom.sh
 fi
 
-# Apply defaults for all parameters the user didn't explicitly set
+
+# Apply defaults for all options not explicitly set in custom.sh
 base_dir=${base_dir:=$default_base_dir}
 code_package=${code_package:=$default_code_package}
 docs_package=${docs_package:=$default_docs_package}
 code_repodir="${code_repodir:=$default_code_repodir}"
 docs_repodir="${docs_repodir:=$default_docs_repodir}"
-revision=${revision:=$default_revision}
-revision=${revision:=$revision}
 fp_repo=${fp_repo=$default_fp_repo}
 
+# Preset defaults for options that can be passed via the command line
+revision=maint
+host=
+
+. "$fp_git_dir"/functions.sh
+
+# Parse command line options
+while getopts "hr:u:" o; do
+    case "${o}" in
+        r)
+            revision=${OPTARG}
+            ;;
+        u)
+            host=${OPTARG}
+            ;;
+        h)
+            usage
+            ;;
+        *)
+            usage
+            ;;
+    esac
+done
+
 # Set up logging
 mkdir -p "$base_dir/logs"
 time_stamp=$(date +%Y-%m-%d-%H-%M-%S)
 log_file="$base_dir/logs/build-$revision-$time_stamp.log"
 exec > >(tee "$log_file") 2>&1
 
-. "$fp_git_dir"/functions.sh
+echo "Starting flatpak build run for $revision"
+if [[ -n "$host" ]]
+then
+  rsync -a "$log_file" "$host"/build-logs
+fi
 
 # Check for new commits in code
 package=${code_package}
@@ -81,4 +108,10 @@ create_manifest
 # Start all necessary builds in parallel
 echo "Creating new flatpak [gnucash=$code_full_version, gnucash-docs=$docs_full_version]"
 flatpak-builder --repo=$fp_repo --force-clean --default-branch="$flatpak_branch" build "$fp_git_dir"/org.gnucash.GnuCash.json
+
 # Optional code to upload
+if [[ -n "$host" ]]
+then
+  rsync -a "$log_file" "$host"/build-logs
+  rsync -a $fp_repo "$host"/$fp_repo
+fi
diff --git a/custom.sh-sample b/custom.sh-sample
index 1c63adc..4c163f0 100644
--- a/custom.sh-sample
+++ b/custom.sh-sample
@@ -21,12 +21,6 @@
 #code_repodir=${base_dir}/src/${code_package}.git
 #docs_repodir=${base_dir}/src/${docs_package}.git
 
-# Revision to build from.
-# The build will always try to check out the same revision
-# in the gnucash and gnucash-docs repository
-# So make sure you use a branch or tag that exists in both repos
-#revision=maint
-
 # Target flatpak repository in which the builds will be stored
 # This a local repository.
 #fp_repo=repo
diff --git a/functions.sh b/functions.sh
index f2582a4..d0395f6 100644
--- a/functions.sh
+++ b/functions.sh
@@ -1,3 +1,25 @@
+function usage()
+{
+  {
+    echo "Usage: $0 [-r <revision>] [-u <remote>]"
+    echo "       $0 -h"
+    echo
+    echo "-h          display this help message"
+    echo
+    echo "-r revision git revision to build. Can be a branch or a tag."
+    echo "            Note this branch or tag should exist in both the gnucash"
+    echo "            and the gnucash-docs repository used for this build."
+    echo "            Default: 'maint'"
+    echo
+    echo "-u remote   an optional remote location to upload the local build results to."
+    echo "            This spec can take any form understood by the rsync tool:"
+    echo "            a local path or an ssh host spec in the form user at host:port/path"
+    echo "            If unset uploading will be skipped"
+    echo "            Default: unset"
+  } 1>&2
+  exit 1
+}
+
 function prepare_repo()
 {
   pushd "${repodir}"

commit 31db0c659183b41a1ec5ffc354c1bdfe3b094b53
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Mon Sep 17 15:53:32 2018 +0200

    Capture all build output to a log file

diff --git a/build_periodic.sh b/build_periodic.sh
index ff665f1..c391f33 100755
--- a/build_periodic.sh
+++ b/build_periodic.sh
@@ -28,6 +28,12 @@ revision=${revision:=$default_revision}
 revision=${revision:=$revision}
 fp_repo=${fp_repo=$default_fp_repo}
 
+# Set up logging
+mkdir -p "$base_dir/logs"
+time_stamp=$(date +%Y-%m-%d-%H-%M-%S)
+log_file="$base_dir/logs/build-$revision-$time_stamp.log"
+exec > >(tee "$log_file") 2>&1
+
 . "$fp_git_dir"/functions.sh
 
 # Check for new commits in code

commit e9b7acad2a627144d7be2e70af7f561fa95bc47a
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Mon Sep 17 15:52:04 2018 +0200

    Allow user to customize target flatpak repo

diff --git a/build_periodic.sh b/build_periodic.sh
index 462c281..ff665f1 100755
--- a/build_periodic.sh
+++ b/build_periodic.sh
@@ -10,6 +10,7 @@ default_docs_package=gnucash-docs
 default_code_repodir="${default_base_dir}"/src/${default_code_package}.git
 default_docs_repodir="${default_base_dir}"/src/${default_docs_package}.git
 default_revision=maint
+default_fp_repo=repo
 
 # Read user parameter settings
 if [ -f "$fp_git_dir"/custom.sh ]
@@ -25,6 +26,7 @@ code_repodir="${code_repodir:=$default_code_repodir}"
 docs_repodir="${docs_repodir:=$default_docs_repodir}"
 revision=${revision:=$default_revision}
 revision=${revision:=$revision}
+fp_repo=${fp_repo=$default_fp_repo}
 
 . "$fp_git_dir"/functions.sh
 
@@ -59,7 +61,7 @@ fi
 echo "Checking for existing build of revision $flatpak_branch"
 # The command below will print an error on first run as the repo doesn't exist yet
 # You can safely ignore the error message
-if flatpak repo repo --branches | grep -qP "/$flatpak_branch\t"
+if flatpak repo $fp_repo --branches | grep -qP "/$flatpak_branch\t"
 then
     echo "Nothing to do: build already in repo"
     exit 0
@@ -72,5 +74,5 @@ create_manifest
 
 # Start all necessary builds in parallel
 echo "Creating new flatpak [gnucash=$code_full_version, gnucash-docs=$docs_full_version]"
-flatpak-builder --repo=repo --force-clean --default-branch="$flatpak_branch" build "$fp_git_dir"/org.gnucash.GnuCash.json
+flatpak-builder --repo=$fp_repo --force-clean --default-branch="$flatpak_branch" build "$fp_git_dir"/org.gnucash.GnuCash.json
 # Optional code to upload
diff --git a/custom.sh-sample b/custom.sh-sample
index f8ca030..1c63adc 100644
--- a/custom.sh-sample
+++ b/custom.sh-sample
@@ -26,3 +26,7 @@
 # in the gnucash and gnucash-docs repository
 # So make sure you use a branch or tag that exists in both repos
 #revision=maint
+
+# Target flatpak repository in which the builds will be stored
+# This a local repository.
+#fp_repo=repo

commit 030c6d66c506e2bd4e0ccdb4a2877cb0d2f19fda
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Mon Sep 17 15:08:47 2018 +0200

    Use flatpak's repo to check for pre-existing builds instead of a simple text file

diff --git a/build_periodic.sh b/build_periodic.sh
index 8eb27e2..462c281 100755
--- a/build_periodic.sh
+++ b/build_periodic.sh
@@ -56,13 +56,15 @@ else
     flatpak_branch="$revision-C$code_full_version-D$docs_full_version"
 fi
 
-touch "$base_dir"/last_built_rev
-last_built_rev=$(cat "$base_dir"/last_built_rev)
-
-if [[ "$flatpak_branch" == "$last_built_rev" ]]
+echo "Checking for existing build of revision $flatpak_branch"
+# The command below will print an error on first run as the repo doesn't exist yet
+# You can safely ignore the error message
+if flatpak repo repo --branches | grep -qP "/$flatpak_branch\t"
 then
-    echo "No changes - exiting"
+    echo "Nothing to do: build already in repo"
     exit 0
+else
+    echo "Branch $flatpak_branch not found in repo, starting build"
 fi
 
 # Create the flatpak manifest
@@ -71,7 +73,4 @@ create_manifest
 # Start all necessary builds in parallel
 echo "Creating new flatpak [gnucash=$code_full_version, gnucash-docs=$docs_full_version]"
 flatpak-builder --repo=repo --force-clean --default-branch="$flatpak_branch" build "$fp_git_dir"/org.gnucash.GnuCash.json
-
-echo -n $flatpak_branch > "$base_dir"/last_built_rev
-
 # Optional code to upload

commit 4a02cef3c432df9df987a88af0e5964b225d58ea
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Mon Sep 17 14:53:09 2018 +0200

    Simplify revision specification
    
    Allow only one revision spec, which should exist in both gnucash and gnucash-doc respositories

diff --git a/build_periodic.sh b/build_periodic.sh
index 45028bd..8eb27e2 100755
--- a/build_periodic.sh
+++ b/build_periodic.sh
@@ -9,8 +9,7 @@ default_code_package=gnucash
 default_docs_package=gnucash-docs
 default_code_repodir="${default_base_dir}"/src/${default_code_package}.git
 default_docs_repodir="${default_base_dir}"/src/${default_docs_package}.git
-default_code_refspec=maint
-default_docs_refspec=${default_code_refspec}
+default_revision=maint
 
 # Read user parameter settings
 if [ -f "$fp_git_dir"/custom.sh ]
@@ -24,37 +23,43 @@ code_package=${code_package:=$default_code_package}
 docs_package=${docs_package:=$default_docs_package}
 code_repodir="${code_repodir:=$default_code_repodir}"
 docs_repodir="${docs_repodir:=$default_docs_repodir}"
-code_refspec=${code_refspec:=$default_code_refspec}
-docs_refspec=${docs_refspec:=$default_docs_refspec}
+revision=${revision:=$default_revision}
+revision=${revision:=$revision}
 
 . "$fp_git_dir"/functions.sh
 
 # Check for new commits in code
 package=${code_package}
 repodir=${code_repodir}
-refspec=${code_refspec}
 prepare_repo
 get_versions
 
 code_curr_rev=${gc_commit}
 code_full_version=${gc_full_version}
-touch "$base_dir"/code_last_rev
-code_last_rev=$(cat "$base_dir"/code_last_rev)
 
 # Check for new commits in docs
 package=${docs_package}
 repodir=${docs_repodir}
-refspec=${docs_refspec}
 prepare_repo
 get_versions
 
 docs_curr_rev=${gc_commit}
 docs_full_version=${gc_full_version}
-touch "$base_dir"/docs_last_rev
-docs_last_rev=$(cat "$base_dir"/docs_last_rev)
 
-if [[ "$code_curr_rev" == "$code_last_rev" ]] &&
-   [[ "$docs_curr_rev" == "$docs_last_rev" ]]
+# Simplify flatpak package version if code and docs are on the same full_version
+# In practice this only happens when a tag is checked out, so as the code
+# is currently written this means it only happens for release builds
+if [[ "$code_full_version" == "$docs_full_version" ]]
+then
+    flatpak_branch="$code_full_version"
+else
+    flatpak_branch="$revision-C$code_full_version-D$docs_full_version"
+fi
+
+touch "$base_dir"/last_built_rev
+last_built_rev=$(cat "$base_dir"/last_built_rev)
+
+if [[ "$flatpak_branch" == "$last_built_rev" ]]
 then
     echo "No changes - exiting"
     exit 0
@@ -65,9 +70,8 @@ create_manifest
 
 # Start all necessary builds in parallel
 echo "Creating new flatpak [gnucash=$code_full_version, gnucash-docs=$docs_full_version]"
-flatpak-builder --repo=repo --force-clean --default-branch="C$code_full_version-D$docs_full_version" build "$fp_git_dir"/org.gnucash.GnuCash.json
+flatpak-builder --repo=repo --force-clean --default-branch="$flatpak_branch" build "$fp_git_dir"/org.gnucash.GnuCash.json
 
-echo -n $code_curr_rev > "$base_dir"/code_last_rev
-echo -n $docs_curr_rev > "$base_dir"/docs_last_rev
+echo -n $flatpak_branch > "$base_dir"/last_built_rev
 
 # Optional code to upload
diff --git a/custom.sh-sample b/custom.sh-sample
index d097bff..f8ca030 100644
--- a/custom.sh-sample
+++ b/custom.sh-sample
@@ -20,5 +20,9 @@
 #docs_package=gnucash-docs
 #code_repodir=${base_dir}/src/${code_package}.git
 #docs_repodir=${base_dir}/src/${docs_package}.git
-#code_refspec=maint
-#docs_refspec=maint
+
+# Revision to build from.
+# The build will always try to check out the same revision
+# in the gnucash and gnucash-docs repository
+# So make sure you use a branch or tag that exists in both repos
+#revision=maint
diff --git a/functions.sh b/functions.sh
index 82ba097..f2582a4 100644
--- a/functions.sh
+++ b/functions.sh
@@ -3,13 +3,13 @@ function prepare_repo()
   pushd "${repodir}"
   echo "Update repository $repodir"
   git fetch
-  git checkout $refspec
-  if git tag | grep -q "^$refspec\$"
+  git checkout $revision
+  if git tag | grep -q "^$revision\$"
   then
     echo "Detected a tag (release) build"
   else
     echo "No tag detected, assuming development build"
-    git reset --hard origin/$refspec
+    git reset --hard origin/$revision
   fi
   popd
 }
@@ -37,6 +37,6 @@ function create_manifest()
   cp "$fp_git_dir"/org.gnucash.GnuCash.json.tpl "$fp_git_dir"/org.gnucash.GnuCash.json
   perl -pi -e "s!{code_repo}!$code_repodir!" "$fp_git_dir"/org.gnucash.GnuCash.json
   perl -pi -e "s!{docs_repo}!$docs_repodir!" "$fp_git_dir"/org.gnucash.GnuCash.json
-  perl -pi -e "s!{code_branch}!$code_refspec!" "$fp_git_dir"/org.gnucash.GnuCash.json
-  perl -pi -e "s!{docs_branch}!$docs_refspec!" "$fp_git_dir"/org.gnucash.GnuCash.json
+  perl -pi -e "s!{code_branch}!$revision!" "$fp_git_dir"/org.gnucash.GnuCash.json
+  perl -pi -e "s!{docs_branch}!$revision!" "$fp_git_dir"/org.gnucash.GnuCash.json
 }

commit 401d37f457355510266d134432b90b9c8f35b21b
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Mon Sep 17 13:46:22 2018 +0200

    Disable debugging

diff --git a/build_periodic.sh b/build_periodic.sh
index 81072ca..45028bd 100755
--- a/build_periodic.sh
+++ b/build_periodic.sh
@@ -1,5 +1,6 @@
 #! /bin/bash
-set -ex
+set -e
+#set -x
 
 # Set up default parameters
 fp_git_dir="$(dirname "$0")"

commit 52a2e98f3d779a929f8b071c39c828187a72dfe1
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Mon Sep 17 13:45:57 2018 +0200

    Allow users to specify tags instead of branches/commits

diff --git a/functions.sh b/functions.sh
index fa3444c..82ba097 100644
--- a/functions.sh
+++ b/functions.sh
@@ -2,9 +2,15 @@ function prepare_repo()
 {
   pushd "${repodir}"
   echo "Update repository $repodir"
-  git checkout $refspec
   git fetch
-  git reset --hard origin/$refspec
+  git checkout $refspec
+  if git tag | grep -q "^$refspec\$"
+  then
+    echo "Detected a tag (release) build"
+  else
+    echo "No tag detected, assuming development build"
+    git reset --hard origin/$refspec
+  fi
   popd
 }
 

commit 72de8322f8bccac95a564b1e136f5210706601ff
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Mon Sep 17 13:45:30 2018 +0200

    Include documentation in the flatpak

diff --git a/README.md b/README.md
index 47e7422..045a7c7 100644
--- a/README.md
+++ b/README.md
@@ -63,7 +63,6 @@ flatpak-builder --repo=repo --force-clean build src/gnucash-on-flatpak.git/org.g
 - complete instructions as the code evolves
 - goal is to make a wrapper around flatpak-builder that will automatically trigger
   new builds only when any of the source repos changes
-- documentation is not included in the build yet
-- finance::quote support is equally missing still
+- finance::quote support is missing still
 
 
diff --git a/functions.sh b/functions.sh
index 7bb092d..fa3444c 100644
--- a/functions.sh
+++ b/functions.sh
@@ -29,6 +29,8 @@ function create_manifest()
 {
   echo "Writing org.gnucash.GnuCash.json manifest file"
   cp "$fp_git_dir"/org.gnucash.GnuCash.json.tpl "$fp_git_dir"/org.gnucash.GnuCash.json
+  perl -pi -e "s!{code_repo}!$code_repodir!" "$fp_git_dir"/org.gnucash.GnuCash.json
+  perl -pi -e "s!{docs_repo}!$docs_repodir!" "$fp_git_dir"/org.gnucash.GnuCash.json
   perl -pi -e "s!{code_branch}!$code_refspec!" "$fp_git_dir"/org.gnucash.GnuCash.json
   perl -pi -e "s!{docs_branch}!$docs_refspec!" "$fp_git_dir"/org.gnucash.GnuCash.json
 }
diff --git a/org.gnucash.GnuCash.json.tpl b/org.gnucash.GnuCash.json.tpl
index e9c1ca1..e9828c6 100644
--- a/org.gnucash.GnuCash.json.tpl
+++ b/org.gnucash.GnuCash.json.tpl
@@ -385,8 +385,18 @@
       "sources": [
         {
           "type": "git",
-          "path": "/home/janssege/Development/gnucash/flatpak/src/gnucash.git",
-	  "branch": "{code_branch}"
+          "path": "{code_repo}",
+          "branch": "{code_branch}"
+        }
+      ]
+    },
+    {
+      "name": "gnucash-docs",
+      "sources": [
+        {
+          "type": "git",
+          "path": "{docs_repo}",
+          "branch": "{docs_branch}"
         }
       ]
     }

commit 70941583f5b338380551c14106477abb2722dd2a
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Mon Sep 17 13:43:29 2018 +0200

    Improve default parameter handling

diff --git a/build_periodic.sh b/build_periodic.sh
index bc262cb..81072ca 100755
--- a/build_periodic.sh
+++ b/build_periodic.sh
@@ -1,22 +1,31 @@
 #! /bin/bash
 set -ex
 
+# Set up default parameters
 fp_git_dir="$(dirname "$0")"
-base_dir="$fp_git_dir/../.."
-
-code_package=gnucash
-docs_package=gnucash-docs
-code_repodir="${base_dir}"/src/${code_package}.git
-docs_repodir="${base_dir}"/src/${docs_package}.git
-code_refspec=maint
-docs_refspec=${code_refspec}
-flatpak_repo=${code_package}-${code_refspec}
+default_base_dir="$(realpath -L "$fp_git_dir/../..")"
+default_code_package=gnucash
+default_docs_package=gnucash-docs
+default_code_repodir="${default_base_dir}"/src/${default_code_package}.git
+default_docs_repodir="${default_base_dir}"/src/${default_docs_package}.git
+default_code_refspec=maint
+default_docs_refspec=${default_code_refspec}
 
+# Read user parameter settings
 if [ -f "$fp_git_dir"/custom.sh ]
 then
   . "$fp_git_dir"/custom.sh
 fi
 
+# Apply defaults for all parameters the user didn't explicitly set
+base_dir=${base_dir:=$default_base_dir}
+code_package=${code_package:=$default_code_package}
+docs_package=${docs_package:=$default_docs_package}
+code_repodir="${code_repodir:=$default_code_repodir}"
+docs_repodir="${docs_repodir:=$default_docs_repodir}"
+code_refspec=${code_refspec:=$default_code_refspec}
+docs_refspec=${docs_refspec:=$default_docs_refspec}
+
 . "$fp_git_dir"/functions.sh
 
 # Check for new commits in code
diff --git a/custom.sh-sample b/custom.sh-sample
index 3e1cea6..d097bff 100644
--- a/custom.sh-sample
+++ b/custom.sh-sample
@@ -2,16 +2,23 @@
 # rename a copy of this file to custom.sh and uncomment
 # the variables you wish to override
 #
-# ATTENTION: if you override a variable which another variable
-#            depends on, you have to uncomment that variable as
-#            well (eg: if you change code_refspec you should also
-#            uncomment flatpak_repo). That's a limiation of how
-#            the script is written.
-#
+# By default the code expects the following directory hierarchy
+# <base_dir>
+# <base_dir>/build                       (generated by the build script)
+# <base_dir>/repo                        (generated by the build script)
+# <base_dir>/src
+# <base_dir>/src/gnucash.git             (code source repo)
+# <base_dir>/src/gnucah-docs.git         (documentation source repo)
+# <base_dir>/src/gnucash-on-flatpak.git  (flatpak packaging scripts repo)
+
+# Base directory for the flatpak generation build environment
+# The default is calculated based on the location of the build_package.sh script
+# assuming the directory structure above
+#base_dir=
+
 #code_package=gnucash
 #docs_package=gnucash-docs
-#code_repodir=../${code_package}-copr
-#docs_repodir=../${docs_package}-copr
-#code_refspec=master
-#docs_refspec=master
-#flatpak_repo=${code_package}-${code_refspec}
+#code_repodir=${base_dir}/src/${code_package}.git
+#docs_repodir=${base_dir}/src/${docs_package}.git
+#code_refspec=maint
+#docs_refspec=maint

commit 2e5f258e5d580346f14f28d5dc60e4e0153d5af1
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sun Sep 16 23:55:01 2018 +0200

    Ignore generated manifest file

diff --git a/.gitignore b/.gitignore
index 622f127..e233c2e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
 custom.sh
 code_last_rev
 docs_last_rev
+org.gnucash.GnuCash.json

commit 18b82c26701ec9ccf6a1ad636e19fd14f7253ca1
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sun Sep 16 23:54:22 2018 +0200

    Manifest file should be in same directory as patch files
    
    So for simplicity keep it in the fp-git-repo. Rename the base manifest
    to *.tpl

diff --git a/build_periodic.sh b/build_periodic.sh
index f007cdb..bc262cb 100755
--- a/build_periodic.sh
+++ b/build_periodic.sh
@@ -55,7 +55,7 @@ create_manifest
 
 # Start all necessary builds in parallel
 echo "Creating new flatpak [gnucash=$code_full_version, gnucash-docs=$docs_full_version]"
-flatpak-builder --repo=repo --force-clean --default-branch="C$code_full_version-D$docs_full_version" build "$base_dir"/org.gnucash.GnuCash.json
+flatpak-builder --repo=repo --force-clean --default-branch="C$code_full_version-D$docs_full_version" build "$fp_git_dir"/org.gnucash.GnuCash.json
 
 echo -n $code_curr_rev > "$base_dir"/code_last_rev
 echo -n $docs_curr_rev > "$base_dir"/docs_last_rev
diff --git a/functions.sh b/functions.sh
index 702f912..7bb092d 100644
--- a/functions.sh
+++ b/functions.sh
@@ -28,7 +28,7 @@ function get_versions()
 function create_manifest()
 {
   echo "Writing org.gnucash.GnuCash.json manifest file"
-  cp $fp_git_dir/org.gnucash.GnuCash.json $base_dir/org.gnucash.GnuCash.json
-  perl -pi.bak -e "s!{code_branch}!$code_refspec!" $base_dir/org.gnucash.GnuCash.json
-#  perl -pi.bak -e "s!@docs_branch@!$docs_refspec!" $base_dir/org.gnucash.GnuCash.json
+  cp "$fp_git_dir"/org.gnucash.GnuCash.json.tpl "$fp_git_dir"/org.gnucash.GnuCash.json
+  perl -pi -e "s!{code_branch}!$code_refspec!" "$fp_git_dir"/org.gnucash.GnuCash.json
+  perl -pi -e "s!{docs_branch}!$docs_refspec!" "$fp_git_dir"/org.gnucash.GnuCash.json
 }
diff --git a/org.gnucash.GnuCash.json b/org.gnucash.GnuCash.json.tpl
similarity index 100%
rename from org.gnucash.GnuCash.json
rename to org.gnucash.GnuCash.json.tpl

commit 2526e1474a50b9b50a853951dd4569d4ea6844cf
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sun Sep 16 23:45:57 2018 +0200

    First version of build_periodic.sh

diff --git a/build_periodic.sh b/build_periodic.sh
new file mode 100755
index 0000000..f007cdb
--- /dev/null
+++ b/build_periodic.sh
@@ -0,0 +1,63 @@
+#! /bin/bash
+set -ex
+
+fp_git_dir="$(dirname "$0")"
+base_dir="$fp_git_dir/../.."
+
+code_package=gnucash
+docs_package=gnucash-docs
+code_repodir="${base_dir}"/src/${code_package}.git
+docs_repodir="${base_dir}"/src/${docs_package}.git
+code_refspec=maint
+docs_refspec=${code_refspec}
+flatpak_repo=${code_package}-${code_refspec}
+
+if [ -f "$fp_git_dir"/custom.sh ]
+then
+  . "$fp_git_dir"/custom.sh
+fi
+
+. "$fp_git_dir"/functions.sh
+
+# Check for new commits in code
+package=${code_package}
+repodir=${code_repodir}
+refspec=${code_refspec}
+prepare_repo
+get_versions
+
+code_curr_rev=${gc_commit}
+code_full_version=${gc_full_version}
+touch "$base_dir"/code_last_rev
+code_last_rev=$(cat "$base_dir"/code_last_rev)
+
+# Check for new commits in docs
+package=${docs_package}
+repodir=${docs_repodir}
+refspec=${docs_refspec}
+prepare_repo
+get_versions
+
+docs_curr_rev=${gc_commit}
+docs_full_version=${gc_full_version}
+touch "$base_dir"/docs_last_rev
+docs_last_rev=$(cat "$base_dir"/docs_last_rev)
+
+if [[ "$code_curr_rev" == "$code_last_rev" ]] &&
+   [[ "$docs_curr_rev" == "$docs_last_rev" ]]
+then
+    echo "No changes - exiting"
+    exit 0
+fi
+
+# Create the flatpak manifest
+create_manifest
+
+# Start all necessary builds in parallel
+echo "Creating new flatpak [gnucash=$code_full_version, gnucash-docs=$docs_full_version]"
+flatpak-builder --repo=repo --force-clean --default-branch="C$code_full_version-D$docs_full_version" build "$base_dir"/org.gnucash.GnuCash.json
+
+echo -n $code_curr_rev > "$base_dir"/code_last_rev
+echo -n $docs_curr_rev > "$base_dir"/docs_last_rev
+
+# Optional code to upload
diff --git a/functions.sh b/functions.sh
new file mode 100644
index 0000000..702f912
--- /dev/null
+++ b/functions.sh
@@ -0,0 +1,34 @@
+function prepare_repo()
+{
+  pushd "${repodir}"
+  echo "Update repository $repodir"
+  git checkout $refspec
+  git fetch
+  git reset --hard origin/$refspec
+  popd
+}
+
+function get_versions()
+{
+  echo "Extracting version numbers for package $package"
+  pushd "${repodir}"
+  # code uses cmake, docs is still on autotools...
+  #if [ -e CMakeLists.txt ]
+  #then
+  #  gc_version=$(grep '(PACKAGE_VERSION ' CMakeLists.txt | perl -pe 's/.*([0-9]+\.[0-9]+).*\)/$1/ge')
+  #else
+  #  gc_version=$(grep AC_INIT configure.ac | perl -pe 's/.*([0-9]+\.[0-9]+).*\)/$1/ge')
+  #fi
+  gc_commit=$(git reflog | head -n1 | awk '{print $1}')
+  #gc_full_version=${gc_version}-nightly.git.${gc_commit}
+  gc_full_version=$(git describe)
+  popd
+}
+
+function create_manifest()
+{
+  echo "Writing org.gnucash.GnuCash.json manifest file"
+  cp $fp_git_dir/org.gnucash.GnuCash.json $base_dir/org.gnucash.GnuCash.json
+  perl -pi.bak -e "s!{code_branch}!$code_refspec!" $base_dir/org.gnucash.GnuCash.json
+#  perl -pi.bak -e "s!@docs_branch@!$docs_refspec!" $base_dir/org.gnucash.GnuCash.json
+}
diff --git a/org.gnucash.GnuCash.json b/org.gnucash.GnuCash.json
index 8cb7ed5..e9c1ca1 100644
--- a/org.gnucash.GnuCash.json
+++ b/org.gnucash.GnuCash.json
@@ -386,7 +386,7 @@
         {
           "type": "git",
           "path": "/home/janssege/Development/gnucash/flatpak/src/gnucash.git",
-	  "branch": "maint"
+	  "branch": "{code_branch}"
         }
       ]
     }

commit 21560cde893fea940a98a8285346284c5bcfdd10
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sun Sep 16 23:45:38 2018 +0200

    Rewrite README

diff --git a/README.md b/README.md
index 2d24c77..47e7422 100644
--- a/README.md
+++ b/README.md
@@ -16,44 +16,54 @@ However, now that it's clearly stated the packages are meant purely for
 testing unreleased features, here's how to use these scripts.
 
 1. Create the following directory structure
-
+```
 flatpak
 flatpak/src
-flatpak/build
+```
 
 2. Navigate into flatpak/src
-
+```
 cd flatpak/src
+```
 
-3. Clone this repo:  
-   git clone https://github.com/Gnucash/gnucash-on-flatpak gnucash-on-flatpak.git
+3. Clone this repo:
+```
+git clone https://github.com/Gnucash/gnucash-on-flatpak gnucash-on-flatpak.git
+```
 
-4. Clone the gnucash repo  
-   git clone https://github.com/Gnucash/gnucash gnucash.git
+4. Clone the gnucash repo
+```
+git clone https://github.com/Gnucash/gnucash gnucash.git
+```
 
-5. Clone the gnucash-docs repo  
-   git clone https://github.com/Gnucash/gnucash-docs gnucash-docs.git
+5. Clone the gnucash-docs repo
+```
+git clone https://github.com/Gnucash/gnucash-docs gnucash-docs.git
+```
 
 6. If needed copy custom.sh-sample to custom.sh and override the variables
    found in there are desired/needed (for example if your repos are in 
    another location than default, or using non-default names/branches).
 
-7. Navigate into flatpak build
+7. Navigate into root directory
+```
+cd ..
+```
 
-cd ../build
+8. Build the application using the following command and add the fresh build into a local flatpak repository
+```
+flatpak-builder --repo=repo --force-clean build src/gnucash-on-flatpak.git/org.gnucash.GnuCash.json
 
-8. Run the following command
+## Notes ##
 
-flatpak-builder flatpak ../src/gnucash-on-flatpak.git/org.gnucash.GnuCash.json
+* The script will only build the packages if there are changes in the source
+  repositories since the last build.
 
-TODO
+## TODO ##
 - complete instructions as the code evolves
 - goal is to make a wrapper around flatpak-builder that will automatically trigger
   new builds only when any of the source repos changes
 - documentation is not included in the build yet
 - finance::quote support is equally missing still
 
-## Notes ##
 
-* The script will only build the packages if there are changes in the source
-  repositories since the last build.

commit 1cf5449f5ce498901cb9d5e5eedfdef194b2a002
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sun Sep 16 21:45:23 2018 +0200

    Add swig to build dependencies
    
    It will be removed after the build is complete so it won't be in the final flatpak.

diff --git a/org.gnucash.GnuCash.json b/org.gnucash.GnuCash.json
index 290207b..8cb7ed5 100644
--- a/org.gnucash.GnuCash.json
+++ b/org.gnucash.GnuCash.json
@@ -338,6 +338,37 @@
         }
       ]
     },
+    {
+        "name": "pcre",
+        "config-opts": [
+            "--enable-unicode-properties"
+        ],
+        "cleanup": ["*"],
+        "sources": [
+        {
+            "type": "archive",
+            "url": "http://prdownloads.sourceforge.net/pcre/pcre-8.42.tar.bz2",
+            "sha1": "df0d1c2ff04c359220cb902539a6e134af4497f4"
+        }
+        ]
+    },
+    {
+      "name": "swig",
+      "config-opts": [
+            "-with-boost-libs=/app/lib",
+            "--without-alllang",
+            "--with-guile=/app/bin/guile",
+            "--with-guile-config=/app/bin/guile-config"
+      ],
+      "cleanup": ["*"],
+      "sources": [
+        {
+          "type": "archive",
+          "url": "http://prdownloads.sourceforge.net/swig/swig-3.0.12.tar.gz",
+          "sha1": "5cc1af41d041e4cc609580b99bb3dcf720effa25"
+        }
+      ]
+    },
     {
       "name": "gnucash",
       "buildsystem": "cmake-ninja",

commit 973a93f919d6c9d476166601ee384488730491e8
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sun Sep 16 20:45:56 2018 +0200

    Add initial sources
    
    org.gnucash.GnuCash.json and gengetopt-makefile.patch were copied from the flathub source tree

diff --git a/README.md b/README.md
new file mode 100644
index 0000000..2d24c77
--- /dev/null
+++ b/README.md
@@ -0,0 +1,59 @@
+# Build environment to build a flatpak version of GnuCash #
+
+This repository contains code to allow building a flatpak version of GnuCash.
+
+Again: these packages are not release quality for several reasons:
+
+1. They will contain features that have not been released yet and that
+   may or may not have been thoroughly tested, or may not even be complete
+   just yet.
+
+2. The script that builds these packages does not use the same source tar ball
+   as the releases do. Releases start from a tar ball generated by running
+   make dist(check) on the source repository.
+
+However, now that it's clearly stated the packages are meant purely for
+testing unreleased features, here's how to use these scripts.
+
+1. Create the following directory structure
+
+flatpak
+flatpak/src
+flatpak/build
+
+2. Navigate into flatpak/src
+
+cd flatpak/src
+
+3. Clone this repo:  
+   git clone https://github.com/Gnucash/gnucash-on-flatpak gnucash-on-flatpak.git
+
+4. Clone the gnucash repo  
+   git clone https://github.com/Gnucash/gnucash gnucash.git
+
+5. Clone the gnucash-docs repo  
+   git clone https://github.com/Gnucash/gnucash-docs gnucash-docs.git
+
+6. If needed copy custom.sh-sample to custom.sh and override the variables
+   found in there are desired/needed (for example if your repos are in 
+   another location than default, or using non-default names/branches).
+
+7. Navigate into flatpak build
+
+cd ../build
+
+8. Run the following command
+
+flatpak-builder flatpak ../src/gnucash-on-flatpak.git/org.gnucash.GnuCash.json
+
+TODO
+- complete instructions as the code evolves
+- goal is to make a wrapper around flatpak-builder that will automatically trigger
+  new builds only when any of the source repos changes
+- documentation is not included in the build yet
+- finance::quote support is equally missing still
+
+## Notes ##
+
+* The script will only build the packages if there are changes in the source
+  repositories since the last build.
diff --git a/custom.sh-sample b/custom.sh-sample
new file mode 100644
index 0000000..3e1cea6
--- /dev/null
+++ b/custom.sh-sample
@@ -0,0 +1,17 @@
+# If you want to override any of the variables below,
+# rename a copy of this file to custom.sh and uncomment
+# the variables you wish to override
+#
+# ATTENTION: if you override a variable which another variable
+#            depends on, you have to uncomment that variable as
+#            well (eg: if you change code_refspec you should also
+#            uncomment flatpak_repo). That's a limiation of how
+#            the script is written.
+#
+#code_package=gnucash
+#docs_package=gnucash-docs
+#code_repodir=../${code_package}-copr
+#docs_repodir=../${docs_package}-copr
+#code_refspec=master
+#docs_refspec=master
+#flatpak_repo=${code_package}-${code_refspec}
diff --git a/gengetopt-makefile.patch b/gengetopt-makefile.patch
new file mode 100644
index 0000000..6a60334
--- /dev/null
+++ b/gengetopt-makefile.patch
@@ -0,0 +1,12 @@
+diff -ruN gengetopt-2.22.6/src/Makefile.am gengetopt-2.22.6-new/src/Makefile.am
+--- gengetopt-2.22.6/src/Makefile.am	2012-11-02 13:26:54.000000000 +0000
++++ gengetopt-2.22.6-new/src/Makefile.am	2017-10-01 21:28:19.072113358 +0100
+@@ -51,7 +51,7 @@
+ 	@LTLIBOBJS@ \
+ 	skels/libgen.la
+ 
+-LDADD = $(top_builddir)/src/libgengetopt.la
++LDADD = libgengetopt.la
+ 
+ EXTRA_DIST = parser.h argsdef.h gengetopt.h ggos.h gm.h gnugetopt.h \
+ cmdline.c cmdline.h \
diff --git a/org.gnucash.GnuCash.json b/org.gnucash.GnuCash.json
new file mode 100644
index 0000000..290207b
--- /dev/null
+++ b/org.gnucash.GnuCash.json
@@ -0,0 +1,363 @@
+{
+  "app-id": "org.gnucash.GnuCash",
+  "runtime": "org.gnome.Platform",
+  "runtime-version": "3.28",
+  "sdk": "org.gnome.Sdk",
+  "command": "gnucash",
+  "copy-icon": true,
+  "rename-icon": "gnucash-icon",
+  "rename-desktop-file": "gnucash.desktop",
+  "rename-appdata-file": "gnucash.appdata.xml",
+  "finish-args": [
+    "--socket=x11", "--share=ipc",
+    "--share=network",
+    "--filesystem=home",
+    "--filesystem=xdg-run/dconf", "--filesystem=~/.config/dconf:ro",
+    "--talk-name=ca.desrt.dconf", "--env=DCONF_USER_CONFIG_DIR=.config/dconf"
+  ],
+  "cleanup": [
+    "*.a",
+    "*.la",
+    "/include",
+    "/lib/pkgconfig"
+  ],
+  "modules": [
+    {
+      "name": "gc",
+      "cleanup": [
+        "/share"
+      ],
+      "sources": [
+        {
+          "type": "archive",
+          "url": "http://www.hboehm.info/gc/gc_source/gc-7.6.4.tar.gz",
+          "sha256": "b94c1f2535f98354811ee644dccab6e84a0cf73e477ca03fb5a3758fb1fecd1c"
+        }
+      ]
+    },
+    {
+      "name": "libunistring",
+      "cleanup": [
+        "/share"
+      ],
+      "sources": [
+        {
+          "type": "archive",
+          "url": "https://ftp.gnu.org/gnu/libunistring/libunistring-0.9.10.tar.xz",
+          "sha256": "eb8fb2c3e4b6e2d336608377050892b54c3c983b646c561836550863003c05d7"
+        }
+      ]
+    },
+    {
+      "name": "guile",
+      "sources": [
+        {
+          "type": "archive",
+          "url": "https://ftp.gnu.org/gnu/guile/guile-2.2.3.tar.xz",
+          "sha256": "8353a8849cd7aa77be66af04bd6bf7a6207440d2f8722e46672232bb9f0a4086"
+        }
+      ]
+    },
+    {
+      "name": "opensp",
+      "rm-configure": true,
+      "config-opts": [ "--disable-doc-build" ],
+      "sources": [
+          {
+              "type": "archive",
+              "url": "https://downloads.sourceforge.net/project/openjade/opensp/1.5.2/OpenSP-1.5.2.tar.gz",
+              "sha256": "57f4898498a368918b0d49c826aa434bb5b703d2c3b169beb348016ab25617ce"
+          },
+          {
+              "type": "script",
+              "dest-filename": "autogen.sh",
+              "commands": [
+                  "autoreconf -vfi"
+              ]
+          }
+      ]
+    },
+    {
+      "name": "gengetopt",
+      "config-opts": [
+          "--prefix=/app"
+          ],
+      "rm-configure": true,
+      "sources": [
+          {
+              "type": "archive",
+              "url": "https://ftp.gnu.org/gnu/gengetopt/gengetopt-2.22.6.tar.gz",
+              "sha256": "30b05a88604d71ef2a42a2ef26cd26df242b41f5b011ad03083143a31d9b01f7"
+          },
+          {
+              "type": "patch",
+              "path": "gengetopt-makefile.patch"
+          },
+          {
+              "type": "script",
+              "dest-filename": "autogen.sh",
+              "commands": [
+                  "autoreconf -vfi"
+              ]
+          }
+      ]
+    },
+    {
+      "name": "libofx",
+      "no-parallel-make": true,
+      "config-opts": [
+          "--with-opensp-includes=/app/include/OpenSP",
+          "--with-opensp-libs=/lib"
+          ],
+      "sources": [
+          {
+              "type": "archive",
+              "url": "https://github.com/libofx/libofx/archive/0.9.12.tar.gz",
+              "sha256": "0288d0166b3e60e8ebbdcf4ac54b034082820d856a09912b748f2aec9b247130"
+          }
+      ]
+    },
+    {
+      "name": "jemalloc",
+      "cleanup": [
+        "/bin/",
+        "/share"
+      ],
+      "sources": [
+        {
+          "type": "archive",
+          "url": "https://github.com/jemalloc/jemalloc/releases/download/5.0.1/jemalloc-5.0.1.tar.bz2",
+          "sha256": "4814781d395b0ef093b21a08e8e6e0bd3dab8762f9935bbfb71679b0dea7c3e9"
+        }
+      ]
+    },
+    {
+      "name": "libaio",
+      "buildsystem": "simple",
+      "build-commands": [
+        "make",
+        "make prefix=/app install"
+      ],
+      "sources": [
+        {
+          "type": "archive",
+          "url": "http://ftp.de.debian.org/debian/pool/main/liba/libaio/libaio_0.3.110.orig.tar.gz",
+          "sha256": "e019028e631725729376250e32b473012f7cb68e1f7275bfc1bbcdd0f8745f7e"
+        }
+      ]
+    },
+    {
+      "name": "mariadb",
+      "buildsystem": "cmake",
+      "no-make-install": true,
+      "config-opts": [
+        "-DBUILD_CONFIG=mysql_release",
+        "-DWITH_INNOBASE_STORAGE_ENGINE=1",
+        "-DWITHOUT_ARCHIVE_STORAGE_ENGINE=1",
+        "-DWITHOUT_BLACKHOLE_STORAGE_ENGINE=1",
+        "-DWITHOUT_PARTITION_STORAGE_ENGINE=1",
+        "-DWITHOUT_TOKUDB=1",
+        "-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1",
+        "-DWITHOUT_FEDERATED_STORAGE_ENGINE=1",
+        "-DWITHOUT_PBXT_STORAGE_ENGINE=1"
+      ],
+      "post-install": [
+        "make -C libmysql install",
+        "make -C include install",
+        "install -Dm755 scripts/mysql_config /app/bin/mysql_config",
+        "install -Dm644 support-files/mariadb.pc /app/share/pkgconfig/mariadb.pc"
+      ],
+      "cleanup": [
+        "/bin/"
+      ],
+      "sources": [
+        {
+          "type": "archive",
+          "url": "http://ftp.hosteurope.de/mirror/archive.mariadb.org/mariadb-10.1.32/source/mariadb-10.1.32.tar.gz",
+          "sha256": "0e2aae6a6a190d07c8e36e87dd43377057fa82651ca3c583462563f3e9369096"
+        }
+      ]
+    },
+    {
+      "name": "postgresql",
+      "no-make-install": true,
+      "post-install": [
+        "make -C src/include install",
+        "make -C src/interfaces install",
+        "make -C src/bin/pg_config install"
+      ],
+      "cleanup": [
+        "/bin",
+        "/share"
+      ],
+      "sources": [
+        {
+          "type": "archive",
+          "url": "https://ftp.postgresql.org/pub/source/v9.6.8/postgresql-9.6.8.tar.bz2",
+          "sha256": "eafdb3b912e9ec34bdd28b651d00226a6253ba65036cb9a41cad2d9e82e3eb70"
+        }
+      ]
+    },
+    {
+      "name": "libdbi",
+      "rm-configure": true,
+      "cleanup": [
+        "/share"
+      ],
+      "sources": [
+        {
+          "type": "archive",
+          "url": "http://downloads.sourceforge.net/project/libdbi/libdbi/libdbi-0.9.0/libdbi-0.9.0.tar.gz",
+          "sha256": "dafb6cdca524c628df832b6dd0bf8fabceb103248edb21762c02d3068fca4503"
+        },
+        {
+          "type": "shell",
+          "commands": [
+            "rm -f config.guess"
+          ]
+        }
+      ]
+    },
+    {
+      "name": "libdbi-drivers",
+      "rm-configure": true,
+      "config-opts": [
+        "--disable-docs",
+        "--with-dbi-libdir=/app/lib/",
+        "--with-dbi-incdir=/app/include/",
+        "--with-mysql",
+        "--with-pgsql",
+        "--with-sqlite3"
+      ],
+      "cleanup": [
+        "/share",
+        "/var"
+      ],
+      "sources": [
+        {
+          "type": "archive",
+          "url": "http://downloads.sourceforge.net/project/libdbi-drivers/libdbi-drivers/libdbi-drivers-0.9.0/libdbi-drivers-0.9.0.tar.gz",
+          "sha256": "43d2eacd573a4faff296fa925dd97fbf2aedbf1ae35c6263478210c61004c854"
+        },
+        {
+          "type": "shell",
+          "commands": [
+            "rm -f config.guess"
+          ]
+        }
+      ]
+    },
+    {
+      "name": "xmlsec",
+      "sources": [
+        {
+          "type": "archive",
+          "url": "https://www.aleksey.com/xmlsec/download/xmlsec1-1.2.26.tar.gz",
+          "sha256": "8d8276c9c720ca42a3b0023df8b7ae41a2d6c5f9aa8d20ed1672d84cc8982d50"
+        }
+      ]
+    },
+    {
+      "name": "ktoblzcheck",
+      "sources": [
+        {
+          "type": "archive",
+          "url": "http://downloads.sourceforge.net/project/ktoblzcheck/ktoblzcheck-1.49.tar.gz",
+          "sha256": "e8971bc6689ea72b174c194bd43ba2c0b65112b0c3f9fd2371562e0c3ab57d29"
+        }
+      ]
+    },
+    {
+      "name": "gwenhywfar",
+      "config-opts": [
+        "--with-guis=''"
+      ],
+      "sources": [
+        {
+          "type": "script",
+          "dest-filename": "libgcrypt-config",
+          "commands": [
+            "case $1 in",
+            "--version) pkg-config --modversion libgcrypt ;;",
+            "--libs) echo $(pkg-config --libs libgcrypt) -lgpg-error ;;",
+            "*) pkg-config $* libgcrypt",
+            "esac"
+          ]
+        },
+        {
+          "type": "shell",
+          "commands": [
+            "install -Dm755 libgcrypt-config /app/bin/libgcrypt-config"
+          ]
+        },
+        {
+          "type": "archive",
+          "url": "https://www.aquamaniac.de/sites/download/download.php?package=01&release=208&file=02&dummy=gwenhywfar-4.20.0.tar.gz",
+          "dest-filename": "gwenhywfar.tar.gz",
+          "sha256": "5a88daabba1388f9528590aab5de527a12dd44a7da4572ce48469a29911b0fb0"
+        }
+      ]
+    },
+    {
+      "name": "aqbanking",
+      "no-parallel-make": true,
+      "sources": [
+        {
+          "type": "archive",
+          "url": "https://www.aquamaniac.de/sites/download/download.php?package=03&release=217&file=02&dummy=aqbanking-5.7.8.tar.gz",
+          "dest-filename": "aqbanking.tar.gz",
+          "sha256": "16f86e4cc49a9eaaa8dfe3206607e627873208bce45a70030c3caea9b5afc768"
+        }
+      ]
+    },
+    {
+      "name": "boost",
+      "buildsystem": "simple",
+      "sources": [
+          {
+              "type": "archive",
+              "url": "https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.bz2",
+              "sha256": "5721818253e6a0989583192f96782c4a98eb6204965316df9f5ad75819225ca9"
+          }
+      ],
+      "build-commands": [
+          "./bootstrap.sh --prefix=/app --with-libraries=locale,filesystem,system,date_time,regex",
+          "./b2 headers",
+          "./b2 -j$FLATPAK_BUILDER_N_JOBS install variant=release --layout=system"
+        ]
+    },
+    {
+      "name": "googletest",
+      "buildsystem": "cmake-ninja",
+      "cleanup": ["*"],
+      "sources": [
+        {
+          "type": "archive",
+          "url": "https://github.com/google/googletest/archive/release-1.8.0.tar.gz",
+          "sha256": "58a6f4277ca2bc8565222b3bbd58a177609e9c488e8a72649359ba51450db7d8"
+        }
+      ]
+    },
+    {
+      "name": "gnucash",
+      "buildsystem": "cmake-ninja",
+      "config-opts": [
+           "-DBOOST_ROOT=/app"
+      ],
+      "cleanup": [
+        "/share/info",
+        "/share/doc"
+      ],
+      "post-install": [
+        "sed -i 's/org.gnucash.Gnucash/org.gnucash.GnuCash/g' /app/share/appdata/*.xml"
+      ],
+      "sources": [
+        {
+          "type": "git",
+          "path": "/home/janssege/Development/gnucash/flatpak/src/gnucash.git",
+	  "branch": "maint"
+        }
+      ]
+    }
+  ]
+}

commit 3362133b5fac2fb38854c07cc660dc5edade3638
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat Sep 15 18:00:21 2018 +0200

    Ignore locally generated files

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..622f127
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+custom.sh
+code_last_rev
+docs_last_rev





More information about the gnucash-changes mailing list