summaryrefslogtreecommitdiffstats
path: root/abs/extra/miro/miro.install
blob: 02b2c063d48649d1a9538e06165a8bcbb135230c (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
60
61
62
63
64
65
66
67
68
69
70
# arg 1:  the new package version
post_install() {
  update-desktop-database -q
  mv /usr/share/mythtv/is.xml /tmp/is.xml.tmp
  sed -e '/\#Miro/,/\#Miro/d' < /tmp/is.xml.tmp > /usr/share/mythtv/is.xml
  mv /usr/share/mythtv/is.xml /tmp
  grep -v -e /mythmenu /tmp/is.xml > /tmp/is.xml.tmp
  echo "<!--#Miro-->" >> /tmp/is.xml.tmp
  echo "   <button>" >> /tmp/is.xml.tmp
  echo "     <type>STREAM</type>" >> /tmp/is.xml.tmp
  echo "     <text>Miro Player</text>" >> /tmp/is.xml.tmp
  echo "     <action>EXEC /usr/bin/miro</action>" >> /tmp/is.xml.tmp 
  echo "   </button>" >> /tmp/is.xml.tmp
  echo "<!--#Miro-->" >> /tmp/is.xml.tmp
  echo "" >> /tmp/is.xml.tmp
  echo "</mythmenu>" >> /tmp/is.xml.tmp
  mv /tmp/is.xml.tmp /usr/share/mythtv/is.xml
  if [ -d /myth/democracy ]
  then
	  ln -s /myth/democracy /home/mythtv/.miro
	  ln -s /myth/miro/Movies /myth/video/Miro
	  exit 1
  else
	  if [ -d /myth/miro ]
	  then
		  ln -s /myth/miro /home/mythtv/.miro
		  ln -s /myth/miro/Movies /myth/video/Miro
		  exit 1
	  else
		  if [ ! -d /myth/miro -o /myth/democracy ]
		  then
			  mkdir -p /myth/miro/Movies
			  ln -s /myth/miro /home/mythtv/.miro
			  ln -s /myth/miro/Movies /home/mythtv/Movies
			  ln -s /myth/miro/Movies /myth/video/Miro
		  fi
	  fi
  fi
  chown -R mythtv.mythtv /myth/miro
}

post_update() {
  mv /usr/share/mythtv/is.xml /tmp/is.xml.tmp
  sed -e '/\#Miro/,/\#Miro/d' < /tmp/is.xml.tmp > /usr/share/mythtv/is.xml
  mv /usr/share/mythtv/is.xml /tmp/is.xml.tmp
  sed -e '/\#Miro/,/\#Miro/d' < /tmp/is.xml.tmp > /usr/share/mythtv/is.xml
  mv /usr/share/mythtv/is.xml /tmp
  grep -v -e /mythmenu /tmp/is.xml > /tmp/is.xml.tmp
  echo "<!--#Miro-->" >> /tmp/is.xml.tmp
  echo "   <button>" >> /tmp/is.xml.tmp
  echo "     <type>STREAM</type>" >> /tmp/is.xml.tmp
  echo "     <text>Miro Player</text>" >> /tmp/is.xml.tmp
  echo "     <action>EXEC /usr/bin/miro</action>" >> /tmp/is.xml.tmp 
  echo "   </button>" >> /tmp/is.xml.tmp
  echo "<!--#Miro-->" >> /tmp/is.xml.tmp
  echo "" >> /tmp/is.xml.tmp
  echo "</mythmenu>" >> /tmp/is.xml.tmp
  mv /tmp/is.xml.tmp /usr/share/mythtv/is.xml
}

post_remove() {
	update-desktop-database -q
	rm -fr /home/mythtv/.miro /myth/video/Miro /myth/miro /myth/democracy
	mv /usr/share/mythtv/is.xml /tmp/is.xml.tmp
	sed -e '/\#Miro/,/\#Miro/d' < /tmp/is.xml.tmp > /usr/share/mythtv/is.xml
}

op=$1
shift
$op $*