Basic workflow for working with packages on Open Build Service.
Install requirements
Add repositories for specific openSuSE version:
openSuSE Leap 15.6
sudo zypper ar https://download.opensuse.org/repositories/openSUSE:/Tools/openSUSE_15.6/ Tools
sudo zypper ar https://download.opensuse.org/repositories/devel:/tools/15.6/ devel:tools
openSUSE Tumbleweed
sudo zypper ar https:///download.opensuse.org/repositories/devel:/tools/openSUSE_Tumbleweed/ devel:tools
Install osc
client and obs services:
sudo zypper in osc obs-service-format_spec_file obs-service-set_version obs-service-obs_scm obs-service-source_validator
Setup
Creating a working dir and config osc
client
mkdir OBS
cd OBS
/OBS $ osc
osc
command write down a new oscrc
configuration file in ~/.config/osc/
.
I usually just add these lines to the file:
su-wrapper = sudo
build-root = /var/tmp/build-root/%(repo)s
checkout_no_colon = 1
This enables sudo wrapper, build directory creation for each operating system and an alternate layout when checking out
a project without colons (home/gallochri
instead of home:gallochri
).
Edit sudoers file to give your user the authority to use osc
and build
command without prompt for password.
su
Password:
visudo
and add this line
gallochri ALL = NOPASSWD: /usr/bin/build, /usr/bin/osc
use your username instead of gallochri 😛.
Checkout a project
Now it’s time to download some projects and start making changes
$ osc co home:gallochri
A home:gallochri
A home:gallochri/EmulationStation
...
Working on existing packet with quilt
cd yourproject/yourpackage
quilt setup -v *spec
cd yourpackage-*/
quilt push -a # apply old patches
quilt new yourpackage-version_fixbuild.patch
quilt edit src/foo.c
quilt refresh -p0
You can find a new .patch
file in source dir.
Creating new packet
cd yourproject
osc mkpac yourpackage
cd yourpackage
rpmdev-newspec -t minimal yourpackage
When you have finished writing your .spec
file without any rpmlint errors, you can send the package to
the Open Build Service.
osc vc # note the changes to the package
osc ci # commit your work