PKGBUILD 6.1 KB

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