Manually building a distribution package » History » Revision 7
Revision 6 (neels, 10/08/2020 09:53 PM) → Revision 7/8 (laforge, 07/25/2022 07:05 AM)
h1. Manually building a distribution package This is a complete example showing how I created a .deb package of a custom osmo-msc version. The aim was to distribute a certain patch of osmo-msc without modifying the official Osmocom package feeds. h2. lxc container For a clean build base, create a fresh debian 10 (buster) container. on lxc host: <pre> lxc-create -t download -n neels-deb10 lxc-start -n neels-deb10 lxc-attach -n neels-deb10 </pre> in neels-deb10 container: <pre> apt install openssh-server useradd -m -s /bin/bash neels cd /home/neels/ mkdir .ssh cd .ssh/ cat > authorized_keys # paste my ssh pubkey, hit ctrl-D cd .. chown -R neels: .ssh passwd neels apt-get install sudo gpasswd -a neels sudo apt-get update apt-get install wget gnupg git tig wget https://download.opensuse.org/repositories/network:/osmocom:/nightly/Debian_10/Release.key sha256sum Release.key | grep b5e2c1df9ff80bc73dd00a0c153ef308e7ec643ddb859e69789fcd4a9b1893d3 apt-key add Release.key rm Release.key cat > /etc/apt/sources.list.d/osmocom-nightly.list <<END deb http://download.opensuse.org/repositories/network:/osmocom:/nightly/Debian_10/ ./ deb-src http://download.opensuse.org/repositories/network:/osmocom:/nightly/Debian_10/ ./ END apt-get update apt-get install git-buildpackage libdistro-info-perl apt-get build-depends osmo-msc # exit the lcx-attach and log in via ssh exit </pre> <pre> lxc-ls -f | grep neels-deb10 # neels-deb10 RUNNING 0 - 192.168.111.12, 192.168.111.240 - false ssh neels@192.168.111.12 # (logged into neels-deb10 container) git clone https://gitea.osmocom.org/cellular-infrastructure/osmo-msc git://git.osmocom.org/osmo-msc cd osmo-msc # checkout the branch to put in the package git checkout neels/mncc_codecs2 git config --global user.email nhofmeyr@sysmocom.de git config --global user.name "Neels Hofmeyr" # update the changelog and commit gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge --ignore-branch --new-version="1.6.1001" dch -r -m --distribution "unstable" "" git add debian/changelog git commit -m "manual package 1.6.1 --> 1.6.1001" # to be able to tag a release, we need to sign it. Create a key to sign with. gpg --generate-key # Enter same name and email as with 'git config' above. # Signing may require a bit of a dance to: # a) get a text based pinentry: sudo apt-get install pinentry-curses # and b) get gpg to use the right tty export GPG_TTY=$(tty) # set the signed tag git tag -s 1.6.1001 -f -m "manual package v1.6.1001 on $(date -I)." # this should show the tag: git describe # build the .deb package. packages are put in ../ (i.e. a dir above $CWD == osmo-msc) dpkg-buildpackage -uc -us -tc ls ../*.deb </pre>