{"id":13512230,"url":"https://github.com/Zimbra/zm-build","last_synced_at":"2025-03-30T22:32:10.268Z","repository":{"id":37447494,"uuid":"85853612","full_name":"Zimbra/zm-build","owner":"Zimbra","description":"zm-build for Zimbra Collaboration Suite, FOSS Edition","archived":false,"fork":false,"pushed_at":"2024-12-04T08:52:39.000Z","size":15037,"stargazers_count":186,"open_issues_count":12,"forks_count":87,"subscribers_count":63,"default_branch":"develop","last_synced_at":"2024-12-16T21:35:30.766Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Zimbra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-22T16:53:15.000Z","updated_at":"2024-12-02T05:04:41.000Z","dependencies_parsed_at":"2023-11-06T14:47:37.260Z","dependency_job_id":"2fd1422e-7da9-4d26-8b7b-c864ea62151d","html_url":"https://github.com/Zimbra/zm-build","commit_stats":null,"previous_names":[],"tags_count":90,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zimbra%2Fzm-build","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zimbra%2Fzm-build/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zimbra%2Fzm-build/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zimbra%2Fzm-build/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zimbra","download_url":"https://codeload.github.com/Zimbra/zm-build/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246390895,"owners_count":20769475,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T03:01:36.938Z","updated_at":"2025-03-30T22:32:07.548Z","avatar_url":"https://github.com/Zimbra.png","language":"Perl","funding_links":[],"categories":["Perl","Sending"],"sub_categories":["Complete Email Server"],"readme":"# zm-build\n\n## Introduction\n\nThis repository contains the build script and supporting files required to create a [FOSS](https://en.wikipedia.org/wiki/Free_and_open-source_software) build of the [Zimbra Collaboration Suite](https://www.zimbra.com/). \n\n## Overview\n\n* `build.pl` - Invoke this script to produce a build.  See the *Building* section \n  below for an example.\n* `instructions/`\n    * `FOSS_remote_list.pl` - Maps between remote label and URL\n    * `FOSS_repo_list.pl` - Specifies which branches (or tags) are checked out to\n      build each component repository.\n    * `FOSS_staging_list.pl` - defines the staging order and details.\n\n## Setup with Zimbra Development Images (used for building)\n\n* Set up docker on your box\n* You can then pull and run using development images (built from Zimbra/zm-base-os.git)\n* In case you need to customize the images for your purposes, you could maintain your own Dockerfile such as this:\n\n        $ cat Dockerfile\n        FROM zimbra/zm-base-os:devcore-ubuntu-16.04\n        RUN sudo apt-get install emacs my-special-tool etc..\n        RUN ...\n\n        $ docker build -t myuser/my-devcore-ubuntu-16 .\n        $ docker run -it myuser/my-devcore-ubuntu-16 bash\n\n### Ubuntu 16.04\n\n    docker run -it zimbra/zm-base-os:devcore-ubuntu-16.04 bash\n\n### CentOS 7\n\n    docker run -it zimbra/zm-base-os:devcore-centos-7 bash\n\n### CentOS 6\n\n    docker run -it zimbra/zm-base-os:devcore-centos-6 bash\n\n    # some tools are installed inside /home/build/.zm-dev-tools/, zm-build automatically sources this path.\n\n## Setup (traditional)\n\n### Ubuntu 16.04\n\nThe following steps assume that your are starting with a clean VM and are\nlogged in as a non-root user with `sudo` privileges.\n\n    sudo apt-get update\n    sudo apt-get install software-properties-common openjdk-8-jdk ant ant-optional ant-contrib ruby git maven build-essential debhelper\n\n### CentOS 7\n\n    sudo yum groupinstall 'Development Tools'\n    sudo yum install java-1.8.0-openjdk ant ant-junit ruby git maven cpan wget perl-IPC-Cmd\n\n### CentOS 6\n\n    sudo yum groupinstall 'Development Tools'\n    sudo yum remove java-1.7.0-openjdk java-1.6.0-openjdk ant\n    sudo yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel ruby git cpan wget\n    # install specific perl modules\n    sudo cpan IPC::Cmd\n    cd /tmp\n    # install maven\n    wget http://mirror.metrocast.net/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz\n    sudo tar -xf apache-maven-3.3.9-bin.tar.gz\n    sudo mv apache-maven-3.3.9 /opt\n    echo 'export PATH=\"/opt/apache-maven-3.3.9/bin:$PATH\"' | sudo tee -a /etc/profile.d/maven.sh\n    # install current version of ant\n    wget https://www.apache.org/dist/ant/binaries/apache-ant-1.9.9-bin.zip\n    sudo unzip apache-ant-1.9.9-bin.zip\n    sudo mv apache-ant-1.9.9 /opt\n    echo 'export PATH=\"/opt/apache-ant-1.9.9/bin:$PATH\"' | sudo tee -a /etc/profile.d/ant.sh\n\n## Building\nCreate a directory for your build and check-out the `zm-build` repository:\n\n    mkdir installer-build\n    cd installer-build\n    git clone https://github.com/Zimbra/zm-build.git\n    cd zm-build\n    git checkout origin/develop\n\nBuild 10.1.0\n\n```\nmkdir installer-build\ncd installer-build\ngit clone --depth 1 --branch 10.1.0 git@github.com:Zimbra/zm-build.git\ncd zm-build\nENV_CACHE_CLEAR_FLAG=true ./build.pl --ant-options -DskipTests=true --git-default-tag=10.1.0 --build-release-no=10.1.0 --build-type=FOSS --build-release=LIBERTY --build-release-candidate=GA --build-thirdparty-server=files.zimbra.com --no-interactive\n```\n\nTo build a specific patch example 10.0.8 run the following:\n\n```\nmkdir installer-build\ncd installer-build\ngit clone --depth 1 --branch 10.0.6 git@github.com:Zimbra/zm-build.git\ncd zm-build\nENV_CACHE_CLEAR_FLAG=true ./build.pl --ant-options -DskipTests=true --git-default-tag=10.0.8,10.0.7,10.0.6,10.0.5,10.0.4,10.0.3,10.0.2,10.0.1,10.0.0-GA --build-release-no=10.0.8 --build-type=FOSS --build-release=LIBERTY --build-release-candidate=GA --build-thirdparty-server=files.zimbra.com --no-interactive\n```\n\nOr for example 9.0.0.p40 run the following:\n\n```\nmkdir installer-build\ncd installer-build\ngit clone --depth 1 --branch 9.0.0.p38 git@github.com:Zimbra/zm-build.git\ncd zm-build\nENV_CACHE_CLEAR_FLAG=true ./build.pl --ant-options -DskipTests=true --git-default-tag=9.0.0.p40,9.0.0.p39,9.0.0.p38,9.0.0.p37,9.0.0.p36,9.0.0.p35,9.0.0.p34,9.0.0.p33,9.0.0.p32.1,9.0.0.p32,9.0.0.p31,9.0.0.p30,9.0.0.p29,9.0.0.p28,9.0.0.p27,9.0.0.p26,9.0.0.p25,9.0.0.p24.1,9.0.0.p24,9.0.0.p23,9.0.0.p22,9.0.0.p21,9.0.0.p20,9.0.0.p19,9.0.0.p18,9.0.0.p17,9.0.0.p16,9.0.0.p15,9.0.0.p14,9.0.0.p13,9.0.0.p12,9.0.0.p11,9.0.0.p10,9.0.0.p9,9.0.0.p8,9.0.0.p7,9.0.0.p6.1,9.0.0.p6,9.0.0.p5,9.0.0.p4,9.0.0.p3,9.0.0.p2,9.0.0.p1,9.0.0 --build-release-no=9.0.0 --build-type=FOSS --build-release=KEPLER --build-release-candidate=GA --build-thirdparty-server=files.zimbra.com --no-interactive\n```\n\nThe `build.pl` command is used to build the product. Run it with the `-h` option for help:\n\n    Usage: ./build.pl \u003coptions\u003e\n    Supported options:\n       --build-no=i\n       --build-ts=i\n       --build-artifacts-base-dir=s\n       --build-sources-base-dir=s\n       --build-release=s\n       --build-release-no=s\n       --build-release-candidate=s\n       --build-type=s\n       --build-thirdparty-server=s\n       --build-prod-flag!\n       --build-debug-flag!\n       --build-dev-tool-base-dir=s\n       --interactive!\n       --git-overrides=s%\n       --git-default-tag=s\n       --git-default-remote=s\n       --git-default-branch=s\n       --stop-after-checkout!\n\nYou _can_ specify all the options on the command-line, as follows:\n\n    ./build.pl --build-no=1713 --build-ts=`date +'%Y%m%d%H%M%S'` \\\n      --build-release=JUDASPRIEST --build-release-no=8.7.6 \\\n      --build-release-candidate=GA --build-type=FOSS \\\n      --build-thirdparty-server=files.zimbra.com --no-interactive\n\nThe completed build will be archived into a `*.tgz` file that is stored in the appropriate platform and release-specific\nsubdirectory of the `BUILDS` directory.  The above command, run on an Ubuntu 16.04 machine, created the following:\n\n    $HOME/installer_build/BUILDS/UBUNTU16_64/JUDASPRIEST-876/20170322153033_FOSS/zm-build/zcs-8.7.6_1713.UBUNTU16_64.20170322153033.tgz\n\nYou can also specify any or all of the required options by placing them in a file\ncalled `config.build`.  This file should be at the top level of the `zm-build`\ndirectory.  For example:\n\n    BUILD_NO                    = 1713\n    BUILD_RELEASE               = JUDASPRIEST\n    BUILD_RELEASE_NO            = 8.7.6\n    BUILD_RELEASE_CANDIDATE     = GA\n    BUILD_TYPE                  = FOSS\n    BUILD_THIRDPARTY_SERVER     = files.zimbra.com\n    INTERACTIVE                 = 0\n\nThen just run `./build.pl`.\n\nThe above command, run on a CentOS 7 machine with the options as shown in `config.build`, created the following:\n\n    $HOME/installer-build/BUILDS/RHEL7_64/JUDASPRIEST-876/20170323061131_FOSS/zm-build/zcs-8.7.6_GA_1713.RHEL7_64.20170323061131.tgz\n\n# Development\n\n## Setup\n\nThe following is a walk-through of the basic steps required to do ZCS development.  The first step is to simply install a current FOSS build on the machine that you wish to use.  The instructions that follow assume that this has been done.\n\n\n1. Create `/home/zimbra` and make `zimbra` the owner.\n\n\t\tsudo mkdir /home/zimbra\n\t\tsudo chown zimbra:zimbra /home/zimbra\n\n2. Install  `git`, `ant`, and `ant-contrib` by whichever method is appropriate for your distro:\n\n\t\tsudo apt-get install git ant ant-contrib\n\n\tor\n\n\t\tsudo yum install git ant ant-contrib\n\n3. Configure `/opt/zimbra/.ssh/config` to use your ssh key for the git remotes that you need to access.\n4. Perform the following edits on `/opt/zimbra/.bash_profile`\n   * Comment-out `export LANG=C` and `export LC_ALL=C`.\n   * Add export `LANG=en_US.UTF-8`\n   * Add export `ANT_OPTS=-Ddev.home=/home/zimbra`\n5. Change permissions on files and folders that you will be updating; e.g.,\n\n\t\tsudo chmod -R o+w /opt/zimbra/lib/\n\t\tsudo chmod -R o+w /opt/zimbra/jetty/\n\t\tsudo chown zimbra:zimbra /opt/zimbra\n\t\t\n\t**Note:** If you run `zmfixperms`, some of these permissions will be overwritten.\n\n6. Add file `/opt/zimbra/.gitconfig` and update as needed.  At a minimum:\n\n\t\t[user]\n\t\t\temail = YOUR-EMAIL-ADDRESS\n\t\t\tname = YOUR-FIRST-AND-LAST-NAME\n\n7. As the `zimbra` user, create a base directory under `/home/zimbra` from which to work.\n\n\t\tcd /home/zimbra\n\t\tmkdir zcs\n\t\tcd zcs\n\n8. Now you can clone any repositories that you require and get to work.\n\n## Email Delivery\n\nIf you want email delivery to work, set up a DNS server on your host\nmachine or another VM and configure `zimbraDNSMasterIP` to point to it.\nTo configure `zimbraDNSMasterIP`, do the following as the `zimbra` user:\n\n\tzmprov ms `zmhostname` zimbraDNSMasterIP DNS-SERVER-IP-ADDRESS\n\nYou may receive the following error when trying to send email:\n\n\tNo SMTP hosts available for domain\n\nIf this occurs, you need to manually configure `zimbraSmtpHostname` for your domain(s).\nTo configure `zimbraSmtpHostname`, do the following as the `zimbra` user:\n\n\tzmprov md DOMAIN-NAME zimbraSmtpHostname `zmhostname`\n\n## zm-mailbox example\n\nAs the `zimbra` user, `cd /home/zimbra/zcs`.  Then clone the `zm-mailbox` repository from github\n\n\tgit clone git@github.com:Zimbra/zm-mailbox.git\n\nThe following sub-directories `zm-mailbox` build and deploy separately:\n\n\tclient\n\tcommon\n\tmilter-conf\n\tnative\n\tsoap\n\tstore\n\tstore-conf\n\nThe top-level `build.xml` is used by the `zm-build` scripts to create\nan installer package.  You will not use that for normal development.  There are build-order\ndependencies between the above-listed deployment targets.  These can be determined by \ninspection of the `ivy.xml` files within each subdirectory.\n\nFor example:\n\n\tgrep 'org=\"zimbra\"' store/ivy.xml\n\n\t\u003cdependency org=\"zimbra\" name=\"zm-common\" rev=\"latest.integration\"/\u003e\n\t\u003cdependency org=\"zimbra\" name=\"zm-soap\" rev=\"latest.integration\"/\u003e\n\t\u003cdependency org=\"zimbra\" name=\"zm-client\" rev=\"latest.integration\"/\u003e\n\t\u003cdependency org=\"zimbra\" name=\"zm-native\" rev=\"latest.integration\"/\u003e\n\nHere you can see that the deployment target, `zm-store` (the `store` \nsubdirectory), depends upon `common`, `soap`, `client`, and `native`.  Here is the current\nordering dependencies among all of the `zm-mailbox` deployment targets. The higher-numbered \ndeployment targets depend upon the lower-numbered ones.  Note that `milter-conf` and \n`store-conf` have no cross-dependencies.\n\n1. `native`\n2. `common`\n3. `soap`\n4. `client`\n5. `store`\n\nSo, from the `native` sub-directory:\n\n\tant -Dzimbra.buildinfo.version=8.7.6_GA clean compile publish-local deploy\n\t\nComments:\n\n- The requirement to include `-Dzimbra.buildinfo.version=8.7.6_GA` to ant is due to a change\n  that was made when the FOSS code was moved to GitHub.  You can also just add that option\n  to your `ANT_OPTS` enviroment variable that you defined in `$HOME/.bash_profile` as follows:\n  \n\t  export ANT_OPTS=\"-Ddev.home=/home/zimbra -Dzimbra.buildinfo.version=8.7.6_GA\"\n\t  \n  If you do that, then you can omit that `-D...` argument to the `ant` command and future\n  examples will reflect that.\n- The `publish-local` target adds the artifact to `/home/zimbra/.zcs-deps`, which is \n  included in the Ivy resolution path.\n- The `deploy` target installs the artifact to its run-time location and restarts the appropriate\n  service(s). This will allow you to test your changes.\n\nThen, from the `common`, `soap`, `client`, and `store` sub-directories (in that order):\n\n\tant clean compile publish-local deploy\n\n## Adding a new LDAP Attribute\n\n**WARNING:It is absolutely imperative to avoid duplicate IDs for attributes.\nUnfortunately, that currently isn't a trivial thing to do.  Need to check\nZimbra 8 and Zimbra X along with all development branches.\nIf customers get different setups using different IDs, this makes future upgrade\nscenarios a complete nightmare**\n\nStart by cloning _both_ the `zm-ldap-utilites` and the `zm-mailbox` repositories from GitHub.\nCheck out the appropriate branch of each. Then proceed as follows:\n\n* Add your new attribute to `zm-mailbox/store/conf/attrs/zimbra-attrs.xml`\n* From `zm-common/store` invoke the following command:\n\n\t\tant generate-getters\n\n* Do the following as `root`:\n\n\t\tchmod -R o+w /opt/zimbra/common/etc/openldap/schema\n\t\tchmod o+w /opt/zimbra/conf/zimbra.ldif\n\t\tchmod +w /opt/zimbra/conf/attrs/zimbra-attrs.xml\n\t\tchmod -R o+w /opt/zimbra/common/etc/openldap/zimbra\n\n* Back as the `zimbra` user, invoke the following command from `zm-mailbox/common`:\n\n\t\tant deploy publish-local\n\n* Then from the `zm-mailbox/store` directory:\n\n\t\tant deploy update-ldap-schema\n\n\nYour ZCS development server should now be running with the new attribute(s).  You can test that\nby querying them and modifying them with `zmprov`.  You can `git add ...` and `git commit`\nyour changes now.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FZimbra%2Fzm-build","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FZimbra%2Fzm-build","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FZimbra%2Fzm-build/lists"}