<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p><br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 11/15/16 1:28 PM, Peter Schober
      wrote:<br>
    </div>
    <blockquote cite="mid:20161115182817.GQ25662@aco.net" type="cite">
      <pre wrap="">* Cantor, Scott <a class="moz-txt-link-rfc2396E" href="mailto:cantor.2@osu.edu"><cantor.2@osu.edu></a> [2016-11-15 19:09]:
</pre>
      <blockquote type="cite">
        <pre wrap="">Once they're back if they come back I can rsync them over, but I
don't know how to host a yum repo so I don't know what other files
are needed. If somebody wants to set one up and give me a set of
files to rsync into place I'm also willing to do that.
</pre>
      </blockquote>
      <pre wrap="">
>From a quick web search this seems easy enough to do (after `yum
install createrepo`) but I'll be at a conference until the end of the
week.
Maybe someone with actual local production use and experience of
running a yum repo can step up and provide a quick start.</pre>
    </blockquote>
    <br>
    <br>
    I have some minimal experience running a local yum repo for some
    custom packages here.  I was going to send a link to my GU wiki page
    of notes, but apparently it's not publicly accessible right now, so:<br>
    <br>
    I don't really do anything more than what Peter said.  It's pretty
    much just running createrepo on the top level directory with the
    RPMs in it.  Essentially the details are:<br>
    <br>
    1) Create (or sync, etc) a directory structure. My layout assumes a
    separate repo for each distro and version, and separate dirs for
    SRPMS vs i686 vs x86_64, etc.  Maybe there are other ways, I don't
    know.  I have only RHEL, but could be others distros and different
    versions:<br>
    <br>
    <meta http-equiv="content-type" content="text/html;
      charset=windows-1252">
    <div class="line number3 index2 alt2"><code class="java plain">/var/www/yum/</code></div>
    <div class="line number4 index3 alt1"><code class="java plain">/var/www/yum/SSG</code></div>
    <div class="line number5 index4 alt2"><code class="java plain">/var/www/yum/SSG/RHEL</code></div>
    <div class="line number6 index5 alt1"><code class="java plain">/var/www/yum/SSG/RHEL/</code><code
        class="java value">5</code></div>
    <div class="line number7 index6 alt2"><code class="java plain">/var/www/yum/SSG/RHEL/</code><code
        class="java value">5</code><code class="java plain">/noarch</code></div>
    <div class="line number8 index7 alt1"><code class="java plain">/var/www/yum/SSG/RHEL/</code><code
        class="java value">5</code><code class="java plain">/repodata</code></div>
    <div class="line number9 index8 alt2"><code class="java plain">/var/www/yum/SSG/RHEL/</code><code
        class="java value">5</code><code class="java plain">/SRPMS</code></div>
    <div class="line number10 index9 alt1"><code class="java plain">/var/www/yum/SSG/RHEL/</code><code
        class="java value">5</code><code class="java plain">/x86_64</code></div>
    <...snip other versions...><br>
    <blockquote cite="mid:20161115182817.GQ25662@aco.net" type="cite">
    </blockquote>
    <br>
    2) Copy the RPMs into the appropriate directories.   For my custom
    ones, I have a simple script that copies them up from my build
    machine like this, with the version, etc already interpolated into
    YUM_REPO_PATH.  The important bits are:<br>
    <br>
    <tt>scp *.src.rpm  ${YUM_REPO_HOST}:${YUM_REPO_PATH}/SRPMS</tt><tt><br>
    </tt><tt><br>
    </tt><tt>for type in x86_64 noarch; do</tt><tt><br>
    </tt><tt>  scp *.${type}.rpm 
      ${YUM_REPO_HOST}:${YUM_REPO_PATH}/${type}</tt><tt><br>
    </tt><tt>done</tt><br>
    <br>
    <br>
    3) Then you just run createrepo to reindex the RPMs, which is the
    stuff that it writes to each repo's /repodata.  The entire script I
    use for this is:<br>
    <br>
    <tt>#!/bin/bash</tt><tt><br>
    </tt><tt><br>
    </tt><tt>destdir="/var/www/yum"</tt><tt><br>
    </tt><tt><br>
      # For SELinux<br>
    </tt><tt>chcon -R --type httpd_user_content_t $destdir</tt><tt><br>
    </tt><tt><br>
    </tt><tt>for group in SSG</tt><tt><br>
    </tt><tt>do</tt><tt><br>
    </tt><tt>    for version in 5 6 7</tt><tt><br>
    </tt><tt>    do</tt><tt><br>
    </tt><tt>        pushd ${destdir}/${group}/RHEL/${version}
      >/dev/null 2>&1</tt><tt><br>
    </tt><tt>        /usr/bin/createrepo .</tt><tt><br>
    </tt><tt>        popd >/dev/null 2>&1</tt><tt><br>
    </tt><tt>    done</tt><tt><br>
    </tt><tt>done</tt><tt><br>
      <br>
      <br>
      *****<br>
      <br>
    </tt>Actually, looking at it now, I think the pushd/popd aren't
    really necessary, since I think with createrepo you can just use an
    absolute path argument.<br>
    <tt><br>
      <br>
      <br>
      <br>
    </tt>4) In Apache, I have indexes turned on.  I think that's
    necessary for some reason, but not totally sure:<br>
    <br>
    <meta http-equiv="content-type" content="text/html;
      charset=windows-1252">
    <tt>Alias /yum /var/www/yum</tt><tt><br>
    </tt><tt><Location /yum></tt><tt><br>
    </tt><tt>  Options +Indexes</tt><tt><br>
    </tt><tt></Location></tt><tt><br>
    </tt><br>
    <br>
    That's pretty much it.  Then the repo is available with a standard
    yum.repos.d entry, like:<br>
    <br>
    <tt>[GU-OIS-SSG]</tt><tt><br>
    </tt><tt>name=GU Custom Packages from OIS-SSG group</tt><tt><br>
    </tt><tt>baseurl=<a class="moz-txt-link-freetext" href="https://www.example.edu/yum/SSG/RHEL/5">https://www.example.edu/yum/SSG/RHEL/5</a></tt><tt><br>
    </tt><tt>enabled=1</tt><tt><br>
    </tt><tt>gpgcheck=1</tt><tt><br>
    </tt><tt>gpgkey=<a class="moz-txt-link-freetext" href="https://www.example.edu/yum/SSG/RPM-GPG-KEY-GU-OIS-SSG">https://www.example.edu/yum/SSG/RPM-GPG-KEY-GU-OIS-SSG</a></tt><br>
    <br>
    <br>
    Not sure how one handles the signing key for this case, where you
    are rsyncing other content. Is the RPM signing key ours (Shibboleth
    projects's) or the build service or what?<br>
    <br>
    Anyways, that's the mechanics I use.<br>
    <br>
    --Brent<br>
    <br>
  </body>
</html>