.TL Packaging for dpkg with Open Build Service .AU tropf .AB A little protocol on the steps I took to get my package into open build service to be used with ubuntu and debian. .AE .DA . .NH 1 Introduction .NH 2 Motivation .PP I made .URL "https://codeberg.org/tropf/smplxmpp" "smplxmpp" "," and I'd like to deliver it as package(s). . .PP I consider packaging for debian as the biggest challenge, as it has a very large market share (and i also use it, though for more practical reasons). I created a package for smplxmpp, mainly following the steps outlined .URL "https://www.debian.org/doc/manuals/packaging-tutorial/packaging-tutorial.pdf" "here" and by using additional documentation I found all over the web. . I will not spend too much time on explaining how to get your environment set up; this is fairly complicated and involves stuff like gpg etc. .NH 2 Setting up git-buildpackage .PP I am using git-buildpackage. For an initial setup i followed .URL "http://honk.sigxcpu.org/projects/git-buildpackage/manual-html/gbp.import.upstream-git.html" "this guide in the official docs" "." .PP To set up the created repo (that already contains the .CW "debian/" directory) at a new machine follow these steps: . .CB # clone git repo git clone https://codeberg.org/tropf/smplxmpp-deb # configure git contact info git config user.name "Rolf Pfeffertal" git config user.email "floss@tropf.io" # add upstream git remote add upstream https://codeberg.org/tropf/smplxmpp # setup git-pbuilder # maybe prefix with DIST=$dist sudo git-pbuilder create .CE . .PP To incoroperate upstream changes: .CB git fetch upstream git merge $TAG # maybe change --snapshot to --release gbp dch --debian-branch=debian/sid --snapshot --auto debian/ # now adjust all the files # and then check if everything builds gbp buildpackage --git-ignore-new --git-pristine-tar --git-pristine-tar-commit --git-pbuilder --git-upstream-tag=\(aqv%(version)s\(aq --git-debian-branch=debian/sid # check package # if ok commit git add debian/ git commit -m "..." .CE . .NH 2 Setting up OBS .PP Follow .URL "https://openbuildservice.org/help/manuals/obs-user-guide/art.obs.bg.html" "this guide" "." . .PP Create a project on the .URL "https://build.opensuse.org/" "openSUSE Build Service" and enable under "Repositories" the targets you want to build for. . .PP Set up .CW "osc" "." . . .NH 1 Preparing required files .PP After you have all your sources ready to build a package, build it locally. I'll use git buildpackage with pbuilder here: .CB gbp buildpackage --git-pristine-tar --git-pristine-tar-commit --git-pbuilder --git-upstream-tag=\(aqv%(version)s\(aq --git-debian-branch=debian/sid .CE . .PP From the parent directory, we now need the files .ULS .LI .CW "_-.dsc" .LI .CW "_.orig.tar.gz" .LI .CW "_-.debian.tar.xz" .ULE . .NH 1 Pushing package to OBS .PP Move these files into the directory of the package you created on obs. At this point you can test building you package. The location of the resulting files will be displayed on stdout. .CB osc build --local-package .CE . .PP After that commit & and push to obs. .CB osc addremove osc st # check output; if ok: osc commit .CE .NOTE .CW "osc commit" is not local; it instantly pushes to OBS. .B "This is not like git." . .PP You should now see build processes in your project on OBS. . .NH 1 Using the repositories .PP This is an adaptation of .URL "https://en.opensuse.org/openSUSE:Build_Service_Debian_builds" "this" "." . .NOTE You might have to wait for quite a while after your build jobs are finished before they are turned into a repo. . .NH 2 Add the repo .PP First get the repo URL by navigating in the OBS project to your distro and click the download icon or the link "go to download repository". I will use .CW "$URL" here to refer to that repo URL. When visiting .CW "$URL" in your browser you should see a bunch of files, including files like .CW "Release" " or" .CW "Sources" "." . .PP Add the repo and its key. .NOTE You could use .CW "apt-key" "," but that is marked as deprecated. . .CB # download key (.asc is important!!) sudo wget -O /etc/apt/trusted.gpg.d/myproject.asc $URL/Release.key # add repo echo "deb $URL /" | sudo tee /etc/apt/sources.list.d/myproject.list .CE . .NH 2 Use the repo .PP .CB sudo apt update sudo apt install mypackage .CE . .NH 1 See also .PP .ULS .LI .URL "https://www.debian.org/doc/manuals/packaging-tutorial/packaging-tutorial.pdf" "presentation on debian packaging" .LI .URL "https://openbuildservice.org/help/manuals/obs-user-guide/art.obs.bg.html" "obs introduction" .LI .URL "https://wiki.debian.org/git-pbuilder" "git-pbuilder doc" .ULE