mirror of
https://gitee.com/openharmony/third_party_cups
synced 2024-11-23 01:49:57 +00:00
modify install script -Signed-off-by dongzhengkuan@huawei.com
Signed-off-by: 15549494042 <dongzhengkuan@huawei.com>
This commit is contained in:
parent
ce9f0ec99c
commit
b8b443e054
552
BUILD.gn
552
BUILD.gn
@ -14,8 +14,8 @@
|
||||
import("//build/ohos.gni")
|
||||
import("./cups.gni")
|
||||
|
||||
config_dir = "."
|
||||
cups_code_dir = "cups-2.4.0/"
|
||||
config_dir = "${target_gen_dir}"
|
||||
cups_code_dir = "${target_gen_dir}/cups-2.4.0"
|
||||
core_code_dir = "$cups_code_dir/cups/"
|
||||
filter_code_dir = "$cups_code_dir/filter"
|
||||
backend_code_dir = "$cups_code_dir/backend"
|
||||
@ -25,41 +25,7 @@ scheduler_code_dir = "$cups_code_dir/scheduler"
|
||||
SUBSYSTEM_NAME = "thirdparty"
|
||||
PART_NAME = "cups"
|
||||
|
||||
group("third_party_cups") {
|
||||
deps = [
|
||||
":cups",
|
||||
":cups-deviced",
|
||||
":cups-driverd",
|
||||
":cups-exec",
|
||||
":cupsd",
|
||||
":cupsfilter",
|
||||
":ipp",
|
||||
":mime.convs",
|
||||
":mime.types",
|
||||
":rastertopwg",
|
||||
]
|
||||
}
|
||||
|
||||
config("cups_config") {
|
||||
defines = cups_defines
|
||||
include_dirs = [
|
||||
"$config_dir",
|
||||
"$cups_code_dir",
|
||||
"$core_code_dir",
|
||||
"//third_party/libusb/libusb-1.0.26/libusb",
|
||||
"//third_party/openssl/include",
|
||||
]
|
||||
|
||||
cflags = [
|
||||
"-Wno-unused-function",
|
||||
"-Wno-unused-value",
|
||||
"-Wno-implicit-function-declaration",
|
||||
"-Wno-int-conversion",
|
||||
]
|
||||
}
|
||||
|
||||
ohos_shared_library("cups") {
|
||||
sources = [
|
||||
cups_generated_sources = [
|
||||
"$core_code_dir/adminutil.c",
|
||||
"$core_code_dir/array.c",
|
||||
"$core_code_dir/auth.c",
|
||||
@ -105,9 +71,7 @@ ohos_shared_library("cups") {
|
||||
"$core_code_dir/pwg-media.c",
|
||||
"$core_code_dir/raster-error.c",
|
||||
"$core_code_dir/raster-interpret.c",
|
||||
"$core_code_dir/raster-interstub.c",
|
||||
"$core_code_dir/raster-stream.c",
|
||||
"$core_code_dir/raster-stubs.c",
|
||||
"$core_code_dir/request.c",
|
||||
"$core_code_dir/sidechannel.c",
|
||||
"$core_code_dir/snmp.c",
|
||||
@ -122,189 +86,15 @@ ohos_shared_library("cups") {
|
||||
"$core_code_dir/util.c",
|
||||
]
|
||||
|
||||
deps = [
|
||||
"//third_party/openssl:libcrypto_shared",
|
||||
"//third_party/openssl:libssl_shared",
|
||||
"//third_party/zlib:libz",
|
||||
]
|
||||
scheduler_util_generated_sources = [ "$scheduler_code_dir/util.c" ]
|
||||
|
||||
public_configs = [ ":cups_config" ]
|
||||
cups_deviced_generated_sources = [ "$scheduler_code_dir/cups-deviced.c" ]
|
||||
|
||||
subsystem_name = "$SUBSYSTEM_NAME"
|
||||
part_name = "$PART_NAME"
|
||||
}
|
||||
cups_driverd_generated_sources = [ "$scheduler_code_dir/cups-driverd.cxx" ]
|
||||
|
||||
ohos_shared_library("cupsimage") {
|
||||
sources = [
|
||||
"$core_code_dir/raster-interstub.c",
|
||||
"$core_code_dir/raster-stubs.c",
|
||||
]
|
||||
cups_exec_generated_sources = [ "$scheduler_code_dir/cups-exec.c" ]
|
||||
|
||||
deps = [ "//third_party/cups:cups" ]
|
||||
|
||||
public_configs = [ ":cups_config" ]
|
||||
|
||||
subsystem_name = "$SUBSYSTEM_NAME"
|
||||
part_name = "$PART_NAME"
|
||||
}
|
||||
|
||||
ohos_executable("rastertopwg") {
|
||||
sources = [ "$filter_code_dir/rastertopwg.c" ]
|
||||
|
||||
deps = [ "//third_party/cups:cups" ]
|
||||
|
||||
install_enable = true
|
||||
module_install_dir = "$cups_serverbin_dir/filter"
|
||||
public_configs = [ ":cups_config" ]
|
||||
subsystem_name = "$SUBSYSTEM_NAME"
|
||||
part_name = "$PART_NAME"
|
||||
}
|
||||
|
||||
ohos_shared_library("backend") {
|
||||
sources = [
|
||||
"$backend_code_dir/ieee1284.c",
|
||||
"$backend_code_dir/network.c",
|
||||
"$backend_code_dir/runloop.c",
|
||||
"$backend_code_dir/snmp-supplies.c",
|
||||
]
|
||||
|
||||
deps = [ "//third_party/cups:cups" ]
|
||||
|
||||
public_configs = [ ":cups_config" ]
|
||||
subsystem_name = "$SUBSYSTEM_NAME"
|
||||
part_name = "$PART_NAME"
|
||||
}
|
||||
|
||||
ohos_executable("ipp") {
|
||||
sources = [ "$backend_code_dir/ipp.c" ]
|
||||
|
||||
deps = [
|
||||
"//third_party/cups:backend",
|
||||
"//third_party/cups:cups",
|
||||
]
|
||||
|
||||
install_enable = true
|
||||
module_install_dir = "$cups_serverbin_dir/backend"
|
||||
public_configs = [ ":cups_config" ]
|
||||
subsystem_name = "$SUBSYSTEM_NAME"
|
||||
part_name = "$PART_NAME"
|
||||
}
|
||||
|
||||
ohos_executable("usb") {
|
||||
sources = [ "$backend_code_dir/usb.c" ]
|
||||
|
||||
deps = [
|
||||
"//third_party/cups:backend",
|
||||
"//third_party/cups:cups",
|
||||
"//third_party/libusb:libusb",
|
||||
]
|
||||
|
||||
install_enable = true
|
||||
module_install_dir = "$cups_serverbin_dir/backend"
|
||||
public_configs = [ ":cups_config" ]
|
||||
subsystem_name = "$SUBSYSTEM_NAME"
|
||||
part_name = "$PART_NAME"
|
||||
}
|
||||
|
||||
#end of backend
|
||||
|
||||
ohos_executable("lpadmin") {
|
||||
sources = [ "$cups_code_dir/systemv/lpadmin.c" ]
|
||||
|
||||
deps = [ "//third_party/cups:cups" ]
|
||||
|
||||
install_enable = true
|
||||
public_configs = [ ":cups_config" ]
|
||||
subsystem_name = "$SUBSYSTEM_NAME"
|
||||
part_name = "$PART_NAME"
|
||||
}
|
||||
|
||||
ohos_executable("lpinfo") {
|
||||
sources = [ "$cups_code_dir/systemv/lpinfo.c" ]
|
||||
|
||||
deps = [ "//third_party/cups:cups" ]
|
||||
|
||||
install_enable = true
|
||||
public_configs = [ ":cups_config" ]
|
||||
subsystem_name = "$SUBSYSTEM_NAME"
|
||||
part_name = "$PART_NAME"
|
||||
}
|
||||
|
||||
ohos_executable("lp") {
|
||||
sources = [ "$cups_code_dir/systemv/lp.c" ]
|
||||
|
||||
deps = [ "//third_party/cups:cups" ]
|
||||
|
||||
install_enable = true
|
||||
public_configs = [ ":cups_config" ]
|
||||
subsystem_name = "$SUBSYSTEM_NAME"
|
||||
part_name = "$PART_NAME"
|
||||
}
|
||||
|
||||
#ppdc
|
||||
ohos_shared_library("cupsppdc") {
|
||||
sources = [
|
||||
"$ppdc_code_dir/ppdc-array.cxx",
|
||||
"$ppdc_code_dir/ppdc-attr.cxx",
|
||||
"$ppdc_code_dir/ppdc-catalog.cxx",
|
||||
"$ppdc_code_dir/ppdc-choice.cxx",
|
||||
"$ppdc_code_dir/ppdc-constraint.cxx",
|
||||
"$ppdc_code_dir/ppdc-driver.cxx",
|
||||
"$ppdc_code_dir/ppdc-file.cxx",
|
||||
"$ppdc_code_dir/ppdc-filter.cxx",
|
||||
"$ppdc_code_dir/ppdc-font.cxx",
|
||||
"$ppdc_code_dir/ppdc-group.cxx",
|
||||
"$ppdc_code_dir/ppdc-import.cxx",
|
||||
"$ppdc_code_dir/ppdc-mediasize.cxx",
|
||||
"$ppdc_code_dir/ppdc-message.cxx",
|
||||
"$ppdc_code_dir/ppdc-option.cxx",
|
||||
"$ppdc_code_dir/ppdc-profile.cxx",
|
||||
"$ppdc_code_dir/ppdc-shared.cxx",
|
||||
"$ppdc_code_dir/ppdc-source.cxx",
|
||||
"$ppdc_code_dir/ppdc-string.cxx",
|
||||
"$ppdc_code_dir/ppdc-variable.cxx",
|
||||
]
|
||||
|
||||
deps = [ "//third_party/cups:cups" ]
|
||||
|
||||
public_configs = [ ":cups_config" ]
|
||||
subsystem_name = "$SUBSYSTEM_NAME"
|
||||
part_name = "$PART_NAME"
|
||||
}
|
||||
|
||||
ohos_executable("ppdc") {
|
||||
sources = [ "$ppdc_code_dir/ppdc.cxx" ]
|
||||
|
||||
deps = [
|
||||
"//third_party/cups:cups",
|
||||
"//third_party/cups:cupsppdc",
|
||||
]
|
||||
|
||||
install_enable = true
|
||||
public_configs = [ ":cups_config" ]
|
||||
subsystem_name = "$SUBSYSTEM_NAME"
|
||||
part_name = "$PART_NAME"
|
||||
}
|
||||
|
||||
#end of ppdc
|
||||
|
||||
#scheduler
|
||||
ohos_shared_library("cupsmime") {
|
||||
sources = [
|
||||
"$scheduler_code_dir/filter.c",
|
||||
"$scheduler_code_dir/mime.c",
|
||||
"$scheduler_code_dir/type.c",
|
||||
]
|
||||
|
||||
deps = [ "//third_party/cups:cups" ]
|
||||
|
||||
public_configs = [ ":cups_config" ]
|
||||
subsystem_name = "$SUBSYSTEM_NAME"
|
||||
part_name = "$PART_NAME"
|
||||
}
|
||||
|
||||
ohos_executable("cupsd") {
|
||||
sources = [
|
||||
cupsd_generated_sources = [
|
||||
"$scheduler_code_dir/auth.c",
|
||||
"$scheduler_code_dir/banners.c",
|
||||
"$scheduler_code_dir/cert.c",
|
||||
@ -332,11 +122,298 @@ ohos_executable("cupsd") {
|
||||
"$scheduler_code_dir/sysman.c",
|
||||
]
|
||||
|
||||
cupsfilter_generated_sources = [ "$scheduler_code_dir/cupsfilter.c" ]
|
||||
|
||||
ipp_generated_sources = [ "$backend_code_dir/ipp.c" ]
|
||||
|
||||
usb_generated_sources = [ "$backend_code_dir/usb.c" ]
|
||||
|
||||
lp_generated_sources = [ "$cups_code_dir/systemv/lp.c" ]
|
||||
|
||||
lpadmin_generated_sources = [ "$cups_code_dir/systemv/lpadmin.c" ]
|
||||
|
||||
lpinfo_generated_sources = [ "$cups_code_dir/systemv/lpinfo.c" ]
|
||||
|
||||
rastertopwg_generated_sources = [ "$filter_code_dir/rastertopwg.c" ]
|
||||
|
||||
cupsmime_generated_sources = [
|
||||
"$scheduler_code_dir/filter.c",
|
||||
"$scheduler_code_dir/mime.c",
|
||||
"$scheduler_code_dir/type.c",
|
||||
]
|
||||
|
||||
cupsimage_generated_sources = [
|
||||
"$core_code_dir/raster-interstub.c",
|
||||
"$core_code_dir/raster-stubs.c",
|
||||
]
|
||||
|
||||
backend_generated_sources = [
|
||||
"$backend_code_dir/ieee1284.c",
|
||||
"$backend_code_dir/network.c",
|
||||
"$backend_code_dir/runloop.c",
|
||||
"$backend_code_dir/snmp-supplies.c",
|
||||
]
|
||||
|
||||
cupsppdc_generated_sources = [
|
||||
"$ppdc_code_dir/ppdc-array.cxx",
|
||||
"$ppdc_code_dir/ppdc-attr.cxx",
|
||||
"$ppdc_code_dir/ppdc-catalog.cxx",
|
||||
"$ppdc_code_dir/ppdc-choice.cxx",
|
||||
"$ppdc_code_dir/ppdc-constraint.cxx",
|
||||
"$ppdc_code_dir/ppdc-driver.cxx",
|
||||
"$ppdc_code_dir/ppdc-file.cxx",
|
||||
"$ppdc_code_dir/ppdc-filter.cxx",
|
||||
"$ppdc_code_dir/ppdc-font.cxx",
|
||||
"$ppdc_code_dir/ppdc-group.cxx",
|
||||
"$ppdc_code_dir/ppdc-import.cxx",
|
||||
"$ppdc_code_dir/ppdc-mediasize.cxx",
|
||||
"$ppdc_code_dir/ppdc-message.cxx",
|
||||
"$ppdc_code_dir/ppdc-option.cxx",
|
||||
"$ppdc_code_dir/ppdc-profile.cxx",
|
||||
"$ppdc_code_dir/ppdc-shared.cxx",
|
||||
"$ppdc_code_dir/ppdc-source.cxx",
|
||||
"$ppdc_code_dir/ppdc-string.cxx",
|
||||
"$ppdc_code_dir/ppdc-variable.cxx",
|
||||
]
|
||||
|
||||
ppdc_generated_sources = [ "$ppdc_code_dir/ppdc.cxx" ]
|
||||
|
||||
mime_convs_generated_source = "$cups_code_dir/conf/mime.convs"
|
||||
mime_types_generated_source = "$cups_code_dir/conf/mime.types"
|
||||
|
||||
action("cups_action") {
|
||||
print("cups_action is exec")
|
||||
script = "//third_party/cups/install.py"
|
||||
outputs = []
|
||||
outputs += cups_generated_sources
|
||||
outputs += cups_deviced_generated_sources
|
||||
outputs += cups_driverd_generated_sources
|
||||
outputs += cups_exec_generated_sources
|
||||
outputs += cupsd_generated_sources
|
||||
outputs += cupsfilter_generated_sources
|
||||
outputs += ipp_generated_sources
|
||||
outputs += usb_generated_sources
|
||||
outputs += lp_generated_sources
|
||||
outputs += lpadmin_generated_sources
|
||||
outputs += lpinfo_generated_sources
|
||||
outputs += rastertopwg_generated_sources
|
||||
outputs += cupsmime_generated_sources
|
||||
outputs += cupsimage_generated_sources
|
||||
outputs += backend_generated_sources
|
||||
outputs += cupsppdc_generated_sources
|
||||
outputs += ppdc_generated_sources
|
||||
outputs += scheduler_util_generated_sources
|
||||
outputs += [ mime_convs_generated_source ]
|
||||
outputs += [ mime_types_generated_source ]
|
||||
|
||||
inputs = [ "//third_party/cups/cups-2.4.0-source.tar.gz" ]
|
||||
cups_path = rebase_path("${target_gen_dir}", root_build_dir)
|
||||
cups_source_path = rebase_path("//third_party/cups", root_build_dir)
|
||||
args = [
|
||||
"--gen-dir",
|
||||
"$cups_path",
|
||||
"--source-dir",
|
||||
"$cups_source_path",
|
||||
]
|
||||
}
|
||||
|
||||
group("third_party_cups") {
|
||||
deps = [
|
||||
":cups",
|
||||
":cups-deviced",
|
||||
":cups-driverd",
|
||||
":cups-exec",
|
||||
":cupsd",
|
||||
":cupsfilter",
|
||||
":cupsimage",
|
||||
":ipp",
|
||||
":mime.convs",
|
||||
":mime.types",
|
||||
":rastertopwg",
|
||||
":usb",
|
||||
]
|
||||
}
|
||||
|
||||
config("cups_config") {
|
||||
defines = cups_defines
|
||||
include_dirs = [
|
||||
"$config_dir",
|
||||
"$cups_code_dir",
|
||||
"$core_code_dir",
|
||||
"//third_party/libusb",
|
||||
"//third_party/openssl/include",
|
||||
]
|
||||
|
||||
cflags = [
|
||||
"-Wno-unused-function",
|
||||
"-Wno-unused-value",
|
||||
"-Wno-implicit-function-declaration",
|
||||
"-Wno-int-conversion",
|
||||
]
|
||||
}
|
||||
|
||||
ohos_shared_library("cups") {
|
||||
sources = cups_generated_sources
|
||||
sources += cupsimage_generated_sources
|
||||
deps = [
|
||||
":cups_action",
|
||||
"//third_party/openssl:libcrypto_shared",
|
||||
"//third_party/openssl:libssl_shared",
|
||||
"//third_party/zlib:libz",
|
||||
]
|
||||
public_configs = [ ":cups_config" ]
|
||||
subsystem_name = "$SUBSYSTEM_NAME"
|
||||
part_name = "$PART_NAME"
|
||||
}
|
||||
|
||||
ohos_shared_library("cupsimage") {
|
||||
sources = cupsimage_generated_sources
|
||||
deps = [
|
||||
":cups_action",
|
||||
"//third_party/cups:cups",
|
||||
]
|
||||
public_configs = [ ":cups_config" ]
|
||||
subsystem_name = "$SUBSYSTEM_NAME"
|
||||
part_name = "$PART_NAME"
|
||||
}
|
||||
|
||||
ohos_executable("rastertopwg") {
|
||||
sources = rastertopwg_generated_sources
|
||||
deps = [
|
||||
":cups_action",
|
||||
"//third_party/cups:cups",
|
||||
]
|
||||
install_enable = true
|
||||
module_install_dir = "$cups_serverbin_dir/filter"
|
||||
public_configs = [ ":cups_config" ]
|
||||
subsystem_name = "$SUBSYSTEM_NAME"
|
||||
part_name = "$PART_NAME"
|
||||
}
|
||||
|
||||
ohos_shared_library("backend") {
|
||||
sources = backend_generated_sources
|
||||
deps = [
|
||||
":cups_action",
|
||||
"//third_party/cups:cups",
|
||||
]
|
||||
public_configs = [ ":cups_config" ]
|
||||
subsystem_name = "$SUBSYSTEM_NAME"
|
||||
part_name = "$PART_NAME"
|
||||
}
|
||||
|
||||
ohos_executable("ipp") {
|
||||
sources = ipp_generated_sources
|
||||
deps = [
|
||||
":cups_action",
|
||||
"//third_party/cups:backend",
|
||||
"//third_party/cups:cups",
|
||||
]
|
||||
install_enable = true
|
||||
module_install_dir = "$cups_serverbin_dir/backend"
|
||||
public_configs = [ ":cups_config" ]
|
||||
subsystem_name = "$SUBSYSTEM_NAME"
|
||||
part_name = "$PART_NAME"
|
||||
}
|
||||
|
||||
ohos_executable("usb") {
|
||||
sources = usb_generated_sources
|
||||
deps = [
|
||||
":cups_action",
|
||||
"//third_party/cups:backend",
|
||||
"//third_party/cups:cups",
|
||||
"//third_party/libusb:libusb",
|
||||
]
|
||||
install_enable = true
|
||||
module_install_dir = "$cups_serverbin_dir/backend"
|
||||
public_configs = [ ":cups_config" ]
|
||||
subsystem_name = "$SUBSYSTEM_NAME"
|
||||
part_name = "$PART_NAME"
|
||||
}
|
||||
|
||||
#end of backend
|
||||
|
||||
ohos_executable("lpadmin") {
|
||||
sources = lpadmin_generated_sources
|
||||
deps = [
|
||||
":cups_action",
|
||||
"//third_party/cups:cups",
|
||||
]
|
||||
install_enable = true
|
||||
public_configs = [ ":cups_config" ]
|
||||
subsystem_name = "$SUBSYSTEM_NAME"
|
||||
part_name = "$PART_NAME"
|
||||
}
|
||||
|
||||
ohos_executable("lpinfo") {
|
||||
sources = lpinfo_generated_sources
|
||||
deps = [
|
||||
":cups_action",
|
||||
"//third_party/cups:cups",
|
||||
]
|
||||
install_enable = true
|
||||
public_configs = [ ":cups_config" ]
|
||||
subsystem_name = "$SUBSYSTEM_NAME"
|
||||
part_name = "$PART_NAME"
|
||||
}
|
||||
|
||||
ohos_executable("lp") {
|
||||
sources = lp_generated_sources
|
||||
deps = [
|
||||
":cups_action",
|
||||
"//third_party/cups:cups",
|
||||
]
|
||||
install_enable = true
|
||||
public_configs = [ ":cups_config" ]
|
||||
subsystem_name = "$SUBSYSTEM_NAME"
|
||||
part_name = "$PART_NAME"
|
||||
}
|
||||
|
||||
#ppdc
|
||||
ohos_shared_library("cupsppdc") {
|
||||
sources = cupsppdc_generated_sources
|
||||
deps = [
|
||||
":cups_action",
|
||||
"//third_party/cups:cups",
|
||||
]
|
||||
public_configs = [ ":cups_config" ]
|
||||
subsystem_name = "$SUBSYSTEM_NAME"
|
||||
part_name = "$PART_NAME"
|
||||
}
|
||||
|
||||
ohos_executable("ppdc") {
|
||||
sources = ppdc_generated_sources
|
||||
deps = [
|
||||
":cups_action",
|
||||
"//third_party/cups:cups",
|
||||
"//third_party/cups:cupsppdc",
|
||||
]
|
||||
install_enable = true
|
||||
public_configs = [ ":cups_config" ]
|
||||
subsystem_name = "$SUBSYSTEM_NAME"
|
||||
part_name = "$PART_NAME"
|
||||
}
|
||||
|
||||
#end of ppdc
|
||||
|
||||
#scheduler
|
||||
ohos_shared_library("cupsmime") {
|
||||
sources = cupsmime_generated_sources
|
||||
deps = [
|
||||
":cups_action",
|
||||
"//third_party/cups:cups",
|
||||
]
|
||||
public_configs = [ ":cups_config" ]
|
||||
subsystem_name = "$SUBSYSTEM_NAME"
|
||||
part_name = "$PART_NAME"
|
||||
}
|
||||
|
||||
ohos_executable("cupsd") {
|
||||
sources = cupsd_generated_sources
|
||||
deps = [
|
||||
":cups_action",
|
||||
"//third_party/cups:cups",
|
||||
"//third_party/cups:cupsmime",
|
||||
]
|
||||
|
||||
install_enable = true
|
||||
public_configs = [ ":cups_config" ]
|
||||
subsystem_name = "$SUBSYSTEM_NAME"
|
||||
@ -344,13 +421,12 @@ ohos_executable("cupsd") {
|
||||
}
|
||||
|
||||
ohos_executable("cupsfilter") {
|
||||
sources = [ "$scheduler_code_dir/cupsfilter.c" ]
|
||||
|
||||
sources = cupsfilter_generated_sources
|
||||
deps = [
|
||||
":cups_action",
|
||||
"//third_party/cups:cups",
|
||||
"//third_party/cups:cupsmime",
|
||||
]
|
||||
|
||||
install_enable = true
|
||||
public_configs = [ ":cups_config" ]
|
||||
subsystem_name = "$SUBSYSTEM_NAME"
|
||||
@ -358,16 +434,13 @@ ohos_executable("cupsfilter") {
|
||||
}
|
||||
|
||||
ohos_executable("cups-deviced") {
|
||||
sources = [
|
||||
"$scheduler_code_dir/cups-deviced.c",
|
||||
"$scheduler_code_dir/util.c",
|
||||
]
|
||||
|
||||
sources = cups_deviced_generated_sources
|
||||
sources += scheduler_util_generated_sources
|
||||
deps = [
|
||||
":cups_action",
|
||||
"//third_party/cups:cups",
|
||||
"//third_party/cups:cupsmime",
|
||||
]
|
||||
|
||||
install_enable = true
|
||||
module_install_dir = "$cups_serverbin_dir/daemon"
|
||||
public_configs = [ ":cups_config" ]
|
||||
@ -376,16 +449,13 @@ ohos_executable("cups-deviced") {
|
||||
}
|
||||
|
||||
ohos_executable("cups-driverd") {
|
||||
sources = [
|
||||
"$scheduler_code_dir/cups-driverd.cxx",
|
||||
"$scheduler_code_dir/util.c",
|
||||
]
|
||||
|
||||
sources = cups_driverd_generated_sources
|
||||
sources += scheduler_util_generated_sources
|
||||
deps = [
|
||||
":cups_action",
|
||||
"//third_party/cups:cups",
|
||||
"//third_party/cups:cupsppdc",
|
||||
]
|
||||
|
||||
install_enable = true
|
||||
module_install_dir = "$cups_serverbin_dir/daemon"
|
||||
public_configs = [ ":cups_config" ]
|
||||
@ -394,10 +464,8 @@ ohos_executable("cups-driverd") {
|
||||
}
|
||||
|
||||
ohos_executable("cups-exec") {
|
||||
sources = [ "$scheduler_code_dir/cups-exec.c" ]
|
||||
|
||||
deps = []
|
||||
|
||||
sources = cups_exec_generated_sources
|
||||
deps = [ ":cups_action" ]
|
||||
install_enable = true
|
||||
module_install_dir = "$cups_serverbin_dir/daemon"
|
||||
public_configs = [ ":cups_config" ]
|
||||
@ -406,16 +474,16 @@ ohos_executable("cups-exec") {
|
||||
}
|
||||
|
||||
ohos_prebuilt_etc("mime.convs") {
|
||||
exec_script(rebase_path("//third_party/cups/generate_mime_convs.py"),
|
||||
[ rebase_path("//third_party/cups/cups-2.4.0/conf") ])
|
||||
source = "$cups_code_dir/conf/mime.convs"
|
||||
source = mime_convs_generated_source
|
||||
deps = [ ":cups_action" ]
|
||||
relative_install_dir = "cups/share/mime"
|
||||
subsystem_name = "$SUBSYSTEM_NAME"
|
||||
part_name = "$PART_NAME"
|
||||
}
|
||||
|
||||
ohos_prebuilt_etc("mime.types") {
|
||||
source = "$cups_code_dir/conf/mime.types"
|
||||
source = mime_types_generated_source
|
||||
deps = [ ":cups_action" ]
|
||||
relative_install_dir = "cups/share/mime"
|
||||
subsystem_name = "$SUBSYSTEM_NAME"
|
||||
part_name = "$PART_NAME"
|
||||
|
4
cups.gni
4
cups.gni
@ -11,10 +11,6 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
cups_path = rebase_path("//third_party/cups")
|
||||
exec_script("install.sh", [ "$cups_path" ])
|
||||
print("cups installed successfully")
|
||||
|
||||
CUPS_SERVICE_DATA_DIR = "/data/service/el1/public/print_service/cups"
|
||||
|
||||
cups_bin_dir = "bin"
|
||||
|
99
install.py
Executable file
99
install.py
Executable file
@ -0,0 +1,99 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import tarfile
|
||||
import argparse
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
import shutil
|
||||
|
||||
|
||||
def untar_file(tar_file_path, extract_path):
|
||||
try:
|
||||
tar_cmd = ['tar', '-zxf', tar_file_path, '-C', extract_path]
|
||||
subprocess.run(tar_cmd, check=True)
|
||||
except Exception as e:
|
||||
print("tar error!")
|
||||
return
|
||||
|
||||
def copy_file(dir):
|
||||
src_name = '/mime.convs.in'
|
||||
dest_name = '/mime.convs'
|
||||
src_file = dir + src_name
|
||||
dest_file = dir + dest_name
|
||||
print(f'copy from %s to %s', src_file, dest_file)
|
||||
shutil.copy2(src_file, dest_file)
|
||||
|
||||
def move_file(src_path, dst_path):
|
||||
files = [
|
||||
"backport-CVE-2022-26691.patch",
|
||||
"backport-CVE-2023-32324.patch",
|
||||
"backport-CVE-2023-34241.patch",
|
||||
"ohos-multi-file-print.patch",
|
||||
"ohos-modify-pthread.patch",
|
||||
"ohos-add-openssl.patch",
|
||||
"backport-CVE-2023-4504.patch",
|
||||
"config.h"
|
||||
]
|
||||
for file in files:
|
||||
src_file = os.path.join(src_path, file)
|
||||
dst_file = os.path.join(dst_path, file)
|
||||
shutil.copy(src_file, dst_file)
|
||||
|
||||
|
||||
def apply_patch(patch_file, target_dir):
|
||||
try:
|
||||
if not os.path.exists(target_dir):
|
||||
return
|
||||
patch_cmd = ['patch', '-p1', "--fuzz=0", "--no-backup-if-mismatch", '-i', patch_file, '-d', target_dir]
|
||||
subprocess.run(patch_cmd, check=True)
|
||||
except Exception as e:
|
||||
print("apply_patch error!")
|
||||
return
|
||||
|
||||
|
||||
def do_patch(target_dir):
|
||||
patch_file = [
|
||||
"backport-CVE-2022-26691.patch",
|
||||
"backport-CVE-2023-32324.patch",
|
||||
"backport-CVE-2023-34241.patch",
|
||||
"ohos-multi-file-print.patch",
|
||||
"ohos-modify-pthread.patch",
|
||||
"ohos-add-openssl.patch",
|
||||
"backport-CVE-2023-4504.patch"
|
||||
]
|
||||
|
||||
for patch in patch_file:
|
||||
apply_patch(patch, target_dir)
|
||||
|
||||
|
||||
def main():
|
||||
cups_path = argparse.ArgumentParser()
|
||||
cups_path.add_argument('--gen-dir', help='generate path of log', required=True)
|
||||
cups_path.add_argument('--source-dir', help='generate path of log', required=True)
|
||||
args = cups_path.parse_args()
|
||||
tar_file_path = os.path.join(args.source_dir, "cups-2.4.0-source.tar.gz")
|
||||
target_dir = os.path.join(args.gen_dir, "cups-2.4.0")
|
||||
convs_dir = os.path.join(target_dir, "conf")
|
||||
|
||||
untar_file(tar_file_path, args.gen_dir)
|
||||
move_file(args.source_dir, target_dir)
|
||||
do_patch(target_dir)
|
||||
copy_file(convs_dir)
|
||||
return 0
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
29
install.sh
29
install.sh
@ -1,29 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set -e
|
||||
cd $1
|
||||
if [ -d "cups-2.4.0" ];then
|
||||
rm -rf cups-2.4.0
|
||||
fi
|
||||
tar xvf cups-2.4.0-source.tar.gz
|
||||
cd $1/cups-2.4.0
|
||||
patch -p1 < $1/backport-CVE-2022-26691.patch --fuzz=0 --no-backup-if-mismatch
|
||||
patch -p1 < $1/backport-CVE-2023-32324.patch --fuzz=0 --no-backup-if-mismatch
|
||||
patch -p1 < $1/backport-CVE-2023-34241.patch --fuzz=0 --no-backup-if-mismatch
|
||||
patch -p1 < $1/ohos-multi-file-print.patch --fuzz=0 --no-backup-if-mismatch
|
||||
patch -p1 < $1/ohos-modify-pthread.patch --fuzz=0 --no-backup-if-mismatch
|
||||
patch -p1 < $1/ohos-add-openssl.patch --fuzz=0 --no-backup-if-mismatch
|
||||
patch -p1 < $1/backport-CVE-2023-4504.patch --fuzz=0 --no-backup-if-mismatch
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user