summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 62831961b94eea13877d1ee851ea06a5f8c83444 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# Maintainer: Otto Sabart <aur@seberm.com>
# Maintainer: Olivier Medoc <o_medoc@yahoo.fr>

pkgname=qubes-vm-xen
pkgver='4.8.5'
pkgrel=14
epoch=
pkgdesc="QubesOS component"
arch=("x86_64")
url="http://qubes-os.org/"
license=('GPL')
groups=()
depends=('python2' 'bridge-utils' 'python2-lxml' 'libutil-linux' 'lzo' 'libsystemd' 'yajl')
makedepends=('wget' 'make' 'gcc' 'patch' 'git' 'bin86' 'dev86' 'iasl' 'yajl' 'pkg-config' 'openssl' 'pixman')
checkdepends=()
optdepends=()
provides=('xen-qubes-vm-essentials')
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=

source=("https://github.com/QubesOS/qubes-vmm-xen/archive/v${pkgver}-${pkgrel}.tar.gz" )
noextract=()
sha512sums=('f151d45ccccf0298285a43de26cbd043f32e6f90728d7c16a40c1ffce56bcdb68d9b6494f30ccb4f28b5e6da2da1a880af9d34b4225c8cae9b221b33e1001eae')


build() {
    export PYTHON=/usr/bin/python2

    cd "${srcdir}/qubes-vmm-xen-${pkgver}-${pkgrel}"
    make get-sources
    make verify-sources
    tar -xvzf "xen-${pkgver}.tar.gz"

    cd xen-$pkgver
    for p in ../patch-*; do ln -f -s $p; done

    ../apply-patches ../series-vm.conf .

    export XEN_VENDORVERSION="-$pkgrel"
    export OCAML_TOOLS=n
    export PYTHON=/usr/bin/python2
    unset LDFLAGS

    autoreconf
    ./configure --prefix=/usr \
                --sbindir=/usr/bin \
                --disable-ocamltools \
                --disable-blktap2

    #make prefix=/usr dist-xen
    make prefix=/usr dist-tools
    #make prefix=/usr dist-docs
}

package() {
    cd "${srcdir}/qubes-vmm-xen-${pkgver}-${pkgrel}"
    cd xen-$pkgver

    export OCAML_TOOLS=n
    export PYTHON=python2

    # Note: Archlinux removed use of directory such as /sbin /bin /usr/sbin (https://mailman.archlinux.org/pipermail/arch-dev-public/2012-March/022625.html)
    make DESTDIR=$pkgdir LIBDIR=/usr/lib/ SBINDIR=/usr/bin prefix=/usr install-tools

    # Remove unwated stuff

    # stubdom: newlib
    rm -rf $pkgdir/usr/*-xen-elf

    # hypervisor symlinks
    rm -rf $pkgdir/boot/

    # silly doc dir fun
    rm -rf $pkgdir/usr/share/doc/xen
    rm -rf $pkgdir/usr/share/doc/qemu

    # Pointless helper
    rm -f $pkgdir/usr/bin/xen-python-path

    # qemu stuff (unused or available from upstream)
    rm -rf $pkgdir/usr/share/xen/man

    # README's not intended for end users
    rm -rf $pkgdir/etc/xen/README*

    # standard gnu info files (removed by packaging post actions anyway)
    rm -rf $pkgdir/usr/info

    # adhere to Static Library Packaging Guidelines
    rm -rf $pkgdir/usr/lib/*.a

    # not used in Qubes VM
    rm -f $pkgdir/usr/bin/xenstored
    rm -f $pkgdir/usr/share/xen/create.dtd
    rm -rf $pkgdir/etc/sysconfig
    rm -rf $pkgdir/etc/rc.d/init.d

    rm -r "$pkgdir/var/run"

    ############ fixup files in /etc ############
    # udev
    rm -f $pkgdir/etc/udev/rules.d/xend.rules

    # config file only used for hotplug, Fedora uses udev instead
    rm -f $pkgdir/etc/sysconfig/xend

    ############ assemble license files ############
    mkdir licensedir
    # avoid licensedir to avoid recursion, also stubdom/ioemu and dist
    # which are copies of files elsewhere
    find . -path licensedir -prune -o -path stubdom/ioemu -prune -o \
      -path dist -prune -o -name COPYING -o -name LICENSE | while read file; do
      mkdir -p licensedir/`dirname $file`
      install -m 644 $file licensedir/$file
    done
    ############ all done now ############

    # Remove /var/lock (it is tmpfs in archlinux anyway)
    rm -rf $pkgdir/var/lock
}