Blob Blame History Raw
%global debug_package %{nil}
%if 0%{?fedora} <= 22 || (0%{?rhel} != 0 && 0%{?rhel} <= 7)
%bcond_with python3
%global pypkg python
%global pysitelib %{python_sitelib}
%global __python %{__python}
%else
%bcond_without python3
%global pypkg python3
%global pysitelib %{python3_sitelib}
%global __python %{__python3}
%endif

%global commit ce09e40922c3f35877d381612280195e445d41c7
%global shortcommit %(c=%{commit}; echo ${c:0:7})

Name: atomic
Version: 1.10.5
Release: 2.git%{shortcommit}%{?dist}
Summary: Tool for managing ProjectAtomic systems and containers
License: LGPLv2+
URL: https://github.com/projectatomic/atomic
%if 0%{?fedora}
ExclusiveArch: %{go_arches}
%else
ExclusiveArch: x86_64
%endif
Source0: https://github.com/projectatomic/%{name}/archive/%{commit}.tar.gz

BuildRequires: %{pypkg}-devel
BuildRequires: %{pypkg}-requests >= 2.4.3
BuildRequires: %{pypkg}-setuptools
BuildRequires: %{pypkg}-tools
BuildRequires: policycoreutils-%{pypkg}
BuildRequires: go-md2man
%if 0%{?fedora}
BuildRequires: go-srpm-macros
BuildRequires: compiler(go-compiler)
%else
BuildRequires: golang >= 1.4.2
%endif
BuildRequires: %{pypkg}-dbus
BuildRequires: %{pypkg}-docker-py
BuildRequires: rpm-%{pypkg}
%if (0%{?rhel} != 0 && 0%{?rhel} <= 7)
BuildRequires: pygobject3-base
%else
BuildRequires: %{pypkg}-gobject-base
%endif
BuildRequires: ostree-devel
%if %{with python3}
BuildRequires: python3-PyYAML
%else
BuildRequires: PyYAML
%endif

Requires: dbus
Requires: skopeo >= 0.1.13
Requires: runc
Requires: docker
Requires: polkit
Requires: setup
Requires: rpm-%{pypkg}
# https://github.com/projectatomic/atomic/pull/180
Requires: %{pypkg}-setuptools
Requires: %{pypkg}-dbus
Requires: %{pypkg}-requests >= 2.4.3
Requires: %{pypkg}-docker-py >= 1.7.2
Requires: %{pypkg}-websocket-client >= 0.11.0
Requires: %{pypkg}-six >= 1.3.0
%if (0%{?rhel} != 0 && 0%{?rhel} <= 7)
Requires: pygobject3-base
%else
Requires: %{pypkg}-gobject-base
Requires: ostree
%endif
%if %{with python3}
Requires: python3-PyYAML
%else
Requires: PyYAML
%endif


%description
The goal of Atomic is to provide a high level, coherent entrypoint to the
system, and fill in gaps.

For Docker, atomic can make it easier to interact with special kinds of
containers, such as super-privileged debugging tools and the like.

The atomic host subcommand wraps rpm-ostree, currently just providing a
friendlier name, but in the future Atomic may provide more unified
management.

%prep
%setup -qn %{name}-%{commit}
if [ %{pypkg} == 'python3' ]; then
sed -i 's/input = raw_input/pass/' Atomic/util.py
fi

%build
make PYTHON=%{__python} PYLINT=true all
make PYTHON=%{__python} docs

%install
make PYTHON=%{__python}  install-only DESTDIR=%{buildroot}

# Better support for doing continuous delivery by supporting optional
# components.  The canonical copy of this is in `rpm-ostree.spec`.
cat > autofiles.py <<EOF
#!%{pypkg}
import os,sys,glob
os.chdir(os.environ['RPM_BUILD_ROOT'])
for line in sys.argv[1:]:
    if line == '':
        break
    assert line[0] == '/'
    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
%{pypkg} autofiles.py > files \
  '%{pysitelib}/Atomic' \
  '%{pysitelib}/%{name}*.egg-info' \
  '%{_sysconfdir}/%{name}.conf' \
  '%{_sysconfdir}/%{name}.d' \
  '%{_sysconfdir}/profile.d/%{name}.sh' \
  '%{_bindir}/%{name}' \
  '%{_datadir}/%{name}' \
  '%{_libexecdir}/%{name}/' \
  '%{_datadir}/bash-completion/completions/%{name}' \
  '%{_datadir}/dbus-1/system-services/org.%{name}.service' \
  '%{_datadir}/polkit-1/actions/org.%{name}.policy' \
  '%{_mandir}/man1/%{name}*'

%check
[ ! -w /run/docker.sock ] || make PYTHON=%{__python} test

%files -f files
%doc COPYING README.md
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.%{name}.conf

%changelog
* Tue Jun 28 2016 Antonio Murdaca <runcom@fedoraproject.org> - 1.10.5-2.gitce09e40
- build atomic 1.10.5

* Thu Jan 07 2016 Colin Walters <walters@redhat.com> - 1.8-3.gitcc5997a
- Depend on python2/3 RPM bindings as appropriate

* Mon Jan 04 2016 Lokesh Mandvekar <lsm5@fedoraproject.org> - 1.8-2.gitcc5997a
- built atomic commit#cc5997a

* Mon Nov 30 2015 Lokesh Mandvekar <lsm5@fedoraproject.org> - 1.7-3.git3be76b5
- built atomic commit#3be76b5

* Mon Nov 23 2015 Lokesh Mandvekar <lsm5@fedoraproject.org> - 1.7-2.gitd378de0
- built atomic commit#d378de0

* Thu Nov 12 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6-6.git09ac479
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Wed Nov 11 2015 Lokesh Mandvekar <lsm5@fedoraproject.org> - 1.6-5.git09ac479
- Resolves: rhbz#1278499 - python(2/3)-dbus based on fedora version
- python(2/3)-dbus at build and runtime
- built atomic commit#09ac479

* Wed Nov 11 2015 Robert Kuska <rkuska@redhat.com> - 1.6-4.git8a66e29
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Tue Nov 10 2015 Lokesh Mandvekar <lsm5@fedoraproject.org> - 1.6-3.git8a66e29
- built atomic commit#8a66e29

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6-2.git9d724aa
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Mon Sep 14 2015 Lokesh Mandvekar <lsm5@fedoraproject.org> - 1.4-1.git9d724aa
- built master commit#9d724aa
- scan subcommand added
- br: python-requests >= 2.4.3

* Mon Aug 03 2015 Lokesh Mandvekar <lsm5@fedoraproject.org> - 1.1-1.git5f631c8
- bump to 1.1
- buildrequires policycoreutils-python(3)

* Fri Jul 24 2015 Lokesh Mandvekar <lsm5@fedoraproject.org> - 1.0-1.git52d695c
- version 1.0 as per setup.py
- use latest upstream master commit
- run test only if docker.sock writable

* Tue Jul 14 2015 Miro HronĨok <mhroncok@redhat.com> - 0-0.12.gitfea1b99
- update to latest upstream master
- add new %%files and require dbus, polkit and setup to have the directories
- switch to Python 3
- disable build for arm (missing docker)
- Resolves: rhbz#1241947

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.11.gite5734c4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Wed Apr 15 2015 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0-0.10.gite5734c4
- update to latest upstream master

* Tue Mar 03 2015 Colin Walters <walters@redhat.com> - 0-0.9.gita7ff4cb
- Match ExclusiveArch with docker (there is no docker on i686)

* Mon Mar 02 2015 Colin Walters <walters@redhat.com> - 0-0.8.gita7ff4cb
- Drop ExclusiveArch, we are just a wrapper for Docker, which in any
  case builds on other architectures now.

* Tue Feb 24 2015 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0-0.7.gita7ff4cb
- remove pylint for rhel/centos

* Tue Feb 24 2015 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0-0.6.gita7ff4cb
- runtime requirement: python-docker-py

* Tue Feb 24 2015 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0-0.5.gita7ff4cb
- build commit#a7ff4cb

* Fri Feb 20 2015 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0-0.4.gitf7f6fa8
- Resolves: rhbz#1194058 - approved version, ready for upload
- change license to LGPLv2+

* Thu Feb 19 2015 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0-0.3.gite4081c9
- manpage installation rules upstreamed

* Wed Feb 18 2015 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0-0.2.git6b82cb7
- install docs

* Wed Feb 18 2015 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0-0.1.git6b82cb7
- Initial package