935 global distDir, sourceDir |
935 global distDir, sourceDir |
936 |
936 |
937 dataSourceDir = os.path.join(eric7SourceDir, "data", "linux") |
937 dataSourceDir = os.path.join(eric7SourceDir, "data", "linux") |
938 |
938 |
939 if distDir: |
939 if distDir: |
|
940 # create directories first |
|
941 for directory in ( |
|
942 os.path.normpath(os.path.join(distDir, name)) |
|
943 for name in ( |
|
944 "usr/share/icons", |
|
945 "usr/share/icons/hicolor/48x48/apps", |
|
946 "usr/share/applications", |
|
947 "usr/share/metainfo", |
|
948 "usr/share/appdata", |
|
949 ) |
|
950 ): |
|
951 if not os.path.exists(directory): |
|
952 os.makedirs(directory) |
|
953 |
940 dst = os.path.normpath(os.path.join(distDir, "usr/share/icons")) |
954 dst = os.path.normpath(os.path.join(distDir, "usr/share/icons")) |
941 if not os.path.exists(dst): |
955 for icon in ("eric_icon.png", "ericWeb48_icon.png"): |
942 os.makedirs(dst) |
956 shutilCopy( |
943 shutilCopy( |
957 os.path.join(eric7SourceDir, "pixmaps", icon), |
944 os.path.join(eric7SourceDir, "pixmaps", "eric_icon.png"), |
958 os.path.join(dst, icon.replace("_icon", "").replace("48", "")), |
945 os.path.join(dst, "eric.png"), |
959 ) |
946 ) |
|
947 shutilCopy( |
|
948 os.path.join(eric7SourceDir, "pixmaps", "ericWeb48_icon.png"), |
|
949 os.path.join(dst, "ericWeb.png"), |
|
950 ) |
|
951 |
960 |
952 dst = os.path.normpath( |
961 dst = os.path.normpath( |
953 os.path.join(distDir, "usr/share/icons/hicolor/48x48/apps") |
962 os.path.join(distDir, "usr/share/icons/hicolor/48x48/apps") |
954 ) |
963 ) |
955 if not os.path.exists(dst): |
964 for icon in ("eric48_icon.png", "ericWeb48_icon.png"): |
956 os.makedirs(dst) |
965 shutilCopy( |
957 shutilCopy( |
966 os.path.join(eric7SourceDir, "pixmaps", icon), |
958 os.path.join(eric7SourceDir, "pixmaps", "eric48_icon.png"), |
967 os.path.join(dst, icon.replace("48_icon", "")), |
959 os.path.join(dst, "eric.png"), |
968 ) |
960 ) |
|
961 shutilCopy( |
|
962 os.path.join(eric7SourceDir, "pixmaps", "ericWeb48_icon.png"), |
|
963 os.path.join(dst, "ericWeb.png"), |
|
964 ) |
|
965 |
969 |
966 dst = os.path.normpath(os.path.join(distDir, "usr/share/applications")) |
970 dst = os.path.normpath(os.path.join(distDir, "usr/share/applications")) |
967 if not os.path.exists(dst): |
971 for desktop in ("eric7_ide", "eric7_browser"): |
968 os.makedirs(dst) |
972 copyDesktopFile( |
969 copyDesktopFile( |
973 os.path.join(dataSourceDir, desktop + ".desktop.in"), |
970 os.path.join(dataSourceDir, "eric7_ide.desktop.in"), |
974 os.path.join(dst, desktop + ".desktop") |
971 os.path.join(dst, "eric7_ide.desktop"), |
975 ) |
972 ) |
976 |
973 copyDesktopFile( |
977 for dst in ( |
974 os.path.join(dataSourceDir, "eric7_browser.desktop.in"), |
978 os.path.normpath(os.path.join(distDir, "usr/share/metainfo")), |
975 os.path.join(dst, "eric7_browser.desktop"), |
979 os.path.normpath(os.path.join(distDir, "usr/share/appdata")), |
976 ) |
980 ): |
977 |
981 copyAppStreamFile( |
978 dst = os.path.normpath(os.path.join(distDir, "usr/share/metainfo")) |
982 os.path.join(dataSourceDir, "eric7.appdata.xml.in"), |
979 if not os.path.exists(dst): |
983 os.path.join(dst, "eric7.appdata.xml"), |
980 os.makedirs(dst) |
984 ) |
981 copyAppStreamFile( |
985 |
982 os.path.join(dataSourceDir, "eric7.appdata.xml.in"), |
|
983 os.path.join(dst, "eric7.appdata.xml"), |
|
984 ) |
|
985 elif os.getuid() == 0: |
986 elif os.getuid() == 0: |
|
987 # eric meta data |
986 shutilCopy( |
988 shutilCopy( |
987 os.path.join(eric7SourceDir, "pixmaps", "eric_icon.png"), |
989 os.path.join(eric7SourceDir, "pixmaps", "eric_icon.png"), |
988 "/usr/share/icons/eric.png", |
990 "/usr/share/icons/eric.png", |
989 ) |
991 ) |
990 shutilCopy( |
992 shutilCopy( |