---
# System prepended metadata

title: Instructions for building zlib UPS products

---

# Instructions for building zlib UPS products

## Setting up building environment

* You need to be on a SL7 machine or docker container (e.g. `dingpf/sl7:latest`);
* Have access to `cvmfs`;
* create a local working directory, e.g. `$PWD/products`;
* Use the following command to start the docker container:
``` docker run --rm -it -v /cvmfs:/cvmfs -v $PWD/products:/products dingpf/sl7```
* Once inside the container, add the path to your working directory to the `$PRODUCTS` env with `export PRODUCTS=/products:$PRODUCTS`;
* Setup UPS products area which provides `gcc`, e.g. `source /cvmfs/dune.opensciencegrid.org/products/dune/setup_dune.sh
`

## Steps to make a newer zlib version
* Download an existing zlib source package with the build script in it ([here](https://home.fnal.gov/~dingpf/zlib_source_v1_2_11.tar.gz) is the one for v1.2.11);
* unwind the source package tarball to `/products`;
* replace the zlib tarball under `/products/zlib/v1_2_11/tar/
` with a newer version from zlib's official website;
* modify `/products/zlib/v1_2_11/build_zlib.sh` with the new zlib version number;
* change the directory name `/products/zlib/v1_2_11` with new version number;
* change to `/products/zlib/$NEW_ZLIB_VERSION`, and run `./build_zlib.sh /products <e14|e17|e19> [tar]`;
* the `tar` option will create a tarball for the built product which you can unwind into any UPS products area.

