distutils extension for dbus service files
Hello, I've created an extension for distutils which reads D-Bus *.service.in files, replaces macros in these files (e.g. @bindir@) and copies them to the appropriate location (e. g. /usr/share/dbus-1/services/ or $HOME/.local/share/dbus-1/services in user-mode). I couldn't find much useful information for this task in the distutils documentation, so I tried to accomplish this by reading through the source code of the distutils commands. Is the attached python script the right way to handle this situation or could this be achieved easier? If this is the correct way to do this I'll also write similar methods for handling PyQt4 ui and translation files. This is an example for a setup.py script from oms_distutils import setup setup(name='example', version='1.0', package_dir={'example': 'src'}, packages=['example.lib'], dbus_files=['data/com.example.test.service.in'], ) And this is the com.example.test.service.in file: [D-BUS Service] Name=com.example.test Exec=@bindir@/example-wrapper Thanks for your comments, Lukas
Bare distutils characterizes these as "data" files (*not* "package data"). There's some documentation on that, but I'm not sure that any sort of transformation is supported for them. Specialized commands may need to be inserted to handle those cases cleanly. -Fred -- Fred L. Drake, Jr. <fdrake at acm.org> "A storm broke loose in my mind." --Albert Einstein
participants (2)
-
Fred Drake
-
Lukas Hetzenecker