File: makedist

package info (click to toggle)
netboot 0.8.1-4
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,728 kB
  • ctags: 4,740
  • sloc: ansic: 15,152; asm: 11,623; yacc: 2,248; makefile: 1,110; pascal: 1,108; lex: 748; sh: 233
file content (57 lines) | stat: -rwxr-xr-x 1,220 bytes parent folder | download | duplicates (3)
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
#!/bin/sh
#
# Shell script to generate netboot distribution

# We need the bash because of some shell variable substitutions
if [ -z $BASH_VERSION ]; then
	echo "$0 requires the GNU bash"
	exit 1
fi

# Determine the netboot base directory
case "$0" in
  */misc/makedist)	ROOTDIR="${0%/misc/makedist}"
			;;
  */makedist)		ROOTDIR="${0%/makedist}/.."
			;;
  *)			ROOTDIR=".."
			;;
esac
if [ ! -d $ROOTDIR -o ! -d $ROOTDIR/misc/config ]; then
	echo "$0: unable to determine netboot base directory"
	exit 1
fi
cd $ROOTDIR
ROOTDIR=`pwd`

# Determine current configuration and cleanup 
./configure --sysconfdir= --enable-bootrom
trap 'rm -f config.tmp' 0
cp config.cache config.tmp
make realclean

# Restore configuration information
cd $ROOTDIR/misc/config
make all
cd $ROOTDIR
mv config.tmp config.cache

# Make everything
./configure --sysconfdir= --enable-bootrom
make distrib

# Cleanup at the end
make distclean

# Create the distribution archive
. $ROOTDIR/version
if [ -n "$PATCHLEVEL" -a "$PATCHLEVEL" -gt 0 ]; then
	VERSION="$VER_MAJOR.$VER_MINOR.$PATCHLEVEL"
else
	VERSION="$VER_MAJOR.$VER_MINOR"
fi
if [ -r $ROOTDIR/bootrom/headers/general.h ]; then
	cd $ROOTDIR/..
	tar czf netboot-$VERSION.tar.gz netboot
fi