init commit
[profile-appoint] / makeprofile-appointments.py
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3 ## This program is free software; you can redistribute it and/or modify
4 ## it under the terms of the GNU General Public License as published
5 ## by the Free Software Foundation; version 2 only.
6 ##
7 ## This program is distributed in the hope that it will be useful,
8 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
9 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10 ## GNU General Public License for more details.
11 ##
12 import pypackager
13 import os
14
15 if __name__ == "__main__":
16     try:
17         os.chdir(os.path.dirname(sys.argv[0]))
18     except:
19         pass
20
21     p=pypackager.PyPackager("profile-appointments")
22     p.version='0.0.1'
23     p.buildversion='1'
24     p.display_name='profile-appointments'
25     p.description="widget to switch profile to silent when a meeting is in progress , and switch back to general afterward"
26     p.author="Niv Waizer"
27     p.maintainer="Niv Waizer"
28     p.email="nivwiz@gmail.com"
29     p.depends = "python-hildon (>= 0.9.0-1maemo15), python-hildondesktop (>= 0.1.0-1maemo3), python-gtk2 (>= 2.12.1-6maemo10), python-gobject (>= 2.16), hildon-desktop-python-loader (>= 0.1.0-1maemo3), python-dbus, sudo, python, python-support (>= 0.90.0), python2.5, python-dbus, python-mafw"
30     p.section="user/development"
31     p.arch="all"
32     p.urgency="extra"
33     p.bugtracker='http://unknown'
34     p.distribution="fremantle"
35     p.repository="extras-devel"
36     p.icon='profile-appointments.png'
37     p["/etc/init.d"] = ["switch_backend",]
38     p["/usr/lib/hildon-desktop"] = ["profile-appointments.py",]
39     p["/usr/lib/switchProfByMeeting"] = ["debug.py", "switch_backend.py",]
40     p["/usr/share/icons/hicolor/32x32/hildon"] = ["profile-appointments.png",]
41     p["/etc/sudoers.d"] = ["profile-appointments.sudoers",]
42     p["/usr/share/applications/hildon-status-menu"] = ["profile-appointments.desktop",]
43     
44     p.postinstall = """#!/bin/sh
45 update-sudoers || true
46
47 gtk-update-icon-cache /usr/share/icons/hicolor/
48
49 #chmod 755".join(p['/usr/...']
50 for file in /etc/init.d/switch_backend /usr/lib/switchProfByMeeting/switch_backend.py ; do
51 chmod 755 $file
52 done
53 for file in /usr/share/applications/hildon-status-menu/profile-appointments.desktop /usr/lib/hildon-desktop/profile-appointments.py ; do
54 chmod 644 $file
55 chown root:root $file
56 done
57 #Force applet reloading to get the icon
58   echo "Reloading switchByProfile"
59   TMPFILE=`mktemp /tmp/temp.XXXXXX`
60   mv /usr/share/applications/hildon-status-menu/profile-appointments.desktop $TMPFILE
61   sleep 2
62   mv $TMPFILE /usr/share/applications/hildon-status-menu/profile-appointments.desktop
63   rm -f $TMPFILE
64
65 # Automatically added by dh_pysupport
66 #if which update-python-modules >/dev/null 2>&1; then
67 #        update-python-modules  openvpn-applet.private
68 #fi
69 exit 0
70 """
71
72     p.changelog="""First Release
73 """
74
75 print p.generate(build_binary=True,build_src=True)