diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e266eb9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/flatpak-builder-0.9.9.tar.xz diff --git a/0001-Add-back-accidentally-lost-flatpak_get_kernel_arch.patch b/0001-Add-back-accidentally-lost-flatpak_get_kernel_arch.patch new file mode 100644 index 0000000..dfcc21e --- /dev/null +++ b/0001-Add-back-accidentally-lost-flatpak_get_kernel_arch.patch @@ -0,0 +1,70 @@ +From d69db55cae7206b032c6a787ca41603e0c8358ac Mon Sep 17 00:00:00 2001 +From: Kalev Lember +Date: Mon, 4 Sep 2017 12:18:22 +0200 +Subject: [PATCH] Add back accidentally lost flatpak_get_kernel_arch + +This fixes the build on ppc64le and various other arches. + +diff --git a/src/builder-flatpak-utils.c b/src/builder-flatpak-utils.c +index da09eb8..ee4bd18 100644 +--- a/src/builder-flatpak-utils.c ++++ b/src/builder-flatpak-utils.c +@@ -201,6 +201,55 @@ flatpak_path_match_prefix (const char *pattern, + return NULL; /* Should not be reached */ + } + ++static const char * ++flatpak_get_kernel_arch (void) ++{ ++ static struct utsname buf; ++ static char *arch = NULL; ++ char *m; ++ ++ if (arch != NULL) ++ return arch; ++ ++ if (uname (&buf)) ++ { ++ arch = "unknown"; ++ return arch; ++ } ++ ++ /* By default, just pass on machine, good enough for most arches */ ++ arch = buf.machine; ++ ++ /* Override for some arches */ ++ ++ m = buf.machine; ++ /* i?86 */ ++ if (strlen (m) == 4 && m[0] == 'i' && m[2] == '8' && m[3] == '6') ++ { ++ arch = "i386"; ++ } ++ else if (g_str_has_prefix (m, "arm")) ++ { ++ if (g_str_has_suffix (m, "b")) ++ arch = "armeb"; ++ else ++ arch = "arm"; ++ } ++ else if (strcmp (m, "mips") == 0) ++ { ++#if G_BYTE_ORDER == G_LITTLE_ENDIAN ++ arch = "mipsel"; ++#endif ++ } ++ else if (strcmp (m, "mips64") == 0) ++ { ++#if G_BYTE_ORDER == G_LITTLE_ENDIAN ++ arch = "mips64el"; ++#endif ++ } ++ ++ return arch; ++} + + /* This maps the kernel-reported uname to a single string representing + * the cpu family, in the sense that all members of this family would +-- +2.13.0 + diff --git a/README.md b/README.md deleted file mode 100644 index 1e12873..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# flatpak-builder - -The flatpak-builder package \ No newline at end of file diff --git a/flatpak-builder.spec b/flatpak-builder.spec new file mode 100644 index 0000000..5060d80 --- /dev/null +++ b/flatpak-builder.spec @@ -0,0 +1,76 @@ +%global glib2_version 2.44 +%global ostree_version 2017.10 +%global flatpak_version 0.9.9 + +Name: flatpak-builder +Version: 0.9.9 +Release: 1%{?dist} +Summary: Tool to build flatpaks from source + +License: LGPLv2+ +URL: http://flatpak.org/ +Source0: https://github.com/flatpak/flatpak-builder/releases/download/%{version}/%{name}-%{version}.tar.xz + +# Fix the build on ppc64le +Patch0: 0001-Add-back-accidentally-lost-flatpak_get_kernel_arch.patch + +BuildRequires: gettext +BuildRequires: docbook-dtds +BuildRequires: docbook-style-xsl +BuildRequires: flatpak >= %{flatpak_version} +BuildRequires: libcap-devel +BuildRequires: libdwarf-devel +BuildRequires: pkgconfig(glib-2.0) >= %{glib2_version} +BuildRequires: pkgconfig(gobject-introspection-1.0) +BuildRequires: pkgconfig(json-glib-1.0) +BuildRequires: pkgconfig(libelf) +BuildRequires: pkgconfig(libsoup-2.4) +BuildRequires: pkgconfig(ostree-1) >= %{ostree_version} +BuildRequires: /usr/bin/xmlto +BuildRequires: /usr/bin/xsltproc + +Requires: flatpak%{?_isa} >= %{flatpak_version} +Requires: glib2%{?_isa} >= %{glib2_version} +Requires: ostree-libs%{?_isa} >= %{ostree_version} +Requires: /usr/bin/bzip2 +Requires: /usr/bin/bzr +Requires: /usr/bin/eu-strip +Requires: /usr/bin/git +Requires: /usr/bin/patch +Requires: /usr/bin/strip +Requires: /usr/bin/tar +Requires: /usr/bin/unzip + +%description +Flatpak-builder is a tool for building flatpaks from sources. + +See http://flatpak.org/ for more information. + + +%prep +%autosetup -p1 + + +%build +%configure \ + --enable-docbook-docs \ + --with-dwarf-header=%{_includedir}/libdwarf + +%make_build V=1 + + +%install +%make_install + + +%files +%license COPYING +%doc %{_pkgdocdir} +%{_bindir}/flatpak-builder +%{_mandir}/man1/flatpak-builder.1* +%{_mandir}/man5/flatpak-manifest.5* + + +%changelog +* Mon Sep 04 2017 Kalev Lember - 0.9.9-1 +- Initial flatpak-builder package diff --git a/sources b/sources new file mode 100644 index 0000000..f8bbd9a --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (flatpak-builder-0.9.9.tar.xz) = 5260b241f2d919cb11111c66fa07c29a1c90d2307b64fd8ae2ba763cc5c9debddb4d58eef51e3b85f1d692bb27821d1763b31cc4b186bcfbe3573ac93cefc011