2019-09-10 17:02:30 +00:00
|
|
|
# The canonical copy of this spec file is upstream at:
|
2021-05-27 12:11:31 +00:00
|
|
|
# https://github.com/coreos/rpm-ostree/blob/main/packaging/rpm-ostree.spec.in
|
2019-09-10 17:02:30 +00:00
|
|
|
|
2017-03-07 13:57:49 +00:00
|
|
|
Summary: Hybrid image/package system
|
2021-06-22 18:12:24 +00:00
|
|
|
Name: rpm-ostree
|
2024-01-25 04:22:14 +00:00
|
|
|
Version: 2024.2
|
2024-01-02 22:24:01 +00:00
|
|
|
Release: %autorelease
|
2023-06-13 21:07:59 +00:00
|
|
|
License: LGPL-2.0-or-later
|
2020-10-30 16:49:36 +00:00
|
|
|
URL: https://github.com/coreos/rpm-ostree
|
2018-06-08 16:30:01 +00:00
|
|
|
# This tarball is generated via "cd packaging && make -f Makefile.dist-packaging dist-snapshot"
|
2021-01-19 15:22:15 +00:00
|
|
|
# in the upstream git. It also contains vendored Rust sources.
|
2020-10-30 16:49:36 +00:00
|
|
|
Source0: https://github.com/coreos/rpm-ostree/releases/download/v%{version}/rpm-ostree-%{version}.tar.xz
|
2017-03-10 16:55:51 +00:00
|
|
|
|
2018-06-08 16:30:01 +00:00
|
|
|
ExclusiveArch: %{rust_arches}
|
2018-12-04 19:45:04 +00:00
|
|
|
|
2023-12-19 17:30:12 +00:00
|
|
|
# ostree not on i686 for RHEL 10
|
|
|
|
# https://github.com/containers/composefs/pull/229#issuecomment-1838735764
|
|
|
|
%if 0%{?rhel} >= 10
|
|
|
|
ExcludeArch: %{ix86}
|
|
|
|
%endif
|
|
|
|
|
2021-04-12 20:23:35 +00:00
|
|
|
BuildRequires: make
|
2023-05-15 21:03:06 +00:00
|
|
|
%if 0%{?rhel}
|
2020-05-26 15:02:24 +00:00
|
|
|
BuildRequires: rust-toolset
|
|
|
|
%else
|
2021-01-19 15:22:15 +00:00
|
|
|
BuildRequires: rust-packaging
|
2019-03-27 21:34:55 +00:00
|
|
|
BuildRequires: cargo
|
|
|
|
BuildRequires: rust
|
2018-12-04 19:45:04 +00:00
|
|
|
%endif
|
2018-10-15 18:53:23 +00:00
|
|
|
|
2021-04-12 20:23:35 +00:00
|
|
|
# Enable ASAN + UBSAN
|
|
|
|
%bcond_with sanitizers
|
2022-02-04 15:10:00 +00:00
|
|
|
# Embedded unit tests
|
|
|
|
%bcond_with bin_unit_tests
|
2021-04-12 20:23:35 +00:00
|
|
|
|
2022-11-18 17:52:33 +00:00
|
|
|
# This is copied from the libdnf spec
|
|
|
|
%if 0%{?rhel} && ! 0%{?centos}
|
|
|
|
%bcond_without rhsm
|
|
|
|
%else
|
|
|
|
%bcond_with rhsm
|
|
|
|
%endif
|
|
|
|
|
2022-02-04 15:10:00 +00:00
|
|
|
# RHEL (8,9) doesn't ship zchunk today. Keep this in sync
|
|
|
|
# with libdnf: https://gitlab.com/redhat/centos-stream/rpms/libdnf/-/blob/762f631e36d1e42c63a794882269d26c156b68c1/libdnf.spec#L45
|
|
|
|
%if 0%{?rhel}
|
2019-12-19 17:10:37 +00:00
|
|
|
%bcond_with zchunk
|
|
|
|
%else
|
|
|
|
%bcond_without zchunk
|
|
|
|
%endif
|
|
|
|
|
2018-08-14 14:04:58 +00:00
|
|
|
# For the autofiles bits below
|
2023-10-04 21:09:09 +00:00
|
|
|
BuildRequires: python3-devel
|
2014-03-11 12:50:13 +00:00
|
|
|
# We always run autogen.sh
|
2015-02-06 13:32:11 +00:00
|
|
|
BuildRequires: autoconf automake libtool git
|
2014-03-11 12:50:13 +00:00
|
|
|
# For docs
|
2016-02-25 20:00:23 +00:00
|
|
|
BuildRequires: chrpath
|
2014-03-11 12:50:13 +00:00
|
|
|
BuildRequires: gtk-doc
|
2017-07-21 12:52:02 +00:00
|
|
|
BuildRequires: /usr/bin/g-ir-scanner
|
2016-02-17 22:55:54 +00:00
|
|
|
# Core requirements
|
2018-10-29 01:42:07 +00:00
|
|
|
# One way to check this: `objdump -p /path/to/rpm-ostree | grep LIBOSTREE` and pick the highest (though that might miss e.g. new struct members)
|
2022-02-04 15:10:00 +00:00
|
|
|
BuildRequires: pkgconfig(ostree-1) >= 2021.5
|
2017-06-20 14:34:00 +00:00
|
|
|
BuildRequires: pkgconfig(polkit-gobject-1)
|
2014-03-11 12:50:13 +00:00
|
|
|
BuildRequires: pkgconfig(json-glib-1.0)
|
2021-07-19 13:59:09 +00:00
|
|
|
BuildRequires: pkgconfig(rpm) >= 4.14.0
|
2016-01-12 15:56:24 +00:00
|
|
|
BuildRequires: pkgconfig(libarchive)
|
2016-06-23 14:28:39 +00:00
|
|
|
BuildRequires: pkgconfig(libsystemd)
|
2014-11-14 23:07:11 +00:00
|
|
|
BuildRequires: libcap-devel
|
2015-03-11 00:45:03 +00:00
|
|
|
BuildRequires: libattr-devel
|
2016-05-26 18:40:38 +00:00
|
|
|
|
2021-04-12 20:23:35 +00:00
|
|
|
# We currently interact directly with librepo (libdnf below also pulls it in,
|
|
|
|
# but duplicating to be clear)
|
2016-02-17 22:55:54 +00:00
|
|
|
BuildRequires: pkgconfig(librepo)
|
2016-05-26 18:40:38 +00:00
|
|
|
|
2018-09-10 21:22:26 +00:00
|
|
|
# Needed by curl-rust
|
|
|
|
BuildRequires: pkgconfig(libcurl)
|
|
|
|
|
2016-05-26 18:40:38 +00:00
|
|
|
BuildRequires: cmake
|
|
|
|
BuildRequires: pkgconfig(expat)
|
|
|
|
BuildRequires: pkgconfig(check)
|
2021-04-12 20:23:35 +00:00
|
|
|
|
|
|
|
# We use some libsolv types directly too (libdnf below also pulls it in,
|
|
|
|
# but duplicating to be clear)
|
2016-02-17 22:55:54 +00:00
|
|
|
BuildRequires: pkgconfig(libsolv)
|
2014-03-11 12:50:13 +00:00
|
|
|
|
2022-02-04 15:10:00 +00:00
|
|
|
# These are build deps which aren't strictly required in Koji/Brew builds, but
|
|
|
|
# are required for git builds. Since they're few and tiny, we just add it here
|
|
|
|
# to keep it part of `dnf builddep`.
|
|
|
|
BuildRequires: jq
|
|
|
|
|
2021-07-19 13:59:09 +00:00
|
|
|
#########################################################################
|
|
|
|
# libdnf build deps #
|
|
|
|
# #
|
|
|
|
# Copy/pasted from libdnf/libdnf.spec. Removed the irrelevant bits like #
|
|
|
|
# valgrind, rhsm, swig, python, and sanitizer stuff. #
|
|
|
|
#########################################################################
|
2018-03-07 14:07:31 +00:00
|
|
|
|
2019-03-27 17:43:42 +00:00
|
|
|
|
2022-05-13 17:40:15 +00:00
|
|
|
%global libsolv_version 0.7.21
|
2021-11-02 16:14:26 +00:00
|
|
|
%global libmodulemd_version 2.13.0
|
2021-07-19 13:59:09 +00:00
|
|
|
%global librepo_version 1.13.1
|
|
|
|
|
|
|
|
BuildRequires: cmake
|
|
|
|
BuildRequires: gcc
|
|
|
|
BuildRequires: gcc-c++
|
2021-04-12 20:23:35 +00:00
|
|
|
BuildRequires: libsolv-devel >= %{libsolv_version}
|
2021-07-19 13:59:09 +00:00
|
|
|
BuildRequires: pkgconfig(librepo) >= %{librepo_version}
|
|
|
|
BuildRequires: pkgconfig(check)
|
|
|
|
BuildRequires: pkgconfig(gio-unix-2.0) >= 2.46.0
|
|
|
|
BuildRequires: pkgconfig(gtk-doc)
|
2022-05-13 17:40:15 +00:00
|
|
|
BuildRequires: rpm-devel >= 4.15.0
|
2022-11-18 17:52:33 +00:00
|
|
|
%if %{with rhsm}
|
|
|
|
BuildRequires: pkgconfig(librhsm) >= 0.0.3
|
|
|
|
%endif
|
2019-12-19 17:10:37 +00:00
|
|
|
%if %{with zchunk}
|
|
|
|
BuildRequires: pkgconfig(zck) >= 0.9.11
|
|
|
|
%endif
|
2021-07-19 13:59:09 +00:00
|
|
|
BuildRequires: pkgconfig(sqlite3)
|
|
|
|
BuildRequires: pkgconfig(json-c)
|
|
|
|
BuildRequires: pkgconfig(cppunit)
|
|
|
|
BuildRequires: pkgconfig(modulemd-2.0) >= %{libmodulemd_version}
|
|
|
|
BuildRequires: pkgconfig(smartcols)
|
|
|
|
BuildRequires: gettext
|
2019-03-27 17:43:42 +00:00
|
|
|
BuildRequires: gpgme-devel
|
|
|
|
|
2020-02-27 20:23:18 +00:00
|
|
|
Requires: libmodulemd%{?_isa} >= %{libmodulemd_version}
|
2021-04-12 20:23:35 +00:00
|
|
|
Requires: libsolv%{?_isa} >= %{libsolv_version}
|
|
|
|
Requires: librepo%{?_isa} >= %{librepo_version}
|
2019-03-27 17:43:42 +00:00
|
|
|
|
2021-07-19 13:59:09 +00:00
|
|
|
#########################################################################
|
|
|
|
# end of libdnf build deps #
|
|
|
|
#########################################################################
|
|
|
|
|
2017-02-27 17:06:10 +00:00
|
|
|
# For now...see https://github.com/projectatomic/rpm-ostree/pull/637
|
|
|
|
# and https://github.com/fedora-infra/fedmsg-atomic-composer/pull/17
|
|
|
|
# etc. We'll drop this dependency at some point in the future when
|
|
|
|
# rpm-ostree wraps more of ostree (such as `ostree admin unlock` etc.)
|
|
|
|
Requires: ostree
|
2016-07-11 20:18:36 +00:00
|
|
|
Requires: bubblewrap
|
2016-09-01 10:45:52 +00:00
|
|
|
Requires: fuse
|
2016-07-11 20:18:36 +00:00
|
|
|
|
2022-02-04 15:10:00 +00:00
|
|
|
# For container functionality
|
|
|
|
# https://github.com/coreos/rpm-ostree/issues/3286
|
2023-01-16 21:00:42 +00:00
|
|
|
Requires: skopeo
|
2022-02-04 15:10:00 +00:00
|
|
|
|
2017-09-26 13:40:49 +00:00
|
|
|
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
|
|
|
|
2014-03-11 12:50:13 +00:00
|
|
|
%description
|
2017-03-07 13:57:49 +00:00
|
|
|
rpm-ostree is a hybrid image/package system. It supports
|
|
|
|
"composing" packages on a build server into an OSTree repository,
|
|
|
|
which can then be replicated by client systems with atomic upgrades.
|
|
|
|
Additionally, unlike many "pure" image systems, with rpm-ostree
|
|
|
|
each client system can layer on additional packages, providing
|
|
|
|
a "best of both worlds" approach.
|
2014-03-11 12:50:13 +00:00
|
|
|
|
2017-07-21 16:17:27 +00:00
|
|
|
%package libs
|
2017-07-21 12:52:02 +00:00
|
|
|
Summary: Shared library for rpm-ostree
|
|
|
|
|
2017-07-21 16:17:27 +00:00
|
|
|
%description libs
|
|
|
|
The %{name}-libs package includes the shared library for %{name}.
|
2017-07-21 12:52:02 +00:00
|
|
|
|
2017-07-21 16:17:27 +00:00
|
|
|
%package devel
|
2015-05-11 20:43:34 +00:00
|
|
|
Summary: Development headers for %{name}
|
2017-09-26 13:40:49 +00:00
|
|
|
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
2015-05-11 20:43:34 +00:00
|
|
|
|
2017-07-21 16:17:27 +00:00
|
|
|
%description devel
|
|
|
|
The %{name}-devel package includes the header files for %{name}-libs.
|
2015-05-11 20:43:34 +00:00
|
|
|
|
2014-03-11 12:50:13 +00:00
|
|
|
%prep
|
2023-05-25 17:22:13 +00:00
|
|
|
%autosetup -Sgit -n %{name}-%{version} -p1
|
2021-06-23 17:51:07 +00:00
|
|
|
%if 0%{?__isa_bits} == 32
|
2021-07-19 13:59:09 +00:00
|
|
|
sed -ie 's,^lto = true,lto = false,' Cargo.toml
|
2021-06-23 17:51:07 +00:00
|
|
|
%endif
|
2014-03-11 12:50:13 +00:00
|
|
|
|
|
|
|
%build
|
2018-12-04 19:45:04 +00:00
|
|
|
env NOCONFIGURE=1 ./autogen.sh
|
2021-01-19 15:22:15 +00:00
|
|
|
# Since we're hybrid C++/Rust we need to propagate this manually;
|
|
|
|
# the %%configure macro today assumes (reasonably) that one is building
|
|
|
|
# C/C++ and sets C{,XX}FLAGS
|
2021-07-19 13:59:09 +00:00
|
|
|
%if 0%{?build_rustflags:1}
|
2021-04-12 20:23:35 +00:00
|
|
|
export RUSTFLAGS="%{build_rustflags}"
|
2021-07-19 13:59:09 +00:00
|
|
|
%endif
|
2022-11-18 17:52:33 +00:00
|
|
|
%configure --disable-silent-rules --enable-gtk-doc %{?rpmdb_default} %{?with_sanitizers:--enable-sanitizers} %{?with_bin_unit_tests:--enable-bin-unit-tests} \
|
|
|
|
%{?with_rhsm:--enable-featuresrs=rhsm}
|
2021-04-12 20:23:35 +00:00
|
|
|
|
2020-07-29 15:49:45 +00:00
|
|
|
%make_build
|
2014-03-11 12:50:13 +00:00
|
|
|
|
|
|
|
%install
|
2020-07-29 15:49:45 +00:00
|
|
|
%make_install INSTALL="install -p -c"
|
2015-05-11 20:43:34 +00:00
|
|
|
find $RPM_BUILD_ROOT -name '*.la' -delete
|
2014-03-11 12:50:13 +00:00
|
|
|
|
2015-09-15 19:17:34 +00:00
|
|
|
# I try to do continuous delivery via rpmdistro-gitoverlay while
|
|
|
|
# reusing the existing spec files. Currently RPM only supports
|
|
|
|
# mandatory file entries. What this is doing is making each file
|
|
|
|
# entry optional - if it exists it will be picked up. That
|
|
|
|
# way the same spec file works more easily across multiple versions where e.g. an
|
|
|
|
# older version might not have a systemd unit file.
|
|
|
|
cat > autofiles.py <<EOF
|
|
|
|
import os,sys,glob
|
|
|
|
os.chdir(os.environ['RPM_BUILD_ROOT'])
|
|
|
|
for line in sys.argv[1:]:
|
|
|
|
if line == '':
|
|
|
|
break
|
2015-11-21 15:11:47 +00:00
|
|
|
if line[0] != '/':
|
|
|
|
sys.stdout.write(line + '\n')
|
2015-09-15 19:17:34 +00:00
|
|
|
else:
|
2015-11-21 15:11:47 +00:00
|
|
|
files = glob.glob(line[1:])
|
|
|
|
if len(files) > 0:
|
|
|
|
sys.stderr.write('{0} matched {1} files\n'.format(line, len(files)))
|
|
|
|
sys.stdout.write(line + '\n')
|
|
|
|
else:
|
|
|
|
sys.stderr.write('{0} did not match any files\n'.format(line))
|
2015-09-15 19:17:34 +00:00
|
|
|
EOF
|
2023-10-04 21:09:09 +00:00
|
|
|
PYTHON='%{python3}'
|
|
|
|
if ! test -x '%{python3}'; then
|
2018-07-16 21:30:32 +00:00
|
|
|
PYTHON=python2
|
|
|
|
fi
|
|
|
|
$PYTHON autofiles.py > files \
|
2015-09-15 19:17:34 +00:00
|
|
|
'%{_bindir}/*' \
|
|
|
|
'%{_libdir}/%{name}' \
|
|
|
|
'%{_mandir}/man*/*' \
|
2019-09-25 15:12:51 +00:00
|
|
|
'%{_datadir}/dbus-1/system.d/*' \
|
2018-01-16 21:44:53 +00:00
|
|
|
'%{_sysconfdir}/rpm-ostreed.conf' \
|
2015-09-15 19:17:34 +00:00
|
|
|
'%{_prefix}/lib/systemd/system/*' \
|
|
|
|
'%{_libexecdir}/rpm-ostree*' \
|
2022-04-20 17:48:25 +00:00
|
|
|
'%{_libexecdir}/libostree/ext/*' \
|
2017-06-20 14:40:05 +00:00
|
|
|
'%{_datadir}/polkit-1/actions/*.policy' \
|
2022-04-20 17:48:25 +00:00
|
|
|
'%{_datadir}/dbus-1/system-services/*' \
|
2019-03-06 19:29:28 +00:00
|
|
|
'%{_datadir}/bash-completion/completions/*'
|
2017-07-21 12:52:02 +00:00
|
|
|
|
2018-07-16 21:30:32 +00:00
|
|
|
$PYTHON autofiles.py > files.lib \
|
2017-07-21 12:52:02 +00:00
|
|
|
'%{_libdir}/*.so.*' \
|
|
|
|
'%{_libdir}/girepository-1.0/*.typelib'
|
|
|
|
|
2018-07-16 21:30:32 +00:00
|
|
|
$PYTHON autofiles.py > files.devel \
|
2015-09-15 19:17:34 +00:00
|
|
|
'%{_libdir}/lib*.so' \
|
|
|
|
'%{_includedir}/*' \
|
2017-06-23 13:43:51 +00:00
|
|
|
'%{_datadir}/dbus-1/interfaces/org.projectatomic.rpmostree1.xml' \
|
2015-09-15 19:17:34 +00:00
|
|
|
'%{_libdir}/pkgconfig/*' \
|
|
|
|
'%{_datadir}/gtk-doc/html/*' \
|
|
|
|
'%{_datadir}/gir-1.0/*-1.0.gir'
|
|
|
|
|
2023-08-24 17:19:19 +00:00
|
|
|
# Setup rpm-ostree-countme.timer according to presets
|
|
|
|
%post
|
|
|
|
%systemd_post rpm-ostree-countme.timer
|
|
|
|
|
|
|
|
%preun
|
|
|
|
%systemd_preun rpm-ostree-countme.timer
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%systemd_postun_with_restart rpm-ostree-countme.timer
|
|
|
|
|
2015-09-15 19:17:34 +00:00
|
|
|
%files -f files
|
2019-09-10 17:02:30 +00:00
|
|
|
%doc COPYING.GPL COPYING.LGPL LICENSE README.md
|
2015-05-11 20:43:34 +00:00
|
|
|
|
2017-07-21 16:17:27 +00:00
|
|
|
%files libs -f files.lib
|
2017-07-21 12:52:02 +00:00
|
|
|
|
2017-07-21 16:17:27 +00:00
|
|
|
%files devel -f files.devel
|
2022-11-18 17:52:33 +00:00
|
|
|
|
2014-03-11 12:50:13 +00:00
|
|
|
%changelog
|
2024-01-02 22:24:01 +00:00
|
|
|
%autochangelog
|