Blame SPECS/flatpak.spec

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