| 24 | ==== Set up building environment ==== |
| 25 | |
| 26 | Install requirements: |
| 27 | |
| 28 | {{{ |
| 29 | sudo apt-get install git-buildpackage |
| 30 | # on Debian also |
| 31 | sudo apt-get install ubuntu-archive-keyring |
| 32 | }}} |
| 33 | |
| 34 | ===== Set sudo access ===== |
| 35 | |
| 36 | Run |
| 37 | |
| 38 | {{{ |
| 39 | sudo visudo |
| 40 | }}} |
| 41 | |
| 42 | and add lines bellow: |
| 43 | |
| 44 | {{{ |
| 45 | # Cmnd alias specification |
| 46 | Cmnd_Alias PBUILDERS=/usr/sbin/pbuilder, /usr/sbin/cowbuilder |
| 47 | |
| 48 | # User privilege specification |
| 49 | <username> ALL=(root) NOPASSWD:PBUILDERS |
| 50 | }}} |
| 51 | |
| 52 | ===== Configuration file ===== |
| 53 | |
| 54 | Configuration file for pbuilder (`~/.pbuilderrc`): |
| 55 | |
| 56 | {{{ |
| 57 | # Optionally set the architecture to the host architecture if none set. Note |
| 58 | # that you can set your own default (i.e. ${ARCH:="i386"}). |
| 59 | : ${ARCH:="$(dpkg --print-architecture)"} |
| 60 | |
| 61 | NAME="$DIST" |
| 62 | if [ -n "${ARCH}" ]; then |
| 63 | NAME="$NAME-$ARCH" |
| 64 | DEBOOTSTRAPOPTS=("--arch" "$ARCH" "${DEBOOTSTRAPOPTS[@]}") |
| 65 | fi |
| 66 | BASETGZ="/var/cache/pbuilder/$NAME-base.tgz" |
| 67 | DISTRIBUTION="$DIST" |
| 68 | BUILDRESULT="/var/cache/pbuilder/$NAME/result/" |
| 69 | APTCACHE="/var/cache/pbuilder/$NAME/aptcache/" |
| 70 | BUILDPLACE="/var/cache/pbuilder/build/" |
| 71 | |
| 72 | DEBOOTSTRAPOPTS=("${DEBOOTSTRAPOPTS[@]}" "--keyring=/usr/share/keyrings/ubuntu-archive-keyring.gpg") |
| 73 | MIRRORSITE="http://cz.archive.ubuntu.com/ubuntu/" |
| 74 | OTHERMIRROR="deb http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu $DIST main" |
| 75 | COMPONENTS="main restricted universe multiverse" |
| 76 | |
| 77 | BUILDRESULT=/root/tmp/pbuilder-results |
| 78 | HOOKDIR=/root/pbuilder-hooks |
| 79 | EXTRAPACKAGES="${EXTRAPACKAGES} devscripts gnupg patchutils vim-tiny openssh-client lintian" |
| 80 | ALLOWUNTRUSTED=yes |
| 81 | }}} |
| 82 | |
| 83 | It's a good idea to configure also lintian pbuilder hook: |
| 84 | |
| 85 | {{{ |
| 86 | mkdir ~/pbuilder-hooks |
| 87 | cp /usr/share/doc/pbuilder/examples/B90lintian ~/pbuilder-hooks/ |
| 88 | sed -i 's/lintian -I --show-overrides/& --pedantic -E/; s/^su /##&/; s/^#su /su /' ~/pbuilder-hooks/B90lintian |
| 89 | }}} |
| 90 | |
| 91 | ==== Create chroot environment ==== |
| 92 | |
| 93 | Create specific chroot environment by (example for Ubuntu Wily - 15.10): |
| 94 | |
| 95 | {{{ |
| 96 | export DIST=wily |
| 97 | sudo -E cowbuilder --create --distribution=$DIST --basepath=/var/cache/pbuilder/base-${DIST}-ubuntugis.cow --save-after-login --login |
| 98 | }} |
| 99 | |
| 100 | === Build new package === |
| 101 | |
| 102 | Clone Git repository |
| 103 | |
| 104 | {{{ |
| 105 | debcheckout --user <username> --git-track '*' grass pkg-grass |
| 106 | cd pkg-grass |
| 107 | }}} |
| 108 | |
| 109 | and checkout selected branch (example for Ubuntu Wily - 15.10): |
| 110 | |
| 111 | {{{ |
| 112 | export DIST=wily |
| 113 | git checkout ubuntugis/$DIST |
| 114 | }}} |
| 115 | |
| 116 | Update changelog by |
| 117 | |
| 118 | {{{ |
| 119 | dch -i |
| 120 | }}} |
| 121 | |
| 122 | a put lines (example for GRASS GIS 7.0.3RC1): |
| 123 | |
| 124 | {{{ |
| 125 | grass (7.0.3~rc1-1~wily1) wily; urgency=medium |
| 126 | |
| 127 | * New upstream release candidate. |
| 128 | |
| 129 | -- [commiters_name] <[commiters_email]> Tue, 12 Jan 2016 20:57:45 +0100 |
| 130 | }}} |
| 131 | |
| 132 | Commit changes to Git repository: |
| 133 | |
| 134 | {{{ |
| 135 | git commit -am"New upstream release candidate (7.0.3RC1)" |
| 136 | git push |
| 137 | }}} |
| 138 | |
| 139 | Build package: |
| 140 | |
| 141 | {{{ |
| 142 | gbp buildpackage --git-pbuilder --git-dist=${DIST}-ubuntugis --git-debian-branch=ubuntugis/$DIST |
| 143 | }}} |
| 144 | |
| 145 | Sign created package |
| 146 | |
| 147 | {{{ |
| 148 | debsign ../grass_7.0.3~rc1-1~wily1_<architecture>.changes |
| 149 | }}} |
| 150 | |
| 151 | and upload to Launchpad: |
| 152 | |
| 153 | {{{ |
| 154 | dput ppa:grass/grass-stable ../ggrass_7.0.3~rc1-1~wily1_<architecture>.changes |
| 155 | }}} |
| 156 | |
| 157 | Tag release version in Git repository: |
| 158 | |
| 159 | {{{ |
| 160 | git tag ubuntugis-wily/7.0.3RC1 |
| 161 | git push --tags |
| 162 | }}} |
| 163 | |
| 164 | ==== Notes ==== |
| 165 | |
| 166 | ===== Create new branch for Ubuntu version ===== |
| 167 | |
| 168 | {{{ |
| 169 | git checkout -b ubuntugis/wily experimental |
| 170 | git push origin ubuntugis/wily |
| 171 | }}} |