File: one_touch_install

package info (click to toggle)
reiser4progs 1.0.7-6.3
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 5,364 kB
  • sloc: ansic: 33,475; sh: 8,489; makefile: 1,004
file content (37 lines) | stat: -rw-r--r-- 687 bytes parent folder | download | duplicates (7)
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
#!/bin/bash

if [ ! -f ./configure.in ]; then
	echo "Error: You should run this from the package directory."
	exit 1
fi

if [ ! -x ./configure ]; then
	echo "Making configure script..."
	aclocal && (
		autoheader && (
			autoconf && (
				automake --add-missing
    			) || exit $?
		) || exit $?
	) || exit $?
fi

cpu_nr=$(cat /proc/cpuinfo | grep ^processor\.*:\.*[[:digit:]] | \
wc -l | tr --delete [[:blank:]])

if test "x$cpu_nr" = "x"; then
	cpu_nr=1
fi

./configure && make -j$cpu_nr

if [ $? != 0 ]; then
	exit $?
fi

if test x$USER != "xroot"; then
	echo "You are not root and installing may require root privilages. \
Enter root password before install."
fi

sudo make install