diff options
author | Vincent Untz <vuntz@gnome.org> | 2011-12-14 17:36:59 +0100 |
---|---|---|
committer | Vincent Untz <vuntz@gnome.org> | 2011-12-14 17:36:59 +0100 |
commit | e27d737869d6ad065c12d84b10501f63595be18a (patch) | |
tree | f2c48e79af273f359a1109fd419179785674bdb6 | |
parent | 0df0ca25aab182de40ca0ca3803dafb103eb9db5 (diff) |
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.c | 7 |
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; |