PKGBUILD 6.3 KB

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