Bug 1458431 - [PATCH] Rework to use %setup again
Summary: [PATCH] Rework to use %setup again
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: atomic
Version: 27
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Brent Baude
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-06-02 20:32 UTC by Colin Walters
Modified: 2017-11-28 23:52 UTC (History)
7 users (show)

Fixed In Version: atomic-1.20.1-1.fc26 atomic-1.20.1-3.fc27
Clone Of:
Environment:
Last Closed: 2017-11-28 23:52:31 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
0001-Rework-to-use-setup-again.patch (3.37 KB, patch)
2017-06-02 20:32 UTC, Colin Walters
no flags Details | Diff

Description Colin Walters 2017-06-02 20:32:07 UTC
From 511c795841e162c269ed31435d73d713c8b0db73 Mon Sep 17 00:00:00 2001
From: Colin Walters <walters>
Date: Fri, 2 Jun 2017 16:12:01 -0400
Subject: [PATCH] Rework to use %setup again

We currently use [rpmdistro-gitoverlay](https://github.com/cgwalters/rpmdistro-gitoverlay)
for [FAHC](https://pagure.io/fedora-atomic-host-continuous) which
builds this package.

However, rdgo is [not aware of multi-source packages](https://github.com/cgwalters/rpmdistro-gitoverlay/issues/24)
and fixing it would be nontrivial.

This gets us back to a place where FAHC at least will ship `atomic`
from git, even if not `registries`.

Implementation wise, there were a lot of tricky things to debug here
because using `%setup` implies changing to the default `Source0` in various
steps.  So we have to explicitly "bounce out" with `cd ..`.
---
 atomic.spec | 37 ++++++++++++++++---------------------
 1 file changed, 16 insertions(+), 21 deletions(-)

diff --git a/atomic.spec b/atomic.spec
index a6a7b5f..098a678 100644
--- a/atomic.spec
+++ b/atomic.spec
@@ -121,28 +121,25 @@ BuildRequires: automake
 Utility that parses a global YAML registry file for container runtimes.
 
 %prep
-tar zxf %{SOURCE0}
+%setup -qn %{name}-%{commit}
+cd ..
 tar zxf %{SOURCE1}
-pushd atomic-%{commit}
-if [ %{pypkg} == 'python3' ]; then
-sed -i 's/input = raw_input/pass/' Atomic/util.py
-fi
-popd
 
+%build
+cd ..
 pushd registries-%{commit_atomic_registries}
 sh ./autogen.sh
 %configure
-
-%build
+%make_build
+popd
 pushd atomic-%{commit}
+if [ %{pypkg} == 'python3' ]; then
+    sed -i 's/input = raw_input/pass/' Atomic/util.py
+fi
 make PYTHON=%{__python} PYLINT=true all
 popd
 
-pushd registries-%{commit_atomic_registries}
-%make_build
-
 %install
-pushd atomic-%{commit}
 make PYTHON=%{__python}  install-only DESTDIR=%{buildroot}
 install -dp %{buildroot}%{_sharedstatedir}/containers/%{name}
 
@@ -163,7 +160,7 @@ for line in sys.argv[1:]:
     else:
         sys.stderr.write('{0} did not match any files\n'.format(line))
 EOF
-%{pypkg} autofiles.py > files \
+%{pypkg} autofiles.py > atomic.files \
   '%{pysitelib}/Atomic' \
   '%{pysitelib}/%{name}*.egg-info' \
   '%{_sysconfdir}/%{name}.conf' \
@@ -176,8 +173,8 @@ EOF
   '%{_datadir}/dbus-1/system-services/org.%{name}.service' \
   '%{_datadir}/polkit-1/actions/org.%{name}.policy' \
   '%{_mandir}/man1/%{name}*'
-popd
 
+cd ..
 pushd registries-%{commit_atomic_registries}
 %make_install
 install -d %{buildroot}%{_sysconfdir}/containers/
@@ -188,24 +185,22 @@ popd
 
 
 %check
-pushd atomic-%{commit}
 [ ! -w /run/docker.sock ] || make PYTHON=%{__python} test
-popd
 
 #define license tag if not already defined
 %{!?_licensedir:%global license %doc}
 
-%files -f atomic-%{commit}/files
-%license atomic-%{commit}/COPYING
-%doc atomic-%{commit}/README.md
+%files -f atomic.files
+%license COPYING
+%doc README.md
 %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
 %config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.%{name}.conf
 %dir %{_sharedstatedir}/containers
 %dir %{_sharedstatedir}/containers/%{name}
 
 %files registries
-%license registries-%{commit_atomic_registries}/COPYING 
-%doc registries-%{commit_atomic_registries}/README.md
+%license ../registries-%{commit_atomic_registries}/COPYING 
+%doc ../registries-%{commit_atomic_registries}/README.md
 %{_libexecdir}/registries
 %{_mandir}/man1/registries*
 %config(noreplace) %{_sysconfdir}/containers/registries.conf
-- 
2.9.4

Comment 1 Colin Walters 2017-06-02 20:32:53 UTC
Created attachment 1284514 [details]
0001-Rework-to-use-setup-again.patch

Comment 2 Brent Baude 2017-06-05 13:10:10 UTC
committed upstream in 59e142aa65133b92aaae07f11e77b65a1b900423.  Will build today.

Comment 3 Jan Kurik 2017-08-15 08:14:34 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle.
Changing version to '27'.

Comment 4 Fedora Update System 2017-11-07 17:57:09 UTC
atomic-1.20.1-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-8abafad976

Comment 5 Fedora Update System 2017-11-07 17:57:39 UTC
atomic-1.20.1-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-021f49279e

Comment 6 Fedora Update System 2017-11-07 19:16:14 UTC
atomic-1.20.1-1.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-021f49279e

Comment 7 Fedora Update System 2017-11-08 00:07:50 UTC
atomic-1.20.1-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-8abafad976

Comment 8 Fedora Update System 2017-11-15 20:17:33 UTC
atomic-1.20.1-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2017-11-21 20:40:56 UTC
atomic-1.20.1-3.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-f6a5dd1d5e

Comment 10 Fedora Update System 2017-11-22 21:39:39 UTC
atomic-1.20.1-3.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-f6a5dd1d5e

Comment 11 Fedora Update System 2017-11-28 23:52:31 UTC
atomic-1.20.1-3.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.