PKGBUILD 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. #!/bin/bash
  2. # Maintainer: Olivier Medoc <o_medoc@yahoo.fr>
  3. # shellcheck disable=SC2034
  4. pkgname=(qubes-vm-core qubes-vm-networking qubes-vm-keyring)
  5. pkgver=$(cat version)
  6. pkgrel=15
  7. epoch=
  8. pkgdesc="The Qubes core files for installation inside a Qubes VM."
  9. arch=("x86_64")
  10. url="http://qubes-os.org/"
  11. license=('GPL')
  12. groups=()
  13. makedepends=(gcc make pkg-config "qubes-vm-utils>=3.1.3" qubes-libvchan qubes-db-vm qubes-vm-xen libx11 python2 python3 lsb-release pandoc)
  14. checkdepends=()
  15. provides=()
  16. conflicts=()
  17. replaces=()
  18. backup=()
  19. options=()
  20. changelog=
  21. source=(
  22. PKGBUILD.qubes-ensure-lib-modules.service PKGBUILD.qubes-update-desktop-icons.hook
  23. PKGBUILD-qubes-pacman-options.conf
  24. PKGBUILD-qubes-repo-3.2.conf
  25. PKGBUILD-qubes-repo-4.1.conf
  26. PKGBUILD-keyring-keys
  27. PKGBUILD-keyring-trusted
  28. PKGBUILD-keyring-revoked
  29. )
  30. noextract=()
  31. md5sums=(SKIP)
  32. build() {
  33. for source in autostart-dropins qubes-rpc qrexec misc Makefile vm-init.d vm-systemd network init version doc setup.py qubesagent post-install.d; do
  34. # shellcheck disable=SC2154
  35. (ln -s "$srcdir/../$source" "$srcdir/$source")
  36. done
  37. # Fix for network tools paths
  38. sed 's:/sbin/ifconfig:ifconfig:g' -i network/*
  39. sed 's:/sbin/route:route:g' -i network/*
  40. sed 's:/sbin/ethtool:ethtool:g' -i network/*
  41. sed 's:/sbin/ip:ip:g' -i network/*
  42. sed 's:/bin/grep:grep:g' -i network/*
  43. # Fix for archlinux sbindir
  44. sed 's:/usr/sbin/ntpdate:/usr/bin/ntpdate:g' -i qubes-rpc/sync-ntp-clock
  45. sed 's:/usr/sbin/qubes-firewall:/usr/bin/qubes-firewall:g' -i vm-systemd/qubes-firewall.service
  46. for dir in qubes-rpc qrexec misc; do
  47. make -C "$dir"
  48. done
  49. }
  50. #This package provides:
  51. # * qrexec agent
  52. # * qubes rpc scripts
  53. # * core linux tools and scripts
  54. # * core systemd services and drop-ins
  55. # * basic network functionality (setting IP address, DNS, default gateway)
  56. package_qubes-vm-core() {
  57. depends=("qubes-vm-utils>=3.1.3" python2 python2-xdg ethtool ntp net-tools
  58. gnome-packagekit imagemagick fakeroot notification-daemon dconf
  59. zenity qubes-libvchan "qubes-db-vm>=3.2.1" haveged python2-gobject
  60. python2-dbus xdg-utils notification-daemon gawk sed procps-ng librsvg
  61. socat
  62. )
  63. optdepends=(gnome-keyring gnome-settings-daemon python2-nautilus gpk-update-viewer qubes-vm-networking qubes-vm-keyring)
  64. install=PKGBUILD.install
  65. # Note: Archlinux removed use of directory such as /sbin /bin /usr/sbin (https://mailman.archlinux.org/pipermail/arch-dev-public/2012-March/022625.html)
  66. # shellcheck disable=SC2154
  67. make -C qrexec install DESTDIR="$pkgdir" SBINDIR=/usr/bin LIBDIR=/usr/lib SYSLIBDIR=/usr/lib
  68. PYTHON=python2 make install-corevm DESTDIR="$pkgdir" SBINDIR=/usr/bin LIBDIR=/usr/lib SYSLIBDIR=/usr/lib SYSTEM_DROPIN_DIR=/usr/lib/systemd/system USER_DROPIN_DIR=/usr/lib/systemd/user DIST=archlinux
  69. # Remove things non wanted in archlinux
  70. rm -r "$pkgdir/etc/yum"*
  71. rm -r "$pkgdir/etc/dnf"*
  72. rm -r "$pkgdir/etc/init.d"
  73. # Remove fedora specific scripts
  74. rm "$pkgdir/etc/fstab"
  75. # Install systemd script allowing to automount /lib/modules
  76. install -m 644 "$srcdir/PKGBUILD.qubes-ensure-lib-modules.service" "${pkgdir}/usr/lib/systemd/system/qubes-ensure-lib-modules.service"
  77. # Install pacman hook to update desktop icons
  78. mkdir -p "${pkgdir}/usr/share/libalpm/hooks/"
  79. install -m 644 "$srcdir/PKGBUILD.qubes-update-desktop-icons.hook" "${pkgdir}/usr/share/libalpm/hooks/qubes-update-desktop-icons.hook"
  80. # Install pacman.d drop-ins (at least 1 drop-in must be installed or pacman will fail)
  81. mkdir -p "${pkgdir}/etc/pacman.d"
  82. install -m 644 "$srcdir/PKGBUILD-qubes-pacman-options.conf" "${pkgdir}/etc/pacman.d/10-qubes-options.conf"
  83. # Install pacman repository
  84. release=$(echo "$pkgver" | cut -d '.' -f 1,2)
  85. echo "Installing repository for release ${release}"
  86. install -m 644 "$srcdir/PKGBUILD-qubes-repo-${release}.conf" "${pkgdir}/etc/pacman.d/99-qubes-repository-${release}.conf.disabled"
  87. # Archlinux specific: enable autologin on tty1
  88. mkdir -p "$pkgdir/etc/systemd/system/getty@tty1.service.d/"
  89. cat <<EOF > "$pkgdir/etc/systemd/system/getty@tty1.service.d/autologin.conf"
  90. [Service]
  91. ExecStart=
  92. ExecStart=-/usr/bin/agetty --autologin user --noclear %I 38400 linux
  93. EOF
  94. # Archlinux packaging guidelines: /var/run is a symlink to a tmpfs. Don't create it
  95. rm -r "$pkgdir/var/run"
  96. }
  97. #This package provides:
  98. # * proxy service used by TemplateVMs to download updates
  99. # * qubes-firewall service (FirewallVM)
  100. #
  101. #Integration of NetworkManager for Qubes VM:
  102. # * make connections config persistent
  103. # * adjust DNS redirections when needed
  104. # * show/hide NetworkManager applet icon
  105. #
  106. package_qubes-vm-networking() {
  107. pkgdesc="Qubes OS tools allowing to use a Qubes VM as a NetVM/ProxyVM"
  108. depends=(qubes-vm-core "qubes-vm-utils>=3.1.3" python2 ethtool net-tools
  109. "qubes-db-vm>=3.2.1" networkmanager iptables tinyproxy nftables
  110. )
  111. install=PKGBUILD-networking.install
  112. # shellcheck disable=SC2154
  113. PYTHON=python2 make install-netvm DESTDIR="$pkgdir" SBINDIR=/usr/bin LIBDIR=/usr/lib SYSLIBDIR=/usr/lib SYSTEM_DROPIN_DIR=/usr/lib/systemd/system USER_DROPIN_DIR=/usr/lib/systemd/user DIST=archlinux
  114. }
  115. package_qubes-vm-keyring() {
  116. pkgdesc="Qubes OS Binary Repository Activation package and Keyring"
  117. install=PKGBUILD-keyring.install
  118. # Install keyring (will be activated through the .install file)
  119. install -dm755 "${pkgdir}/usr/share/pacman/keyrings/"
  120. install -m0644 PKGBUILD-keyring-keys "${pkgdir}/usr/share/pacman/keyrings/qubesos-vm.gpg"
  121. install -m0644 PKGBUILD-keyring-trusted "${pkgdir}/usr/share/pacman/keyrings/qubesos-vm-trusted"
  122. install -m0644 PKGBUILD-keyring-revoked "${pkgdir}/usr/share/pacman/keyrings/qubesos-vm-revoked"
  123. }
  124. # vim:set ts=2 sw=2 et: