Add Apport package hook for Ubuntu.
Add debian/local/apport-hook.py: Apport package hook for collecting
devkit-disks --dump and available SMART blobs. Install it in debian/rules when
building on Ubuntu. Add "lsb-release" build dependency for this.
Martin Pitt
14 years ago
0 | 0 |
libatasmart (0.17-2) UNRELEASED; urgency=low
|
1 | 1 |
|
2 | 2 |
* debian/control: Wrap build dependencies.
|
|
3 |
* Add debian/local/apport-hook.py: Apport package hook for collecting
|
|
4 |
devkit-disks --dump and available SMART blobs. Install it in debian/rules
|
|
5 |
when building on Ubuntu. Add "lsb-release" build dependency for this.
|
3 | 6 |
|
4 | 7 |
-- Martin Pitt <mpitt@debian.org> Sat, 14 Nov 2009 08:19:07 -0600
|
5 | 8 |
|
6 | 6 |
cdbs,
|
7 | 7 |
autotools-dev,
|
8 | 8 |
quilt,
|
|
9 |
lsb-release,
|
9 | 10 |
pkg-config,
|
10 | 11 |
libudev-dev
|
11 | 12 |
Standards-Version: 3.8.3
|
|
0 |
'''apport package hook for libatasmart
|
|
1 |
|
|
2 |
(c) 2009 Canonical Ltd.
|
|
3 |
Author: Martin Pitt <martin.pitt@ubuntu.com>
|
|
4 |
'''
|
|
5 |
|
|
6 |
import os
|
|
7 |
import os.path
|
|
8 |
import apport.hookutils
|
|
9 |
import dbus
|
|
10 |
|
|
11 |
DK_D = 'org.freedesktop.DeviceKit.Disks'
|
|
12 |
|
|
13 |
def add_info(report):
|
|
14 |
report['DevkitDisksDump'] = apport.hookutils.command_output(['devkit-disks', '--dump'])
|
|
15 |
|
|
16 |
# grab SMART blobs
|
|
17 |
dkd = dbus.Interface(dbus.SystemBus().get_object(DK_D,
|
|
18 |
'/org/freedesktop/DeviceKit/Disks'), DK_D)
|
|
19 |
for d in dkd.EnumerateDevices():
|
|
20 |
dev_props = dbus.Interface(dbus.SystemBus().get_object(DK_D, d),
|
|
21 |
dbus.PROPERTIES_IFACE)
|
|
22 |
blob = dev_props.Get(DK_D, 'DriveAtaSmartBlob')
|
|
23 |
if len(blob) > 0:
|
|
24 |
report['AtaSmartBlob_' + os.path.basename(d)] = ''.join(map(chr, blob))
|
|
25 |
|
|
26 |
if __name__ == '__main__':
|
|
27 |
r = {}
|
|
28 |
add_info(r)
|
|
29 |
for k, v in r.iteritems():
|
|
30 |
print '%s: "%s"' % (k, v)
|
|
31 |
|
8 | 8 |
|
9 | 9 |
install/libatasmart-dev::
|
10 | 10 |
dh_link -p$(cdbs_curpkg) lib/$$(basename $$(readlink debian/tmp/usr/lib/libatasmart.so)) usr/lib/libatasmart.so
|
|
11 |
|
|
12 |
binary-install/libatasmart4::
|
|
13 |
# when building for Ubuntu, install Apport hook
|
|
14 |
if [ "`lsb_release -is 2>/dev/null`" = "Ubuntu" ]; then \
|
|
15 |
install -m 644 -D debian/local/apport-hook.py debian/$(cdbs_curpkg)/usr/share/apport/package-hooks/$(cdbs_curpkg).py; \
|
|
16 |
fi
|
|
17 |
|