-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathdeb-gcc-arm-eabi-toolchain.sh
executable file
·60 lines (60 loc) · 2.19 KB
/
deb-gcc-arm-eabi-toolchain.sh
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
#!/bin/bash
export NAME=gcc-arm-eabi-toolchain
export VERSION=4.7-2013-q1
export DEBVERSION=${VERSION}-1
if [ ! -f "${NAME}_${VERSION}.orig.tar.bz2" ]; then
wget https://launchpad.net/gcc-arm-embedded/4.7/4.7-2013-q1-update/+download/gcc-arm-none-eabi-4_7-2013q1-20130313-src.tar.bz2 -O ${NAME}_${VERSION}.orig.tar.bz2
else
rm -rf gcc-arm-none-eabi-4_7-2013q1-20130313
fi
tar xjvf ${NAME}_${VERSION}.orig.tar.bz2
cd gcc-arm-none-eabi-4_7-2013q1-20130313/
#Extract and patch everything
cd src
for i in *.bz2 ; do tar xjvf $i ; done
for i in *.gz ; do tar xzvf $i ; done
cd zlib-1.2.5
patch -p1 <../zlib-1.2.5.patch
#Build the toolchain (before debuild!)
cd ../../
./build-prerequisites.sh
./build-toolchain.sh
exit
rm -rf debian
mkdir -p debian
#Use the LICENSE file from nodejs as copying file
touch debian/copying
#Create the changelog (no messages needed)
dch --create -v $DEBVERSION --package $NAME ""
#Create control file
echo "Source: $NAME" > debian/control
echo "Maintainer: None <[email protected]>" >> debian/control
echo "Section: misc" >> debian/control
echo "Priority: optional" >> debian/control
echo "Standards-Version: 3.9.2" >> debian/control
echo "Build-Depends: debhelper (>= 8)" >> debian/control
echo "" >> debian/control
echo "Package: $NAME" >> debian/control
echo "Architecture: amd64" >> debian/control
echo "Provides: gcc-arm-none-eabi" >> debian/control
echo "Depends: ${shlibs:Depends}, ${misc:Depends}" >> debian/control
echo "Description: GCC ARM EABI toolchain https://launchpad.net/gcc-arm-embedded" >> debian/control
#Create rules file
echo '#!/usr/bin/make -f' > debian/rules
echo '%:' >> debian/rules
echo -e '\tdh $@' >> debian/rules
echo 'override_dh_auto_configure:' >> debian/rules
echo -e '\t' >> debian/rules
echo 'override_dh_auto_build:' >> debian/rules
echo -e '\t' >> debian/rules
echo 'override_dh_auto_test:' >> debian/rules
echo -e '\t' >> debian/rules
echo 'override_dh_auto_install:' >> debian/rules
echo -e '\tmkdir -p debian/clang+llvm/usr' >> debian/rules
echo -e '\tcp -r lib include bin share debian/clang+llvm/usr' >> debian/rules
#Create some misc files
echo "8" > debian/compat
mkdir -p debian/source
echo "3.0 (quilt)" > debian/source/format
#Build the package
debuild -us -uc -b