PKGBUILD 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. #!/bin/bash
  2. # shellcheck disable=SC2034
  3. pkgname=(qubes-vm-core qubes-vm-networking qubes-vm-keyring qubes-vm-passwordless-root)
  4. pkgver=$(cat version)
  5. pkgrel=15
  6. epoch=
  7. pkgdesc="The Qubes core files for installation inside a Qubes VM."
  8. arch=("x86_64")
  9. url="http://qubes-os.org/"
  10. license=('GPL')
  11. groups=()
  12. makedepends=(gcc make pkg-config qubes-vm-utils qubes-libvchan qubes-db-vm qubes-vm-xen libx11 python python-setuptools lsb-release pandoc)
  13. checkdepends=()
  14. provides=()
  15. conflicts=()
  16. replaces=()
  17. backup=()
  18. options=()
  19. changelog=
  20. source=(
  21. PKGBUILD.qubes-ensure-lib-modules.service PKGBUILD.qubes-update-desktop-icons.hook
  22. PKGBUILD-qubes-pacman-options.conf
  23. PKGBUILD-qubes-repo-4.1.conf
  24. PKGBUILD-keyring-keys
  25. PKGBUILD-keyring-trusted
  26. PKGBUILD-keyring-revoked
  27. )
  28. noextract=()
  29. md5sums=(SKIP)
  30. build() {
  31. 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
  32. # shellcheck disable=SC2154
  33. (ln -s "$srcdir/../$source" "$srcdir/$source")
  34. done
  35. # Fix for network tools paths
  36. sed 's:/sbin/ifconfig:ifconfig:g' -i network/*
  37. sed 's:/sbin/route:route:g' -i network/*
  38. sed 's:/sbin/ethtool:ethtool:g' -i network/*
  39. sed 's:/sbin/ip:ip:g' -i network/*
  40. sed 's:/bin/grep:grep:g' -i network/*
  41. # Fix for archlinux sbindir
  42. sed 's:/usr/sbin/ntpdate:/usr/bin/ntpdate:g' -i qubes-rpc/sync-ntp-clock
  43. for dir in qubes-rpc misc; do
  44. make -C "$dir"
  45. done
  46. }
  47. #This package provides:
  48. # * qubes rpc scripts
  49. # * core linux tools and scripts
  50. # * core systemd services and drop-ins
  51. # * basic network functionality (setting IP address, DNS, default gateway)
  52. package_qubes-vm-core() {
  53. depends=(qubes-vm-utils python python-xdg ethtool ntp net-tools
  54. gnome-packagekit imagemagick fakeroot notification-daemon dconf
  55. zenity qubes-libvchan qubes-db-vm haveged python-gobject
  56. python-dbus xdg-utils notification-daemon gawk sed procps-ng librsvg
  57. socat
  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: