Fvennetier (Talk | contribs) |
Fvennetier (Talk | contribs) m (→How to create a new package ? (from an existing SPEC file)) |
||
| Line 39: | Line 39: | ||
== How to create a new package ? (from an existing SPEC file) == | == How to create a new package ? (from an existing SPEC file) == | ||
=== Requirements === | === Requirements === | ||
| - | * A project on an OBS server where you have maintainer rights (for example your home project). | + | * A project on an OBS server (public or [http://susestudio.com/a/e0uuBG/meego-obs private]) where you have maintainer rights (for example your home project), and with a [http://en.opensuse.org/openSUSE:Build_Service_Tutorial#Step_Three.C2.A0.E2.80.93_Choose_build_targets build target] already configured. |
* An archive of your program, named like <tt>program-version.tar.gz</tt> (<tt>tar.bz2</tt> is OK). | * An archive of your program, named like <tt>program-version.tar.gz</tt> (<tt>tar.bz2</tt> is OK). | ||
* A valid SPEC file, named <tt>program.spec</tt>. | * A valid SPEC file, named <tt>program.spec</tt>. | ||
| Line 52: | Line 52: | ||
# Now you should be able to import this package in [[OBS Light]]. | # Now you should be able to import this package in [[OBS Light]]. | ||
#* Run <tt>obslightgui</tt>. | #* Run <tt>obslightgui</tt>. | ||
| - | #* Click ''Import project'' button. | + | #* Click ''Import project'' button (on the left-bottom). |
| - | #* Select a server from the list or | + | #* Select a server from the list or configure a new one. |
#* Select your project in the list. | #* Select your project in the list. | ||
#* Select a target and an architecture. | #* Select a target and an architecture. | ||
| - | #* Give an alias to the project (can be the name of the project | + | #* Give an alias to the project (can be the name of the project without "''':'''", we suggest suffixing with the architecture). |
#* You should now see a list of packages, with the one you created in web UI. | #* You should now see a list of packages, with the one you created in web UI. | ||
#* Select it and press ''finish''. | #* Select it and press ''finish''. | ||
| Line 64: | Line 64: | ||
#* The files appear in the list with status ''Added''. | #* The files appear in the list with status ''Added''. | ||
#* In the middle panel, click ''Commit changes'', and enter a commit message. | #* In the middle panel, click ''Commit changes'', and enter a commit message. | ||
| - | #* The files are uploaded | + | #* The files are uploaded, and the package starts to build on the OBS server. |
== How to prepare a Spec file using Spectacle ? == | == How to prepare a Spec file using Spectacle ? == | ||
All data is stored in ~/OBSLight and subdirectories.
Each OBS project has its own directory in ~/OBSLight/ObsProjects/, each MIC project has its own directory in ~/OBSLight/MicProjects/.
Configuration file is ~/OBSLight/ObslightConfig.
While running an OBS Light appliance is simple and easy and just requires 1GB of RAM allocated to the virtual machine, running an OBS server appliance can be much more demanding but running the OBS server server appliance on your desktop or laptop (a minimum 4GB of RAM is mandatory) via a virtual machine can be very handy during evaluation tests.
The main advantage is that you do not need a special authorisation from your IT department to start playing but you need to allocate at least 2GB to the appliance and as many CPU cores that you can spare. You need to patch on the OBS server appliance (need to be root) the file /etc/sysconfig/obs-worker to set the variable OBS_WORKER_INSTANCES to 1 (default is zero) to limit the RAM resources requires by your appliance during build process.
If you plan to build large packages such as Chromium you will need more than 2GB of RAM allocated (actually on my desktop I have 16GB).
You can overcome that limit with the addition of an obsworker appliance on a separate server. OBS Light project provides one pre-configured to work with and OBS Light server appliance.
If you use the Bridge mode, external OBS work appliance will be detected and used automatically (NAT more would require a complex configuration). The Worker can be running on a more powerfull unit and speed the preparation work before for example leaving the office with a complete fully built project on a laptop.
You can stop the worker on the laptop by the command rcobsworker stop (need to be root). You can check that your OBS Worker appliance can see your OBS Light Server Appliance with the command slptool findsrvs obs.source_server
As a general rule using the bridge mode is advisable. Note this is not the default option of VirtualBox.
The NAT mode is interesting to run an OBS Light server via a VPN or for unconnected demos. In that case you will need to declare NAT rules in your Vitual Machine Manager redirecting the ports 80, 81 and 82 from your local host to your OBS appliance internal NAT address (with VitualBox under Linux rerouting port bellow 1000 is reserved for root only).
Do not forget to add a host name "obslightserver" in your workstation pointing to the OBS Light server appliance IP address or localhost in the case of a NAT configuration.
The kernel package has flags to prevent builds on ARM. To compile an ARM kernel, you must use another package, for example the kernel-adaptation-n900 package.
If the project on your OBS doesn’t provide some dependencies and you must add a repository to your project filesystem's zypper configuration, you have two choices:
## obslight filesystem repositories add <repository_url> <repository_alias> <project_alias> obslight filesystem repositories add http://download.meego.com/live/MeeGo:/1.2:/non-oss/MeeGo_1.2/ MeeGo_non-oss MeeGo_1.2_oss
## obslight filesystem repositories add from <source_project_alias> <project_alias> obslight filesystem repositories add from MeeGo_1.2_non-oss MeeGo_1.2_oss
OBS Light cannot create new packages at the moment. You have to use the web UI or osc first.
Official documentation: Spectacle
Run the following command:
specify --new=your_package_name
It will create a new YAML file from a template, and ask you to edit the file. Just replace "^^^" occurrences by which seems appropriate, and got to the Spec and YAML customization section.
autospectacle can analyze source archives and generate an appropriate YAML file, but has no documentation.
Run the following command:
spec2spectacle your_package_name.spec
It will parse your Spec file, generate a YAML file, and generate a new Spec file from the YAML file. Notice that the conversion is not perfect, and you may lost information.
Except from lines between "# >> " and "# << " tags, the content of the Spec file should not be modified by you, because it will be re-written by specify each time you modify the YAML file. So if you see a line you don't like, you have to find which option of the YAML file has generated it (or can prevent it to be generated), change it, and run the following command to update the Spec file:
specify your_package_name.yaml
Complete list of Spectacle options is here: Syntax of spectacle YAML
Bugs are centralized on MeeGo's bugzilla.