PKGBUILD 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. pkgname=(qubes-vm-core qubes-vm-networking qubes-vm-keyring qubes-vm-passwordless-root)
  2. pkgver=$(cat version)
  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 post-install.d; do
  30. # shellcheck disable=SC2154
  31. (ln -s "$srcdir/../$source" "$srcdir/$source")
  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. depends=(qubes-vm-utils python python-xdg ethtool ntp net-tools
  52. gnome-packagekit imagemagick fakeroot notification-daemon dconf
  53. zenity qubes-libvchan qubes-db-vm haveged python-gobject
  54. python-dbus xdg-utils notification-daemon gawk sed procps-ng librsvg
  55. socat pacman-contrib
  56. # Block updating if there is a major python update as the python API will be in the wrong PYTHONPATH
  57. 'python<3.10'
  58. )
  59. optdepends=(gnome-keyring gnome-settings-daemon python-nautilus gpk-update-viewer qubes-vm-networking qubes-vm-keyring)
  60. install=PKGBUILD.install
  61. # shellcheck disable=SC2154
  62. 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
  63. make -C app-menu install DESTDIR="$pkgdir" install LIBDIR=/usr/lib SYSLIBDIR=/usr/lib
  64. make -C misc install DESTDIR="$pkgdir" install LIBDIR=/usr/lib SYSLIBDIR=/usr/lib
  65. make -C qubes-rpc DESTDIR="$pkgdir" install
  66. make -C qubes-rpc/kde DESTDIR="$pkgdir" install
  67. make -C qubes-rpc/nautilus DESTDIR="$pkgdir" install
  68. make -C qubes-rpc/thunar DESTDIR="$pkgdir" install
  69. # Install systemd script allowing to automount /lib/modules
  70. install -m 644 "$srcdir/PKGBUILD.qubes-ensure-lib-modules.service" "${pkgdir}/usr/lib/systemd/system/qubes-ensure-lib-modules.service"
  71. # Install pacman hook to update desktop icons
  72. mkdir -p "${pkgdir}/usr/share/libalpm/hooks/"
  73. install -m 644 "$srcdir/PKGBUILD.qubes-update-desktop-icons.hook" "${pkgdir}/usr/share/libalpm/hooks/qubes-update-desktop-icons.hook"
  74. # Install pacman.d drop-ins (at least 1 drop-in must be installed or pacman will fail)
  75. mkdir -p "${pkgdir}/etc/pacman.d"
  76. install -m 644 "$srcdir/PKGBUILD-qubes-pacman-options.conf" "${pkgdir}/etc/pacman.d/10-qubes-options.conf"
  77. # Install pacman repository
  78. release=$(echo "$pkgver" | cut -d '.' -f 1,2)
  79. echo "Installing repository for release ${release}"
  80. install -m 644 "$srcdir/PKGBUILD-qubes-repo-${release}.conf" "${pkgdir}/etc/pacman.d/99-qubes-repository-${release}.conf.disabled"
  81. # Archlinux specific: enable autologin on tty1
  82. mkdir -p "$pkgdir/etc/systemd/system/getty@tty1.service.d/"
  83. cat <<EOF > "$pkgdir/etc/systemd/system/getty@tty1.service.d/autologin.conf"
  84. [Service]
  85. ExecStart=
  86. ExecStart=-/usr/bin/agetty --autologin user --noclear %I 38400 linux
  87. EOF
  88. # Archlinux packaging guidelines: /var/run is a symlink to a tmpfs. Don't create it
  89. rm -rf "$pkgdir/var/run"
  90. }
  91. #This package provides:
  92. # * proxy service used by TemplateVMs to download updates
  93. # * qubes-firewall service (FirewallVM)
  94. #
  95. #Integration of NetworkManager for Qubes VM:
  96. # * make connections config persistent
  97. # * adjust DNS redirections when needed
  98. # * show/hide NetworkManager applet icon
  99. #
  100. package_qubes-vm-networking() {
  101. pkgdesc="Qubes OS tools allowing to use a Qubes VM as a NetVM/ProxyVM"
  102. depends=(qubes-vm-core qubes-vm-utils python ethtool net-tools
  103. qubes-db-vm networkmanager iptables tinyproxy nftables
  104. conntrack-tools
  105. )
  106. install=PKGBUILD-networking.install
  107. # shellcheck disable=SC2154
  108. 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
  109. 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
  110. }
  111. package_qubes-vm-keyring() {
  112. pkgdesc="Qubes OS Binary Repository Activation package and Keyring"
  113. install=PKGBUILD-keyring.install
  114. # Install keyring (will be activated through the .install file)
  115. install -dm755 "${pkgdir}/usr/share/pacman/keyrings/"
  116. install -m0644 PKGBUILD-keyring-keys "${pkgdir}/usr/share/pacman/keyrings/qubesos-vm.gpg"
  117. install -m0644 PKGBUILD-keyring-trusted "${pkgdir}/usr/share/pacman/keyrings/qubesos-vm-trusted"
  118. install -m0644 PKGBUILD-keyring-revoked "${pkgdir}/usr/share/pacman/keyrings/qubesos-vm-revoked"
  119. }
  120. package_qubes-vm-passwordless-root() {
  121. pkgdesc="Qubes OS Passwordless root access from normal user"
  122. 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
  123. }
  124. # vim:set ts=2 sw=2 et: