support/package-builder/constants.py
b5e09fac
 from Logger import Logger
2820c61a
 
 class constants(object):
     specPath=""
     sourcePath=""
     rpmPath=""
     logPath=""
4c54f74b
     dist=""
2c153d29
     buildNumber="0000000"
     releaseVersion="NNNnNNN"
2820c61a
     topDirPath=""
65584c99
     buildRootPath="/mnt"
2fcd8ac0
     prevPublishRPMRepo=""
062d56d1
     prevPublishXRPMRepo=""
3cc43c92
     pullsourcesConfig=""
42ffccb5
     buildPatch=False
     inputRPMSPath=""
bc90d582
     rpmCheck=False
d2526915
     sourceRpmPath=""
620867de
     publishBuildDependencies=False
     packageWeightsPath=None
7418d2bf
 
     noDepsPackageList=[
         "texinfo",
         "bzip2",
         "bzip2-libs",
         "gettext",
         "nspr",
         "xz",
         "bison",
         "go",
         "sqlite",
         "sqlite-devel",
         "sqlite-libs"]
 
fb300e7c
     # These packages will be built in first order as build-core-toolchain stage
     listCoreToolChainPackages=[
21a45f16
         "filesystem",
55dba468
         "linux-api-headers",
         "glibc",
         "zlib",
         "file",
         "binutils",
         "gmp",
         "mpfr",
         "mpc",
         "libgcc",
         "libstdc++",
         "libgomp",
         "gcc",
         "pkg-config",
         "ncurses",
         "readline",
         "bash"]
 
fb300e7c
     # These packages will be built in a second stage to replace publish RPMS
     listToolChainPackages=[
21a45f16
         "filesystem",
55dba468
         "linux-api-headers",
         "glibc",
         "zlib",
         "file",
         "binutils",
         "gmp",
         "mpfr",
         "mpc",
         "gcc",
         "pkg-config",
         "ncurses",
         "bash",
         "bzip2",
         "sed",
         "procps-ng",
         "coreutils",
         "m4",
         "grep",
         "readline",
         "diffutils",
         "gawk",
         "findutils",
         "gettext",
         "gzip",
         "make",
         "patch",
         "util-linux",
         "tar",
         "xz",
         "libtool",
         "flex",
         "bison",
         "lua",
         "popt",
         "nspr",
7418d2bf
         "nspr-devel",
9874e684
         "sqlite",
55dba468
         "nss",
fb300e7c
         "elfutils",
         "expat",
         "libffi",
55dba468
         "libpipeline",
         "gdbm",
         "perl",
         "texinfo",
         "autoconf",
         "automake",
fb300e7c
         "openssl",
7418d2bf
         "openssl-devel",
fb300e7c
         "python2",
ec017e0f
         "libdb",
fb300e7c
         "rpm",
55dba468
         "groff",
         "man-pages",
fb300e7c
         "cpio"]
55dba468
 
fb300e7c
     # List or RPMS that will be installed in a chroot prior to build each
7f9d2e12
     # package. This list should be ordered by install order. On a stage1
     # and stage2 published rpms will/might be used after stage2 only local
     # RPMS will be used
fb300e7c
     listToolChainRPMsToInstall=[
21a45f16
         "filesystem",
55dba468
         "linux-api-headers",
         "glibc",
         "glibc-devel",
42e8b7da
         "glibc-iconv",
         "glibc-tools",
55dba468
         "zlib",
         "zlib-devel",
         "file",
         "binutils",
         "binutils-devel",
         "gmp",
         "gmp-devel",
         "mpfr",
         "mpfr-devel",
         "mpc",
         "libgcc",
         "libgcc-devel",
         "libstdc++",
         "libstdc++-devel",
         "libgomp",
         "libgomp-devel",
         "gcc",
         "pkg-config",
         "ncurses",
f5cac196
         "ncurses-libs",
         "ncurses-devel",
55dba468
         "bash",
         "bzip2",
7fbd3a1e
         "bzip2-libs",
fb300e7c
         "bzip2-devel",
55dba468
         "sed",
         "procps-ng",
         "coreutils",
         "m4",
         "grep",
         "readline",
         "diffutils",
         "gawk",
         "findutils",
         "gettext",
         "gzip",
         "make",
         "patch",
         "util-linux",
42e8b7da
         "util-linux-libs",
55dba468
         "util-linux-devel",
         "tar",
         "xz",
7fbd3a1e
         "xz-libs",
55dba468
         "libtool",
         "flex",
         "flex-devel",
         "bison",
         "readline-devel",
         "lua",
         "lua-devel",
         "popt",
         "popt-devel",
         "nspr",
7fbd3a1e
         "nspr-devel",
9874e684
         "sqlite",
fb300e7c
         "sqlite-libs",
55dba468
         "nss",
7fbd3a1e
         "nss-libs",
55dba468
         "nss-devel",
         "elfutils-libelf",
         "elfutils",
         "elfutils-libelf-devel",
         "elfutils-devel",
         "expat",
7fbd3a1e
         "expat-libs",
55dba468
         "libffi",
         "libpipeline",
         "gdbm",
         "perl",
         "texinfo",
         "autoconf",
         "automake",
         "openssl",
         "openssl-devel",
         "python2",
         "python2-libs",
         "python2-devel",
         "libcap",
ec017e0f
         "libdb",
         "libdb-devel",
55dba468
         "rpm",
         "rpm-build",
         "rpm-devel",
fb300e7c
         "rpm-libs",
55dba468
         "groff",
         "man-pages",
fb300e7c
         "cpio",
         "go"]
 
8c91b2bd
     perPackageToolChain = dict.fromkeys(["openjdk8", "openjdk8-doc", "openjdk8-src", "openjdk8-sample", "openjre8" ], [
062d56d1
         "glib-devel",
         "icu-devel",
202dd1d6
         "openjdk",
         "openjre",
062d56d1
         "icu",
         "harfbuzz",
         "harfbuzz-devel",
         "freetype2",
         "freetype2-devel",
         "alsa-lib",
         "alsa-lib-devel",
         "xcb-proto",
         "libXdmcp-devel",
         "libXau-devel",
         "util-macros",
         "xtrans",
         "libxcb-devel",
         "fontconfig-devel",
         "proto",
         "libXdmcp",
         "libxcb",
         "libXau",
         "fontconfig",
         "xtrans-devel",
         "libX11",
         "libX11-devel",
         "libXext",
         "libXext-devel",
         "libICE-devel",
         "libSM",
         "libICE",
         "libSM-devel",
         "libXt",
         "libXmu",
         "libXt-devel",
         "libXmu-devel",
         "libXrender",
202dd1d6
         "libXrender-devel"])
27a75769
     perPackageToolChain["apache-maven"] = ["apache-maven"]
fb300e7c
     # List of RPMs which are not published. They will be created during the
     # build process
     listOfRPMsProvidedAfterBuild=[
         "util-linux-devel",
         "flex-devel",
7fbd3a1e
         "nspr-devel",
42e8b7da
         "glibc-iconv",
         "glibc-tools",
7fbd3a1e
         "bzip2-libs",
         "expat-libs",
f5cac196
         "ncurses-libs",
42e8b7da
         "util-linux-libs",
7fbd3a1e
         "nss-libs",
         "xz-libs",
9874e684
         "sqlite",
fb300e7c
         "sqlite-libs",
         "rpm-libs"]
55dba468
 
fb300e7c
     # List of packages that will be installed in addition for each
     # package to make check
b5e09fac
     listMakeCheckRPMPkgtoInstall=[
         "python2",
         "python2-devel",
         "python2-libs",
         "python2-tools",
202dd1d6
         "PyYAML",
         "libyaml",
b5e09fac
         "libffi",
         "python-setuptools",
14b9b3bb
         "python3-setuptools",
b5e09fac
         "ca-certificates",
         "linux",
         "createrepo",
         "sudo",
         "ruby",
         "curl",
         "pcre-devel",
         "boost-devel",
         "which",
         "go",
         "e2fsprogs-devel",
         "shadow",
         "check",
         "libacl-devel",
         "device-mapper",
         "wget",
         "tar",
         "pkg-config",
         "git",
         "openssl",
2a807a3e
         "openssl-devel",
b5e09fac
         "net-tools",
         "less",
9874e684
         "iana-etc",
b5e09fac
         "yum-metadata-parser",
         "yum",
ec017e0f
         "libdb",
b5e09fac
         "rpm-devel",
         "rpm",
         "libxml2",
         "python-xml",
14b9b3bb
         "python3-xml",
b5e09fac
         "libacl",
         "tzdata",
2a807a3e
         "libgcrypt-devel",
98f63cc4
         "Linux-PAM",
99f94a68
         "unzip",
         "systemd-devel",
a9c2129a
         "gnupg",
         "ncurses-terminfo" ]
a5e4be9f
 
7418d2bf
     listReInstallPackages=[
         "go"]
 
ba2f92e6
     # List of packages that requires privileged docker
     # to run make check.
     listReqPrivilegedDockerForTest=[
83bd478f
         "elfutils", # SYS_PTRACE
96a6c448
         "gdb",
c9535d05
         "glibc",
         "tar"]
ba2f92e6
 
45c9260c
     # .spec file might contain lines such as
     # Requires(post):/sbin/useradd
     # Build system should interpret it as
     # Requires: shadow
     providedBy={
7f9d2e12
         "/usr/sbin/useradd":"shadow",
         "/usr/sbin/groupadd":"shadow",
         "/usr/bin/which":"which",
         "/bin/sed":"sed"
45c9260c
     }
 
0f1fdc4b
     # list of spec files to skip for parsing for given arch
     skipSpecsForArch={
         "x86_64":[],
         "aarch64":[
             # fakeroot-ng does not support aarch64
             "fakeroot-ng.spec",
             # ipxe does not support aarch64
             "ipxe.spec",
             # kexec-tools for arm64 does not support fpic
             "kexec-tools.spec",
             # no TXT/tboot on arm64
             "tboot.spec",
             # backward-cpp does not support amd64
             "backward-cpp.spec",
             "envoy.spec",
             # only generic linux is for arm64
             "linux-esx.spec",
             "linux-secure.spec",
             # only linux-secure supports aufs
             "aufs-util.spec",
             # open-vm-tools does not support aarch64
             "open-vm-tools.spec",
             # TODO: mariadb build hangs on amd64
             "mariadb.spec",
             # TODO: mysql fails on amd64 with fpic
             "mysql.spec",
             # irqbalance for arm64 ?
             "irqbalance.spec",
             # no X rpms to build openjdk, skip all java packages
             "openjdk8.spec",
             "ant-contrib.spec",
             "apache-ant.spec",
             "apache-maven.spec",
             "apache-tomcat.spec",
             "cassandra.spec",
             "commons-daemon.spec",
             "jna.spec",
             "kubernetes-dashboard.spec",
             "lightwave.spec",
             "mesos.spec",
             "protobuf.spec",
             "wavefront-proxy.spec",
             "zookeeper.spec",
             # requires lightwave
             "pmd.spec",
             # requires protobuf
             "calico-felix.spec",
             "lightstep-tracer-cpp.spec",
             "protobuf-c.spec",
             "runc.spec",
             # requires cassandra
             "python-cqlsh.spec",
             # requires python-pyinstaller, but it has unresolved glibc deps
             "calico-k8s-policy.spec",
             "libcalico.spec",
             # pcstat requires patching for aarch64
             "pcstat.spec",
             # sysdig for aarch64 requires luajit, skip it and falco
             # https://github.com/draios/sysdig/issues/833
             "sysdig.spec",
             "falco.spec"
         ]
     }
 
2820c61a
     @staticmethod
     def initialize(options):
4c54f74b
         constants.dist = options.dist
2c153d29
         constants.buildNumber = options.buildNumber
         constants.releaseVersion = options.releaseVersion
2820c61a
         constants.specPath = options.specPath
         constants.sourcePath = options.sourcePath
         constants.rpmPath = options.rpmPath
d2526915
         constants.sourceRpmPath = options.sourceRpmPath
2820c61a
         constants.topDirPath = options.topDirPath
         constants.logPath = options.logPath
062d56d1
         constants.prevPublishRPMRepo = options.publishRPMSPath
         constants.prevPublishXRPMRepo = options.publishXRPMSPath
d23d369f
         constants.buildRootPath=options.buildRootPath
3cc43c92
         constants.pullsourcesConfig = options.pullsourcesConfig
42ffccb5
         constants.inputRPMSPath=options.inputRPMSPath
b5e09fac
         constants.testForceRPMS=[]
         constants.rpmCheck = options.rpmCheck
         constants.rpmCheckStopOnError = options.rpmCheckStopOnError
5f40784b
         constants.publishBuildDependencies=options.publishBuildDependencies
         constants.packageWeightsPath=options.packageWeightsPath
96a6c448
         constants.tmpDirPath = "/dev/shm"
b5e09fac
         if constants.rpmCheck:
             constants.testLogger=Logger.getLogger("MakeCheckTest",constants.logPath)
9b2f8b85
 
e2512398
     @staticmethod
     def setTestForceRPMS(listsPackages):
         constants.testForceRPMS=listsPackages