updated on Mon Jan 16 00:01:41 UTC 2012
[aur-mirror.git] / sqlzma / PKGBUILD
blobe9668eb9adef444a79e7dd5c495256e65699868f
1 # Contributor: Jens Pranaitis <jens@jenux.homelinux.org>
2 # Contributor: Janos Kovacs <janny@frugalware.org>
3 # Contributor: VMiklos <vmiklos@frugalware.org>
5 pkgname=sqlzma
6 _realname=squashfs
7 pkgver=3.4
8 lzmaver=457
9 pkgrel=10
10 url="http://www.squashfs-lzma.org"
11 pkgdesc="A highly compressed read-only filesystem for Linux."
12 depends=('kernel26>=2.6.31' 'kernel26<2.6.32' 'zlib')
13 license=('GPL')
14 arch=('i686' 'x86_64')
15 source=(#http://frugalware.org/~janny/source_pkgs/lzma${lzmaver}.tar.bz2 \
16         #http://frugalware.org/~janny/source_pkgs/${_realname}${pkgver}.tar.gz \
17         #http://frugalware.org/~janny/source_pkgs/sqlzma${pkgver}-${lzmaver}.tar.bz2
18         lzma${lzmaver}.tar.bz2
19         ${_realname}${pkgver}.tar.gz
20         sqlzma${pkgver}-${lzmaver}.tar.bz2
21         squashfs-lzma.tar.gz
22         squashfs3.4-include-patch)
23 md5sums=('fc7a12a396ade1772e959604d6eb31e1'
24          '2a4d2995ad5aa6840c95a95ffa6b1da6'
25          '0e7201a040fa9372e9b33f3abdbe19c9'
26          'd7c53db305d77701cd2298e2845adb13'
27          '2ed00248c56672a6664864084011e85a')
28 _kernver='2.6.31-ARCH'
29 _kdir="${pkgdir}"/lib/modules/${_kernver}/kernel/fs/${_realname}
31 build()
33         cd "${srcdir}"
34         ls > foo
35         echo "applying squashfs3.4-include-patch"
36         cp -R /usr/src/linux-$_kernver ${srcdir}
37         cd linux-${_kernver}
38         patch -p1 < ../squashfs3.4-include-patch || return 1
39         cd ../
40         echo "applying sqlzma2u-3.4.patch"
41         patch -p0 < ${srcdir}/sqlzma2u-3.4.patch || return 1
42         cd ${srcdir}/linux-${_kernver}/include
43         rm -f asm
44         ln -sf asm-x86 asm
45         cd ${srcdir}
46         if [ "$CARCH" == "x86_64" ]; then
47                 sed -i 's/-Werror//' ${srcdir}/sqlzma1-${lzmaver}.patch || return 1
48                 sed -i 's/-Werror//' ${srcdir}/Makefile || return 1
49         fi
50         
51         echo "applying sqlzma1-${lzmaver}.patch"
52         patch -p1 < "${srcdir}"/sqlzma1-${lzmaver}.patch || return 1
53         cd "${srcdir}" || return 1
54         
55         echo "sed Makefile"
56         sed -i "s|KDir =.*|KDir = "${srcdir}"/linux-$_kernver|" Makefile || return 1
57         sed -i "s|SqFs =.*|SqFs = "${srcdir}"/squashfs|" Makefile || return 1
58         sed -i "s/LzmaVer =.*/LzmaVer = ./" Makefile || return 1
59         #sed -i "s/C=1/C=0/" Makefile || return 1
60         
61         echo "Compiling"
62         make || return 1
63         
64         echo "Installing files"
65         mkdir -p "${_kdir}"
66         install -D -m 644 "${srcdir}/squashfs/squashfs.ko" "${_kdir}"
67         install -D -m 644 C/Compress/Lzma/kmod/{un,sq}lzma.ko "${_kdir}"