Guest User

Untitled

a guest
Jun 30th, 2019
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.75 KB | None | 0 0
  1. #build-deps gnutls-dev pkgconf
  2. #apt install libp11-kit-dev libnetcf-dev libnl-3-dev libnl-route3-dev libxml2-dev libdbus1-dev libsasl2-dev libssh-dev libudev-dev libpciaccess-dev libyajl-dev open-iscsi libdevmapper-dev libparted-dev zfsutils-linux
  3.  
  4. name: virtpackage # you probably want to 'snapcraft register <name>'
  5. version: '0.1' # just for humans, typically '1.2+git' or '1.3.2'
  6. summary: QEmu + LibVirt + Virt-Manager
  7. description: |
  8. A package containing QEmu + LibVirt + Virt-Managers
  9. base: core18
  10. grade: devel # must be 'stable' to release into candidate/stable channels
  11. confinement: devmode # use 'strict' once you have the right plugs and slots
  12.  
  13. parts:
  14. bash:
  15. source: https://ftp.gnu.org/gnu/bash/bash-5.0.tar.gz
  16. plugin: autotools
  17. gmplib:
  18. source: https://gmplib.org/download/gmp/gmp-6.1.2.tar.xz
  19. plugin: autotools
  20. stage:
  21. - -share/info/dir
  22. nettle:
  23. source: https://ftp.gnu.org/gnu/nettle/nettle-3.5.1.tar.gz
  24. after: [gmplib]
  25. plugin: autotools
  26. # configflags:
  27. # - --libdir=/usr/lib
  28. gnutls:
  29. source: https://www.gnupg.org/ftp/gcrypt/gnutls/v3.6/gnutls-3.6.8.tar.xz
  30. plugin: autotools
  31. after: [gmplib, nettle]
  32. build-packages: [pkgconf]
  33. configflags:
  34. - --with-included-libtasn1
  35. - --with-included-unistring
  36. stage:
  37. - -share/info/dir
  38. qemu:
  39. source: https://download.qemu.org/qemu-4.0.0.tar.xz
  40. plugin: autotools
  41. build-packages: [libglib2.0-dev,libpulse-dev,libfdt-dev,libpixman-1-dev,zlib1g-dev,python3,libspice-protocol-dev,libspice-server-dev]
  42. stage-packages: [libglib2.0-0,libpulse0,libfdt1,libpixman-1-0,zlib1g,python3,libspice-server1,]
  43. after: [gnutls]
  44. configflags:
  45. - --target-list=x86_64-softmmu
  46. - --audio-drv-list=pa
  47. - --enable-kvm
  48. - --enable-vnc
  49. - --enable-vhost-kernel
  50. - --enable-vhost-user
  51. - --enable-vhost-vsock
  52. - --enable-vhost-scsi
  53. - --enable-spice
  54. - --python=/usr/bin/python3
  55. libvirt:
  56. source: https://libvirt.org/sources/libvirt-5.4.0.tar.xz
  57. plugin: autotools
  58. after: [qemu]
  59. build-packages: [parted, xsltproc,libxml2-utils,pkgconf,libp11-kit-dev,libnetcf-dev,libnl-3-dev,libnl-route-3-dev,libxml2-dev,libdbus-1-dev,libsasl2-dev,libssh-dev,libudev-dev,libpciaccess-dev,libyajl-dev,open-iscsi,libdevmapper-dev,libparted-dev,zfsutils-linux]
  60. stage-packages: [iptables,dmidecode,netcf,libpulse0,dnsmasq-base,parted, xsltproc,libxml2-utils,pkgconf,libp11-kit0,libnetcf1,libnl-3-200,libnl-route-3-200,libxml2,libdbus-1-3,libsasl2-2,libssh-4,libudev1,libpciaccess0,libyajl2,open-iscsi,libdevmapper1.02.1,libparted,zfsutils-linux]
  61. build-environment: #need to override configure script detected binary paths as it stuffs them in config.h and embeds in program macros, build env has these in /root/parts...
  62. - ac_cv_path_DNSMASQ: /usr/sbin/dnsmasq
  63. - ac_cv_path_PARTED=: /sbin/parted
  64. - ac_cv_path_ZFS: /sbin/zfs
  65. - ac_cv_path_ZPOOL: /sbin/zpool
  66. - ac_cv_path_DMIDECODE: /usr/sbin/dmidecode
  67. - ac_cv_path_IPTABLES: /sbin/iptables
  68. configflags:
  69. - --sharedstatedir=/var/snap/virtpackage/common/libvirt/com
  70. - --localstatedir=/var/snap/virtpackage/common/libvirt/var
  71. - --datarootdir=/var/snap/virtpackage/common/libvirt/share
  72. - --prefix=/usr #works around configmake.h build issue
  73. - --disable-silent-rules
  74. - --disable-rpath
  75. - --with-qemu
  76. - --with-qemu-user=libvirt-qemu
  77. - --with-qemu-group=kvm
  78. - --without-openvz
  79. - --without-avahi #disable multicast dns discovery of libvirt hosts
  80. - --with-sasl
  81. - --with-yajl
  82. - --with-ssh
  83. - --with-dbus
  84. - --with-polkit #used for socket access for libvirt clients
  85. - --with-udev
  86. - --with-storage-fs
  87. - --with-storage-dir
  88. - --with-storage-lvm
  89. - --with-storage-iscsi
  90. - --with-storage-disk
  91. - --without-storage-sheepdog
  92. - --without-storage-rbd
  93. - --without-storage-gluster
  94. - --with-storage-zfs
  95. - --with-init-script=systemd
  96. - --without-numactl
  97. - --without-numad
  98. - --without-selinux
  99. - --without-apparmor
  100. - --without-phyp
  101. - --without-esx
  102. - --with-macvtap
  103. - --with-network
  104. - --without-netcf #doesnt seem to work with snap
  105. - --without-xen
  106. - --without-lxc
  107. - --without-audit
  108. - --without-vbox
  109. - --without-libxl
  110. - --without-dtrace
  111. - --without-firewalld
  112. - --without-hal
  113. - --without-attr
  114. - --with-nss-plugin
  115. - --without-wireshark-dissector
  116. libvirt-glib:
  117. source: https://libvirt.org/sources/glib/libvirt-glib-2.0.0.tar.gz
  118. plugin: autotools
  119. after: [libvirt]
  120. configflags:
  121. - --enable-introspection=yes
  122.  
  123. libvirt-python:
  124. source: https://libvirt.org/sources/python/libvirt-python-5.4.0.tar.gz
  125. plugin: dump
  126. after: [libvirt-glib]
  127. virtmanager:
  128. source: https://virt-manager.org/download/sources/virt-manager/virt-manager-2.2.0.tar.gz
  129. plugin: dump
  130. after: [libvirt-python]
  131. build-packages: [python3-cairo,libgirepository1.0-dev,python3-pip,python3-venv, python3-python-utils,python3-setuptools,python3-distutils-extra,python3-wheel,libgtk-3-dev,python3-gi,gir1.2-gtk-vnc-2.0,gir1.2-spiceclientgtk-3.0,libosinfo-1.0-dev,gir1.2-vte-2.91,python3-libxml2,python3-requests]
  132. stage-packages: [python3-cairo,libgirepository-1.0-1,python3-pip,python3-venv, python3-python-utils,python3-setuptools,python3-distutils-extra,python3-wheel,libgtk-3-dev,python3-gi,gir1.2-gtk-vnc-2.0,gir1.2-spiceclientgtk-3.0,libosinfo-1.0-dev,gir1.2-vte-2.91,python3-libxml2,python3-requests]
  133. override-build: |
  134. set -x
  135. /usr/bin/python3 -m pip install virtualenv
  136. /usr/bin/python3 -m venv /opt/python-virt-venv
  137. #because the library was built with this path and it is exposed to python during build...maybe there is a better way to handle it
  138. /opt/python-virt-venv/bin/python -m pip install wheel
  139. /opt/python-virt-venv/bin/python -m pip install pgi
  140. /opt/python-virt-venv/bin/python -m pip install PyGObject
  141. /opt/python-virt-venv/bin/python -m pip install lxml
  142. /opt/python-virt-venv/bin/python -m pip install libxml2-python3
  143. /opt/python-virt-venv/bin/python -m pip install requests
  144. mkdir -p /var/snap/virtpackage/common
  145. mount -o bind /root/stage/var/snap/virtpackage/common/ /var/snap/virtpackage/common
  146. cd /root/parts/libvirt-python/build
  147. PKG_CONFIG_PATH=/root/stage/usr/lib/pkgconfig /opt/python-virt-venv/bin/python setup.py install
  148. umount /var/snap/virtpackage/common
  149. cd /root/parts/virtmanager/build
  150. PKG_CONFIG_PATH=/root/stage/usr/lib/pkgconfig LD_LIBRARY_PATH=/root/stage/usr/lib/:root/stage/lib/ /opt/python-virt-venv/bin/python setup.py configure --prefix=/opt/virtmanager
  151. PKG_CONFIG_PATH=/root/stage/usr/lib/pkgconfig LD_LIBRARY_PATH=/root/stage/usr/lib/:root/stage/lib/ /opt/python-virt-venv/bin/python setup.py install
  152. mkdir -p /root/stage/opt
  153. mkdir -p /root/prime/opt
  154. cp -ar /opt/virtmanager /root/stage/opt
  155. cp -ar /opt/virtmanager /root/prime/opt
  156. cp -ar /opt/python-virt-venv /root/stage/opt
  157. cp -ar /opt/python-virt-venv /root/prime/opt
  158. #somehow usr/bin/pkg-config got touched, must be part of a dep. odd. No need to stage anything in usr for these two parts anyway
  159. stage:
  160. - -usr/bin/pkg-config
  161. - -usr/share/aclocal/pkg.m4
  162. - -usr/share/man/man1/pkg-config.1.gz
  163. - -usr/share/pkg-config-crosswrapper
  164.  
  165.  
  166. layout:
  167. /usr/lib/libvirt:
  168. bind: $SNAP/usr/lib/libvirt
  169. /usr/sbin:
  170. bind: $SNAP/usr/sbin
  171. /sbin:
  172. bind: $SNAP/sbin
  173. /opt:
  174. bind: $SNAP/opt
  175.  
  176. apps:
  177. libvirtd:
  178. command: usr/sbin/libvirtd
  179. virsh:
  180. command: usr/bin/virsh
  181. bash:
  182. command: bin/bash
  183. environment:
  184. LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/lib/x86_64-linux-gnu/pulseaudio
  185. virt-manager:
  186. command: /opt/python-virt-venv/bin/python3 /opt/virtmanager/share/virt-manager/virt-manager
  187. environment:
  188. GI_TYPELIB_PATH: $SNAP/lib/girepository-1.0:$SNAP/usr/lib/x86_64-linux-gnu/girepository-1.0
Add Comment
Please, Sign In to add comment