summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Untz <vuntz@gnome.org>2011-12-14 17:36:59 +0100
committerVincent Untz <vuntz@gnome.org>2011-12-14 17:36:59 +0100
commite27d737869d6ad065c12d84b10501f63595be18a (patch)
treef2c48e79af273f359a1109fd419179785674bdb6
parent0df0ca25aab182de40ca0ca3803dafb103eb9db5 (diff)
downloaddesktop-file-utils-e27d737869d6ad065c12d84b10501f63595be18a.tar.gz
install: Look at RPM_BUILD_ROOT to know where to install desktop files
If the default directory to install desktop files is used, then look at the RPM_BUILD_ROOT environment variable in case a package is being built to correctly install the .desktop file.
-rw-r--r--src/install.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/install.c b/src/install.c
index 6329400..30b651b 100644
--- a/src/install.c
+++ b/src/install.c
@@ -879,7 +879,12 @@ main (int argc, char **argv)
target_dir = g_strdup (g_getenv ("DESKTOP_FILE_INSTALL_DIR"));
if (target_dir == NULL)
- target_dir = g_build_filename (DATADIR, "applications", NULL);
+ {
+ if (g_getenv ("RPM_BUILD_ROOT"))
+ target_dir = g_build_filename (g_getenv ("RPM_BUILD_ROOT"), DATADIR, "applications", NULL);
+ else
+ target_dir = g_build_filename (DATADIR, "applications", NULL);
+ }
/* Create the target directory */
dir_permissions = permissions;