-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild-node.sh
47 lines (43 loc) · 1.32 KB
/
build-node.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
#!/bin/sh
BUILDDIR="/root/build"
DEBDIR="/root/latestbuilds"
MAINTAINER="[email protected]"
LOGFILE="/root/logbuilds"
#####################
# Cleanup, dl, untar
#####################
cd "$BUILDDIR"
rm -R node*
wget http://nodejs.org/dist/node-latest.tar.gz
tar xvf node-latest.tar.gz
rm node-latest.tar.gz
cd node-v*
#####################
#####################
# Control files
#####################
mkdir -p tmp/DEBIAN
echo "Package: node" >> tmp/DEBIAN/control
echo "Maintainer: $MAINTAINER" >> tmp/DEBIAN/control
echo "Architecture: amd64" >> tmp/DEBIAN/control
echo "Version: $(pwd | tail -c 8)" >> tmp/DEBIAN/control
echo "Provides: node" >> tmp/DEBIAN/control
echo "Priority: extra" >> tmp/DEBIAN/control
echo "Section: main" >> tmp/DEBIAN/control
echo "Filename: pool/main/n/node/node_$(pwd | tail -c 8)_amd64.deb" >> tmp/DEBIAN/control
echo "Description: nodejs" >> tmp/DEBIAN/control
chmod -R a-s tmp/DEBIAN
echo "#!/bin/sh" >> tmp/DEBIAN/postinst
echo "ldconfig" >> tmp/DEBIAN/postinst
chmod 755 tmp/DEBIAN/postinst
#####################
#####################
# Build it!
#####################
./configure
make DESTDIR="$(pwd)"/tmp install
dpkg-deb --build tmp "node_$(pwd | tail -c 8)_amd64.deb"
rm $DEBDIR/node*deb 2> /dev/null
mv *deb "$DEBDIR/"
echo "$(date) - nodejs $(pwd | tail -c 8) build ready" >> "$LOGFILE"
#####################