PKGBUILD 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #!/bin/bash
  2. # Maintainer: Olivier Medoc <o_medoc@yahoo.fr>
  3. # shellcheck disable=SC2034
  4. pkgname=qubes-vm-core
  5. pkgver=$(cat version)
  6. pkgrel=11
  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. depends=("qubes-vm-utils>=3.1.3" python2 python3 python2-xdg ethtool ntp net-tools gnome-packagekit imagemagick fakeroot notification-daemon dconf zenity qubes-libvchan "qubes-db-vm>=3.2.1" haveged python2-gobject python2-dbus xdg-utils notification-daemon gawk sed procps-ng librsvg)
  14. makedepends=(gcc make pkg-config "qubes-vm-utils>=3.1.3" qubes-libvchan qubes-db-vm qubes-vm-xen libx11 python2 python3 lsb-release)
  15. checkdepends=()
  16. optdepends=(gnome-keyring gnome-settings-daemon networkmanager iptables tinyproxy python2-nautilus gpk-update-viewer)
  17. provides=()
  18. conflicts=()
  19. replaces=()
  20. backup=()
  21. options=()
  22. install=PKGBUILD.install
  23. changelog=
  24. source=(
  25. PKGBUILD.qubes-ensure-lib-modules.service PKGBUILD.qubes-update-desktop-icons.hook
  26. PKGBUILD-qubes-noupgrade.conf
  27. PKGBUILD-qubes-repo-3.1.conf
  28. PKGBUILD-qubes-repo-3.2.conf
  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; 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. package() {
  56. # Note: Archlinux removed use of directory such as /sbin /bin /usr/sbin (https://mailman.archlinux.org/pipermail/arch-dev-public/2012-March/022625.html)
  57. # shellcheck disable=SC2154
  58. make -C qrexec install DESTDIR="$pkgdir" SBINDIR=/usr/bin LIBDIR=/usr/lib SYSLIBDIR=/usr/lib
  59. make install-vm 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
  60. # Remove things non wanted in archlinux
  61. rm -r "$pkgdir/etc/yum"*
  62. rm -r "$pkgdir/etc/init.d"
  63. # Remove fedora specific scripts
  64. rm "$pkgdir/etc/fstab"
  65. # Install systemd script allowing to automount /lib/modules
  66. install -m 644 "$srcdir/PKGBUILD.qubes-ensure-lib-modules.service" "${pkgdir}/usr/lib/systemd/system/qubes-ensure-lib-modules.service"
  67. # Install pacman hook to update desktop icons
  68. mkdir -p "${pkgdir}/usr/share/libalpm/hooks/"
  69. install -m 644 "$srcdir/PKGBUILD.qubes-update-desktop-icons.hook" "${pkgdir}/usr/share/libalpm/hooks/qubes-update-desktop-icons.hook"
  70. # Install pacman.d drop-ins (at least 1 drop-in must be installed or pacman will fail)
  71. mkdir -p "${pkgdir}/etc/pacman.d"
  72. install -m 644 "$srcdir/PKGBUILD-qubes-noupgrade.conf" "${pkgdir}/etc/pacman.d/10-qubes-noupgrade.conf"
  73. # Install pacman repository
  74. release=$(echo "$pkgver" | cut -d '.' -f 1,2)
  75. echo "Installing repository for release ${release}"
  76. install -m 644 "$srcdir/PKGBUILD-qubes-repo-${release}.conf" "${pkgdir}/etc/pacman.d/99-qubes-repository-${release}.conf.disabled"
  77. # Archlinux specific: enable autologin on tty1
  78. mkdir -p "$pkgdir/etc/systemd/system/getty@tty1.service.d/"
  79. cat <<EOF > "$pkgdir/etc/systemd/system/getty@tty1.service.d/autologin.conf"
  80. [Service]
  81. ExecStart=
  82. ExecStart=-/usr/bin/agetty --autologin user --noclear %I 38400 linux
  83. EOF
  84. # Archlinux packaging guidelines: /var/run is a symlink to a tmpfs. Don't create it
  85. rm -r "$pkgdir/var/run"
  86. }
  87. # vim:set ts=2 sw=2 et: