PKGBUILD 3.5 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=18
  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-libvchan qubes-vm-utils imagemagick ntp zenity notification-daemon haveged)
  16. makedepends=(qubes-vm-utils)
  17. checkdepends=()
  18. optdepends=()
  19. provides=()
  20. conflicts=()
  21. replaces=()
  22. backup=()
  23. options=()
  24. install=PKGBUILD.install
  25. changelog=
  26. source=(PKGBUILD.qubes-ensure-lib-modules.service)
  27. noextract=()
  28. md5sums=('88f4b3d5b156888a9d38f5bc28702ab8') #generate with 'makepkg -g'
  29. build() {
  30. for source in qubes-rpc qrexec misc Makefile vm-init.d vm-systemd network ; do
  31. (ln -s $srcdir/../$source $srcdir/$source)
  32. done
  33. # Fix for building with python2
  34. export PYTHON=python2
  35. sed 's:python:python2:g' -i misc/Makefile
  36. # Fix for network tools paths
  37. sed 's:/sbin/ifconfig:ifconfig:g' -i network/*
  38. sed 's:/sbin/route:route:g' -i network/*
  39. sed 's:/sbin/ethtool:ethtool:g' -i network/*
  40. sed 's:/sbin/ip:ip:g' -i network/*
  41. sed 's:/bin/grep:grep:g' -i network/*
  42. # Fix for archlinux sbindir
  43. sed 's:/usr/sbin/ntpdate:/usr/bin/ntpdate:g' -i qubes-rpc/sync-ntp-clock
  44. sed 's:/usr/sbin/qubes-netwatcher:/usr/bin/qubes-netwatcher:g' -i vm-systemd/qubes-netwatcher.service
  45. sed 's:/usr/sbin/qubes-firewall:/usr/bin/qubes-firewall:g' -i vm-systemd/qubes-firewall.service
  46. for dir in qubes-rpc qrexec misc; do
  47. (cd $dir; make)
  48. done
  49. }
  50. package() {
  51. # Note: Archlinux removed use of directory such as /sbin /bin /usr/sbin (https://mailman.archlinux.org/pipermail/arch-dev-public/2012-March/022625.html)
  52. (cd qrexec; make install DESTDIR=$pkgdir SBINDIR=/usr/bin)
  53. make install-vm DESTDIR=$pkgdir SBINDIR=/usr/bin DIST=archlinux
  54. # Convert module loading to ARCHLINUX
  55. mkdir -p $pkgdir/etc/modules-load.d/
  56. #misc/qubes-core.modules
  57. echo xen-evtchn > $pkgdir/etc/modules-load.d/qubes_core.conf
  58. echo xen-blkback >> $pkgdir/etc/modules-load.d/qubes_core.conf
  59. # Note : need to compile pvusb drivers for this last one?
  60. echo xen-usbfront >> $pkgdir/etc/modules-load.d/qubes_core.conf
  61. #misc/qubes-misc.modules
  62. #install -D misc/qubes_misc.modules $pkgdir/etc/sysconfig/modules/qubes_misc.modules
  63. echo dummy-hcd > $pkgdir/etc/modules-load.d/qubes_misc.conf
  64. # Change the place for iptable rules to match archlinux standard
  65. mkdir -p $pkgdir/etc/iptables
  66. mv $pkgdir/etc/sysconfig/iptables $pkgdir/etc/iptables/iptables.rules
  67. mv $pkgdir/etc/sysconfig/ip6tables $pkgdir/etc/iptables/ip6tables.rules
  68. # Note: appears in the gui package but required for qrexec agent to work
  69. echo u2mfn > $pkgdir/etc/modules-load.d/qubes_u2mfn.conf
  70. # Remove things non wanted in archlinux
  71. rm -r $pkgdir/etc/yum*
  72. rm -r $pkgdir/etc/init.d
  73. # Remove fedora specific scripts
  74. rm $pkgdir/etc/fstab
  75. # Install systemd script allowing to automount /lib/modules
  76. install -m 644 $srcdir/PKGBUILD.qubes-ensure-lib-modules.service $pkgdir/lib/systemd/system/qubes-ensure-lib-modules.service
  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. }
  85. # vim:set ts=2 sw=2 et: