wok-6.x view linux-libre-module-headers/receipt @ rev 18730

Quote root dir in post_install
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Dec 20 15:13:45 2015 +0100 (2015-12-20)
parents ad59999b3fce
children 9e8d7fd12ee2
line source
1 # SliTaz package receipt.
3 PACKAGE="linux-libre-module-headers"
4 VERSION="2.6.37-gnu"
5 CATEGORY="development"
6 SHORT_DESC="Header files and scripts for building modules for Linux Libre kernel."
7 MAINTAINER="gokhlayeh@slitaz.org"
8 LICENSE="GPL2"
9 PROVIDE="linux-module-headers"
10 DEPENDS="slitaz-toolchain"
11 WANTED="linux-libre"
12 WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/"
13 KVERSION=$VERSION-slitaz
15 # Rules to gen a SliTaz package suitable for Tazpkg.
16 genpkg_rules()
17 {
18 local path
19 _AUFSVER=`grep ^VERSION= $WOK/aufs/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
20 AUFSDIR="$WOK/$WANTED/aufs-${_AUFSVER}"
21 path=usr/src/linux-$KVERSION
22 mkdir -p $fs/lib/modules/$KVERSION
23 ln -sf /$path $fs/lib/modules/$KVERSION/build
24 install -D -m644 $src/Makefile \
25 $fs/$path/Makefile
26 install -D -m644 $src/kernel/Makefile \
27 $fs/$path/kernel/Makefile
28 install -D -m644 $src/.config \
29 $fs/$path/.config
30 mkdir -p $fs/$path/include
32 for i in acpi asm-generic config generated linux math-emu media net pcmcia scsi sound trace video xen; do
33 cp -a $src/include/$i $fs/$path/include/
34 done
36 # copy arch includes for external modules
37 mkdir -p $fs/$path/arch/x86
38 cp -a $src/arch/x86/include $fs/$path/arch/x86/
40 # copy files necessary for later builds, like nvidia and vmware
41 cp -a $src/Module.symvers-modules $fs/$path/Module.symvers
42 cp -a $src/scripts $fs/$path
43 # fix permissions on scripts dir
44 chmod og-w -R $fs/$path/scripts
45 mkdir -p $fs/$path/.tmp_versions
47 mkdir -p $fs/$path/arch/x86/kernel
48 cp -a $src/arch/x86/Makefile $fs/$path/arch/x86/
49 cp -a $src/arch/x86/Makefile_32.cpu $fs/$path/arch/x86/
50 cp -a $src/arch/x86/kernel/asm-offsets.s $fs/$path/arch/x86/kernel/
52 # add headers for lirc package
53 mkdir -p $fs/$path/drivers/media/video
54 cp -a $src/drivers/media/video/*.h $fs/$path/drivers/media/video/
56 for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo ; do
57 mkdir -p $fs/$path/drivers/media/video/$i
58 cp -a $src/drivers/media/video/$i/*.h $fs/$path/drivers/media/video/$i
59 done
61 # add docbook makefile
62 install -D -m644 $src/Documentation/DocBook/Makefile \
63 $fs/$path/Documentation/DocBook/Makefile
65 # add dm headers
66 mkdir -p $fs/$path/drivers/md
67 cp -a $src/drivers/md/*.h $fs/$path/drivers/md
69 # add inotify.h
70 mkdir -p $fs/$path/include/linux
71 cp -a $src/include/linux/inotify.h $fs/$path/include/linux/
73 # add wireless headers
74 mkdir -p $fs/$path/net/mac80211/
75 cp -a $src/net/mac80211/*.h $fs/$path/net/mac80211/
77 # add dvb headers for external modules
78 # in reference to:
79 # http://bugs.archlinux.org/task/9912
80 mkdir -p $fs/$path/drivers/media/dvb/dvb-core
81 cp -a $src/drivers/media/dvb/dvb-core/*.h $fs/$path/drivers/media/dvb/dvb-core/
83 # add dvb headers for external modules
84 # in reference to:
85 # http://bugs.archlinux.org/task/11194
86 if [ -d $src/include/config/dvb/ ]; then
87 mkdir -p $fs/$path/include/config/dvb/
88 cp $src/include/config/dvb/*.h $fs/$path/include/config/dvb/
89 fi
91 # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
92 # in reference to:
93 # http://bugs.archlinux.org/task/13146
94 mkdir -p $fs/$path/drivers/media/dvb/frontends/
95 cp -a $src/drivers/media/dvb/frontends/lgdt330x.h $fs/$path/drivers/media/dvb/frontends/
96 cp -a $src/drivers/media/video/msp3400-driver.h $fs/$path/drivers/media/dvb/frontends/
98 # add dvb headers
99 # in reference to:
100 # http://bugs.archlinux.org/task/20402
101 mkdir -p $fs/$path/drivers/media/dvb/dvb-usb
102 cp -a $src/drivers/media/dvb/dvb-usb/*.h $fs/$path/drivers/media/dvb/dvb-usb/
103 mkdir -p $fs/$path/drivers/media/dvb/frontends
104 cp -a $src/drivers/media/dvb/frontends/*.h $fs/$path/drivers/media/dvb/frontends/
105 mkdir -p $fs/$path/drivers/media/common/tuners
106 cp -a $src/drivers/media/common/tuners/*.h $fs/$path/drivers/media/common/tuners/
108 # add xfs and shmem for aufs building
109 mkdir -p $fs/$path/fs/xfs
110 mkdir -p $fs/$path/mm
111 cp -a $src/fs/xfs/xfs_sb.h $fs/$path/fs/xfs/xfs_sb.h
113 # add headers vor virtualbox
114 # in reference to:
115 # http://bugs.archlinux.org/task/14568
116 cp -a $src/include/drm $fs/$path/include/
118 # add headers for broadcom wl
119 # in reference to:
120 # http://bugs.archlinux.org/task/14568
121 cp -a $src/include/trace $fs/$path/include/
122 # add headers for crypto modules
123 # in reference to:
124 # http://bugs.archlinux.org/task/22081
125 cp -a $src/include/crypto $fs/$path/include/
126 # copy in Kconfig files
127 for i in $(find . -name "Kconfig*"); do
128 mkdir -p $fs/$path/$(echo $i | sed 's|/Kconfig.*||')
129 cp -a $src/$i $fs/$path/$i
130 done
132 chown -R root.root $fs/$path
133 find $fs/$path -type d -exec chmod 755 {} \;
134 # remove unneeded architectures
135 rm -rf $fs/$path/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
137 }
139 pre_remove() {
140 if [ -e "$1/usr/src/linux" ]; then
141 rm -rf "$1/usr/src/linux"
142 fi
143 }
145 post_install() {
146 # Added soft link to make it easier to point to kernel folder
147 [ -L "$1/usr/src/linux" ] && rm -f "$1/usr/src/linux"
148 ln -sf /usr/src/linux-$KVERSION "$1/usr/src/linux"
149 }