PKGBUILD 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. #!/bin/bash
  2. # shellcheck disable=SC2034
  3. pkgname=(qubes-vm-core qubes-vm-networking qubes-vm-keyring)
  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 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 qubes-rpc qrexec misc 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 qrexec misc; do
  44. make -C "$dir"
  45. done
  46. }
  47. #This package provides:
  48. # * qrexec agent
  49. # * qubes rpc scripts
  50. # * core linux tools and scripts
  51. # * core systemd services and drop-ins
  52. # * basic network functionality (setting IP address, DNS, default gateway)
  53. package_qubes-vm-core() {
  54. depends=(qubes-vm-utils python python-xdg ethtool ntp net-tools
  55. gnome-packagekit imagemagick fakeroot notification-daemon dconf
  56. zenity qubes-libvchan qubes-db-vm haveged python-gobject
  57. python-dbus xdg-utils notification-daemon gawk sed procps-ng librsvg
  58. socat
  59. )
  60. optdepends=(gnome-keyring gnome-settings-daemon python-nautilus gpk-update-viewer qubes-vm-networking qubes-vm-keyring)
  61. install=PKGBUILD.install
  62. # Note: Archlinux removed use of directory such as /sbin /bin /usr/sbin (https://mailman.archlinux.org/pipermail/arch-dev-public/2012-March/022625.html)
  63. # shellcheck disable=SC2154
  64. make -C qrexec install DESTDIR="$pkgdir" SBINDIR=/usr/bin LIBDIR=/usr/lib SYSLIBDIR=/usr/lib
  65. 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
  66. make -C qubes-rpc DESTDIR="$pkgdir" install
  67. make -C qubes-rpc/kde DESTDIR="$pkgdir" install
  68. make -C qubes-rpc/nautilus DESTDIR="$pkgdir" install
  69. make -C qubes-rpc/thunar DESTDIR="$pkgdir" install
  70. # Remove things non wanted in archlinux
  71. rm -r "$pkgdir/etc/yum"*
  72. rm -r "$pkgdir/etc/dnf"*
  73. rm -r "$pkgdir/etc/init.d"
  74. # Remove fedora specific scripts
  75. rm "$pkgdir/etc/fstab"
  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 "${pkgdir}/etc/pacman.d"
  83. install -m 644 "$srcdir/PKGBUILD-qubes-pacman-options.conf" "${pkgdir}/etc/pacman.d/10-qubes-options.conf"
  84. # Install pacman repository
  85. release=$(echo "$pkgver" | cut -d '.' -f 1,2)
  86. echo "Installing repository for release ${release}"
  87. install -m 644 "$srcdir/PKGBUILD-qubes-repo-${release}.conf" "${pkgdir}/etc/pacman.d/99-qubes-repository-${release}.conf.disabled"
  88. # Archlinux specific: enable autologin on tty1
  89. mkdir -p "$pkgdir/etc/systemd/system/getty@tty1.service.d/"
  90. cat <<EOF > "$pkgdir/etc/systemd/system/getty@tty1.service.d/autologin.conf"
  91. [Service]
  92. ExecStart=
  93. ExecStart=-/usr/bin/agetty --autologin user --noclear %I 38400 linux
  94. EOF
  95. # Archlinux packaging guidelines: /var/run is a symlink to a tmpfs. Don't create it
  96. rm -r "$pkgdir/var/run"
  97. }
  98. #This package provides:
  99. # * proxy service used by TemplateVMs to download updates
  100. # * qubes-firewall service (FirewallVM)
  101. #
  102. #Integration of NetworkManager for Qubes VM:
  103. # * make connections config persistent
  104. # * adjust DNS redirections when needed
  105. # * show/hide NetworkManager applet icon
  106. #
  107. package_qubes-vm-networking() {
  108. pkgdesc="Qubes OS tools allowing to use a Qubes VM as a NetVM/ProxyVM"
  109. depends=(qubes-vm-core qubes-vm-utils python ethtool net-tools
  110. qubes-db-vm networkmanager iptables tinyproxy nftables
  111. )
  112. install=PKGBUILD-networking.install
  113. # shellcheck disable=SC2154
  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. # vim:set ts=2 sw=2 et: