aboutsummaryrefslogtreecommitdiff
path: root/make_install.sh
blob: 88e35dd39e661f4555ef9a0e05ae535878c5f552 (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
#!/bin/bash

. basic.sh

function main
{
	if [ "$#" -lt 2 ]
	then
		echo "Usage: $0 <base_dir> <type> (<xy>-<zw>|-a)" >&2
		exit 1
	elif [ "$#" -gt 2 ]
	then
		cd "${1}/${2}" || exit 1
	fi

	if [[ "$1" == src ]]
	then
		ext=
	else
		ext="-${2}"
	fi

	init

	if [[ "$3" == "-a" ]]
	then
		for lang in ${langs[@]}
		do
			make_install
		done
	else
		lang=$3
		make_install
	fi
}

function make_install
{
	pkgname=dict-freedict-${lang}${ext}

	cp ../sample.install "$tmp"
	replace "%LANG%" "$lang"
	replace "%SUFFIX%" "$ext"
	mv "$tmp" ${pkgname}/${pkgname}.install
}

main "$@"