From Fedora Project Wiki
(Replaced content with "{{admon/important|This page is deprecated| All Fedora Modularity Documentation has moved to the new [https://docs.pagure.org/modularity/ Fedora Modularity Documentation we...")
 
Line 1: Line 1:
== Getting Pungi (Modularity Style) ==
{{admon/important|This page is deprecated| All Fedora Modularity Documentation has moved to the new [https://docs.pagure.org/modularity/ Fedora Modularity Documentation website] with source hosted along side the code in the [https://pagure.io/modularity Fedora Modularity website git repository]}}
 
Because Modularity is a work-in-progress, we don't commit code specific to it to the main branches of projects, but keep them in separate branches. To work with the modularized version of Pungi, this affects the <code>pungi</code> and <code>productmd</code> projects (<code>modularity</code> and <code>modulemd</code> are modularity-specific per se).
 
This document will describe two slightly different ways to get the code from the right branches:
 
# Downloading and running a script which will clone the necessary source repositories into a newly created subdirectory, and print out a sourcable shell snippet that sets up the environment to work with it.
# Cloning the repositories manually, and making them available in a Python virtualenv.
 
=== The quick way: using a script ===
 
# Download <code>[https://pagure.io/pungi-modularity/raw/master/f/checkout-modularity-into-pwd.sh https://pagure.io/pungi-modularity/blob/master/f/checkout-modularity-into-pwd.sh]</code>.
# From a directory of your choice, execute this script. It will create a subdirectory <code>modularity</code> into which the 4 projects are cloned. It will also print out a shell snippet setting up the environment to work there, which should be saved as e.g. <code>$HOME/.modularity.sh</code>.
# Run <code>source $HOME/.modularity.sh</code> to set up the environment.
 
=== The slightly longer way: using a Python virtualenv ===
 
<ol>
<li>Download the projects. Go to the place where the projects should be in your filesystem, we'll call it <code>$WORKSPACE</code> from here on, and execute this:
  <pre>git clone --branch modularity-prototype https://pagure.io/forks/lkocman/pungi.git pungi
git clone --branch modularity https://github.com/lkocman/productmd.git productmd
git clone https://pagure.io/pungi-modularity.git pungi-modularity
git clone https://pagure.io/modulemd.git modulemd</pre>
Alternatively, you can use SSH URLs, of course, if you have an account set up on these sites:
  <pre>git clone --branch modularity-prototype ssh://git@pagure.io/forks/lkocman/pungi.git pungi
git clone --branch modularity ssh://git@github.com/lkocman/productmd.git productmd
git clone ssh://git@pagure.io/pungi-modularity.git pungi-modularity
git clone ssh://git@pagure.io/modulemd.git modulemd</pre>
This is largely what the <code>checkout-modularity-into-pwd.sh</code> does, except that it creates a <code>modularity</code> subdirectory to hold the repositories.
</li>
<li>Create the Python virtualenv. We'll use <code>pungi-modularity</code> as its name in this document:
  <pre>mkvirtualenv modularity</pre>
The virtualenv will be activated immediately, later on you can switch it on and off using <code>workon modularity</code> and <code>deactivate</code>.
</li>
<li>''Optional:'' Upgrade <code>pip</code> so it doesn't complain about the old version being installed all the time:
  <pre>pip install --upgrade pip</pre>
</li>
<li>Install some Python packages which aren't available from [http://pypi.python.org http://pypi.python.org] into the system, using <code>dnf</code> or <code>yum</code>:
<pre>koji
kobo-rpmlib
python2-dnf
yum
rpm-python
python-librepo
python-libcomps
python-hawkey</pre>
</li>
<li>Symlink the Python packages installed in the previous step from the system into the virtualenv:
<pre>cdvirtualenv
cd lib/python2.7/site-packages
ln -s /usr/lib/python2.7/site-packages/koji koji
ln -s /usr/lib/python2.7/site-packages/kobo kobo
ln -s /usr/lib/python2.7/site-packages/dnf dnf
ln -s /usr/lib/python2.7/site-packages/rpmUtils rpmUtils
ln -s /usr/lib64/python2.7/site-packages/rpm rpm
ln -s /usr/lib64/python2.7/site-packages/librepo librepo
ln -s /usr/lib64/python2.7/site-packages/libcomps libcomps
ln -s /usr/lib64/python2.7/site-packages/hawkey hawkey</pre>
If you use a 32bit system, the last four lines must be changed to:
<pre>ln -s /usr/lib/python2.7/site-packages/rpm rpm
ln -s /usr/lib/python2.7/site-packages/librepo librepo
ln -s /usr/lib/python2.7/site-packages/libcomps libcomps
ln -s /usr/lib/python2.7/site-packages/hawkey hawkey</pre>
</li>
<li>Install Python dependencies needed by <code>dnf</code>, <code>koji</code> and <code>pungi</code> into the virtualenv:
<pre>pip install iniparse lxml pygpgme pyliblzma pyOpenSSL python-krbV</pre>
</li>
<li>Make the virtualenv use the checked out source of the projects (and install dependencies):
<pre>cd "$WORKSPACE"
for proj in modulemd productmd pungi; do
    (cd "$proj" && python setup.py develop)
done</pre>
</li>
</ol>
 
At this point, everything should be in set up to run the <code>pungi/bin/pungi-*-prototype</code> scripts. You'll need to download some source and binary packages for them to work on, we mainly use the Server edition of Fedora (currently the alphas and betas of version 24). Review the <code>pungi-modularity/example-*.sh</code> scripts for command syntax.

Latest revision as of 07:57, 20 February 2017

Important.png
This page is deprecated
All Fedora Modularity Documentation has moved to the new Fedora Modularity Documentation website with source hosted along side the code in the Fedora Modularity website git repository