Meego Wiki
Views

User:Fvennetier/OBS Light Create new package

From MeeGo wiki
(Difference between revisions)
Jump to: navigation, search
m
m
Line 1: Line 1:
-
= How to create a new package using spectacle and a SPEC file ? =
+
= How to prepare a Spec file using Spectacle ? =
Official documentation: [[Spectacle]]
Official documentation: [[Spectacle]]
-
== Requirements ==
 
-
* A project on an OBS server where you have maintainer rights (for example your home project)
 
-
* OBS Light [[ObsLightDeliverable | already installed on your computer]]
 
-
* An archive of your program, named like <tt>program-version.tar.gz</tt> (<tt>tar.bz2</tt> is OK)
 
-
* A SPEC file, <tt>program.spec</tt>
 
-
== Prepare the SPEC file ==
+
== Generate a YAML file from scratch ==
-
* First you have to generate a YAML file:
+
=== The manual way ===
-
  spec2spectacle mypackage.spec
+
Run the following command:
-
* Edit the generated YAML file, <tt>mypackage.yaml</tt>. You may have to complete some fields, for example the source file, which should look like ''%{name}-%{version}.tar.gz''.
+
  specify --new=your_package_name
-
* Re-generate the SPEC file
+
It will create a new YAML file from a template, and ask you to edit the file.
-
  specify mypackage.yaml
+
 
-
* Now check the SPEC file, especially the script section. Your old scripts should have been surrounded by "'''# >> '''" and "'''# << '''" tags. '''%if''' macros have been removed.
+
=== The automatic way ===
 +
[https://meego.gitorious.org/meego-developer-tools/autospectacle autospectacle]
 +
 
 +
== Generate a YAML file from a Spec file ==
 +
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.
 +
 
 +
== Customize the Spec and YAML files ==
 +
Except from lines between "<tt># >> </tt>" and "<tt># << </tt>" tags, the content of the Spec file should not be modified by you, because it will be re-written by <tt>specify</tt> 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
== Create the package ==
== Create the package ==
[[OBS_Light_FAQ#How_to_create_a_new_package_.3F_.28from_an_existing_SPEC_file.29 | Procedure is there]]
[[OBS_Light_FAQ#How_to_create_a_new_package_.3F_.28from_an_existing_SPEC_file.29 | Procedure is there]]

Revision as of 10:53, 23 March 2012

Contents

How to prepare a Spec file using Spectacle ?

Official documentation: Spectacle

Generate a YAML file from scratch

The manual way

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.

The automatic way

autospectacle

Generate a YAML file from a Spec file

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.

Customize the Spec and YAML files

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

Create the package

Procedure is there

Personal tools