Repository: beeware/briefcase

Issue:
Reccent Flatpak builder versions cannot be interpreted
### Describe the bug

Fedora 38:
```
[root@9560ae46967b helloworld]# flatpak-builder --version
flatpak-builder-1.3.3
```

Ubuntu 22.04:
```
❯ flatpak-builder --version
flatpak-builder 1.2.2
```
Error message:
```
*************************************************************************
** WARNING: Unable to determine the version of flatpak-builder         **
*************************************************************************

    Briefcase will proceed, assuming everything is OK. If you
    experience problems, this is almost certainly the cause of those
    problems.

    Please report this as a bug at:

      https://github.com/beeware/briefcase/issues/new

    In your report, please including the output from running:

      flatpak-builder --version

    from the command prompt.

*************************************************************************
```

### Steps to reproduce

Run `briefcase build linux flatpak` on Fedora 38

### Expected behavior

Recent Flatpak builder versions are accepted.

### Screenshots

_No response_

### Environment

- Operating System: fedora 38
- Python version: 3.10
- Software versions:
  - Briefcase: 0.3.16


### Logs

_No response_

### Additional context

_No response_

Comments:

Patch:
diff --git a/changes/1513.bugfix.rst b/changes/1513.bugfix.rst
new file mode 100644
index 00000000..ecd8498e
--- /dev/null
+++ b/changes/1513.bugfix.rst
@@ -0,0 +1,1 @@
+``flatpak-builder`` 1.3+ can now be correctly identified.
diff --git a/src/briefcase/integrations/flatpak.py b/src/briefcase/integrations/flatpak.py
index f1c70640..c7ba438e 100644
--- a/src/briefcase/integrations/flatpak.py
+++ b/src/briefcase/integrations/flatpak.py
@@ -85,7 +85,10 @@ You must install both flatpak and flatpak-builder.
                 ["flatpak-builder", "--version"]
             ).strip("\n")
 
-            parts = output.split(" ")
+            # flatpak-builder 1.3 changed the output of --version
+            # from "flatpak-builder 1.2.X" to "flatpak-build-1.3.X".
+            # Converge on the new-style format.
+            parts = output.replace(" ", "-").rsplit("-", 1)
             try:
                 if parts[0] == "flatpak-builder":
                     version = parts[1].split(".")
diff --git a/src/briefcase/platforms/linux/system.py b/src/briefcase/platforms/linux/system.py
index b431379c..12792e86 100644
--- a/src/briefcase/platforms/linux/system.py
+++ b/src/briefcase/platforms/linux/system.py
@@ -927,7 +927,7 @@ class LinuxSystemPackageCommand(LinuxSystemMixin, PackageCommand):
                             f"Package: {app.app_name}",
                             f"Version: {app.version}",
                             f"Architecture: {self.deb_abi(app)}",
-                            f"Maintainer: {app.author } <{app.author_email}>",
+                            f"Maintainer: {app.author} <{app.author_email}>",
                             f"Homepage: {app.url}",
                             f"Description: {app.description}",
                             f" {debian_multiline_description(app.long_description)}",


Test patch:
diff --git a/tests/integrations/flatpak/test_Flatpak__verify.py b/tests/integrations/flatpak/test_Flatpak__verify.py
index 4f60bea7..888dfffd 100644
--- a/tests/integrations/flatpak/test_Flatpak__verify.py
+++ b/tests/integrations/flatpak/test_Flatpak__verify.py
@@ -157,11 +157,20 @@ def test_flatpak_builder_old(mock_tools):
     )
 
 
-def test_installed(mock_tools):
+@pytest.mark.parametrize(
+    "flatpak_builder_version",
+    [
+        # Ubuntu 22.04; flatpak-builder < 1.3
+        "flatpak-builder 1.2.2",
+        # Fedora 38; flatpak-builder >= 1.3
+        "flatpak-builder-1.3.3",
+    ],
+)
+def test_installed(mock_tools, flatpak_builder_version, capsys):
     """If flatpak is installed, it can be verified."""
     mock_tools.subprocess.check_output.side_effect = [
         "Flatpak 1.12.7",
-        "flatpak-builder 1.2.2",
+        flatpak_builder_version,
     ]
 
     Flatpak.verify(mock_tools)
@@ -174,6 +183,14 @@ def test_installed(mock_tools):
         any_order=False,
     )
 
+    # We shouldn't get any warnings about unknown versions.
+    output = capsys.readouterr()
+    assert (
+        "** WARNING: Unable to determine the version of flatpak-builder"
+        not in output.out
+    )
+    assert output.err == ""
+
 
 @pytest.mark.parametrize(
     "flatpak_version",