summaryrefslogtreecommitdiffstats
path: root/abs/mv-core/myth/release-fixes/mythtv-release-fixes/mythtv.install
blob: 2c87aee750d1faf4aaa79fc13f76b40b5e6593e7 (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
54
55
56
57
58
59

# arg 1:  the new package version
pre_install () {
        echo "backing up the database"
                dbver=`pacman -Q mythtv-release-fixes | awk  ' { print $2 } '`
        if [ ! -e /data/databases_backup ]
        then
                mkdir -p /data/database_backup
        fi
        mysqldump -u mythtv -pmythtv mythconverg -c > /data/database_backup/${dbver}.dump.sql
}

post_install() {
  	mkdir -p /data/home
        /usr/sbin/useradd -G users,video,audio,optical  -m -d /data/home/mythtv mythtv
        /usr/sbin/usermod -G users,video,audio,optical mythtv
#        mkdir /var/log/mythtv
#        chown -R mythtv:users /var/log/mythtv
        dbver=`pacman -Q mythtv-release-fixes | awk  ' { print $2 } '`
        if [ ! -e /data/database_backup ]
        then
                mkdir -p /data/database_backup
        fi
	chown mythtv:nobody /data/database_backup
	chmod g+s  /data/database_backup
        
	mysqldump -u mythtv -pmythtv mythconverg -c > /data/database_backup/${dbver}.dump.sql
	grep -q /usr/local/lib  /etc/ld.so.conf
	if [ $? = 1 ]
	then
		echo "/usr/local/lib" >> /etc/ld.so.conf
	fi

}
pre_upgrade () {
 pre_install
}

# arg 1:  the new package version
# arg 2:  the old package version
post_upgrade() {
  post_install

  /bin/true
}

# arg 1:  the old package version
pre_remove() {
  /bin/true
}

# arg 1:  the old package version
post_remove() {
/bint/true
}

op=$1
shift
$op $*