2019-09-06 22:25:27 +03:00
# The canonical copy of this spec file is upstream at:
# https://github.com/projectatomic/rpm-ostree/blob/master/packaging/rpm-ostree.spec.in
2017-03-07 17:00:56 +03:00
Summary : Hybrid image/package system
2014-01-16 06:54:48 +04:00
Name : rpm-ostree
2020-02-06 00:02:23 +03:00
Version : 2020.1
2014-01-16 06:54:48 +04:00
Release : 1%{?dist}
2014-02-24 02:27:56 +04:00
#VCS: https://github.com/cgwalters/rpm-ostree
2019-09-06 22:25:27 +03:00
# This tarball is generated via "cd packaging && make -f Makefile.dist-packaging dist-snapshot"
# in the upstream git. If rust is enabled, it contains vendored sources.
2014-01-16 06:54:48 +04:00
Source0 : rpm-ostree-%{version} .tar.xz
License : LGPLv2+
2017-03-07 17:00:56 +03:00
URL : https://github.com/projectatomic/rpm-ostree
2019-09-06 22:25:27 +03:00
ExclusiveArch : %{rust_arches}
%if 0%{?fedora}
BuildRequires : cargo
BuildRequires : rust
%else
# assume el8
BuildRequires : rust-toolset
%endif
2019-10-17 00:02:45 +03:00
# RHEL8 doesn't ship zchunk today. See also the comments
# in configure.ac around this as libdnf/librepo need to be in
# sync, and today we bundle libdnf but not librepo.
%if 0%{?rhel}
%bcond_with zchunk
%else
%bcond_without zchunk
%endif
2019-09-06 22:25:27 +03:00
# For the autofiles bits below
BuildRequires : /usr/bin/python3
2014-01-16 06:54:48 +04:00
# We always run autogen.sh
2017-03-07 17:00:56 +03:00
BuildRequires : autoconf automake libtool git
2014-01-16 06:54:48 +04:00
# For docs
2017-03-07 17:00:56 +03:00
BuildRequires : chrpath
2014-01-16 06:54:48 +04:00
BuildRequires : gtk-doc
2017-03-07 17:00:56 +03:00
BuildRequires : gperf
2014-01-16 06:54:48 +04:00
BuildRequires : gnome-common
2019-09-06 22:25:27 +03:00
BuildRequires : /usr/bin/g-ir-scanner
2017-03-07 17:00:56 +03:00
# Core requirements
2019-09-06 22:25:27 +03: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)
BuildRequires : pkgconfig(ostree-1) >= 2019.2
BuildRequires : pkgconfig(polkit-gobject-1)
2014-02-13 03:26:31 +04:00
BuildRequires : pkgconfig(json-glib-1.0)
2014-03-28 03:57:10 +04:00
BuildRequires : pkgconfig(rpm)
2017-03-07 17:00:56 +03:00
BuildRequires : pkgconfig(libarchive)
BuildRequires : pkgconfig(libsystemd)
2014-11-15 02:07:47 +03:00
BuildRequires : libcap-devel
2017-03-07 17:00:56 +03:00
BuildRequires : libattr-devel
# We currently interact directly with librepo
BuildRequires : pkgconfig(librepo)
2014-01-16 07:22:49 +04:00
2019-09-06 22:25:27 +03:00
# Needed by curl-rust
BuildRequires : pkgconfig(libcurl)
2017-03-07 17:00:56 +03:00
# libdnf bundling
# We're using RPATH to pick up our bundled version
%global __requires_exclude ^libdnf[.]so[.].*$
2019-09-06 22:25:27 +03:00
# Our bundled libdnf.so.2 is for us only
%global __provides_exclude_from ^%{_libdir} /%{name} /.*$
2017-03-07 17:00:56 +03:00
BuildRequires : cmake
BuildRequires : pkgconfig(expat)
BuildRequires : pkgconfig(check)
BuildRequires : pkgconfig(libsolv)
2019-09-06 22:25:27 +03:00
# We need g++ for libdnf
BuildRequires : gcc-c++
# more libdnf build deps (see libdnf's spec for versions)
%global swig_version 3.0.12
2020-02-21 18:58:31 +03:00
%global libmodulemd_version 2.5.0
2019-09-06 22:25:27 +03:00
BuildRequires : swig >= %{swig_version}
2020-02-21 18:58:31 +03:00
BuildRequires : pkgconfig(modulemd-2.0) >= %{libmodulemd_version}
2019-09-06 22:25:27 +03:00
BuildRequires : pkgconfig(json-c)
BuildRequires : pkgconfig(cppunit)
BuildRequires : pkgconfig(sqlite3)
BuildRequires : pkgconfig(smartcols)
2019-10-17 00:02:45 +03:00
%if %{with zchunk}
BuildRequires : pkgconfig(zck) >= 0.9.11
%endif
2019-09-06 22:25:27 +03:00
BuildRequires : gpgme-devel
2020-02-21 18:58:31 +03:00
Requires : libmodulemd%{?_isa} >= %{libmodulemd_version}
2017-03-07 17:00:56 +03: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
Requires : bubblewrap
Requires : fuse
2014-01-16 06:54:48 +04:00
2019-09-06 22:25:27 +03:00
Requires : %{name} -libs%{?_isa} = %{version} -%{release}
2014-01-16 06:54:48 +04:00
%description
2017-03-07 17:00:56 +03:00
rpm-ostree is a hybrid image/package system. It supports
" c o m p o s i n g " packages on a build server into an OSTree repository,
which can then be replicated by client systems with atomic upgrades.
Additionally, unlike many " p u r e " image systems, with rpm-ostree
each client system can layer on additional packages, providing
a " b e s t o f b o t h w o r l d s " approach.
2014-01-16 06:54:48 +04:00
2019-09-06 22:25:27 +03:00
%package libs
Summary : Shared library for rpm-ostree
%description libs
The %{name} -libs package includes the shared library for %{name} .
2015-04-09 00:20:50 +03:00
%package devel
Summary : Development headers for %{name}
2019-09-06 22:25:27 +03:00
Requires : %{name} -libs%{?_isa} = %{version} -%{release}
2015-04-09 00:20:50 +03:00
%description devel
2019-09-06 22:25:27 +03:00
The %{name} -devel package includes the header files for %{name} -libs.
2015-04-09 00:20:50 +03:00
2014-01-16 06:54:48 +04:00
%prep
2017-03-07 17:00:56 +03:00
%autosetup -Sgit -n %{name} -%{version}
2014-01-16 06:54:48 +04:00
%build
env NOCONFIGURE=1 ./autogen.sh
2015-09-01 00:21:35 +03:00
%configure --disable-silent-rules --enable-gtk-doc
2014-01-16 06:54:48 +04:00
make %{?_smp_mflags}
%install
make install DESTDIR=$RPM_BUILD_ROOT INSTALL=" i n s t a l l - p - c "
2015-04-09 00:20:50 +03:00
find $RPM_BUILD_ROOT -name '*.la' -delete
2014-01-16 06:54:48 +04:00
2017-03-07 17:00:56 +03: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
if line[0] != '/' :
sys.stdout.write(line + '\n' )
else:
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))
EOF
2019-09-06 22:25:27 +03:00
PYTHON=python3
if ! test -x /usr/bin/python3; then
PYTHON=python2
fi
$PYTHON autofiles.py > files \
2017-03-07 17:00:56 +03:00
'%{_bindir}/*' \
'%{_libdir}/%{name}' \
'%{_mandir}/man*/*' \
2019-09-16 18:51:13 +03:00
'%{_datadir}/dbus-1/system.d/*' \
2019-09-06 22:25:27 +03:00
'%{_sysconfdir}/rpm-ostreed.conf' \
2017-03-07 17:00:56 +03:00
'%{_prefix}/lib/systemd/system/*' \
'%{_libexecdir}/rpm-ostree*' \
2019-09-06 22:25:27 +03:00
'%{_datadir}/polkit-1/actions/*.policy' \
2017-06-09 13:52:01 +03:00
'%{_datadir}/dbus-1/system-services' \
2019-09-06 22:25:27 +03:00
'%{_datadir}/bash-completion/completions/*'
$PYTHON autofiles.py > files.lib \
'%{_libdir}/*.so.*' \
'%{_libdir}/girepository-1.0/*.typelib'
$PYTHON autofiles.py > files.devel \
2017-03-07 17:00:56 +03:00
'%{_libdir}/lib*.so' \
'%{_includedir}/*' \
2019-09-06 22:25:27 +03:00
'%{_datadir}/dbus-1/interfaces/org.projectatomic.rpmostree1.xml' \
2017-03-07 17:00:56 +03:00
'%{_libdir}/pkgconfig/*' \
'%{_datadir}/gtk-doc/html/*' \
'%{_datadir}/gir-1.0/*-1.0.gir'
2015-04-09 00:20:50 +03:00
2017-03-07 17:00:56 +03:00
%files -f files
2019-09-06 21:38:59 +03:00
%doc COPYING.GPL COPYING.LGPL LICENSE README.md
2014-02-24 02:27:56 +04:00
2019-09-06 22:25:27 +03:00
%files libs -f files.lib
2014-03-10 22:19:29 +04:00
2019-09-06 22:25:27 +03:00
%files devel -f files.devel