Codebase list libatasmart / e8dfa4f
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
4 changed file(s) with 43 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
00 libatasmart (0.17-2) UNRELEASED; urgency=low
11
22 * 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.
36
47 -- Martin Pitt <mpitt@debian.org> Sat, 14 Nov 2009 08:19:07 -0600
58
66 cdbs,
77 autotools-dev,
88 quilt,
9 lsb-release,
910 pkg-config,
1011 libudev-dev
1112 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
88
99 install/libatasmart-dev::
1010 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