Guest User

Untitled

a guest
Jun 30th, 2019
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.13 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-python:
  117. # source: https://libvirt.org/sources/python/libvirt-python-5.4.0.tar.gz
  118. # plugin: python
  119. # python-version: python3
  120. # after: [libvirt]
  121. # build-packages: [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]
  122. # stage-packages: [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]
  123. # virtmanager:
  124. # source: https://virt-manager.org/download/sources/virt-manager/virt-manager-2.2.0.tar.gz
  125. # plugin: python
  126. # python-version: python3
  127. # after: [libvirt-python]
  128.  
  129. layout:
  130. /usr/lib/libvirt:
  131. bind: $SNAP/usr/lib/libvirt
  132. /usr/sbin:
  133. bind: $SNAP/usr/sbin
  134. /sbin:
  135. bind: $SNAP/sbin
  136.  
  137. apps:
  138. libvirtd:
  139. command: usr/sbin/libvirtd
  140. virsh:
  141. command: usr/bin/virsh
  142. bash:
  143. command: bin/bash
  144. environment:
  145. LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/lib/x86_64-linux-gnu/pulseaudio
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154. #ludicrous, the build environment and runtime environment differ, libvirt hard compiles in paths discovered in their configure script
  155. #mount and bind as a workaround for build
  156. mkdir -p /var/snap/virtpackage/common
  157. mount -o bind /root/prime/var/snap/virtpackage/common/ /var/snap/virtpackage/common
  158. PKG_CONFIG_PATH=/root/stage/usr/lib/pkgconfig /root/parts/python-venv/bin/python setup.py install
  159. umount /root/prime/var/snap/virtpackage/common/
  160. /root/parts/python-venv/bin/python -m pip install wheel
  161. /root/parts/python-venv/bin/python -m pip install pgi
  162. /root/parts/python-venv/bin/python -m pip install PyGObject
  163. /root/parts/python-venv/bin/python -m pip install lxml
  164. /root/parts/python-venv/bin/python -m pip install libxml2-python3
  165. /root/parts/python-venv/bin/python -m pip install requests
  166. PKG_CONFIG_PATH=/root/stage/usr/lib/pkgconfig LD_LIBRARY_PATH=/root/stage/usr/lib/:root/stage/lib/ /root/parts/python-venv/bin/python setup.py configure --prefix=/root/parts/virtmanager/install
  167. PKG_CONFIG_PATH=/root/stage/usr/lib/pkgconfig LD_LIBRARY_PATH=/root/stage/usr/lib/:root/stage/lib/ /root/parts/python-venv/bin/python setup.py install
  168. cp -ar /root/parts/virtmanager/install /root/stage
  169. cp -ar /root/parts/virtmanager/install /root/prime
  170. mkdir -p /root/stage/opt
  171. mkdir -p /root/prime/opt
  172. cp -ar /root/parts/python-venv /root/stage/opt
  173. cp -ar /root/parts/python-venv /root/prime/opt
Add Comment
Please, Sign In to add comment