PKGBUILD 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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=3
  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=(ethtool ntp net-tools qubes-vm-utils gnome-packagekit imagemagick fakeroot notification-daemon pygtk zenity qubes-libvchan qubes-db-vm haveged python2-gobject)
  16. makedepends=(qubes-vm-utils qubes-libvchan-xen)
  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)
  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 running with python2
  43. sed 's:#!/usr/bin/python:#!/usr/bin/python2:' -i misc/*
  44. sed 's:#!/usr/bin/python:#!/usr/bin/python2:' -i qubes-rpc/*
  45. # Fix for archlinux sbindir
  46. sed 's:/usr/sbin/ntpdate:/usr/bin/ntpdate:g' -i qubes-rpc/sync-ntp-clock
  47. sed 's:/usr/sbin/qubes-netwatcher:/usr/bin/qubes-netwatcher:g' -i vm-systemd/qubes-netwatcher.service
  48. sed 's:/usr/sbin/qubes-firewall:/usr/bin/qubes-firewall:g' -i vm-systemd/qubes-firewall.service
  49. for dir in qubes-rpc qrexec misc; do
  50. (cd $dir; make)
  51. done
  52. }
  53. package() {
  54. # Note: Archlinux removed use of directory such as /sbin /bin /usr/sbin (https://mailman.archlinux.org/pipermail/arch-dev-public/2012-March/022625.html)
  55. (cd qrexec; make install DESTDIR=$pkgdir SBINDIR=/usr/bin LIBDIR=/usr/lib SYSLIBDIR=/usr/lib)
  56. make install-vm DESTDIR=$pkgdir SBINDIR=/usr/bin LIBDIR=/usr/lib SYSLIBDIR=/usr/lib DIST=archlinux
  57. # Change the place for iptable rules to match archlinux standard
  58. mkdir -p $pkgdir/etc/iptables
  59. mv $pkgdir/usr/lib/qubes/init/iptables $pkgdir/etc/iptables/iptables.rules
  60. mv $pkgdir/usr/lib/qubes/init/ip6tables $pkgdir/etc/iptables/ip6tables.rules
  61. # Remove things non wanted in archlinux
  62. rm -r $pkgdir/etc/yum*
  63. rm -r $pkgdir/etc/init.d
  64. # Remove fedora specific scripts
  65. rm $pkgdir/etc/fstab
  66. # Install systemd script allowing to automount /lib/modules
  67. install -m 644 $srcdir/PKGBUILD.qubes-ensure-lib-modules.service ${pkgdir}/usr/lib/systemd/system/qubes-ensure-lib-modules.service
  68. # Archlinux specific: enable autologin on tty1
  69. mkdir -p $pkgdir/etc/systemd/system/getty@tty1.service.d/
  70. cat <<EOF > $pkgdir/etc/systemd/system/getty@tty1.service.d/autologin.conf
  71. [Service]
  72. ExecStart=
  73. ExecStart=-/usr/bin/agetty --autologin user --noclear %I 38400 linux
  74. EOF
  75. # Archlinux packaging guidelines: /var/run is a symlink to a tmpfs. Don't create it
  76. rm -r $pkgdir/var/run
  77. }
  78. # vim:set ts=2 sw=2 et: