40
Getting Started on Packaging Apps with Open Build Service Learn How To Build Package Andi Sugandi – openSUSE Indonesia [email protected]

Getting Started on Packaging Apps with Open Build Service

Embed Size (px)

Citation preview

Page 1: Getting Started on Packaging Apps with Open Build Service

Getting Started on Packaging Apps with Open Build Service Learn How To Build Package

Andi Sugandi – openSUSE Indonesia [email protected]

Page 2: Getting Started on Packaging Apps with Open Build Service

2

Andi Sugandi

SuSE 9.3 (2004)

@openSUSEID (since 2007)

openSUSE Memberhttps://connect.opensuse.org/pg/profile/andisugandi

/ : @andisugandi

Page 3: Getting Started on Packaging Apps with Open Build Service

3

Andi Sugandi

Page 4: Getting Started on Packaging Apps with Open Build Service

openSUSE Build Service

Page 5: Getting Started on Packaging Apps with Open Build Service

5

Web UICommand

LineClient

Installer(YaST,etc.)

OBS API (api.opensuse.org)

User controller, Database, Search, ...

Storage

BuildHost

Your Client

MirrorInterface

BuildHost

BuildHost

BuildHost

BuildHost

BuildHost

Backend

HermesWeb UI

NotificationServer

Components Overview

Page 6: Getting Started on Packaging Apps with Open Build Service

6

Packagers OBS Tools

Page 7: Getting Started on Packaging Apps with Open Build Service

7

Packagers OBS ToolsReference Server

build.opensuse.org

Page 8: Getting Started on Packaging Apps with Open Build Service

8

Packagers OBS Tools Web Client

Page 9: Getting Started on Packaging Apps with Open Build Service

9

Packagers OBS Toolsosc

Page 10: Getting Started on Packaging Apps with Open Build Service

Creating Packages

Page 11: Getting Started on Packaging Apps with Open Build Service

11

Creating Packages

✔ Create a package

✔ in your own home project

✔ on the reference server1

Page 12: Getting Started on Packaging Apps with Open Build Service

12

Creating openSUSE Account

Page 13: Getting Started on Packaging Apps with Open Build Service

13

Installing osc

$ sudo zypper ar -r http://r.opensu.se/devel ➥ :tools:scm/openSUSE_Leap_42.1/r

$ sudo zypper in osc

Page 14: Getting Started on Packaging Apps with Open Build Service

14

Log in to OBS via osc

$ osc co home:<username>$ cd home:<username>

*Example:

home:andisugandi

Page 15: Getting Started on Packaging Apps with Open Build Service

15

Making Package Project

$ osc mkpac screenFetch$ cd screenFetch

*Package example of this workshop is: screenFetch

Page 16: Getting Started on Packaging Apps with Open Build Service

16

Providing Package’s Source Code

$ wget https://codeload.github.com/KittyKatt/ ➥ screenFetch/tar.gz/v3.7.0

Page 17: Getting Started on Packaging Apps with Open Build Service

17

Editing .spec File

$ vim screenFetch.spec

*Example:https://build.opensuse.org/package/view_file/home:yaumulmajid/screenFetch/screenFetch.spec

Page 18: Getting Started on Packaging Apps with Open Build Service

18

Marking Files to be Committed

$ osc addremove

Page 19: Getting Started on Packaging Apps with Open Build Service

Building Packages

Page 20: Getting Started on Packaging Apps with Open Build Service

20

Building Packages

✔ Build a package

✔ locally on your laptop

✔ and on the reference server2

Page 21: Getting Started on Packaging Apps with Open Build Service

21

Creating (distribution) build target(s)

$ osc meta prj -e home:<username>

Page 22: Getting Started on Packaging Apps with Open Build Service

22

<project name="home:<username>">

<title/> <description/> <person userid="<username>" role="maintainer"/>

<repository name="openSUSE_42.1"> <path project="openSUSE:Leap:42.1" repository="standard"/> <arch>i586</arch> <arch>x86_64</arch>

</repository>

</project>

Creating (distribution) build target(s)

Page 23: Getting Started on Packaging Apps with Open Build Service

23

Setting Up Local Build Environment … [1]

$ sudo mount openSUSE-Leap-42.1-DVD-x86_64.iso ➥ /run/media/summit2016/openSUSE-Leap-42.1-DVD -➥ x86_64026 -o loop

Page 24: Getting Started on Packaging Apps with Open Build Service

24

Setting Up Local Build Environment … [2]

$ sudo mkdir -p /var/tmp/osbuild- ➥ packagecache/openSUSE\:Leap\:42.1/standard

Page 25: Getting Started on Packaging Apps with Open Build Service

25

Setting Up Local Build Environment … [3]

$ sudo cp -r /run/media/summit2016/openSUSE-Leap ➥ -42.1-DVD-x86_64026/suse/* /var/tmp/osbuild ➥ -packagecache/openSUSE\:Leap\:42.1/standard

Page 26: Getting Started on Packaging Apps with Open Build Service

26

Setting Up Local Build Environment … [4]

$ sudo find /var/tmp/osbuild-packagecache ➥ /openSUSE\:Leap\:42.1/standard -type d -exec ➥ chmod 755 {} \;

Page 27: Getting Started on Packaging Apps with Open Build Service

27

Setting Up Local Build Environment … [5]

$ sudo find /var/tmp/osbuild-packagecache ➥ /openSUSE\:Leap\:42.1/standard -type f -exec ➥ chmod 644 {} \;

Page 28: Getting Started on Packaging Apps with Open Build Service

28

Building (screenFetch) Package Locally

$ sudo osc build openSUSE_42.1 x86_64 ➥ screenFetch.spec

*Example build log (built successfully):http://paste.opensuse.org/view/simple/4027883

Page 29: Getting Started on Packaging Apps with Open Build Service

29

The Resulting Package (Locally)

/var/tmp/build-root/openSUSE_42.1-x86_64/home/abuild/ ➥ rpmbuild/SRPMS/screenFetch-3.7.0-0.src.rpm

/var/tmp/build-root/openSUSE_42.1-x86_64/home/abuild/ ➥ rpmbuild/RPMS/noarch/screenFetch-3.7.0-0.noarch.rpm

•*See corresponding log for details

Page 30: Getting Started on Packaging Apps with Open Build Service

30

Building Package on OBS Server

$ osc commit

*Fill in the data required (example, via: VIM text editor), Pres [i] to start writing.

Page 31: Getting Started on Packaging Apps with Open Build Service

31

Example Commit Message

Thu Oct 6 12:44:44 UTC 2016 – [email protected]

- First check in of the screenFetch 3.7.0 package

*To stop writing and quit VIM: Press [Esc], then: [:] [w] [q] [Enter]

Page 32: Getting Started on Packaging Apps with Open Build Service

32

The Resulting Package on OBS Server

Page 33: Getting Started on Packaging Apps with Open Build Service

33

Page 34: Getting Started on Packaging Apps with Open Build Service

Collaborating on Packages

Page 35: Getting Started on Packaging Apps with Open Build Service

35

Collaborating on Packages

✔ Branch a package

✔ Submit a merge request

✔ Review a merge request3

Page 36: Getting Started on Packaging Apps with Open Build Service

Questions?

Page 37: Getting Started on Packaging Apps with Open Build Service

37

References

OBS-Packager-Workshop.odphttp://openbuildservice.org/files/workshops ➥ /OBS-Packager-Workshop.odp

Open Build Service Materialshttp://openbuildservice.org/help/materials

Page 38: Getting Started on Packaging Apps with Open Build Service

Thank you.

Join the conversation,contribute & have a lot of fun!www.opensuse.org

Page 39: Getting Started on Packaging Apps with Open Build Service

39

Have a lot of fun and join us at:www.opensuse.org

Page 40: Getting Started on Packaging Apps with Open Build Service

General DisclaimerThis document is not to be construed as a promise by any participating organisation to develop, deliver, or market a product. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. openSUSE makes no representations or warranties with respect to the contents of this document, and specifically disclaims any express or implied warranties of merchantability or fitness for any particular purpose. The development, release, and timing of features or functionality described for openSUSE products remains at the sole discretion of openSUSE. Further, openSUSE reserves the right to revise this document and to make changes to its content, at any time, without obligation to notify any person or entity of such revisions or changes. All openSUSE marks referenced in this presentation are trademarks or registered trademarks of SUSE LLC, in the United States and other countries. All third-party trademarks are the property of their respective owners.

LicenseThis slide deck is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license. It can be shared and adapted for any purpose (even commercially) as long as Attribution is given and any derivative work is distributed under the same license.

Details can be found at https://creativecommons.org/licenses/by-sa/4.0/

Credits

TemplateRichard Brown [email protected]

Design & InspirationopenSUSE Design Teamhttp://opensuse.github.io/branding-guidelines/