<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 10/26/13, 10:25 AM, Jan Lieskovsky
      wrote:<br>
    </div>
    <blockquote
      cite="mid:2074697153.12156851.1382797505465.JavaMail.root@redhat.com"
      type="cite">
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 12px;"
        lang="x-unicode">
        <pre wrap="">This patch changes Source0 location in RHEL-6's / main SPEC
file to use the remote one instead of a local one.

Also changes the main Makefile, so when building SRPM the
remote tarball would be retrieved first (and [S]RPM
content built from it).

Basic regression &amp;&amp; sanity testing:
- all of make tarball, srpm, rpm and
- basic RHEL-6 make rules have passed.

Please review.

Thank you &amp;&amp; Regards, Jan.
--
Jan iankko Lieskovsky / Red Hat Security Technologies Team

P.S.: scap-security-guide-0.1-15.rc5.tar.gz has been uploaded
      to upstream location:
        <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://repos.ssgproject.org/sources/">http://repos.ssgproject.org/sources/</a>

P.S.#2: Remember when making changes in the future, the new workflow
        to be as follows:
        * make tarball
        * upload the new tarball to <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://repos.ssgproject.org/sources/">http://repos.ssgproject.org/sources/</a>
        * then make srpm / rpm etc.
</pre>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"><legend
          class="mimeAttachmentHeaderName">0001-RHEL6-0.1-15.rc5.patch</legend></fieldset>
      <br>
      <div class="moz-text-plain" wrap="true" graphical-quote="true"
        style="font-family: -moz-fixed; font-size: 12px;"
        lang="x-western">
        <pre wrap="">From e3c6dfd3a5d0aeb2854f1441e9f98bdd6f1fbf5d Mon Sep 17 00:00:00 2001
From: Jan Lieskovsky <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:jlieskov@redhat.com">&lt;jlieskov@redhat.com&gt;</a>
Date: Sat, 26 Oct 2013 16:15:39 +0200
Subject: [PATCH] [RHEL6] 0.1-15.rc5: - Point the spec's source to proper
 remote tarball location - Modify the main Makefile to use remote tarball when
 building RHEL6's SRPM

Signed-off-by: Jan Lieskovsky <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:jlieskov@redhat.com">&lt;jlieskov@redhat.com&gt;</a>
---
 Makefile                 | 16 +++++++++++++---
 scap-security-guide.spec |  8 ++++++--
 2 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 8a067bc..1a1c388 100644
--- a/Makefile
+++ b/Makefile
@@ -109,8 +109,18 @@ zipfile:
         mv $(PKG)-$(RELEASE).zip $(RPM_TOPDIR)<i class="moz-txt-slash"><span class="moz-txt-tag">/</span>ZIP<span class="moz-txt-tag">/</span></i>
 
 srpm: $(RPM_DEPS)
-        @echo "Building $(PKGNAME) SRPM..."
+        # Obtain the source from RedHat's spec file
+        $(eval SOURCE := $(shell sed -ne 's/Source0:\t\(.*\)/\1/p' $(RPM_SPEC)))
+        # Substitute %{name}, %{version}, and %{redhatssgrelease} with their actual values
+        $(eval SOURCE := $(shell echo $(SOURCE) | sed -ne "s/%{name}/$(PKGNAME)/p"))
+        $(eval SOURCE := $(shell echo $(SOURCE) | sed -ne "s/%{version}/$(VERSION)/p"))
+        $(eval SOURCE := $(shell echo $(SOURCE) | sed -ne "s/%{redhatssgrelease}/$(REDHAT_SSG_RELEASE)/p"))
+        # Download the tarball
+        @echo "Downloading the $(SOURCE) tarball..."
+        @wget -O $(TARBALL) $(SOURCE)
+        @echo "Copying the SPEC file to proper location..."
         cat $(RPM_SPEC) &gt; $(RPM_TOPDIR)<i class="moz-txt-slash"><span class="moz-txt-tag">/</span>SPECS<span class="moz-txt-tag">/</span></i>$(notdir $(RPM_SPEC))
+        @echo "Building $(PKGNAME) SRPM..."
         cd $(RPM_TOPDIR) &amp;&amp; rpmbuild $(RPMBUILD_ARGS) --target=$(ARCH) -bs SPECS/$(notdir $(RPM_SPEC)) --nodeps
 
 fedora-srpm: $(FEDORA_RPM_DEPS)
@@ -123,9 +133,9 @@ fedora-srpm: $(FEDORA_RPM_DEPS)
         $(eval FEDORA_SOURCE := $(shell echo $(FEDORA_SOURCE) | sed -ne "s/%{version}/$(FEDORA_VERSION)/p"))
         $(eval FEDORA_SOURCE := $(shell echo $(FEDORA_SOURCE) | sed -ne "s/%{fedorassgrelease}/$(FEDORA_SSG_RELEASE)/p"))
         # Download the tarball
-        @echo "Downloading the $(FEDORA_TARBALL) tarball..."
+        @echo "Downloading the $(FEDORA_SOURCE) tarball..."
         @wget -O $(FEDORA_TARBALL) $(FEDORA_SOURCE)
-        @echo "Copying $(FEDORA_SPEC) file to proper location..."
+        @echo "Copying the SPEC file to proper location..."
         cat $(FEDORA_SPEC) &gt; $(RPM_TOPDIR)<i class="moz-txt-slash"><span class="moz-txt-tag">/</span>SPECS<span class="moz-txt-tag">/</span></i>$(notdir $(FEDORA_SPEC))
         @echo "Building Fedora source $(PKGNAME) RPM package..."
         cd $(RPM_TOPDIR) &amp;&amp; rpmbuild $(RPMBUILD_ARGS) --target=$(ARCH) -bs SPECS/$(notdir $(FEDORA_SPEC)) --nodeps
diff --git a/scap-security-guide.spec b/scap-security-guide.spec
index f9828fc..678031d 100644
--- a/scap-security-guide.spec
+++ b/scap-security-guide.spec
@@ -1,5 +1,5 @@
 
-%global                redhatssgrelease        15.rc4
+%global                redhatssgrelease        15.rc5
 
 Name:                scap-security-guide
 Version:        0.1
@@ -11,7 +11,7 @@ Group:                System Environment/Base
 License:        Public Domain
 URL:                <a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://fedorahosted.org/scap-security-guide/">https://fedorahosted.org/scap-security-guide/</a>
 
-Source0:        %{name}-%{version}-%{redhatssgrelease}.tar.gz
+Source0:        <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://repos.ssgproject.org/sources/%">http://repos.ssgproject.org/sources/%</a>{name}-%{version}-%{redhatssgrelease}.tar.gz
 
 BuildArch:        noarch
 
@@ -52,6 +52,10 @@ cp -a RHEL6/input/auxiliary/scap-security-guide.8 %{buildroot}%{_mandir}/en/man8
 %doc RHEL6/LICENSE RHEL6/output/rhel6-guide.html RHEL6/output/table-rhel6-cces.html RHEL6/output/table-rhel6-nistrefs-common.html RHEL6/output/table-rhel6-nistrefs.html RHEL6/output/table-rhel6-srgmap-flat.html RHEL6/output/table-rhel6-srgmap-flat.xhtml RHEL6/output/table-rhel6-srgmap.html RHEL6/output/table-rhel6-stig.html JBossEAP5/docs/JBossEAP5_Guide.html
 
 %changelog
+* Sat Oct 26 2013 Jan iankko Lieskovsky <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:jlieskov@redhat.com">&lt;jlieskov@redhat.com&gt;</a> 0.1-15.rc5
+- Point the spec's source to proper remote tarball location
+- Modify the main Makefile to use remote tarball when building RHEL6's SRPM
+
 * Sat Oct 26 2013 Jan iankko Lieskovsky <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:jlieskov@redhat.com">&lt;jlieskov@redhat.com&gt;</a> 0.1-15.rc4
 - Don't include the table html files two times
 - Remove makewhatis
<div class="moz-txt-sig">-- 
1.8.3.1

</div></pre>
      </div>
    </blockquote>
    <br>
    pushed<br>
<a class="moz-txt-link-freetext" href="https://git.fedorahosted.org/cgit/scap-security-guide.git/commit/?id=9f38a1626ce2ccbc56ff9fdf36eee88e58f6f805">https://git.fedorahosted.org/cgit/scap-security-guide.git/commit/?id=9f38a1626ce2ccbc56ff9fdf36eee88e58f6f805</a><br>
    <br>
  </body>
</html>