PKGBUILD 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. # This is an example PKGBUILD file. Use this as a start to creating your own,
  2. # and remove these comments. For more information, see 'man PKGBUILD'.
  3. # NOTE: Please fill out the license field for your package! If it is unknown,
  4. # then please put 'unknown'.
  5. # Maintainer: Olivier Medoc <o_medoc@yahoo.fr>
  6. pkgname=qubes-vm-core
  7. pkgver=`cat version`
  8. pkgrel=11
  9. epoch=
  10. pkgdesc="The Qubes core files for installation inside a Qubes VM."
  11. arch=("x86_64")
  12. url="http://qubes-os.org/"
  13. license=('GPL')
  14. groups=()
  15. 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)
  16. makedepends=(gcc make pkg-config "qubes-vm-utils>=3.1.3" qubes-libvchan qubes-db-vm qubes-vm-xen libx11 python2 python3 lsb-release)
  17. checkdepends=()
  18. optdepends=(gnome-keyring gnome-settings-daemon networkmanager iptables tinyproxy python2-nautilus gpk-update-viewer)
  19. provides=()
  20. conflicts=()
  21. replaces=()
  22. backup=()
  23. options=()
  24. install=PKGBUILD.install
  25. changelog=
  26. source=( PKGBUILD.qubes-ensure-lib-modules.service PKGBUILD.qubes-update-desktop-icons.hook
  27. PKGBUILD-qubes-noupgrade.conf
  28. PKGBUILD-qubes-repo-3.1.conf
  29. PKGBUILD-qubes-repo-3.2.conf
  30. )
  31. noextract=()
  32. md5sums=(SKIP)
  33. build() {
  34. for source in autostart-dropins qubes-rpc qrexec misc Makefile vm-init.d vm-systemd network init version; do
  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. (cd $dir; make)
  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. (cd qrexec; make install DESTDIR=$pkgdir SBINDIR=/usr/bin LIBDIR=/usr/lib SYSLIBDIR=/usr/lib)
  58. make install-vm DESTDIR=$pkgdir SBINDIR=/usr/bin LIBDIR=/usr/lib SYSLIBDIR=/usr/lib DROPIN_DIR=usr/lib/systemd DIST=archlinux
  59. # Remove things non wanted in archlinux
  60. rm -r $pkgdir/etc/yum*
  61. rm -r $pkgdir/etc/init.d
  62. # Remove fedora specific scripts
  63. rm $pkgdir/etc/fstab
  64. # Install systemd script allowing to automount /lib/modules
  65. install -m 644 $srcdir/PKGBUILD.qubes-ensure-lib-modules.service ${pkgdir}/usr/lib/systemd/system/qubes-ensure-lib-modules.service
  66. # Install pacman hook to update desktop icons
  67. mkdir -p ${pkgdir}/usr/share/libalpm/hooks/
  68. install -m 644 $srcdir/PKGBUILD.qubes-update-desktop-icons.hook ${pkgdir}/usr/share/libalpm/hooks/qubes-update-desktop-icons.hook
  69. # Install pacman.d drop-ins (at least 1 drop-in must be installed or pacman will fail)
  70. mkdir -p ${pkgdir}/etc/pacman.d
  71. install -m 644 $srcdir/PKGBUILD-qubes-noupgrade.conf ${pkgdir}/etc/pacman.d/10-qubes-noupgrade.conf
  72. # Install pacman repository
  73. release=`echo $pkgver | cut -d '.' -f 1,2`
  74. echo "Installing repository for release ${release}"
  75. install -m 644 $srcdir/PKGBUILD-qubes-repo-${release}.conf ${pkgdir}/etc/pacman.d/99-qubes-repository-${release}.conf
  76. # Archlinux specific: enable autologin on tty1
  77. mkdir -p $pkgdir/etc/systemd/system/getty@tty1.service.d/
  78. cat <<EOF > $pkgdir/etc/systemd/system/getty@tty1.service.d/autologin.conf
  79. [Service]
  80. ExecStart=
  81. ExecStart=-/usr/bin/agetty --autologin user --noclear %I 38400 linux
  82. EOF
  83. # Archlinux packaging guidelines: /var/run is a symlink to a tmpfs. Don't create it
  84. rm -r $pkgdir/var/run
  85. }
  86. # vim:set ts=2 sw=2 et: