Difference between revisions of "StarlingX/MultiOS/OpenSUSE"
Line 2: | Line 2: | ||
=== Scope of the project === | === Scope of the project === | ||
− | To support StarlingX on openSUSE OS the first step is to package the Flock services into an RPM. Currently StarlingX MultiOS team is using openSUSE Build Service, which is a public instance of the Open Build Service (OBS). | + | To support StarlingX on openSUSE OS the first step is to package the Flock services into an RPM. Currently StarlingX MultiOS team is using openSUSE Build Service, which is a public instance of the Open Build Service (OBS) [https://build.opensuse.org/project/show/Cloud:StarlingX:2.0 Cloud:StarlingX:2.0 OBS]. <br /> |
+ | |||
+ | The StarlingX directory layout is explained in [https://opendev.org/starlingx/specs/src/branch/master/specs/2019.03/approved/multi-os-2004891-directory-layout.rst StarlingX: Define directory layout for MultiOS] specification. | ||
=== How to build packages using OBS === | === How to build packages using OBS === | ||
Line 10: | Line 12: | ||
3. Then, you can get your project using this command: | 3. Then, you can get your project using this command: | ||
− | osc checkout home: | + | osc checkout home:<your_login> |
osc will require your credentials the first time you use it.<br /> | osc will require your credentials the first time you use it.<br /> | ||
− | 4. Create a new package | + | 4. Create a new package. |
− | osc mkpac | + | osc mkpac <your_package_name> |
− | 5. Add the spec file and tarball.<br /> | + | |
+ | 5. Add a tarball to <your_package_name>.<br /> | ||
+ | |||
+ | To get the Flock tarballs you can use directly the opendev URL. For example, to get the Fault Flock you can do this. | ||
+ | cd <your_package_name> | ||
+ | curl -L -o stx-fault-1.0.tar.gz http://opendev.org/starlingx/fault/archive/master.tar.gz | ||
+ | |||
+ | You would need to change "fault" for the StarlingX Flock repository that has the project you want to package.<br /> | ||
+ | |||
+ | 6. Add the spec file and edit it.<br /> | ||
+ | |||
+ | A StarlingX Flock repository has many projects, each of them has a directory for its source code and directories for the supported Operating Systems. You could use the current CentOS spec file as the basis for the openSUSE spec file, and modify it when appropriate. <br /> | ||
+ | |||
+ | The convention to follow is to use the repository tarball and add to the openSUSE spec file the source code location in the %setup macro. <br /> | ||
+ | |||
+ | For example, Fault repository has the fm-common project. So, in the OBS package you should have a stx-fault-1.0.tar.gz tarball and a fm-common.spec file. The fm-common.spec is going to have this information: | ||
+ | ... | ||
+ | Source0: stx-fault-1.0.tar.gz | ||
+ | ... | ||
+ | %setup -n fm-common/sources | ||
+ | ... | ||
+ | |||
+ | 7. In addition, add a changes file using this command. | ||
+ | osc vc | ||
+ | Remember that you should add the %changelog macro to the spec file. | ||
− | + | 8. Do a local build. | |
− | osc build -p /tmp/foo -k /tmp/foo --no-verify openSUSE_Leap_15.0 x86_64 | + | osc build -p /tmp/foo -k /tmp/foo --no-verify openSUSE_Leap_15.0 x86_64 <your_package_name>.spec |
− | + | 9. The output is descriptive and will tell you about errors, warnings and where it put the resulting RPMs.<br /> | |
− | + | 10. You can see the status of the files in your working copy using osc. | |
osc status | osc status | ||
− | + | 11. You will need to add to the new/changed files. | |
− | osc add | + | osc add <your_package_name>.spec |
− | osc add | + | osc add <your_package_name>.changes |
− | + | osc add <your_package_name>-<version>.tar.xz | |
+ | 12. After having a successful build, you now can send the files to your personal project. In this case home:<your_login>. | ||
osc commit | osc commit | ||
− | + | 13. Once it is on OBS infrastructure, a build is triggered. You can see on your OBS account the status and log of that build.<br /> | |
− | + | 14. Finally, you can contribute to StarlingX by submitting your package to Cloud:StarlingX:2.0 project. | |
− | osc submitreq home: | + | osc submitreq home:<your_login> <your_package_name> Cloud:StarlingX:2.0 <your_package_name> |
+ | And sending your spec to the project source code. | ||
− | === References === | + | === References === |
− | |||
* [https://openbuildservice.org/help/manuals/obs-user-guide/cha.obs.osc.html osc installing and configuration] | * [https://openbuildservice.org/help/manuals/obs-user-guide/cha.obs.osc.html osc installing and configuration] | ||
* [https://openbuildservice.org/help/manuals/obs-beginners-guide/ OBS beginners guide] | * [https://openbuildservice.org/help/manuals/obs-beginners-guide/ OBS beginners guide] | ||
* [https://en.opensuse.org/openSUSE:Specfile_guidelines openSUSE:Specfile guidelines] | * [https://en.opensuse.org/openSUSE:Specfile_guidelines openSUSE:Specfile guidelines] | ||
* [https://en.opensuse.org/openSUSE:Packaging_checks openSUSE:Packaging checks] | * [https://en.opensuse.org/openSUSE:Packaging_checks openSUSE:Packaging checks] |
Revision as of 21:03, 5 June 2019
Contents
StarlingX packaging for openSUSE
Scope of the project
To support StarlingX on openSUSE OS the first step is to package the Flock services into an RPM. Currently StarlingX MultiOS team is using openSUSE Build Service, which is a public instance of the Open Build Service (OBS) Cloud:StarlingX:2.0 OBS.
The StarlingX directory layout is explained in StarlingX: Define directory layout for MultiOS specification.
How to build packages using OBS
1. Create OBS account: openSUSE Build Service.
2. Install osc OBS cli tool.
3. Then, you can get your project using this command:
osc checkout home:<your_login>
osc will require your credentials the first time you use it.
4. Create a new package.
osc mkpac <your_package_name>
5. Add a tarball to <your_package_name>.
To get the Flock tarballs you can use directly the opendev URL. For example, to get the Fault Flock you can do this.
cd <your_package_name> curl -L -o stx-fault-1.0.tar.gz http://opendev.org/starlingx/fault/archive/master.tar.gz
You would need to change "fault" for the StarlingX Flock repository that has the project you want to package.
6. Add the spec file and edit it.
A StarlingX Flock repository has many projects, each of them has a directory for its source code and directories for the supported Operating Systems. You could use the current CentOS spec file as the basis for the openSUSE spec file, and modify it when appropriate.
The convention to follow is to use the repository tarball and add to the openSUSE spec file the source code location in the %setup macro.
For example, Fault repository has the fm-common project. So, in the OBS package you should have a stx-fault-1.0.tar.gz tarball and a fm-common.spec file. The fm-common.spec is going to have this information:
... Source0: stx-fault-1.0.tar.gz ... %setup -n fm-common/sources ...
7. In addition, add a changes file using this command.
osc vc
Remember that you should add the %changelog macro to the spec file.
8. Do a local build.
osc build -p /tmp/foo -k /tmp/foo --no-verify openSUSE_Leap_15.0 x86_64 <your_package_name>.spec
9. The output is descriptive and will tell you about errors, warnings and where it put the resulting RPMs.
10. You can see the status of the files in your working copy using osc.
osc status
11. You will need to add to the new/changed files.
osc add <your_package_name>.spec osc add <your_package_name>.changes osc add <your_package_name>-<version>.tar.xz
12. After having a successful build, you now can send the files to your personal project. In this case home:<your_login>.
osc commit
13. Once it is on OBS infrastructure, a build is triggered. You can see on your OBS account the status and log of that build.
14. Finally, you can contribute to StarlingX by submitting your package to Cloud:StarlingX:2.0 project.
osc submitreq home:<your_login> <your_package_name> Cloud:StarlingX:2.0 <your_package_name>
And sending your spec to the project source code.