opensuse packaging for the osmocom stack...opensuse •thanks to various opensuse community...
TRANSCRIPT
openSUSE Packaging for the osmocom stack
Martin Hauke
21.04.2018
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)
Agenda
• Open Build Service (OBS)
• Which osmocom packages are currently available on OBS?
• Packaging challenges
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.
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
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
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
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.
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
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
RPM SPEC files
preamble
%prep
%build
%install
%check
%files
%changelog
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
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
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
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
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
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
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/
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
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
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