summaryrefslogtreecommitdiff
path: root/contrib/spec
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/spec')
-rw-r--r--contrib/spec/podman.spec.in33
-rw-r--r--contrib/spec/python-podman.spec.in104
2 files changed, 107 insertions, 30 deletions
diff --git a/contrib/spec/podman.spec.in b/contrib/spec/podman.spec.in
index e40cf47a7..1f1274a4d 100644
--- a/contrib/spec/podman.spec.in
+++ b/contrib/spec/podman.spec.in
@@ -205,26 +205,10 @@ Requires: python3-varlink
Requires: python3-dateutil
Provides: python3-%{name} = %{version}-%{release}
-Summary: Python 3 bindings for %{name}
+Summary: Python 3 bindings and client for %{name}
%description -n python3-%{name}
-This package contains Python 3 bindings for %{name}.
-
-%package -n python3-py%{name}
-BuildArch: noarch
-BuildRequires: python3-devel
-BuildRequires: python3-setuptools
-BuildRequires: python3-varlink
-
-Requires: python3-setuptools
-Requires: python3-varlink
-Requires: python3-dateutil
-
-Provides: python3-py%{name} = %{version}-%{release}
-Summary: Python 3 tool for %{name}
-
-%description -n python3-py%{name}
-This package contains Python 3 tool for %{name}.
+This package contains Python 3 bindings and client for %{name}.
%endif # varlink
%if 0%{?with_devel}
@@ -403,18 +387,6 @@ GOPATH=$GOPATH go generate ./cmd/podman/varlink/...
GOPATH=$GOPATH BUILDTAGS=$BUILDTAGS %gobuild -o bin/%{name} %{import_path}/cmd/%{name}
BUILDTAGS=$BUILDTAGS make binaries docs
-%if %{with varlink}
-#untar contents for python-podman
-pushd contrib/python/podman/dist
-tar zxf %{name}*.tar.gz
-popd
-
-#untar contents for python-pypodman
-pushd contrib/python/pypodman/dist
-tar zxf %{name}*.tar.gz
-popd
-%endif #varlink
-
%install
install -dp %{buildroot}%{_unitdir}
%make_install PREFIX=%{buildroot}%{_prefix} install install.completions
@@ -502,6 +474,7 @@ export GOPATH=%{buildroot}/%{gopath}:$(pwd)/vendor:%{gopath}
%license LICENSE
%doc README.md CONTRIBUTING.md install.md code-of-conduct.md transfer.md
%{_bindir}/%{name}
+%{_bindir}/py%{name}
%{_mandir}/man1/*.1*
%{_mandir}/man5/*.5*
%{_datadir}/bash-completion/completions/*
diff --git a/contrib/spec/python-podman.spec.in b/contrib/spec/python-podman.spec.in
new file mode 100644
index 000000000..d7956d110
--- /dev/null
+++ b/contrib/spec/python-podman.spec.in
@@ -0,0 +1,104 @@
+# If any of the following macros should be set otherwise,
+# you can wrap any of them with the following conditions:
+# - %%if 0%%{?centos} == 7
+# - %%if 0%%{?rhel} == 7
+# - %%if 0%%{?fedora} == 23
+# Or just test for particular distribution:
+# - %%if 0%%{?centos}
+# - %%if 0%%{?rhel}
+# - %%if 0%%{?fedora}
+#
+# Be aware, on centos, both %%rhel and %%centos are set. If you want to test
+# rhel specific macros, you can use %%if 0%%{?rhel} && 0%%{?centos} == 0 condition.
+# (Don't forget to replace double percentage symbol with single one in order to apply a condition)
+
+%undefine _enable_debug_packages
+
+%global provider github
+%global provider_tld com
+%global project projectatomic
+%global repo libpod
+# https://github.com/projectatomic/libpod
+%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
+%global import_path %{provider_prefix}
+%global commit #COMMIT#
+%global shortcommit %(c=%{commit}; echo ${c:0:7})
+
+Name: python3-podman
+Version: 0.7.3
+Release: #COMMITDATE#.git%{shortcommit}%{?dist}
+Summary: Python 3 bindings and client for podman
+License: ASL 2.0
+URL: https://%{provider_prefix}
+Source0: https://api.%{provider}.%{provider_tld}/repos/%{project}/%{repo}/tarball/%{commit}
+
+BuildArch: noarch
+BuildRequires: git
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-varlink
+
+Requires: python3-humanize
+Requires: python3-pytoml
+Requires: python3-setuptools
+Requires: python3-varlink
+Requires: podman
+
+%if 0%{?fedora}
+# 2018-07-20 RHEL8 doesn't have varlink RPM yet
+Requires: python3-varlink
+%endif
+
+Provides: %{name} = %{version}-%{release}
+
+%description
+%{summary}
+python3-podman provides python bindings and client for communicating
+with podman as a service.
+
+%prep
+%autosetup -Sgit -n %{project}-%{repo}-%{shortcommit}
+
+%build
+export PODMAN_VERSION=%{version}
+
+pushd contrib/python/podman
+%{__python3} setup.py build
+popd
+
+pushd contrib/python/pypodman
+%{__python3} setup.py build
+popd
+
+%install
+export PODMAN_VERSION=%{version}
+
+install -d -m 755 %{buildroot}%{_mandir}/man1
+
+pushd contrib/python/pypodman
+install -m 644 -t %{buildroot}%{_mandir}/man1 docs/man1/*.1
+%{__python3} setup.py install --skip-build --root %{buildroot}
+popd
+
+pushd contrib/python/podman
+%{__python3} setup.py install --skip-build --root %{buildroot}
+popd
+
+
+%check
+#define license tag if not already defined
+%{!?_licensedir:%global license %doc}
+
+%files
+%license LICENSE
+%doc README.md CONTRIBUTING.md install.md code-of-conduct.md transfer.md
+%{_bindir}/pypodman
+%{_mandir}/man1/pypodman.1*
+%dir %{python3_sitelib}/podman
+%dir %{python3_sitelib}/pypodman
+%{python3_sitelib}/podman/*
+%{python3_sitelib}/pypodman/*
+%{python3_sitelib}/podman-%{version}*.egg-info
+%{python3_sitelib}/pypodman-%{version}*.egg-info
+
+%changelog