flatpak/build.sh | 81 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 50 insertions(+), 31 deletions(-)
New commits: commit fbb4c45db34a5995dd41bd5cd24938626d37c726 Author: Stephan Bergmann <[email protected]> Date: Wed May 25 17:41:23 2016 +0200 flatpak/build.sh: signing diff --git a/flatpak/build.sh b/flatpak/build.sh index fc8a568..c8fb676 100755 --- a/flatpak/build.sh +++ b/flatpak/build.sh @@ -7,9 +7,12 @@ # This shell script creates a LibreOffice.flatpak bundle from a given git # branch/tag. # -# It expects two command line arguments, an absolute pathname for a directory -# where the script does all its work, followed by the requested git branch/tag -# (i.e., the --branch argument to "git clone"). +# It expects four command line arguments, in the following order: +# * An absolute pathname for a directory where the script does all its work. +# * The requested git branch/tag (i.e., the --branch argument to "git clone"). +# * The absolute pathname of the GPG home directory (i.e., the --homedir= +# argument to gpg) +# * The GPG key ID for signing. # # The script expects an installation of flatpak and availability of the # org.gnome.Platform 3.20 runtime (and SDK) from <http://sdk.gnome.org/repo/>. @@ -24,8 +27,6 @@ # * Fix the --repo-url=http://libreoffice.org/TODO URL in the build-bundle # step. # -# * GPG signing. -# # * Explicitly specify the --arch to build? @@ -33,6 +34,8 @@ set -e my_dir="${1?}" my_branch="${2?}" +my_gpghomedir="${3?}" +my_gpgkeyid="${4?}" mkdir -p "${my_dir?}" @@ -128,8 +131,13 @@ flatpak build-finish --command=/app/libreoffice/program/soffice \ --share=network --share=ipc --socket=x11 --socket=wayland --socket=pulseaudio \ --socket=system-bus --socket=session-bus --filesystem=host \ --env=LIBO_FLATPAK=1 "${my_dir?}"/app -flatpak build-export "${my_dir?}"/repo "${my_dir?}"/app +flatpak build-export --gpg-homedir="${my_gpghomedir?}" \ + --gpg-sign="${my_gpgkeyid?}" "${my_dir?}"/repo "${my_dir?}"/app flatpak build-update-repo --title='The Document Foundation LibreOffice Fresh' \ - --generate-static-deltas --prune "${my_dir?}"/repo -flatpak build-bundle --repo-url=http://libreoffice.org/TODO "${my_dir?}"/repo \ + --generate-static-deltas --prune --gpg-homedir="${my_gpghomedir?}" \ + --gpg-sign="${my_gpgkeyid?}" "${my_dir?}"/repo +gpg --homedir="${my_gpghomedir?}" --output="${my_dir?}"/key --export \ + "${my_gpgkeyid?}" +flatpak build-bundle --repo-url=http://libreoffice.org/TODO \ + --gpg-keys="${my_dir?}"/key "${my_dir?}"/repo \ "${my_dir?}"/LibreOffice.flatpak org.libreoffice.LibreOffice commit ac3968398d93eb98bdbe4b89278df511fa1e4dc2 Author: Stephan Bergmann <[email protected]> Date: Wed May 25 14:48:14 2016 +0200 flatpak/build.sh: call "flatpak build-update-repo" diff --git a/flatpak/build.sh b/flatpak/build.sh index 0f3c4b2..fc8a568 100755 --- a/flatpak/build.sh +++ b/flatpak/build.sh @@ -129,5 +129,7 @@ flatpak build-finish --command=/app/libreoffice/program/soffice \ --socket=system-bus --socket=session-bus --filesystem=host \ --env=LIBO_FLATPAK=1 "${my_dir?}"/app flatpak build-export "${my_dir?}"/repo "${my_dir?}"/app +flatpak build-update-repo --title='The Document Foundation LibreOffice Fresh' \ + --generate-static-deltas --prune "${my_dir?}"/repo flatpak build-bundle --repo-url=http://libreoffice.org/TODO "${my_dir?}"/repo \ "${my_dir?}"/LibreOffice.flatpak org.libreoffice.LibreOffice commit 6e215ca53b7315a8f148dc520bee93acf603491b Author: Stephan Bergmann <[email protected]> Date: Wed May 25 10:10:45 2016 +0200 Reuse existing flatpak/build.sh work dir diff --git a/flatpak/build.sh b/flatpak/build.sh index 8b77adf..0f3c4b2 100755 --- a/flatpak/build.sh +++ b/flatpak/build.sh @@ -8,8 +8,8 @@ # branch/tag. # # It expects two command line arguments, an absolute pathname for a directory -# where the script does all its work (which must not yet exist), followed by the -# requested git branch/tag (i.e., the --branch argument to "git clone"). +# where the script does all its work, followed by the requested git branch/tag +# (i.e., the --branch argument to "git clone"). # # The script expects an installation of flatpak and availability of the # org.gnome.Platform 3.20 runtime (and SDK) from <http://sdk.gnome.org/repo/>. @@ -34,25 +34,35 @@ set -e my_dir="${1?}" my_branch="${2?}" -mkdir "${my_dir?}" +mkdir -p "${my_dir?}" # 1 Install Perl:Archive-Zip not available in org.gnome.Sdk: -wget http://search.cpan.org/CPAN/authors/id/P/PH/PHRED/Archive-Zip-1.56.tar.gz \ - -O "${my_dir?}"/Archive-Zip-1.56.tar.gz -mkdir "${my_dir?}"/perl -(cd "${my_dir?}"/perl && tar xf "${my_dir?}"/Archive-Zip-1.56.tar.gz) +if [ ! -e "${my_dir?}"/perl ]; then + wget \ + http://search.cpan.org/CPAN/authors/id/P/PH/PHRED/Archive-Zip-1.56.tar.gz \ + -O "${my_dir?}"/Archive-Zip-1.56.tar.gz + mkdir "${my_dir?}"/perl + (cd "${my_dir?}"/perl && tar xf "${my_dir?}"/Archive-Zip-1.56.tar.gz) +fi # 2 Clone the LibreOffice git repo: -git clone --branch "${my_branch?}" --recursive \ - git://gerrit.libreoffice.org/core "${my_dir?}"/lo +if [ -e "${my_dir?}"/lo ]; then + git -C "${my_dir?}"/lo pull + git -C "${my_dir?}"/lo submodule update + git -C "${my_dir?}"/lo checkout "${my_branch?}" +else + git clone --branch "${my_branch?}" --recursive \ + git://gerrit.libreoffice.org/core "${my_dir?}"/lo +fi # 3 Fetch external dependencies of LibreOffice: +rm -fr "${my_dir?}"/fetch mkdir "${my_dir?}"/fetch (cd "${my_dir?}"/fetch \ && "${my_dir?}"/lo/autogen.sh --prefix="${my_dir?}"/inst \ @@ -62,6 +72,7 @@ mkdir "${my_dir?}"/fetch # 4 Build LibreOffice: +rm -fr "${my_dir?}"/app "${my_dir?}"/build "${my_dir?}"/inst flatpak build-init "${my_dir?}"/app org.libreoffice.LibreOffice org.gnome.Sdk \ org.gnome.Platform 3.20 mkdir "${my_dir?}"/build commit ecfb0d2cf589b2cb17ed3f4d628577a50720f59d Author: Stephan Bergmann <[email protected]> Date: Tue May 24 14:45:49 2016 +0200 xdg-app -> flatpak diff --git a/flatpak/build.sh b/flatpak/build.sh index 1e583fc..8b77adf 100755 --- a/flatpak/build.sh +++ b/flatpak/build.sh @@ -11,13 +11,13 @@ # where the script does all its work (which must not yet exist), followed by the # requested git branch/tag (i.e., the --branch argument to "git clone"). # -# The script expects an installation of flatpak (nee xdg-app). and availability -# of the org.gnome.Platform 3.20 runtime (and SDK) from -# <http://sdk.gnome.org/repo/>. To obtain the latter, do something like: +# The script expects an installation of flatpak and availability of the +# org.gnome.Platform 3.20 runtime (and SDK) from <http://sdk.gnome.org/repo/>. +# To obtain the latter, do something like: # -# $ xdg-app --user remote-add gnome-sdk http://sdk.gnome.org/repo/ -# $ xdg-app --user install gnome-sdk org.gnome.Platform 3.20 -# $ xdg-app --user install gnome-sdk org.gnome.Sdk 3.20 +# $ fedpkg --user remote-add gnome-sdk http://sdk.gnome.org/repo/ +# $ fedpkg --user install gnome-sdk org.gnome.Platform 3.20 +# $ fedpkg --user install gnome-sdk org.gnome.Sdk 3.20 # # TODO: # @@ -27,9 +27,6 @@ # * GPG signing. # # * Explicitly specify the --arch to build? -# -# * The script still calls the old "xdg-app" tool throughout. All these calls -# shall be rewritten to "flatpak" in environments that use the new name. set -e @@ -65,10 +62,10 @@ mkdir "${my_dir?}"/fetch # 4 Build LibreOffice: -xdg-app build-init "${my_dir?}"/app org.libreoffice.LibreOffice org.gnome.Sdk \ +flatpak build-init "${my_dir?}"/app org.libreoffice.LibreOffice org.gnome.Sdk \ org.gnome.Platform 3.20 mkdir "${my_dir?}"/build -xdg-app build --build-dir="${my_dir?}"/build \ +flatpak build --build-dir="${my_dir?}"/build \ --env=PERLLIB="${my_dir?}"/perl/Archive-Zip-1.56/lib "${my_dir?}"/app bash -c \ '"${1?}"/lo/autogen.sh --prefix="${1?}"/inst --with-distro=LibreOfficeFlatpak \ --with-external-tar="${1?}"/tar && make && make distro-pack-install' \ @@ -95,30 +92,31 @@ for i in "${my_dir?}"/inst/share/icons/hicolor/*/apps/libreoffice-*; do cp -a "$i" \ "$(dirname "${my_dir?}"/app/files/share/icons/hicolor/"${i#"${my_dir?}"/inst/share/icons/hicolor/}")"/org.libreoffice.LibreOffice-"${i##*/apps/libreoffice-}" done -## see git://anongit.freedesktop.org/xdg-app/xdg-app -## app/flatpak-builtins-build-finish.c for further places where build-finish -## would look for data: +## see <https://github.com/flatpak/flatpak/blob/master/app/ +## flatpak-builtins-build-finish.c> for further places where build-finish would +## look for data: ## cp ... "${my_dir?}"/app/files/share/dbus-1/services/ ## cp ... "${my_dir?}"/app/files/share/gnome-shell/search-providers/ ## -## see git://anongit.freedesktop.org/xdg-app/xdg-app builder/builder-manifest.c +## see +## <https://github.com/flatpak/flatpak/blob/master/builder/builder-manifest.c> ## for the appstream-compose command line: mkdir "${my_dir?}"/app/files/share/appdata for i in "${my_dir?}"/inst/share/appdata/libreoffice-*.appdata.xml; do sed -e 's/<id>libreoffice-/<id>org.libreoffice.LibreOffice-/' "$i" \ > "${my_dir?}"/app/files/share/appdata/org.libreoffice.LibreOffice-"${i##*/libreoffice-}" done -xdg-app build --nofilesystem=host "${my_dir?}"/app appstream-compose \ +flatpak build --nofilesystem=host "${my_dir?}"/app appstream-compose \ --prefix=/app --origin=flatpak --basename=org.libreoffice.LibreOffice \ org.libreoffice.LibreOffice-{base,calc,draw,impress,writer} # 6 Generate bundle: -xdg-app build-finish --command=/app/libreoffice/program/soffice \ +flatpak build-finish --command=/app/libreoffice/program/soffice \ --share=network --share=ipc --socket=x11 --socket=wayland --socket=pulseaudio \ --socket=system-bus --socket=session-bus --filesystem=host \ --env=LIBO_FLATPAK=1 "${my_dir?}"/app -xdg-app build-export "${my_dir?}"/repo "${my_dir?}"/app -xdg-app build-bundle --repo-url=http://libreoffice.org/TODO "${my_dir?}"/repo \ +flatpak build-export "${my_dir?}"/repo "${my_dir?}"/app +flatpak build-bundle --repo-url=http://libreoffice.org/TODO "${my_dir?}"/repo \ "${my_dir?}"/LibreOffice.flatpak org.libreoffice.LibreOffice _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
