928 os.path.join(eric7SourceDir, "pixmaps", "eric_icon.png"), |
928 os.path.join(eric7SourceDir, "pixmaps", "eric_icon.png"), |
929 os.path.join(dst, "eric.png")) |
929 os.path.join(dst, "eric.png")) |
930 shutilCopy( |
930 shutilCopy( |
931 os.path.join(eric7SourceDir, "pixmaps", "ericWeb48_icon.png"), |
931 os.path.join(eric7SourceDir, "pixmaps", "ericWeb48_icon.png"), |
932 os.path.join(dst, "ericWeb.png")) |
932 os.path.join(dst, "ericWeb.png")) |
|
933 |
|
934 dst = os.path.normpath( |
|
935 os.path.join(distDir, "usr/share/icons/hicolor/48x48/apps")) |
|
936 if not os.path.exists(dst): |
|
937 os.makedirs(dst) |
|
938 shutilCopy( |
|
939 os.path.join(eric7SourceDir, "pixmaps", "eric48_icon.png"), |
|
940 os.path.join(dst, "eric.png")) |
|
941 shutilCopy( |
|
942 os.path.join(eric7SourceDir, "pixmaps", "ericWeb48_icon.png"), |
|
943 os.path.join(dst, "ericWeb.png")) |
|
944 |
933 dst = os.path.normpath( |
945 dst = os.path.normpath( |
934 os.path.join(distDir, "usr/share/applications")) |
946 os.path.join(distDir, "usr/share/applications")) |
935 if not os.path.exists(dst): |
947 if not os.path.exists(dst): |
936 os.makedirs(dst) |
948 os.makedirs(dst) |
937 copyDesktopFile(os.path.join(sourceDir, "linux", "eric7.desktop.in"), |
949 copyDesktopFile(os.path.join(sourceDir, "linux", "eric7.desktop.in"), |
938 os.path.join(dst, "eric7.desktop")) |
950 os.path.join(dst, "eric7.desktop")) |
939 copyDesktopFile( |
951 copyDesktopFile( |
940 os.path.join(sourceDir, "linux", "eric7_browser.desktop.in"), |
952 os.path.join(sourceDir, "linux", "eric7_browser.desktop.in"), |
941 os.path.join(dst, "eric7_browser.desktop")) |
953 os.path.join(dst, "eric7_browser.desktop")) |
|
954 |
942 dst = os.path.normpath( |
955 dst = os.path.normpath( |
943 os.path.join(distDir, "usr/share/metainfo")) |
956 os.path.join(distDir, "usr/share/metainfo")) |
944 if not os.path.exists(dst): |
957 if not os.path.exists(dst): |
945 os.makedirs(dst) |
958 os.makedirs(dst) |
946 copyAppStreamFile( |
959 copyAppStreamFile( |
948 os.path.join(dst, "eric7.appdata.xml")) |
961 os.path.join(dst, "eric7.appdata.xml")) |
949 elif os.getuid() == 0: |
962 elif os.getuid() == 0: |
950 shutilCopy( |
963 shutilCopy( |
951 os.path.join(eric7SourceDir, "pixmaps", "eric_icon.png"), |
964 os.path.join(eric7SourceDir, "pixmaps", "eric_icon.png"), |
952 "/usr/share/icons/eric.png") |
965 "/usr/share/icons/eric.png") |
|
966 shutilCopy( |
|
967 os.path.join(eric7SourceDir, "pixmaps", "eric48_icon.png"), |
|
968 "/usr/share/icons/hicolor/48x48/apps/eric.png") |
953 copyDesktopFile( |
969 copyDesktopFile( |
954 os.path.join(sourceDir, "linux", "eric7.desktop.in"), |
970 os.path.join(sourceDir, "linux", "eric7.desktop.in"), |
955 "/usr/share/applications/eric7.desktop") |
971 "/usr/share/applications/eric7.desktop") |
956 if os.path.exists("/usr/share/metainfo"): |
972 if os.path.exists("/usr/share/metainfo"): |
957 copyAppStreamFile( |
973 copyAppStreamFile( |
962 os.path.join(sourceDir, "linux", "eric7.appdata.xml.in"), |
978 os.path.join(sourceDir, "linux", "eric7.appdata.xml.in"), |
963 "/usr/share/appdata/eric7.appdata.xml") |
979 "/usr/share/appdata/eric7.appdata.xml") |
964 shutilCopy( |
980 shutilCopy( |
965 os.path.join(eric7SourceDir, "pixmaps", "ericWeb48_icon.png"), |
981 os.path.join(eric7SourceDir, "pixmaps", "ericWeb48_icon.png"), |
966 "/usr/share/icons/ericWeb.png") |
982 "/usr/share/icons/ericWeb.png") |
|
983 shutilCopy( |
|
984 os.path.join(eric7SourceDir, "pixmaps", "ericWeb48_icon.png"), |
|
985 "/usr/share/icons/hicolor/48x48/apps/ericWeb.png") |
967 copyDesktopFile( |
986 copyDesktopFile( |
968 os.path.join(sourceDir, "linux", "eric7_browser.desktop.in"), |
987 os.path.join(sourceDir, "linux", "eric7_browser.desktop.in"), |
969 "/usr/share/applications/eric7_browser.desktop") |
988 "/usr/share/applications/eric7_browser.desktop") |
970 elif os.getuid() >= 1000: |
989 elif os.getuid() >= 1000: |
971 # it is assumed, that user ids start at 1000 |
990 # it is assumed, that user ids start at 1000 |
972 localPath = os.path.join(os.path.expanduser("~"), |
991 localPath = os.path.join(os.path.expanduser("~"), |
973 ".local", "share") |
992 ".local", "share") |
974 # create directories first |
993 # create directories first |
975 for directory in [os.path.join(localPath, name) |
994 for directory in [os.path.join(localPath, name) |
976 for name in ("icons", "applications", |
995 for name in ("icons", "icons/hicolor/48x48/apps", |
977 "metainfo", "appdata")]: |
996 "applications", "metainfo", "appdata")]: |
978 if not os.path.isdir(directory): |
997 if not os.path.isdir(directory): |
979 os.makedirs(directory) |
998 os.makedirs(directory) |
980 # now copy the files |
999 # now copy the files |
981 shutilCopy( |
1000 shutilCopy( |
982 os.path.join(eric7SourceDir, "pixmaps", "eric_icon.png"), |
1001 os.path.join(eric7SourceDir, "pixmaps", "eric_icon.png"), |
983 os.path.join(localPath, "icons", "eric.png")) |
1002 os.path.join(localPath, "icons", "eric.png")) |
|
1003 shutilCopy( |
|
1004 os.path.join(eric7SourceDir, "pixmaps", "eric48_icon.png"), |
|
1005 os.path.join(localPath, "icons/hicolor/48x48/apps", "eric.png")) |
984 copyDesktopFile( |
1006 copyDesktopFile( |
985 os.path.join(sourceDir, "linux", "eric7.desktop.in"), |
1007 os.path.join(sourceDir, "linux", "eric7.desktop.in"), |
986 os.path.join(localPath, "applications", "eric7.desktop")) |
1008 os.path.join(localPath, "applications", "eric7.desktop")) |
987 copyAppStreamFile( |
1009 copyAppStreamFile( |
988 os.path.join(sourceDir, "linux", "eric7.appdata.xml.in"), |
1010 os.path.join(sourceDir, "linux", "eric7.appdata.xml.in"), |
991 os.path.join(sourceDir, "linux", "eric7.appdata.xml.in"), |
1013 os.path.join(sourceDir, "linux", "eric7.appdata.xml.in"), |
992 os.path.join(localPath, "appdata", "eric7.appdata.xml")) |
1014 os.path.join(localPath, "appdata", "eric7.appdata.xml")) |
993 shutilCopy( |
1015 shutilCopy( |
994 os.path.join(eric7SourceDir, "pixmaps", "ericWeb48_icon.png"), |
1016 os.path.join(eric7SourceDir, "pixmaps", "ericWeb48_icon.png"), |
995 os.path.join(localPath, "icons", "ericWeb.png")) |
1017 os.path.join(localPath, "icons", "ericWeb.png")) |
|
1018 shutilCopy( |
|
1019 os.path.join(eric7SourceDir, "pixmaps", "ericWeb48_icon.png"), |
|
1020 os.path.join(localPath, "icons/hicolor/48x48/apps", "ericWeb.png")) |
996 copyDesktopFile( |
1021 copyDesktopFile( |
997 os.path.join(sourceDir, "linux", "eric7_browser.desktop.in"), |
1022 os.path.join(sourceDir, "linux", "eric7_browser.desktop.in"), |
998 os.path.join(localPath, "applications", |
1023 os.path.join(localPath, "applications", |
999 "eric7_browser.desktop")) |
1024 "eric7_browser.desktop")) |
1000 |
1025 |