<?xml version="1.0"?>
<!-- name="generator" content="blosxom/2.0" -->
<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">

<rss version="0.91">
  <channel>
    <title>Tony's Diary  05 2008</title>
    <link>http://bakeyournoodle.com/~tony/diary</link>
    <description>Tony's Diary</description>
    <language>en</language>

  <item>
    <title>Experiments in Fedora 0x01</title>
    <pubDate>Tue, 27 May 2008 15:23:00 </pubDate>
    <link>http://bakeyournoodle.com/~tony/diary/2008/05/27#20080527</link>
    <description>&lt;p&gt;Running your own local yum repo isn't all that hard as it turns out.
&lt;ol&gt;
&lt;li&gt;  Allow building as a non-root user.
&lt;ol&gt;
&lt;li&gt;Make some important directories.  I only care about powerpc packages, so I
make the ppc and ppc64 directories, clearly if you use another architecture you
should change that &lt;tt&gt;;P&lt;/tt&gt;
&lt;blockquote&gt;
&lt;pre&gt;
mkdir -p /home/user/rpmbuild/fedora/{BUILD,SOURCES,SPECS,SRPMS,tmp,RPMS/{noarch,ppc,ppc64}}
&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;  Now create a &lt;tt&gt;~/.rpmmacros&lt;/tt&gt; file.  To use those directories you
just created.
&lt;blockquote&gt;
&lt;pre&gt;
%_topdir        /home/user/rpmbuild/fedora/
%_builddir      %{_topdir}/BUILD
%_rpmdir        %{_topdir}/RPMS
%_specdir       %{_topdir}/SPECS
%_srcrpmdir     %{_topdir}/SRPMS
%_sourcedir     %{_topdir}/SOURCES/%{name}-%{version}-%{release}
%_tmppath       %{_topdir}/tmp
%_buildroot     %{_topdir}/%{_tmppath}/%{name}-%{version}-root
%packager       user@example.com
&lt;/pre&gt;
&lt;/blockquote&gt;

With this there you can &lt;tt&gt;rpm -i src.rpm&lt;/tt&gt; files, and run
&lt;tt&gt;rpmbuild&lt;/tt&gt; commands to generate RPMS (binary and source).  I intend to
have a bunch of packages on the go at any time so I use the
&lt;tt&gt;%_sourcedir&lt;/tt&gt; macro, have one directory per
&lt;tt&gt;%{name}-%{version}-%{release}&lt;/tt&gt;.  You could just as easily do:
&lt;blockquote&gt;
&lt;pre&gt;
%_sourcedir     %{_topdir}/SOURCES
&lt;/pre&gt;
&lt;/blockquote&gt;
It's easiest to decide upfront as changing will be a little cumbersome.
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt; Make some RPMS.  True this can be a little challenging at times but
fortunately the packages I'm interested presented little challenge ...
&lt;tt&gt;woot!&lt;/tt&gt;&lt;/li&gt;
&lt;li&gt; Fedora has a util for rummaging through RPMs and makeing the repodata
files.  It's called &lt;tt&gt;createrepo&lt;/tt&gt;.  So install that: &lt;tt&gt;yum install -y createrepo&lt;/tt&gt;
&lt;li&gt; I then moved all my locally built RPMS into a separate directory structure.
I &lt;em&gt;tried&lt;/em&gt; to make this look at least a little like &lt;em&gt;real&lt;/em&gt; Fedora repos.
Again I only care about powerpc, hence setting &lt;tt&gt;$basearch&lt;/tt&gt;.  You don't
need to &lt;tt&gt;:)&lt;/tt&gt;.  In case it isn't obvious I ran this script from the root
directory of the repo (in my case &lt;tt&gt;/opt/yum&lt;/tt&gt;).
&lt;blockquote&gt;
&lt;pre&gt;
#!/bin/sh

basearch=ppc
releasever=9
rpmbuild_base=/home/user/rpmbuild/fedora

for i in local local-debuginfo local-source ; do
        d=&quot;$i/$releasever/$basearch&quot;
        [ ! -d $d ] &amp;&amp; mkdir -p $d
done

find $rpmbuild_base/RPMS/  -type f \
	-exec /bin/cp {} ./local/$releasever/$basearch/. \;
find $rpmbuild_base/SRPMS/ -type f \
	-exec /bin/cp {} ./local-source/$releasever/$basearch/. \;
find ./local/$releasever/$basearch/. -type f -name '*debug*' \
	-exec /bin/mv {} ./local-debuginfo/$releasever/$basearch/. \;

for i in local local-debuginfo local-source ; do
        cd &quot;$i/$releasever/$basearch&quot;
        /usr/bin/createrepo .
        cd -
done
&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;  Setup apache to serve up that directory.  This machine shouldn't need any other web services, so I just make &lt;tt&gt;/&lt;/tt&gt; point at my &lt;tt&gt;/opt/yum&lt;/tt&gt; directory
&lt;blockquote&gt;
&lt;pre&gt;
NameVirtualHost *
&amp;lt;VirtualHost *&amp;gt;
    ServerAdmin user@example.com
    DocumentRoot /opt/yum/
    ServerAlias host
    ServerName host.example.com
    ErrorLog /var/log/httpd/yum.repo-error_log
    CustomLog /var/log/httpd/yum.repo-access_log combined

    &amp;lt;Directory /opt/yum&amp;gt;
        Options Indexes
    &amp;lt;/Directory&amp;gt;
&amp;lt;/VirtualHost&amp;gt;
&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;  Now create a yum config you use this new goodness.
&lt;blockquote&gt;
&lt;pre&gt;
[local]
name=local $releasever - $basearch
baseurl=http://host.example.com/local/$releasever/$basearch/
enabled=1
gpgcheck=0

[local-debuginfo]
name=local $releasever - $basearch - Debug
baseurl=http://host.example.com/local-debuginfo/$releasever/$basearch/
enabled=1
gpgcheck=0

[local-source]
name=local $releasever - $basearch - Source
baseurl=http://host.example.com/local-source/$releasever/$basearch/
enabled=1
gpgcheck=0
&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt; If that all went well then:
&lt;blockquote&gt;
&lt;pre&gt;
[user@host ~]$ yum repolist
Loaded plugins: refresh-packagekit
repo id              repo name                                 status
fedora               Fedora 9 - ppc                            enabled
fedora-debuginfo     Fedora 9 - ppc - Debug                    enabled
fedora-source        Fedora 9 - Source                         enabled
local                local 9 - ppc                             enabled
local-debuginfo      local 9 - ppc - Debug                     enabled
local-source         local 9 - ppc - Source                    enabled
updates              Fedora 9 - ppc - Updates                  enabled
updates-debuginfo    Fedora 9 - ppc - Updates - Debug          enabled
updates-source       Fedora 9 - Updates Source                 enabled
&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;p&gt; and &lt;tt&gt;debuginfo-install&lt;/tt&gt; and &lt;tt&gt;yumdownloader&lt;/tt&gt; should do the
right things &lt;tt&gt;woot!&lt;/tt&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;There are probabluy all sorts of other cool things you can do here but this is enought to keep a few local machines in sync &lt;tt&gt;:)&lt;/tt&gt;&lt;/p&gt;
&lt;p&gt;Update: Type fixes, and add note about installign createrepo&lt;/p&gt;</description>
  </item>
  <item>
    <title>Experiments in Fedora 0x00</title>
    <pubDate>Tue, 20 May 2008 12:07:00 </pubDate>
    <link>http://bakeyournoodle.com/~tony/diary/2008/05/20#20080520</link>
    <description>&lt;p&gt;So it's been a long time since I used RPM based distro &amp;quot;in anger&amp;quot;,
so I'm trying Fedora 9.  First tips
&lt;ul&gt;
&lt;li&gt;&lt;tt&gt;yum check-update&lt;/tt&gt;  Check all enabled repositories for update and
display them.&lt;/li&gt;
&lt;li&gt;&lt;tt&gt;yumdownloader --source ${package}&lt;/tt&gt;  To grab the source RPM
(&lt;tt&gt;*.src.rpm&lt;/tt&gt;) for ${package}.  You must have the appropriate source
repositories configured and enabled.  It's a shame that this isn't available
(or did I missit) with the &lt;tt&gt;yum&lt;/tt&gt; command.&lt;/li&gt;
&lt;li&gt; Rename &lt;tt&gt;/etc/httpd/conf.d/welcome.conf&lt;/tt&gt; to something that doesn't
end in &lt;tt&gt;.conf&lt;/tt&gt; once you've setup your web content.  Otherwise you just
get the std. &amp;quot;Welcome to Fedora&amp;quot; page.
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: These may not be the &lt;em&gt;best&lt;/em&gt; ways to get the job done but they worked for me&lt;/p&gt;
&lt;p&gt;Update: fix typos&lt;/p&gt;</description>
  </item>
  </channel>
</rss>