cloudflare/ClickHouse
Publicmirrored fromhttps://github.com/cloudflare/ClickHouse
debian/.pbuilderrc
154lines · modecode
| 1 | # ubuntu: |
| 2 | # prepare old (trusty or earlier) host system: |
| 3 | # sudo ln -s gutsy /usr/share/debootstrap/scripts/artful |
| 4 | # sudo ln -s gutsy /usr/share/debootstrap/scripts/bionic |
| 5 | # build ubuntu: |
| 6 | # sudo DIST=trusty pbuilder create --configfile debian/.pbuilderrc && DIST=trusty pdebuild --configfile debian/.pbuilderrc |
| 7 | # sudo DIST=xenial pbuilder create --configfile debian/.pbuilderrc && DIST=xenial pdebuild --configfile debian/.pbuilderrc |
| 8 | # sudo DIST=zesty pbuilder create --configfile debian/.pbuilderrc && DIST=zesty pdebuild --configfile debian/.pbuilderrc |
| 9 | # sudo DIST=artful pbuilder create --configfile debian/.pbuilderrc && DIST=artful pdebuild --configfile debian/.pbuilderrc |
| 10 | # sudo DIST=bionic pbuilder create --configfile debian/.pbuilderrc && DIST=bionic pdebuild --configfile debian/.pbuilderrc |
| 11 | # sudo DIST=devel pbuilder create --configfile debian/.pbuilderrc && DIST=devel pdebuild --configfile debian/.pbuilderrc |
| 12 | # build debian: |
| 13 | # sudo DIST=stable pbuilder create --configfile debian/.pbuilderrc && DIST=stable pdebuild --configfile debian/.pbuilderrc |
| 14 | # sudo DIST=testing pbuilder create --configfile debian/.pbuilderrc && DIST=testing pdebuild --configfile debian/.pbuilderrc |
| 15 | # sudo DIST=unstable pbuilder create --configfile debian/.pbuilderrc && DIST=unstable pdebuild --configfile debian/.pbuilderrc |
| 16 | # sudo DIST=experimental pbuilder create --configfile debian/.pbuilderrc && DIST=experimental pdebuild --configfile debian/.pbuilderrc |
| 17 | # build i386 experimental: |
| 18 | # sudo DIST=trusty ARCH=i386 pbuilder create --configfile debian/.pbuilderrc && DIST=trusty ARCH=i386 pdebuild --configfile debian/.pbuilderrc |
| 19 | # sudo DIST=xenial ARCH=i386 pbuilder create --configfile debian/.pbuilderrc && DIST=xenial ARCH=i386 pdebuild --configfile debian/.pbuilderrc |
| 20 | # sudo DIST=zesty ARCH=i386 pbuilder create --configfile debian/.pbuilderrc && DIST=zesty ARCH=i386 pdebuild --configfile debian/.pbuilderrc |
| 21 | # sudo DIST=artful ARCH=i386 pbuilder create --configfile debian/.pbuilderrc && DIST=artful ARCH=i386 pdebuild --configfile debian/.pbuilderrc |
| 22 | # sudo DIST=bionic ARCH=i386 pbuilder create --configfile debian/.pbuilderrc && DIST=bionic ARCH=i386 pdebuild --configfile debian/.pbuilderrc |
| 23 | # sudo DIST=stable ARCH=i386 pbuilder create --configfile debian/.pbuilderrc && DIST=stable ARCH=i386 pdebuild --configfile debian/.pbuilderrc |
| 24 | # sudo DIST=testing ARCH=i386 pbuilder create --configfile debian/.pbuilderrc && DIST=testing ARCH=i386 pdebuild --configfile debian/.pbuilderrc |
| 25 | # sudo DIST=experimental ARCH=i386 pbuilder create --configfile debian/.pbuilderrc && DIST=experimental ARCH=i386 pdebuild --configfile debian/.pbuilderrc |
| 26 | # with embedded compiler (only artful have clang-5.0): |
| 27 | # env EXTRAPACKAGES="liblld-5.0-dev libclang-5.0-dev liblld-5.0" CMAKE_FLAGS="-DUSE_EMBEDDED_COMPILER=1" DIST=artful pdebuild --configfile debian/.pbuilderrc |
| 28 | # use only clang: |
| 29 | # env DEB_CC=clang-5.0 DEB_CXX=clang++-5.0 env EXTRAPACKAGES="liblld-5.0 liblld-5.0-dev libclang-5.0-dev clang-5.0" CMAKE_FLAGS="-DNO_WERROR=1 -DUSE_EMBEDDED_COMPILER=1" DIST=artful pdebuild --configfile debian/.pbuilderrc |
| 30 | |
| 31 | # Your packages built here: /var/cache/pbuilder/*-*/result |
| 32 | |
| 33 | # from https://wiki.debian.org/PbuilderTricks : |
| 34 | |
| 35 | # Codenames for Debian suites according to their alias. Update these when |
| 36 | # needed. |
| 37 | UNSTABLE_CODENAME="sid" |
| 38 | TESTING_CODENAME="buster" |
| 39 | STABLE_CODENAME="stretch" |
| 40 | STABLE_BACKPORTS_SUITE="$STABLE_CODENAME-backports" |
| 41 | |
| 42 | # List of Debian suites. |
| 43 | DEBIAN_SUITES=($UNSTABLE_CODENAME $TESTING_CODENAME $STABLE_CODENAME $STABLE_BACKPORTS_SUITE |
| 44 | "experimental" "unstable" "testing" "stable") |
| 45 | |
| 46 | # List of Ubuntu suites. Update these when needed. |
| 47 | UBUNTU_SUITES=("bionic" "artful" "zesty" "xenial" "trusty" "devel") |
| 48 | |
| 49 | # Mirrors to use. Update these to your preferred mirror. |
| 50 | DEBIAN_MIRROR="deb.debian.org" |
| 51 | #UBUNTU_MIRROR="mirrors.kernel.org" |
| 52 | |
| 53 | UBUNTU_MIRROR="mirror.yandex.ru" |
| 54 | #DEBIAN_MIRROR="mirror.yandex.ru" |
| 55 | |
| 56 | # Set a default distribution if none is used. Note that you can set your own default (i.e. ${DIST:="unstable"}). |
| 57 | : ${DIST:="$(lsb_release --short --codename)"} |
| 58 | |
| 59 | # Optionally change Debian codenames in $DIST to their aliases. |
| 60 | case "$DIST" in |
| 61 | $UNSTABLE_CODENAME) |
| 62 | DIST="unstable" |
| 63 | ;; |
| 64 | $TESTING_CODENAME) |
| 65 | DIST="testing" |
| 66 | ;; |
| 67 | $STABLE_CODENAME) |
| 68 | DIST="stable" |
| 69 | ;; |
| 70 | esac |
| 71 | |
| 72 | # Optionally set the architecture to the host architecture if none set. Note |
| 73 | # that you can set your own default (i.e. ${ARCH:="i386"}). |
| 74 | : ${ARCH:="$(dpkg --print-architecture)"} |
| 75 | |
| 76 | NAME="$DIST" |
| 77 | if [ -n "${ARCH}" ]; then |
| 78 | NAME="$NAME-$ARCH" |
| 79 | DEBOOTSTRAPOPTS=("--arch" "$ARCH" "${DEBOOTSTRAPOPTS[@]}") |
| 80 | fi |
| 81 | |
| 82 | BASETGZ="/var/cache/pbuilder/$NAME-base.tgz" |
| 83 | DISTRIBUTION="$DIST" |
| 84 | BUILDRESULT="/var/cache/pbuilder/$NAME/result/" |
| 85 | APTCACHE="/var/cache/pbuilder/$NAME/aptcache/" |
| 86 | BUILDPLACE="/var/cache/pbuilder/build/" |
| 87 | |
| 88 | if $(echo ${DEBIAN_SUITES[@]} | grep -q $DIST); then |
| 89 | # Debian configuration |
| 90 | OSNAME=debian |
| 91 | MIRRORSITE="http://$DEBIAN_MIRROR/$OSNAME/" |
| 92 | COMPONENTS="main contrib non-free" |
| 93 | if $(echo "$STABLE_CODENAME stable" | grep -q $DIST); then |
| 94 | OTHERMIRROR="$OTHERMIRROR | deb $MIRRORSITE $STABLE_BACKPORTS_SUITE $COMPONENTS" |
| 95 | fi |
| 96 | # APTKEYRINGS=/usr/share/keyrings/debian-archive-keyring.gpg |
| 97 | # sudo apt install debian-archive-keyring |
| 98 | DEBOOTSTRAPOPTS+=( '--keyring' '/usr/share/keyrings/debian-archive-keyring.gpg' ) |
| 99 | elif $(echo ${UBUNTU_SUITES[@]} | grep -q $DIST); then |
| 100 | # Ubuntu configuration |
| 101 | OSNAME=ubuntu |
| 102 | MIRRORSITE="http://$UBUNTU_MIRROR/$OSNAME/" |
| 103 | COMPONENTS="main restricted universe multiverse" |
| 104 | |
| 105 | OTHERMIRROR+="deb $MIRRORSITE $DIST-updates main restricted universe multiverse |" |
| 106 | OTHERMIRROR+="deb $MIRRORSITE $DIST-security main restricted universe multiverse |" |
| 107 | |
| 108 | case "$DIST" in |
| 109 | "trusty" | "xenial" ) |
| 110 | OTHERMIRROR+="deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/$OSNAME $DIST main |" |
| 111 | ALLOWUNTRUSTED=yes |
| 112 | ;; |
| 113 | esac |
| 114 | |
| 115 | # deb http://apt.llvm.org/zesty/ llvm-toolchain-zesty-5.0 main |
| 116 | else |
| 117 | echo "Unknown distribution: $DIST" |
| 118 | exit 1 |
| 119 | fi |
| 120 | |
| 121 | echo "using $NAME $OSNAME $DIST $ARCH $LOGNAME" |
| 122 | |
| 123 | case "$DIST" in |
| 124 | "trusty") |
| 125 | # ccache broken |
| 126 | ;; |
| 127 | *) |
| 128 | CCACHEDIR=/var/cache/pbuilder/ccache |
| 129 | ;; |
| 130 | esac |
| 131 | |
| 132 | case "$DIST" in |
| 133 | "trusty" | "xenial" | "experimental" | "unstable" ) |
| 134 | export DEB_CC=gcc-7 |
| 135 | export DEB_CXX=g++-7 |
| 136 | ;; |
| 137 | esac |
| 138 | |
| 139 | export CCACHE_PREFIX= |
| 140 | |
| 141 | export DEB_BUILD_OPTIONS=parallel=`nproc` |
| 142 | |
| 143 | # Floating bug with permissions: |
| 144 | sudo mkdir -p /var/cache/pbuilder/ccache |
| 145 | sudo chmod -R a+rwx /var/cache/pbuilder/ccache |
| 146 | |
| 147 | # echo "DEBOOTSTRAPOPTS = ${DEBOOTSTRAPOPTS[@]}" |
| 148 | |
| 149 | # Use current dir to make package (by default should have src archive) |
| 150 | # echo "3.0 (native)" > debian/source/format |
| 151 | # OR |
| 152 | # pdebuild --debbuildopts "--source-option=--format=\"3.0 (native)\"" |
| 153 | # OR |
| 154 | DEBBUILDOPTS="--source-option=--format=\"3.0 (native)\"" |