build.cfg 3.34 KB
Newer Older
1 2 3 4 5 6
[buildout]
extends =
  ../../component/vm-img/debian.cfg
parts =
  debuild-rina-tools
  test-rina
7
download-cache = download-cache
8 9 10 11 12 13 14 15 16

[vm-run-base]
smp = 4
# estimate the of RAM needed depending on the number CPUs
mem = 2048
apt-sources =
apt-update =
  for x in ${:apt-sources}
  do echo deb [trusted=yes] file:`map $x` ./
17 18
  done |sudo sh -c "cat >>/etc/apt/sources.list
  apt-get update"
19 20 21

[debuild-rina-base]
<= vm-run-base
22
mount.rina = ${irati-stack:location}
23
cd-source =
24 25
  git clone -snc core.sparseCheckout=true /mnt/rina rina
  cd rina
26 27 28 29 30 31 32 33 34 35
  echo /${:component} > .git/info/sparse-checkout
  git reset --hard
  cd ${:component}
# following lines are for debchange
  export NAME=`git show -s --format=%cn`
  export EMAIL=`git show -s --format=%ce`
  dist=${:suite}
  [ "$dist" ] && dist=`lsb_release -sc`/$dist || dist=UNRELEASED
prepare =
build-deps =
36
  mk-build-deps -irs sudo -t 'apt-get -y'
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
build =
  dpkg-buildpackage -uc -b -jauto
finalize =
  df
  cd ..
  mv *.changes *.deb $PARTDIR
  cd $PARTDIR
  dpkg-scanpackages -m . /dev/null |gzip --best >Packages.gz
  r=`apt-ftparchive release .`
  echo "$r" > Release
command =
  ${:apt-update}
  ${:cd-source}
  ( ${:prepare}
    ${:build-deps}
    ${:build}
  ) 2>&1 |tee $PARTDIR/build.log
  ${:finalize}

[debuild-rina-kernel]
<= debuild-rina-base
component = linux
prepare =
  debian/dch-snapshot --force-distribution -D $dist
61
  sudo apt-get -y install kernel-wedge quilt python-six
62 63 64 65
  QUILT_PATCHES=$PWD/debian/patches QUILT_PC=.pc quilt push --quiltrc - -a -q --fuzz=0
  debian/rules debian/rules.gen || :
build =
  arch=`dpkg-architecture -qDEB_HOST_ARCH`
66
  fakeroot make -j${:smp} -f debian/rules.gen binary-arch_$${arch}_none binary-libc-dev_$${arch}
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
  dpkg-genchanges -b -UBinary -UDescription \
    >../linux_`dpkg-parsechangelog -S Version`_$${arch}.changes

[debuild-librina]
<= debuild-rina-base
component = librina
apt-sources = ${debuild-rina-kernel:location}
prepare =
  debian/rules DIST=$dist

[debuild-rinad]
<= debuild-librina
component = rinad
apt-sources = ${debuild-librina:location}

[rina-tools-deps]
apt-sources = ${debuild-librina:location} ${debuild-rinad:location}

[debuild-rina-tools]
<= debuild-librina
  rina-tools-deps
component = rina-tools
# check that the built packages install
finalize =
91
  sudo dpkg -i ../*.deb
92 93 94 95 96
  ${debuild-librina:finalize}

[test-rina]
<= vm-run-base
  rina-tools-deps
97
mount.download-cache = ${buildout:download-cache}
98
mount.rina = ${irati-stack:location}
99 100 101 102 103
mount.slapos = ${:_profile_base_location_}/../..
mount.slapos.package = ${slapos.package-repository:location}
commands = install test
install =
  ${:apt-update}
104
  sudo apt-get -y install librinad-dev rinad
105 106
  mkdir software
  cd software
107 108 109 110
  cat <<EOF >buildout.cfg
  [buildout]
  extends = /mnt/slapos/software/hellorina/software.cfg
  develop = /mnt/slapos
111
  download-cache = /mnt/download-cache
112 113 114
  [slapos-cookbook-develop]
  recipe =
  setup =
115
  [irati-stack]
116
  repository = /mnt/rina
117
  shared = true
118 119 120
  [versions]
  slapos.cookbook =
  EOF
121 122
  python -S /mnt/buildout/bin/buildout bootstrap
  MAKEFLAGS=-j${:smp} bin/buildout
123 124

  arch=`dpkg-architecture -qDEB_HOST_ARCH`
125 126 127
  sudo sh -c "/mnt/slapos.package/playbook/roles/rina/gen-ipcm-conf
  systemctl enable ipcm-re6st
  dpkg -i `map ${debuild-rina-kernel:location}`/linux-image-*-$${arch}_*.deb"
128 129 130 131 132
  reboot
test = ( set -x
# TODO: more tests
  grep re6st/1// /sys/rina/ipcps/1/name
  ) 2>&1 |tee $PARTDIR/result