Project

General

Profile

Manually building a distribution package » History » Revision 3

Revision 2 (neels, 09/16/2020 12:48 PM) → Revision 3/8 (neels, 09/16/2020 11:17 PM)

h1. THIS IS WORK IN PROGRESS, unfinished 

 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 

 git clone git://git.osmocom.org/osmo-msc 
 cd osmo-msc 

 # checkout the branch to put in the package 
 git checkout neels/mncc_codecs2 

 # 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. 
 # Signing may require a bit of a dance to a) get gpg to use the right tty and b) to get a text based pinentry: 
 sudo apt-get install pinentry-curses 
 export GPG_TTY=$(tty) 

 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 
 </pre> 
Add picture from clipboard (Maximum size: 48.8 MB)