$OpenBSD: patch-installer_core_install_py,v 1.12 2013/01/20 07:32:08 ajacoutot Exp $
--- installer/core_install.py.orig	Tue Nov 20 10:51:37 2012
+++ installer/core_install.py	Sat Jan 19 10:58:47 2013
@@ -218,7 +218,7 @@ class CoreInstall(object):
         self.endian = utils.LITTLE_ENDIAN
         self.distro, self.distro_name, self.distro_version = DISTRO_UNKNOWN, '', DISTRO_VER_UNKNOWN
         self.distro_version_supported = False
-        self.install_location = '/usr'
+        self.install_location = '${PREFIX}'
         self.hplip_present = False
         self.have_dependencies = {}
         self.native_cups = True
@@ -876,7 +876,7 @@ class CoreInstall(object):
 
 
     def check_make(self):
-        return check_tool('make --version', 3.0)
+        return True
 
 
     def check_libusb(self):
@@ -885,14 +885,14 @@ class CoreInstall(object):
             if not check_lib('libusb'):
                 return False
             if self.distro_name != "rhel":
-                return len(locate_file_contains("usb.h", '/usr/include', 'usb_init'))
+                return len(locate_file_contains("usb.h", '${LOCALBASE}/include', 'usb_init'))
             else:
                 return True
         else:
             if not check_lib('libusb-1.0'):
                 return False
             if self.distro_name != "rhel":
-                return len(locate_file_contains("libusb.h", '/usr/include/libusb-1.0', 'libusb_init'))
+                return len(locate_file_contains("libusb.h", '${LOCALBASE}/include/libusb-1.0', 'libusb_init'))
             else:
                 return True
 
@@ -902,11 +902,10 @@ class CoreInstall(object):
 
 
     def check_libcrypto(self):
-        return check_lib("libcrypto") and check_file("crypto.h")
+        return True
 
-
     def check_libpthread(self):
-        return check_lib("libpthread") and check_file("pthread.h")
+        return True
 
 
     def check_libnetsnmp(self):
@@ -958,7 +957,7 @@ class CoreInstall(object):
 
 
     def check_sane_devel(self):
-        return len(locate_file_contains("sane.h", '/usr/include', 'extern SANE_Status sane_init'))
+        return len(locate_file_contains("sane.h", '${LOCALBASE}/include', 'extern SANE_Status sane_init'))
 
 
     def check_xsane(self):
@@ -1059,9 +1058,8 @@ class CoreInstall(object):
 
 
     def check_dbus(self):
-        log.debug("Checking for dbus running and header files present (dbus-devel)...")
-        return check_ps(['dbus-daemon'])  and \
-            len(locate_file_contains("dbus-message.h", '/usr/include', 'dbus_message_new_signal'))
+        log.debug("Checking for dbus header files...")
+        return check_file("dbus-message.h", "${LOCALBASE}/include")
 
 
     def check_cups_devel(self):
@@ -1079,17 +1077,17 @@ class CoreInstall(object):
 
 
     def check_cups_image(self):
-      return check_file("raster.h", "/usr/include/cups")
+      return check_file("raster.h", "${LOCALBASE}/include/cups")
 
 
     def check_hplip(self):
         log.debug("Checking for HPLIP...")
-        return locate_files('hplip.conf', '/etc/hp')
+        return locate_files('hplip.conf', '${SYSCONFDIR}/hp')
 
 
-    def check_hpssd(self):
-        log.debug("Checking for hpssd...")
-        return check_ps(['hpssd'])
+#    def check_hpssd(self):
+#        log.debug("Checking for hpssd...")
+#        return check_ps(['hpssd'])
 
 
     def check_libtool(self):
@@ -1109,14 +1107,14 @@ class CoreInstall(object):
     def check_cupsddk(self):
         log.debug("Checking for cups-ddk...")
         # TODO: Compute these paths some way or another...
-        #return check_tool("/usr/lib/cups/driver/drv list") and os.path.exists("/usr/share/cupsddk/include/media.defs")
-        return (check_file('drv', "/usr/lib/cups/driver") or check_file('drv', "/usr/lib64/cups/driver")) and \
-            check_file('media.defs', "/usr/share/cupsddk/include")
+        #return check_tool("${LOCALBASE}/libexec/cups/driver/drv list") and os.path.exists("${LOCALBASE}/share/cupsddk/include/media.defs")
+        return (check_file('drv', "${LOCALBASE}/libexec/cups/driver") or check_file('drv', "/usr/lib64/cups/driver")) and \
+            check_file('media.defs', "${LOCALBASE}/share/cupsddk/include")
 
 
     def check_policykit(self):
         log.debug("Checking for PolicyKit...")
-        return (check_file('PolicyKit.conf', "/etc/PolicyKit") and check_file('org.gnome.PolicyKit.AuthorizationManager.service', "/usr/share/dbus-1/services")) or (check_file('50-localauthority.conf', "/etc/polkit-1/localauthority.conf.d") and check_file('org.freedesktop.PolicyKit1.service', "/usr/share/dbus-1/system-services"))
+        return (check_file('PolicyKit.conf', "/etc/PolicyKit") and check_file('org.gnome.PolicyKit.AuthorizationManager.service', "/usr/share/dbus-1/services")) or (check_file('org.freedesktop.PolicyKit1.service', "${LOCALBASE}/share/dbus-1/system-services"))
 
     def check_cupsext(self):
         log.debug("Checking 'cupsext' CUPS extension...")
@@ -1540,7 +1538,7 @@ class CoreInstall(object):
             cmd = self.su_sudo() % '/etc/init.d/cupsys restart'
 
         else:
-            cmd = self.su_sudo() % 'killall -HUP cupsd'
+            cmd = self.su_sudo() % 'pkill -HUP cupsd'
 
         self.run(cmd)
 
@@ -1883,7 +1881,7 @@ class CoreInstall(object):
     def pre_build(self,distro_ver=None):
         cmds = []
         if self.get_distro_ver_data('fix_ppd_symlink', False,distro_ver):
-            cmds.append(self.su_sudo() % 'python ./installer/fix_symlink.py')
+            cmds.append(self.su_sudo() % '${MODPY_BIN} ./installer/fix_symlink.py')
 
         return cmds
 
@@ -2058,8 +2056,8 @@ class CoreInstall(object):
         url = "http://hplip.sf.net/plugin.conf"
         home = sys_conf.get('dirs', 'home')
 
-        if os.path.exists('/etc/hp/plugin.conf'):
-            url = "file:///etc/hp/plugin.conf"
+        if os.path.exists('${SYSCONFDIR}/hp/plugin.conf'):
+            url = "file://${SYSCONFDIR}/hp/plugin.conf"
 
         elif os.path.exists(os.path.join(home, 'plugin.conf')):
             url = "file://" + os.path.join(home, 'plugin.conf')
