File: install

package info (click to toggle)
firedns 0.9.12-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,192 kB
  • ctags: 322
  • sloc: ansic: 4,026; sh: 964; makefile: 6
file content (68 lines) | stat: -rw-r--r-- 1,295 bytes parent folder | download | duplicates (12)
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
61
62
63
64
65
66
67
68
#!/bin/sh
#require id
#require makefiletop
#phase init
#after init_id
#phase makefile
#after makefile_makefiletop
case $PHASE in
	init)
		dispn "Creating installation script..."
		$ECHO "#!/bin/sh
FILENAME="\$2/\`basename \$1\`"
mkdir -p \$2
cp -f \$1 \$FILENAME
chown \$3:\$4 \$FILENAME
chmod \$5 \$FILENAME" > copy.sh
		chmod 0755 copy.sh
		INSTALL="./copy.sh"
		disp "done"

		dispn "Checking for installation username..."
		INSTALL_GROUP=`$ID -ng root`
		if test "$?" = "0"; then
			INSTALL_USER=root
			disp "found, \"root\""
		else
			disp "none found, aborting"
			exit 1
		fi

		dispn "Checking for installation group name..."
		if test "$INSTALL_GROUP" = ""; then
			disp "none found, aborting"
			exit 1
		else
			disp "found, \"$INSTALL_GROUP\""
		fi

		;;
	makefile)
		dispn "Writing install entry..."
		$ECHO -n "install:"
		if module binaries; then
			$ECHO -n " install_binaries"
		fi
		if module libraries; then
			$ECHO -n " install_libraries"
		fi
		if module man; then
			$ECHO -n " install_man"
		fi
		if module headers; then
			$ECHO -n " install_headers"
		fi
		if module conf; then
			$ECHO -n " install_conf"
		fi
		$ECHO
		$ECHO
		disp "done"

		dispn "Writing install cleanup entry..."
		$ECHO "clean_install:"
		$ECHO "	rm -f $INSTALL"
		$ECHO
		disp "done"
		;;
esac