obslight-fakeobs
--------------------
Python script that partially implements an OBS API.
It does not build anything, but can be used as an OBS remote link.

You can use it for example to build your own project against a fixed
release of a public project (Tizen, MeeGo...), without the drawbacks
of a slow/unreliable internet connection.

It is based on Mer Delivery System tools
https://wiki.merproject.org/wiki/Mer_Delivery_System

modified for the needs of OBS Light project
http://en.opensuse.org/openSUSE:OBS_Light

RPM packages for openSUSE 11.4 and 12.1:
http://repo.pub.meego.com/Project:/OBS_Light/
Python dependencies (python-cmdln):
http://download.opensuse.org/repositories/devel:/languages:/python/

More information on
http://en.opensuse.org/openSUSE:OBS_Light_Fakeobs

Most commands should be run as root.

Where are fakeobs data stored ?
-------------------------------
fakeobs data are stored in /srv/obslight-fakeobs and its subdirectories.
The daemon log file is /var/log/fakeobs-daemon.log
Configuration file is /etc/obslight-fakeobs.conf


On which port does fakeobs API listen ?
---------------------------------------
fakeobs API listens on port 8001.
You can test if it is running by calling
  http://<your_host>:8001/public/source/
in your web browser. You should see the list of installed projects as XML.
If you see "Unable to connect", the daemon is probably stopped.
Try "rcfakeobs start".


On which port are published the package repositories ?
------------------------------------------------------
The package repositories are published on port 8002.


How to create a link to the fake OBS on the real OBS ?
------------------------------------------------------
- If they run on the same host (we hope so), you can run
  "obslight-fakeobs createlink", optionally with the path to your
  ".oscrc" file (without it, the script will try the default port, user
  and password of an OBS appliance http://susestudio.com/a/e0uuBG/meego-obs).
- If they don't, we suggest you to follow this guide
http://en.opensuse.org/openSUSE:Build_Service_private_instance_boot_strapping#Use_OBS_Remote_Link
  and replace
     "https://api.meego.com/public"
  by
     "http://<your_host>:8001/public"

Note: you have to do this only once. All fakeobs projects will be used
      through the same link.


How to list installed projects ?
--------------------------------
Run "obslight-fakeobs list". '-t' option lists targets for
each project, '-d' option lists dependencies.


How to import a fakeobs project from an archive ?
-------------------------------------------------
Run "obslight-fakeobs import" with the archive path as parameter.

Example:
$ obslight-fakeobs import Tizen_1.0_Base-1.0.tar.gz


How to remove a fakeobs project ?
---------------------------------
Run "obslight-fakeobs remove" with the project name as parameter.

Example:
$ obslight-fakeobs remove "Tizen:1.0:Base"


How to check a fakeobs project ?
--------------------------------
Run "obslight-fakeobs check" with the project name as parameter.
This is automatically run after a grab, but you may want to
run it after an import.


How to update a project ?
-------------------------
If a URL has been provided by the creator of a fakeobs archive
(you can check by running 'obslight-fakeobs list -u'), you can
update the project by running
  obslight-fakeobs update


Where can I find fakeobs projects archives ?
--------------------------------------------
Some archives for Tizen are available at http://tizen.fridu.net/.


Can I create fakeobs project archives myself ?
----------------------------------------------
You will need:
- the name of the project
- the URL of the OBS public API you want to get project from
- the rsync URL of the root of package repositories (see example below)
- optional: the name of the repository target
- optional: the list of architectures of the project

Step1: grab the project
  obslight-fakeobs grab -A <api> -r <repo_url> <project_name> [-t <repository>] [-a <architecture>]...
ex: obslight-fakeobs grab -A "https://api.tizen.org/public" -r "rsync://download.tizen.org/live" "Tizen:1.0:Base" -t "standard" -a "i586" -a "armv7el"
This will take some time, depending on your internet connection.
At this point, the project is installed locally as if you had done an import.

Step2: shrink the project
Some RPM packages may appear at 2 different places (:full and repositories).
'shrink' will make hard links between them, to save space.
  obslight-fakeobs shrink <project>
ex: obslight-fakeobs shrink "Tizen:1.0:Base"

Step3: build the archive
  obslight-fakeobs export <project_name>
ex: obslight-fakeobs export "Tizen:1.0:Base"
Now you can find a big archive in current directory named after the project
(with ':' replaced by '_').


Import projects from old fakeobs versions (< 1.0.0)
---------------------------------------------------
Data organization changed between fakeobs-0.6.x and fakeobs-1.0.x.
The 'convert' command allows you to import projects which were
installed by < 1.0.0 versions. After installing the newest version,
simply run
  obslight-fakeobs convert <project> <release>
for each project/release you want to convert.
After checking that everything works as expected, you can remove
the old fakeobs directory (/srv/fakeobs).

