REVERT:
From c9650c0bb7324c32d82fa6d7d898e236f10ea63b Mon Sep 17 00:00:00 2001
From: Richard Hughes <richard@hughsie.com>
Date: Mon, 24 Jul 2017 14:30:12 +0100
Subject: [PATCH] Make udev a hard requirement

/var/lib -> /var/db

Index: src/cd-main.c
--- src/cd-main.c.orig
+++ src/cd-main.c
@@ -60,7 +60,9 @@ typedef struct {
 	CdMappingDb		*mapping_db;
 	CdDeviceDb		*device_db;
 	CdProfileDb		*profile_db;
+#ifdef HAVE_UDEV
 	CdSensorClient		*sensor_client;
+#endif
 	GPtrArray		*sensors;
 	GPtrArray		*plugins;
 	GMainLoop		*loop;
@@ -1618,8 +1620,8 @@ cd_main_icc_store_added_cb (CdIccStore *icc_store,
 	/* create profile */
 	profile = cd_profile_new ();
 	filename = cd_icc_get_filename (icc);
-	if (g_str_has_prefix (filename, "/usr/share/color") ||
-	    g_str_has_prefix (filename, "/var/lib/color"))
+	if (g_str_has_prefix (filename, "{PREFIX}/share/color") ||
+	    g_str_has_prefix (filename, "/var/db/color"))
 		cd_profile_set_is_system_wide (profile, TRUE);
 
 	/* parse the profile name */
@@ -1905,8 +1907,10 @@ cd_main_on_name_acquired_cb (GDBusConnection *connecti
 		cd_main_add_disk_device (priv, device_id);
 	}
 
+#ifdef HAVE_UDEV
 	/* add sensor devices */
 	cd_sensor_client_coldplug (priv->sensor_client);
+#endif
 
 	/* coldplug plugin devices */
 	cd_main_plugin_phase (priv, CD_PLUGIN_PHASE_COLDPLUG);
@@ -1936,6 +1940,7 @@ cd_main_on_name_lost_cb (GDBusConnection *connection,
 	g_main_loop_quit (priv->loop);
 }
 
+#ifdef HAVE_UDEV
 
 static void
 cd_main_client_sensor_added_cb (CdSensorClient *sensor_client_,
@@ -1967,6 +1972,7 @@ cd_main_client_sensor_removed_cb (CdSensorClient *sens
 				       NULL);
 	g_ptr_array_remove (priv->sensors, sensor);
 }
+#endif
 
 static gboolean
 cd_main_timed_exit_cb (gpointer user_data)
@@ -2390,6 +2396,7 @@ main (int argc, char *argv[])
 	priv->devices_array = cd_device_array_new ();
 	priv->profiles_array = cd_profile_array_new ();
 	priv->sensors = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
+#ifdef HAVE_UDEV
 	priv->sensor_client = cd_sensor_client_new ();
 	g_signal_connect (priv->sensor_client, "sensor-added",
 			  G_CALLBACK (cd_main_client_sensor_added_cb),
@@ -2397,11 +2404,12 @@ main (int argc, char *argv[])
 	g_signal_connect (priv->sensor_client, "sensor-removed",
 			  G_CALLBACK (cd_main_client_sensor_removed_cb),
 			  priv);
+#endif
 
 	/* connect to the mapping db */
 	priv->mapping_db = cd_mapping_db_new ();
 	ret = cd_mapping_db_load (priv->mapping_db,
-				  LOCALSTATEDIR "/lib/colord/mapping.db",
+				  LOCALSTATEDIR "/db/colord/mapping.db",
 				  &error);
 	if (!ret) {
 		g_warning ("CdMain: failed to load mapping database: %s",
@@ -2412,7 +2420,7 @@ main (int argc, char *argv[])
 	/* connect to the device db */
 	priv->device_db = cd_device_db_new ();
 	ret = cd_device_db_load (priv->device_db,
-				 LOCALSTATEDIR "/lib/colord/storage.db",
+				 LOCALSTATEDIR "/db/colord/storage.db",
 				 &error);
 	if (!ret) {
 		g_warning ("CdMain: failed to load device database: %s",
@@ -2423,7 +2431,7 @@ main (int argc, char *argv[])
 	/* connect to the profile db */
 	priv->profile_db = cd_profile_db_new ();
 	ret = cd_profile_db_load (priv->profile_db,
-				  LOCALSTATEDIR "/lib/colord/storage.db",
+				  LOCALSTATEDIR "/db/colord/storage.db",
 				  &error);
 	if (!ret) {
 		g_warning ("CdMain: failed to load profile database: %s",
@@ -2519,8 +2527,10 @@ out:
 			g_ptr_array_unref (priv->sensors);
 		if (priv->plugins != NULL)
 			g_ptr_array_unref (priv->plugins);
+#ifdef HAVE_UDEV
 		if (priv->sensor_client != NULL)
 			g_object_unref (priv->sensor_client);
+#endif
 		if (priv->icc_store != NULL)
 			g_object_unref (priv->icc_store);
 		if (priv->mapping_db != NULL)
