PKGBUILD 5.9 KB

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