summaryrefslogtreecommitdiff
path: root/setup
blob: 75924f81ce5e1768d8b1a9eb8e19c7bbf453652b (plain)
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
#!/bin/sh

# Extra setup after cloning an Asterisk repository.
# Assumes you also cloned asterisk-tools to a near-by directory.
# 'AUTHORS' is generated by './gen_authors >AUTHORS'

# Extra setup to run
TOOLS_DIR=`dirname $0`

# FIXME: proper usage message
usage() {
	echo >&2 "Usage: $0 <name>"
}

name="$1"
case "$name" in
	asterisk)
		# Use the dummy menuselect:
		mkdir -p menuselect
		(cd menuselect; ln -s ../$TOOLS_DIR/menuselect/* .)
		make -C menuselect dummies
		;;
	dahdi-tools)
		# A really-dummy menuselect
		mkdir menuselect
		cp $TOOLS_DIR/menuselect/Makefile menuselect
		ln -s /bin/true menuselect/menuselect
		;;
	dahdi-linux)
		ln -s ../../../octapi/software drivers/dahdi/oct612x
		if [ ! -d ../octapi ]; then
			echo >&2 "$0: Warning: dahdi-linux was set up, but you still need to fetch octapi."
		fi
		;;
	libpri)
		: # Nothing special to fix. Master already set to 1.4.
		;;
	*)
		usage; exit 1;;
esac

# Just in case you'll use git-svn here as well:
ln -s $TOOLS_DIR/AUTHORS .
git config --add svn.authorsfile AUTHORS

# Make sure we have a proper .version file after checkout / pull
for hook in post-checkout post-merge; do
	if [ ! -r .git/hooks/$hook ]; then
		ln -s ../../$TOOLS_DIR/version_hook .git/hooks/$hook
	fi
done

ln -s $TOOLS_DIR/${name}_gitignore .gitignore