-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdeb.py
executable file
·25 lines (17 loc) · 929 Bytes
/
deb.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env python
import commands
def run(c):
return commands.getstatusoutput(c)[0]
def build(dir, name, ver, desc, deps):
run('mkdir ' + dir + 'DEBIAN')
l = (name, ver, ', '.join(deps), desc)
i = 'Package: %s\nPriority: optional\nSection: gnome\nMaintainer: Eugeny Pankov <[email protected]>\nArchitecture: all\nVersion: %s\nDepends: %s\nDescription: %s\n' % l
with open(dir + 'DEBIAN/control', 'w') as f:
f.write(i)
run('dpkg-deb -b ' + dir + ' ' + name + '-' + ver + '.deb')
run('mkdir -p deb/usr/bin')
run('mkdir -p deb/usr/share/icons/hicolor/22x22/status')
run('cp main.py deb/usr/bin/indicator-usb')
run('cp icon.png deb/usr/share/icons/hicolor/22x22/status/indicator-usb-panel.png')
build('deb/', 'indicator-usb', '0.2.1', 'Application indicator for easy USB device safe-removal', ['python-appindicator', 'python-gnome2', 'python-notify'])
run('rm -r deb')