Blob Blame History Raw
%bcond_without bundled_libhif
Summary: Client side upgrade program and server side compose tool
Name: rpm-ostree
Version: 2016.3.1.g5bd7211
Release: 1.atomic%{?dist}
#VCS: https://github.com/cgwalters/rpm-ostree
# This tarball is generated via "make -f Makefile.dist-packaging dist-snapshot"
# because github doesn't support placing submodules in tarballs and RPM
# doesn't understand git.
Source0: rpm-ostree-%{version}.tar.xz
# https://github.com/rpm-software-management/libhif
# Bundled because the library is API/ABI unstable, and we're trying to
# avoid being version locked with PackageKit/dnf right now.
# This source is generated via
#   git archive --format=tar --prefix=libhif/ 
%if %{with bundled_libhif}
Source1: libhif.tar.gz
Provides: bundled(libhif) = 0.7.0
%endif
License: LGPLv2+
URL: https://github.com/projectatomic/rpm-ostree

# We always run autogen.sh
BuildRequires: autoconf automake libtool git
# For docs
BuildRequires: chrpath
BuildRequires: gtk-doc
BuildRequires: gnome-common
BuildRequires: gobject-introspection
# Core requirements
BuildRequires: pkgconfig(ostree-1) >= 2015.1
BuildRequires: pkgconfig(libgsystem)
BuildRequires: pkgconfig(json-glib-1.0)
BuildRequires: pkgconfig(rpm)
BuildRequires: pkgconfig(libarchive)
BuildRequires: libcap-devel
BuildRequires: libattr-devel

# We currently interact directly with librepo
BuildRequires: pkgconfig(librepo)

# We're using RPATH to pick up our bundled version
%global __requires_exclude ^libhif[.]so[.].*$

%if %{with bundled_libhif}
BuildRequires: cmake
BuildRequires: pkgconfig(expat)
BuildRequires: pkgconfig(check)
BuildRequires: python-devel
BuildRequires: python-sphinx
%if (0%{?rhel} != 0 && 0%{?rhel} <= 7)
BuildRequires: libsolv-devel
%else
BuildRequires: pkgconfig(libsolv)
%endif
%else
BuildRequires: pkgconfig(libhif)
%endif

%description
This tool binds together the world of RPM packages with the OSTree
model of bootable filesystem trees.  It provides commands usable both
on client systems as well as server-side composes.

%package devel
Summary: Development headers for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description devel
The %{name}-devel package includes the header files for the %{name} library.

%prep
%autosetup -Sgit -n %{name}-%{version}
%if %{with bundled_libhif}
tar xf %{SOURCE1}
%endif

%build
%if %{with bundled_libhif}
(cd libhif
 cmake \
     -DCMAKE_INSTALL_PREFIX:PATH=%{_libexecdir}/rpm-ostree \
     -DINCLUDE_INSTALL_DIR:PATH=%{_libexecdir}/rpm-ostree/include \
     -DLIB_INSTALL_DIR:PATH=%{_libexecdir}/rpm-ostree \
     -DSYSCONF_INSTALL_DIR:PATH=%{_libexecdir}/rpm-ostree/etc \
     -DSHARE_INSTALL_PREFIX:PATH=%{_libexecdir}/rpm-ostree/share \
     -DLIB_SUFFIX=64 \
     -DBUILD_SHARED_LIBS:BOOL=ON .
 make %{?_smp_mflags}
 cat > libhif/libhif.pc<<EOF
Name: libhif
Description: Simple package manager interface and librepo
Version: 
Requires: glib-2.0, gobject-2.0, librepo, rpm
Libs: -L$(pwd)/libhif -lhif
Cflags: -I$(pwd) -I$(pwd)/libhif
EOF
)
export PKG_CONFIG_PATH=$(pwd)/libhif/libhif${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}
export LD_LIBRARY_PATH=$(pwd)/libhif/libhif${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
%endif
env NOCONFIGURE=1 ./autogen.sh
%configure --disable-silent-rules --enable-gtk-doc LDFLAGS='-Wl,-rpath=%{_libdir}/rpm-ostree'
make %{?_smp_mflags}

%install
%if %{with bundled_libhif}
(cd libhif
 make install DESTDIR=$RPM_BUILD_ROOT
 for path in %{_libdir}/python2.7 %{_libexecdir}/rpm-ostree/include %{_libexecdir}/rpm-ostree/pkg-config \
	     %{_libexecdir}/rpm-ostree/share/man; do \
     rm $RPM_BUILD_ROOT/${path} -rf; \
 done
 install -d $RPM_BUILD_ROOT/%{_libdir}/rpm-ostree
 # Cherry pick the shared library...
 mv $RPM_BUILD_ROOT/%{_libexecdir}/rpm-ostree/lib*/libhif*.so.* $RPM_BUILD_ROOT/%{_libdir}/rpm-ostree
 # and nuke everything else.
 rm $RPM_BUILD_ROOT/%{_libexecdir}/rpm-ostree -rf
)
%endif
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p -c"
find $RPM_BUILD_ROOT -name '*.la' -delete

# 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
#!/usr/bin/python
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
python autofiles.py > files \
  '%{_bindir}/*' \
  '%{_libdir}/%{name}' \
  '%{_libdir}/*.so.*' \
  '%{_mandir}/man*/*' \
  '%{_libdir}/girepository-1.0/*.typelib' \
  '%{_sysconfdir}/dbus-1/system.d/*' \
  '%{_prefix}/lib/systemd/system/*' \
  '%{_libexecdir}/rpm-ostree*' \
  '%{_datadir}/dbus-1/system-services'
python autofiles.py > files.devel \
  '%{_libdir}/lib*.so' \
  '%{_includedir}/*' \
  '%{_libdir}/pkgconfig/*' \
  '%{_datadir}/gtk-doc/html/*' \
  '%{_datadir}/gir-1.0/*-1.0.gir'

%files -f files
%doc COPYING README.md

%files devel -f files.devel

%changelog
* Tue Jun 14 2016 Colin Walters <walters@redhat.com> - 2016.3-3.atomic
- New upstream version

* Tue Apr 19 2016 Colin Walters <walters@redhat.com> - 2016.1-2.atomic
- New upstream version

* Tue Jan 12 2016 Colin Walters <walters@redhat.com> - 2015.11-2.atomic
- New upstream version
  Resolves: #1291841
  Resolves: #1274070

* Tue Oct 06 2015 Colin Walters <walters@redhat.com> - 2015.9-2.atomic
- New upstream version

* Fri Sep 25 2015 Colin Walters <walters@redhat.com> - 2015.5-3.atomic
- Rebuild

* Mon May 18 2015 Colin Walters <walters@redhat.com> - 2015.5-2.atomic
- Rebuild against latest libhif

* Fri May 15 2015 Colin Walters <walters@redhat.com> - 2015.5-1.atomic
- Rebase to Fedora rawhide

* Wed May 13 2015 Colin Walters <walters@redhat.com> - 2015.3-4.atomic
- Drop /usr/bin/atomic like we did for -client; this fixes installing
  with the new atomic package.

* Fri Apr 17 2015 Colin Walters <walters@redhat.com> - 2015.3-3.atomic
- Backport client side GPG verification status patches

* Fri Jan 23 2015 Colin Walters <walters@redhat.com> - 2015.3-2.atomic
- New upstream release

* Fri Jan 09 2015 Colin Walters <walters@redhat.com> - 2015.2-2.atomic
- New upstream release

* Fri Dec 19 2014 Colin Walters <walters@redhat.com> - 2014.114-2.atomic
- Rebuild for 7.1

* Fri Dec 05 2014 Colin Walters <walters@redhat.com> - 2014.114-1.atomic
- New upstream release

* Thu Nov 20 2014 Colin Walters <walters@redhat.com> - 2014.111-2.atomic
- New upstream release

* Fri Oct 24 2014 Colin Walters <walters@redhat.com> - 2014.109-1.atomic
- New upstream release

* Thu Oct 16 2014 Colin Walters <walters@redhat.com>
- New upstream version

* Tue Oct 07 2014 Colin Walters <walters@redhat.com> - 2014.107-2.atomic
- New upstream version

* Mon Sep 29 2014 Colin Walters <walters@redhat.com> - 2014.106-4.atomic
- rebuilt

* Mon Sep 29 2014 Colin Walters <walters@redhat.com> - 2014.106-3.atomic
- rebuilt

* Tue Sep 09 2014 Colin Walters <walters@redhat.com> - 2014.106-2.atomic
- New upstream release
- BR/R OSTree 2014.6

* Fri Aug 08 2014 Colin Walters <walters@redhat.com> - 2014.105-2.atomic
- New upstream release

* Mon Jul 14 2014 Colin Walters <walters@redhat.com>
- New upstream version

* Fri May 23 2014 Colin Walters <walters@redhat.com>
- Previous autobuilder code is split off into rpm-ostree-toolbox

* Sat Mar 22 2014 Colin Walters <walters@verbum.org> - 2014.6.3.g5707fa7-1
- New git snapshot, add rpm-ostree-sign to file list

* Sat Mar 22 2014 Colin Walters <walters@verbum.org> - 2014.6-1
- New upstream version

* Fri Mar 07 2014 Colin Walters <walters@verbum.org> - 2014.5-1
- Initial package