summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 58b235c58eb7c00d3f00b20ea8a5fa657334b7e3 (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
# Maintainer: robertfoster
# Contributor: abozanich

pkg=linux-sgx-driver
pkgname=$pkg-dkms-git
pkgver=2.5
pkgrel=1
pkgdesc="IntelĀ® SGX Linux module - dkms"
arch=('i686' 'x86_64')
url="https://01.org/intel-softwareguard-extensions"
license=('GPL2')
depends=('dkms')
optdepends=('linux-headers: Build the module for Arch kernel'
'linux-lts-headers: Build the module for LTS Arch kernel')
source=("$pkg::git+https://github.com/01org/linux-sgx-driver.git"
dkms.conf)

pkgver() {
    cd $srcdir/$pkg
    git describe --tags | cut -c 12-
}

package() {
    installDir="$pkgdir/usr/src/$pkg-$pkgver"

    install -dm755 "$installDir"

    # Copy dkms .conf
    install -Dm644 ../dkms.conf "$installDir/dkms.conf"

    # Set name and version
    sed -e "s/@PKG@/${pkg}/" \
        -e "s/@PKGVER@/${pkgver}/" \
        -i "$installDir/dkms.conf"

    # Copy sources
    cd $srcdir/$pkg

    for d in `find . -type d`
    do
        install -dm755  "${installDir}/$d"
    done
    for f in `find . -type f ! -name 'README.md' ! -name '.gitignore'`
    do
        install -m644 "$f" "${installDir}/$f"
    done

    sed -e "s/-O0//" \
        -i "$installDir/Makefile"
}

md5sums=('SKIP'
'620201f62a773287ddfa6e9b0ffde1f8')