29
openSUSE Packaging for the osmocom stack Martin Hauke [email protected] 21.04.2018

openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged

  • Upload
    others

  • View
    12

  • Download
    0

Embed Size (px)

Citation preview

Page 1: openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged

openSUSE Packaging for the osmocom stack

Martin Hauke

[email protected]

21.04.2018

Page 2: openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged

Intro

• Why openSUSE ?▫ It‘s my favourite Linux distribution

▫ (open)SUSE has great tools and infrastructure OBS, OpenQA, KIWI

• openSUSE comes in two flavours▫ Leap 42.3 (stable)

▫ Tumbleweed (rolling)

Page 3: openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged

Agenda

• Open Build Service (OBS)

• Which osmocom packages are currently available on OBS?

• Packaging challenges

Page 4: openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged

Why packaging at all?

• Users of your applications just want to use your stuff▫ We all like to apt-get , zypper install, yum install

Provides an convenient way to install, upgrade or remove applications

▫ Normal users usually don‘t want build from source They mess up their systems with shared libraries in different places

The often cannot deal with error messages they get from the build-system orthe compiler.

Page 5: openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged
Page 6: openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged

OBS - Overview

• Generate packages• Supports multiple distributions, multiple architectures▫ (open)SUSE, Debian, Fedora, RHEL,…

• Automated, repeatable and consistent:▫ Clean chroot▫ Handle build dependencies und autorebuild if needed▫ Take care of publishing consistent repositories

• OBS is free software and licenced under the GPLv2

• build.opensuse.org▫ Most popular OBS instance

Page 7: openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged

OBS – User Interface

• WEB UI▫ Great to get an overview of a project

▫ Simple package fixes

• OSC command line client▫ Works like an SCM system (svn, git)

▫ Supports local builds for testing

Page 8: openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged
Page 9: openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged
Page 10: openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged
Page 11: openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged
Page 12: openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged

osc – basic commands

• checkout (co) – Checkout files

• addremove (ar) – Add new files, removes disappeared files

• update (up) – Update a working copy

• build – Build a package on your local machine

• commit (ci) – Upload content to the repository server

• linkpac – „Link“ a package to another package

Page 13: openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged

osc - Example$ osc co home:mnhauke:osmocom:nightly/osmo-pcapA home:mnhauke:osmocom:nightly/osmo-pcapA home:mnhauke:osmocom:nightly/osmo-pcap/_serviceA home:mnhauke:osmocom:nightly/osmo-pcap/_servicedataA home:mnhauke:osmocom:nightly/osmo-pcap/osmo-pcap-0.0.6.72.tar.xzA home:mnhauke:osmocom:nightly/osmo-pcap/osmo-pcap.changesA home:mnhauke:osmocom:nightly/osmo-pcap/osmo-pcap.specAt revision 29.

$ cd home:mnhauke:osmocom:nightly/osmo-pcap

$ osc service drCloning into '/home/mhauke/home:mnhauke:osmocom:nightly/osmo-pcap/osmo-pcap'...e89231d8b0ab0f45ed5714123d1bfb4d655b2aa3Identical target file osmo-pcap-0.0.6.72.tar.xz already exists, skipping..

$ touch testfile$ osc addremoveA testfile

$ osc commitSending testfileTransmitting file dataCommitted revision 30.

Page 14: openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged

OBS - Source Services

• Tools to validate, generate or modify sources in a trustable way

• Modes▫ run: run defined services locally

▫ disabledrun: run disabled or server side only services

▫ remoterun: trigger a re-run on the server side

Page 15: openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged

OBS - Source Services Examples

• tar_scm – Create an archive from your source code repository

• recompress – Change archive compression

• set_version – Update version in .spec and .dsc files

• extract_file – Extract files from an archive

Page 16: openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged

RPM SPEC files

preamble

%prep

%build

%install

%check

%files

%changelog

Page 17: openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged
Page 18: openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged

Latest/Nightly Package feeds for Debian/Ubuntu

• Since mid 2016 osmocom package feeds for Debian/Ubuntu areavailable

▫ network:osmocom:latest The latest tagged releases of all Osmocom cellular infrastructure software

▫ network:osmocom:nightly Current master branches of all Osmocom cellular Infrastructure software

Page 19: openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged

openSUSE

• Thanks to various openSUSE community contributors most of the commonlibraries from the osmocom project are already packaged and available in thelatest openSUSE releases.

▫ network:telephony libosmo-abis libosmo-netif libosmo-sccp libosmocore libsmpp34 libgtpnl libasn1c

Page 20: openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged

openSUSE – my personal stuff

• In the last years I packaged most of the osmocom stuff I personally everplayed with for openSUSE in one of my OBS home projects.

▫ These includes: Osmocom cellular software

Several branches of osmocom-bb + proper GNU ARM-Toolchain

Osmocom SDR stuff

• List of packages

Page 21: openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged

Latest/Nightly package feeds for (open)SUSE

• Since 2017 (open)SUSE packages similar to official debian/ubuntupackage feeds are available in my OBS home-project

▫ home:mnhauke:osmocom:latest The latest tagged releases of all Osmocom cellular infrastructure software

▫ network:osmocom:nightly Current master branches of all Osmocom cellular Infrastructure software

Page 22: openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged
Page 23: openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged
Page 24: openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged

Packaging challenges

• OBS supports multiple distributions but▫ If you want to have packages for deb and rpm based distributions

You have to write your stuff twice (SPEC files and debian dsc, control, rules, …) and you should have those in sync Package names

Package descriptions

Subpackages

Compile-time options

Used sources

Page 25: openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged

Packaging challenges - dependencies

• If you want to support older distributions or distributions with a limited set of packages (e.g. SLE)▫ You somtimes do not have all the packages you need for building your

packages You‘ll end up with the import of these needed packages into your OBS-

repository to have all dependencies in place

e.g. libdbi is not available in SLE12_SP3 and SLE_15

Page 26: openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged

Packaging challenges – legal issues

• In case you are using the public build.opensuse.org instance of OBS there are some legal restrictions

• Packages that do not have have free licenses are not allowed▫ e.g.

gapk includes libgsmhr

• Using the PackMan OBS instance for the few problematic package couldbe a workaround▫ http://packman.links2linux.org/

Page 27: openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged

Packaging challenges – platform optimization

• openSUSE packages should avoid overly aggressive CPU optimization▫ Not everybody has CPUs with modern features:

Intel: AVX, AVX2, FMX

ARM: NEON

• Using SSE 4.1 is considered OK at the moment

Page 28: openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged

Packaging challenges – Download statistics

• Sometime it would be nice to know how many users are using yourapplications▫ Currently there are no download statistics available if you use the

build.opensuse.org

Page 29: openSUSE Packaging for the osmocom stack...openSUSE •Thanks to various openSUSE community contributors most of the common libraries from the osmocom project are already packaged

Further Reading

OBS Guides (OBS + RPM)http://openbuildservice.org/help/manuals/obs-beginners-guide/

http://openbuildservice.org/help/manuals/obs-user-guide/

OBS Source Serviceshttps://en.opensuse.org/openSUSE:Build_Service_Concept_SourceService

openSUSE Packaging guidelineshttps://en.opensuse.org/openSUSE:Packaging_guidelines