Blame SPECS/flatpak.spec

b3de6a
%global flatpak_version 1.0.9
c775e9
%global flatpak_builder_version 1.0.0
c775e9
%global ostree_version 2018.8
778716
778716
Name:           flatpak
c775e9
Version:        %{flatpak_version}
01d78b
Release:        13%{?dist}
778716
Summary:        Application deployment framework for desktop apps
778716
778716
License:        LGPLv2+
778716
URL:            http://flatpak.org/
778716
Source0:        https://github.com/flatpak/flatpak/releases/download/%{version}/%{name}-%{version}.tar.xz
778716
Source1:        https://github.com/ostreedev/ostree/releases/download/v%{ostree_version}/libostree-%{ostree_version}.tar.xz
c775e9
Source2:        https://github.com/flatpak/flatpak-builder/releases/download/%{flatpak_builder_version}/flatpak-builder-%{flatpak_builder_version}.tar.xz
c775e9
c775e9
# Avoid dbus activating systemd services on the session bus (we don't have a
c775e9
# user bus, and I'm pretty sure we don't have systemd --user)
c775e9
Patch0:         no-user-systemd.patch
c775e9
# Make sure our resulting binaries always have the rpath set to the bundled
c775e9
# ostree directory
c775e9
Patch1:         flatpak-ostree-bundle.patch
1d7db6
# https://bugzilla.redhat.com/show_bug.cgi?id=1660137
1d7db6
Patch2:         flatpak-1.0.4-oci-fixes.patch
65ffb5
Patch3:         0001-oci-Handle-cancellations-for-appstream.patch
65ffb5
Patch4:         0003-update-Fix-OCI-updates-in-the-system-repo.patch
bf4f97
# https://bugzilla.redhat.com/show_bug.cgi?id=1918771
bf4f97
Patch5:         flatpak-1.0.9-fix-CVE-2021-21261.patch
804a12
# https://bugzilla.redhat.com/show_bug.cgi?id=1938059
804a12
Patch6:         flatpak-1.0.9-fix-CVE-2021-21381.patch
b4368f
# https://bugzilla.redhat.com/show_bug.cgi?id=2012864
b4368f
Patch7:         flatpak-1.0.9-fix-CVE-2021-41133.patch
01d78b
# Backported CVE-2024-32462 fix from upstream
01d78b
Patch8:         flatpak-CVE-2024-32462.patch
c775e9
c775e9
BuildRequires:  pkgconfig(appstream-glib)
778716
BuildRequires:  pkgconfig(fuse)
778716
BuildRequires:  pkgconfig(gio-unix-2.0)
778716
BuildRequires:  pkgconfig(gobject-introspection-1.0) >= 1.40.0
778716
BuildRequires:  pkgconfig(json-glib-1.0)
778716
BuildRequires:  pkgconfig(libarchive) >= 2.8.0
778716
BuildRequires:  pkgconfig(libelf) >= 0.8.12
778716
BuildRequires:  pkgconfig(libsoup-2.4)
c775e9
BuildRequires:  pkgconfig(libxml-2.0) >= 2.4
778716
BuildRequires:  pkgconfig(polkit-gobject-1)
778716
BuildRequires:  pkgconfig(libseccomp)
778716
BuildRequires:  pkgconfig(liblzma)
c775e9
BuildRequires:  pkgconfig(yaml-0.1)
778716
BuildRequires:  pkgconfig(xau)
778716
BuildRequires:  pkgconfig(e2p)
b0c5b1
BuildRequires:  automake, autoconf, libtool, gettext-devel, gtk-doc
778716
BuildRequires:  bison
778716
BuildRequires:  docbook-dtds
778716
BuildRequires:  docbook-style-xsl
778716
BuildRequires:  intltool
778716
BuildRequires:  libattr-devel
778716
BuildRequires:  libcap-devel
778716
BuildRequires:  libdwarf-devel
778716
BuildRequires:  gpgme-devel
778716
BuildRequires:  systemd
c775e9
BuildRequires:  /usr/bin/eu-strip
778716
BuildRequires:  /usr/bin/xmlto
778716
BuildRequires:  /usr/bin/xsltproc
c775e9
# Bundled ostree BRs:
c775e9
BuildRequires:  pkgconfig(zlib)
c775e9
BuildRequires:  pkgconfig(libcurl)
c775e9
BuildRequires:  openssl-devel
c775e9
BuildRequires:  pkgconfig(mount)
c775e9
BuildRequires:  pkgconfig(libsystemd)
778716
b0c5b1
# libostree bundling
b0c5b1
# https://fedoraproject.org/wiki/EPEL:Packaging_Autoprovides_and_Requires_Filtering
b0c5b1
# We're using RPATH to pick up our bundled version
b0c5b1
%filter_from_requires /libostree-1/d
b0c5b1
b0c5b1
# And ensure we don't add a Provides
b0c5b1
%{?filter_setup:
b0c5b1
%filter_provides_in %{_libdir}/%{name}/.*
b0c5b1
%filter_setup
b0c5b1
}
b0c5b1
# And for now we manually inject this dep; surprisingly the
b0c5b1
# command line doesn't currently link to the public libflatpak
b0c5b1
# library.
b0c5b1
Requires:       %{name}-libs = %{version}-%{release}
b0c5b1
c775e9
# Make sure the document portal is installed
c775e9
%if 0%{?fedora} || 0%{?rhel} > 7
c775e9
Recommends:     xdg-desktop-portal > 0.10
c775e9
# Remove in F30.
c775e9
Conflicts:      xdg-desktop-portal < 0.10
c775e9
%else
c775e9
Requires:       xdg-desktop-portal > 0.10
c775e9
%endif
c775e9
778716
%description
778716
flatpak is a system for building, distributing and running sandboxed desktop
778716
applications on Linux. See https://wiki.gnome.org/Projects/SandboxedApps for
778716
more information.
778716
778716
%package builder
c775e9
# Override to the version of the bundled flatpak-builder.
c775e9
Version:        %{flatpak_builder_version}
778716
Summary:        Build helper for %{name}
778716
License:        LGPLv2+
c775e9
# Overridden, as the macro expands to the version of this subpackage.
c775e9
Requires:       %{name}%{?_isa} = %{flatpak_version}-%{release}
778716
Requires:       /usr/bin/bzip2
778716
Requires:       /usr/bin/bzr
778716
Requires:       /usr/bin/git
778716
Requires:       /usr/bin/patch
778716
Requires:       /usr/bin/strip
c775e9
Requires:       /usr/bin/svn
778716
Requires:       /usr/bin/tar
778716
Requires:       /usr/bin/unzip
778716
778716
%description builder
778716
flatpak-builder is a tool that makes it easy to build applications and their
778716
dependencies by automating the configure && make && make install steps.
778716
778716
%package devel
c775e9
# Overriden, to reset the version macro back to that of the base package.
c775e9
Version:        %{flatpak_version}
778716
Summary:        Development files for %{name}
778716
License:        LGPLv2+
778716
Requires:       %{name}%{?_isa} = %{version}-%{release}
778716
Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
778716
778716
%description devel
778716
This package contains the pkg-config file and development headers for %{name}.
778716
778716
%package libs
778716
Summary:        Libraries for %{name}
778716
License:        LGPLv2+
778716
# Drop if using an external ostree-libs.
778716
Requires:       %{name}%{?_isa} = %{version}-%{release}
778716
778716
%description libs
778716
This package contains libflatpak.
778716
778716
778716
%prep
c775e9
%setup -q -a 1 -a 2
778716
%patch0 -p1
b0c5b1
%patch1 -p1
990548
%patch2 -p1
65ffb5
%patch3 -p1
65ffb5
%patch4 -p1
bf4f97
%patch5 -p1
804a12
%patch6 -p1
b4368f
%patch7 -p1
01d78b
%patch8 -p1
b0c5b1
778716
778716
%build
778716
cd libostree-%{ostree_version}
778716
 %configure \
778716
           --disable-silent-rules \
778716
           --disable-gtk-doc \
778716
           --disable-man \
778716
           --disable-rofiles-fuse \
778716
           --without-libmount \
778716
           --disable-introspection \
778716
           --without-selinux \
778716
           --without-dracut \
12d9a6
           LIBS=-lgpg-error \
12d9a6
           CPPFLAGS="$CPPFLAGS -DDISABLE_OTMPFILE"
778716
%make_build V=1
778716
cd ..
778716
778716
mkdir -p root/lib/pkgconfig
778716
ROOT=`pwd`/root
778716
b0c5b1
mv libostree-%{ostree_version}/.libs/libostree-1.so* root/lib
b0c5b1
ls -al root/lib/libostree*
778716
ln -s `pwd`/libostree-%{ostree_version}/src/libostree root/include
778716
778716
cat > root/lib/pkgconfig/ostree-1.pc <
778716
Name: OSTree
778716
Description: Git for operating system binaries
778716
Version: %{ostree_version}
778716
Requires: gio-unix-2.0
b0c5b1
Libs: -L$ROOT/lib -Wl,-rpath=%{_libdir}/flatpak -lostree-1
778716
Cflags: -I$ROOT/include
778716
EOF
b0c5b1
rm -f configure
b0c5b1
gtkdocize
b0c5b1
autoreconf -f -i -s
778716
export PKG_CONFIG_PATH=$ROOT/lib/pkgconfig
778716
(if ! test -x configure; then NOCONFIGURE=1 ./autogen.sh; CONFIGFLAGS=--enable-gtk-doc; fi;
778716
 # User namespace support is sufficient.
778716
 # Generate consistent IDs between runs to avoid multilib problems.
778716
 export XMLTO_FLAGS="--stringparam generate.consistent.ids=1"
778716
 %configure \
c775e9
            --with-priv-mode=none \
778716
            --enable-docbook-docs \
778716
            --disable-introspection $CONFIGFLAGS)
778716
%make_build V=1
778716
sed -i s/ostree-1// %{name}.pc
778716
c775e9
cd flatpak-builder-%{flatpak_builder_version}
c775e9
cat > flatpak <
c775e9
#!/bin/sh
c775e9
echo %{flatpak_version}
c775e9
EOF
c775e9
chmod +x ./flatpak
c775e9
 %configure \
c775e9
           --with-dwarf-header=%{_includedir}/libdwarf \
c775e9
           --disable-silent-rules \
c775e9
           FLATPAK=./flatpak
c775e9
%make_build CFLAGS+=-std=c99 V=1
c775e9
c775e9
778716
%install
b0c5b1
mkdir -p %{buildroot}%{_datadir}/gtk-doc/html/flatpak
778716
%make_install
b0c5b1
install -d %{buildroot}%{_libdir}/flatpak
b0c5b1
mv root/lib/libostree-1.so* %{buildroot}%{_libdir}/flatpak
12d9a6
# Work around https://bugzilla.redhat.com/show_bug.cgi?id=1392354
12d9a6
install -d %{buildroot}/%{_pkgdocdir}
12d9a6
if test -d %{buildroot}/%{_docdir}/%{name}; then
12d9a6
    mv %{buildroot}/%{_docdir}/%{name}/* %{buildroot}/%{_pkgdocdir}
12d9a6
    rmdir %{buildroot}/%{_docdir}/%{name}/
12d9a6
fi
12d9a6
install -t %{buildroot}/%{_pkgdocdir} -pm 644 NEWS README.md
778716
# The system repo is not installed by the flatpak build system.
778716
install -d %{buildroot}%{_localstatedir}/lib/flatpak
778716
install -d %{buildroot}%{_sysconfdir}/flatpak/remotes.d
778716
rm -f %{buildroot}%{_libdir}/libflatpak.la
c775e9
# We don't have python3 and flatpak introspection is disabled
c775e9
rm %{buildroot}%{_bindir}/flatpak-bisect
c775e9
rm %{buildroot}%{_bindir}/flatpak-coredumpctl
c775e9
c775e9
cd flatpak-builder-%{flatpak_builder_version}
c775e9
%make_install
c775e9
cd ..
778716
%find_lang %{name}
778716
c775e9
778716
%post
778716
# Create an (empty) system-wide repo.
778716
flatpak remote-list --system &> /dev/null || :
778716
778716
%post libs -p /sbin/ldconfig
778716
778716
%postun libs -p /sbin/ldconfig
778716
778716
778716
%files -f %{name}.lang
778716
%license COPYING
778716
# Comply with the packaging guidelines about not mixing relative and absolute
778716
# paths in doc.
778716
%doc %{_pkgdocdir}
778716
%{_bindir}/flatpak
778716
%{_datadir}/bash-completion
778716
%{_datadir}/dbus-1/interfaces/org.freedesktop.Flatpak.xml
c775e9
%{_datadir}/dbus-1/interfaces/org.freedesktop.portal.Flatpak.xml
778716
%{_datadir}/dbus-1/services/org.freedesktop.Flatpak.service
c775e9
%{_datadir}/dbus-1/services/org.freedesktop.portal.Flatpak.service
778716
%{_datadir}/dbus-1/system-services/org.freedesktop.Flatpak.SystemHelper.service
778716
# Co-own directory.
778716
%{_datadir}/gdm/env.d
778716
%{_datadir}/%{name}
778716
%{_datadir}/polkit-1/actions/org.freedesktop.Flatpak.policy
778716
%{_datadir}/polkit-1/rules.d/org.freedesktop.Flatpak.rules
c775e9
%{_datadir}/zsh/site-functions
778716
%{_libexecdir}/flatpak-dbus-proxy
c775e9
%{_libexecdir}/flatpak-portal
778716
%{_libexecdir}/flatpak-session-helper
778716
%{_libexecdir}/flatpak-system-helper
778716
%attr(04755,root,root) %{_libexecdir}/flatpak-bwrap
778716
778716
%dir %{_localstatedir}/lib/flatpak
778716
%{_mandir}/man1/%{name}*.1*
778716
%{_mandir}/man5/%{name}-metadata.5*
778716
%{_mandir}/man5/flatpak-flatpakref.5*
778716
%{_mandir}/man5/flatpak-flatpakrepo.5*
c775e9
%{_mandir}/man5/flatpak-installation.5*
c775e9
%{_mandir}/man5/flatpak-remote.5*
778716
%exclude %{_mandir}/man1/flatpak-builder.1*
778716
%{_sysconfdir}/dbus-1/system.d/org.freedesktop.Flatpak.SystemHelper.conf
778716
%{_sysconfdir}/flatpak/remotes.d
778716
%{_sysconfdir}/profile.d/flatpak.sh
778716
%{_unitdir}/flatpak-system-helper.service
c775e9
%{_userunitdir}/flatpak-portal.service
778716
%{_userunitdir}/flatpak-session-helper.service
778716
# Co-own directory.
778716
%{_userunitdir}/dbus.service.d
778716
778716
%files builder
c775e9
%doc %{_docdir}/flatpak-builder
778716
%{_bindir}/flatpak-builder
778716
%{_mandir}/man1/flatpak-builder.1*
c775e9
%{_mandir}/man5/flatpak-manifest.5*
778716
778716
%files devel
778716
%{_datadir}/gtk-doc/
778716
%{_includedir}/%{name}/
778716
%{_libdir}/libflatpak.so
778716
%{_libdir}/pkgconfig/%{name}.pc
778716
778716
%files libs
778716
%license COPYING
b0c5b1
%{_libdir}/flatpak/libostree-1.so*
778716
%{_libdir}/libflatpak.so.*
778716
778716
778716
%changelog
01d78b
* Fri Jun 07 2024 Kalev Lember <klember@redhat.com> - 1.0.9-13
01d78b
- Fix CVE-2024-32462
01d78b
b4368f
* Wed Oct 27 2021 Debarshi Ray <rishi@fedoraproject.org> - 1.0.9-12
b4368f
- Fix CVE-2021-41133 (#2012864)
b4368f
804a12
* Mon Mar 22 2021 David King <dking@redhat.com> - 1.0.9-11
804a12
- Fix CVE-2021-21381 (#1938059)
804a12
bf4f97
* Tue Jan 26 2021 David King <dking@redhat.com> - 1.0.9-10
bf4f97
- Fix CVE-2021-21261 (#1918771)
bf4f97
65ffb5
* Wed Jan 29 2020 Kalev Lember <klember@redhat.com> - 1.0.9-9
65ffb5
- Backport OCI fixes from upstream
65ffb5
- Resolves: #1796340
65ffb5
b3de6a
* Fri Sep 20 2019 Kalev Lember <klember@redhat.com> - 1.0.9-8
b3de6a
- Update to 1.0.9 (#1753591)
b3de6a
1d7db6
* Mon Apr 29 2019 David King <dking@redhat.com> - 1.0.2-7
1d7db6
- Fix IOCSTI sandbox bypass (#1700652)
b14014
1d7db6
* Fri Feb 15 2019 David King <dking@redhat.com> - 1.0.2-6
1d7db6
- Tweak /proc sandbox patch (#1675435)
990548
1d7db6
* Wed Feb 13 2019 David King <dking@redhat.com> - 1.0.2-5
1d7db6
- Do not mount /proc in root sandbox (#1675435)
1d7db6
1d7db6
* Mon Jan 14 2019 David King <dking@redhat.com> - 1.0.2-4
1d7db6
- Apply the OCI support patch (#1660137)
1d7db6
1d7db6
* Mon Jan 07 2019 David King <dking@redhat.com> - 1.0.2-3
1d7db6
- Backport patches to improve OCI support (#1660137)
990548
c775e9
* Thu Sep 13 2018 Kalev Lember <klember@redhat.com> - 1.0.2-2
c775e9
- Update to 1.0.2 (#1570030)
c775e9
c775e9
* Wed Sep 12 2018 Kalev Lember <klember@redhat.com> - 1.0.1-1
c775e9
- Update to 1.0.1 (#1570030)
c775e9
c775e9
* Mon Jun 04 2018 David King <dking@redhat.com> - 0.10.4-2
c775e9
- Fix subpackage versions (#1585604)
c775e9
c775e9
* Fri Jun 01 2018 David King <dking@redhat.com> - 0.10.4-1
c775e9
- Rebase to 0.10.4 (#1570030)
7e13fc
12d9a6
* Mon Dec 11 2017 David King <dking@redhat.com> - 0.8.8-3
12d9a6
- Disable O_TMPFILE in libglnx (#1520311)
12d9a6
12d9a6
* Fri Nov 10 2017 Ray Strode <rstrode@redhat.com> - 0.8.8-2
b0c5b1
- Fix crasher in xdg-desktop-portal
12d9a6
  Resolves: #1503579
b0c5b1
- Tweak spec file so it still builds even though we need to
b0c5b1
  autoreconf.
b0c5b1
12d9a6
* Wed Nov 01 2017 David King <dking@redhat.com> - 0.8.8-1
12d9a6
- Update to 0.8.8 (#1500800)
12d9a6
12d9a6
* Tue Aug 01 2017 Colin Walters <walters@verbum.org> - 0.8.7-3
b0c5b1
- Fix libostree bundling:
b0c5b1
  Ensure we do not Provide or Require libostree.
b0c5b1
  Move the shared library into flatpak-libs so flatpak always
b0c5b1
  depends on it.
b0c5b1
  Keep the shared library filename as libostree, but put it
b0c5b1
  under a private directory.  Renaming the file on disk did not
b0c5b1
  really do much since the dynamic linker and RPM work from the
b0c5b1
  soname.
b0c5b1
  Resolves: #1476905
12d9a6
12d9a6
* Tue Aug 01 2017 Colin Walters <walters@verbum.org> - 0.8.7-2
b0c5b1
- Tweak build to work both with and without BZ#1392354
b0c5b1
778716
* Tue Jun 20 2017 Kalev Lember <klember@redhat.com> - 0.8.7-1
778716
- Update to 0.8.7
778716
- Resolves: #1391018
778716
778716
* Tue Apr  4 2017 Alexander Larsson <alexl@redhat.com> - 0.8.5-2
778716
- Add libostree use-after-free patch
778716
- Resolves: #1391018
778716
778716
* Mon Apr 03 2017 Kalev Lember <klember@redhat.com> - 0.8.5-1
778716
- Update to 0.8.5
778716
- Resolves: #1391018
778716
778716
* Fri Mar 10 2017 David King <dking@redhat.com> - 0.8.4-2
778716
- Sync bzip2 dependency with Fedora package
778716
- Make the libs subpackage depend on the base package for libostree
778716
- Fix multilib issues with XML-based documentation
778716
778716
* Fri Mar 10 2017 Kalev Lember <klember@redhat.com> - 0.8.4-1
778716
- Update to 0.8.4
778716
- Resolves: #1391018
778716
778716
* Wed Feb 22 2017 Kalev Lember <klember@redhat.com> - 0.8.3-4
778716
- Remove ExcludeArch ppc now that we have libseccomp there
778716
- Resolves: #1391018
778716
778716
* Fri Feb 17 2017 Alexander Larsson <alexl@redhat.com> - 0.8.3-3
778716
- ExcludeArch 32bit ppc which doesn't have libseccomp
778716
- Resolves: #1391018
778716
778716
* Fri Feb 17 2017 Alexander Larsson <alexl@redhat.com> - 0.8.3-2
778716
- Added pkgconfig(e2p) build dependency
778716
- Resolves: #1391018
778716
778716
* Fri Feb 17 2017 Alexander Larsson <alexl@redhat.com> - 0.8.3-1
778716
- Bundle ostree and bubblewrap
778716
- Resolves: #1391018
778716
778716
* Tue Feb 14 2017 Kalev Lember <klember@redhat.com> - 0.8.3-1
778716
- Update to 0.8.3
778716
778716
* Fri Jan 27 2017 Kalev Lember <klember@redhat.com> - 0.8.2-1
778716
- Update to 0.8.2
778716
778716
* Wed Jan 18 2017 David King <amigadave@amigadave.com> - 0.8.1-1
778716
- Update to 0.8.1
778716
778716
* Tue Dec 20 2016 Kalev Lember <klember@redhat.com> - 0.8.0-1
778716
- Update to 0.8.0
778716
778716
* Tue Nov 29 2016 David King <amigadave@amigadave.com> - 0.6.14-2
778716
- Add a patch to fix a GNOME Software crash
778716
- Silence repository listing during post
778716
778716
* Tue Nov 29 2016 Kalev Lember <klember@redhat.com> - 0.6.14-1
778716
- Update to 0.6.14
778716
778716
* Wed Oct 26 2016 David King <amigadave@amigadave.com> - 0.6.13-2
778716
- Add empty /etc/flatpak/remotes.d
778716
778716
* Tue Oct 25 2016 David King <amigadave@amigadave.com> - 0.6.13-1
778716
- Update to 0.6.13
778716
778716
* Thu Oct 06 2016 David King <amigadave@amigadave.com> - 0.6.12-1
778716
- Update to 0.6.12
778716
778716
* Tue Sep 20 2016 Kalev Lember <klember@redhat.com> - 0.6.11-1
778716
- Update to 0.6.11
778716
- Set minimum ostree and bubblewrap versions
778716
778716
* Mon Sep 12 2016 David King <amigadave@amigadave.com> - 0.6.10-1
778716
- Update to 0.6.10
778716
778716
* Tue Sep 06 2016 David King <amigadave@amigadave.com> - 0.6.9-2
778716
- Look for bwrap in PATH
778716
778716
* Thu Aug 25 2016 David King <amigadave@amigadave.com> - 0.6.9-1
778716
- Update to 0.6.9
778716
778716
* Mon Aug 01 2016 David King <amigadave@amigadave.com> - 0.6.8-1
778716
- Update to 0.6.8 (#1361823)
778716
778716
* Thu Jul 21 2016 David King <amigadave@amigadave.com> - 0.6.7-2
778716
- Use system bubblewrap
778716
778716
* Fri Jul 01 2016 David King <amigadave@amigadave.com> - 0.6.7-1
778716
- Update to 0.6.7
778716
778716
* Thu Jun 23 2016 David King <amigadave@amigadave.com> - 0.6.6-1
778716
- Update to 0.6.6
778716
778716
* Fri Jun 10 2016 David King <amigadave@amigadave.com> - 0.6.5-1
778716
- Update to 0.6.5
778716
778716
* Wed Jun 01 2016 David King <amigadave@amigadave.com> - 0.6.4-1
778716
- Update to 0.6.4
778716
778716
* Tue May 31 2016 David King <amigadave@amigadave.com> - 0.6.3-1
778716
- Update to 0.6.3
778716
- Move bwrap to main package
778716
778716
* Tue May 24 2016 David King <amigadave@amigadave.com> - 0.6.2-1
778716
- Rename from xdg-app to flatpak (#1337434)