.. -*- mode: rst -*-

.. _mrepo: http://dag.wieers.com/home-made/mrepo/

.. _appendix-configuration-mrepo:

mrepo
=====

.. This section describes how to setup an `mrepo`_ mirror.

`mrepo`_ builds a local APT/Yum RPM repository from local ISO files,
downloaded updates, and extra packages from 3rd party repositories. It
takes care of setting up the ISO files, downloading the RPMs,
configuring HTTP access and providing PXE/TFTP resources for remote
network installations.

Sample mrepo configuration
--------------------------

::

    ### Configuration file for mrepo

    ### The [main] section allows to override mrepo's default settings
    ### The mrepo-example.conf gives an overview of all the possible settings
    [main]
    srcdir = /var/mrepo/src
    wwwdir = /var/www/mrepo
    confdir = /etc/mrepo.conf.d
    arch = x86_64

    mailto = <youremail>
    smtp-server = localhost

    hardlink = yes
    shareiso = yes

    rsync-timeout = 3600

    [centos5]
    name = CentOS Server $release ($arch)
    release = 5
    arch = x86_64
    metadata = yum repomd

    # ISO images
    iso = centos-$release-server-$arch-DVD.iso

    #addons = rsync://mirrors.kernel.org/centos/$release/addons/$arch/RPMS
    centosplus = rsync://mirrors.kernel.org/centos/$release/centosplus/$arch/RPMS
    extras = rsync://mirrors.kernel.org/centos/$release/extras/$arch/RPMS
    #fasttrack = rsync://mirrors.kernel.org/centos/$release/fasttrack/$arch/RPMS
    os = rsync://mirrors.kernel.org/centos/$release/os/$arch/CentOS
    updates = rsync://mirrors.kernel.org/centos/$release/updates/$arch/RPMS
    dag = http://apt.sw.be/redhat/el$release/en/$arch/RPMS.dag
    dries = http://apt.sw.be/redhat/el$release/en/$arch/RPMS.dries
    rpmforge = http://apt.sw.be/redhat/el$release/en/$arch/RPMS.rpmforge

    ### Any other section is considered a definition for a distribution
    ### You can put distribution sections in /etc/mrepo.conf.d/
    ### Examples can be found in the documentation at:
    ###     /usr/share/doc/mrepo-0.8.6/dists/.

Update the repositories
-----------------------

::

    mrepo -ug

Example sources.xml file
------------------------

.. code-block:: xml

    <Sources>
            <!-- CentOS (5.4) sources -->
            <YUMSource>
                    <Group>centos-5.4</Group>
                    <RawURL>http://mrepo/centos5-x86_64/RPMS.os</RawURL>
                    <Arch>x86_64</Arch>
            </YUMSource>
            <YUMSource>
                    <Group>centos-5.4</Group>
                    <RawURL>http://mrepo/centos5-x86_64/RPMS.updates</RawURL>
                    <Arch>x86_64</Arch>
            </YUMSource>
            <YUMSource>
                    <Group>centos-5.4</Group>
                    <RawURL>http://mrepo/centos5-x86_64/RPMS.extras</RawURL>
                    <Arch>x86_64</Arch>
            </YUMSource>
    </Sources>
