# Initialize env vars ifndef PREFIX PREFIX=$(shell dirname $(shell dirname $(PWD)))/python3 endif PATH := $(PREFIX)/bin:$(PREFIX)/sbin:$(PATH) LDFLAGS = -Wl,-rpath,$(PREFIX)/lib -Wl,-rpath,$(PREFIX)/lib64 -L$(PREFIX)/lib -L$(PREFIX)/lib64 CFLAGS = -Wl,-rpath,$(PREFIX)/lib -Wl,-rpath,$(PREFIX)/lib64 -I$(PREFIX)/include CPPFLAGS = $(CFLAGS) PKG_CONFIG_PATH = $(PREFIX)/lib/pkgconfig export PATH LDFLAGS CFLAGS CPPFLAGS PKG_CONFIG_PATH PREFIX ifndef NOCOLORS RED=\033[0;31m YEL=\033[0;33m GRE=\033[0;32m # No Color NC=\033[0m endif # Software Package Versions bzip2=1.0.8 cyrussasl=2.1.27 expat=2.2.10 gdbm=1.19 libffi=3.3 ncurses=6.2 openldap=2.4.57 openssl=1.1.1h readline=8.1 sqlite3=3.34.1 sqlite3_year=2021 python3=3.9.1 xz=5.2.5 zlib=1.2.11 # Software filenames bzip2file=bzip2-$(bzip2).tar.gz cyrussaslfile=cyrus-sasl-$(cyrussasl).tar.gz expatfile=expat-$(expat).tar.bz2 gdbmfile=gdbm-$(gdbm).tar.gz libffifile=libffi-$(libffi).tar.gz ncursesfile=ncurses-$(ncurses).tar.gz openldapfile=openldap-$(openldap).tgz opensslfile=openssl-$(openssl).tar.gz python3file=Python-$(python3).tgz readlinefile=readline-$(readline).tar.gz sqlite3file=sqlite-autoconf-$(shell printf '%d%02d%02d%02d' $(subst ., ,$(sqlite3))).tar.gz xzfile=xz-$(xz).tar.bz2 zlibfile=zlib-$(zlib).tar.gz # Software sources bzip2source=https://sourceware.org/pub/bzip2/$(bzip2file) cyrussaslsource=https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-$(cyrussasl)/$(cyrussaslfile) expatsource=https://github.com/libexpat/libexpat/releases/download/R_$(subst .,_,$(expat))/$(expatfile) gdbmsource=https://ftp.gnu.org/gnu/gdbm/$(gdbmfile) libffisource=ftp://sourceware.org/pub/libffi/$(libffifile) ncursessource=ftp://ftp.gnu.org/gnu/ncurses/$(ncursesfile) openldapsource=ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/$(openldapfile) opensslsource=https://www.openssl.org/source/$(opensslfile) readlinesource=ftp://ftp.gnu.org/gnu/readline/$(readlinefile) sqlite3source=https://www.sqlite.org/$(sqlite3_year)/$(sqlite3file) python3source=https://www.python.org/ftp/python/$(python3)/$(python3file) xzsource=https://tukaani.org/xz/$(xzfile) zlibsource=https://zlib.net/$(zlibfile) # Software dir names bzip2dir=$(basename $(basename $(bzip2file))) cyrussasldir=$(basename $(basename $(cyrussaslfile))) expatdir=$(basename $(basename $(expatfile))) gdbmdir=$(basename $(basename $(gdbmfile))) libffidir=$(basename $(basename $(libffifile))) ncursesdir=$(basename $(basename $(ncursesfile))) openldapdir=$(basename $(openldapfile)) openssldir=$(basename $(basename $(opensslfile))) readlinedir=$(basename $(basename $(readlinefile))) sqlite3dir=$(basename $(basename $(sqlite3file))) python3dir=$(basename $(python3file)) xzdir=$(basename $(basename $(xzfile))) zlibdir=$(basename $(basename $(zlibfile))) $(VERBOSE).SILENT: .PHONY: \ help \ clean \ bzip2 \ cyrussasl \ expat \ gdbm \ libffi \ ncurses \ openldap \ openssl \ readline \ sqlite3 \ python3 \ xz \ zlib \ python-update \ ansible \ python-ldap help: echo "Makefile for Python $(python3) and dependencies." echo "Will build artifacts and install them to PREFIX=$(PREFIX)" echo "If PREFIX is set as an environment variable this Makefile will use it." echo echo "Any source code needed will be retrieved." echo "Any targets will automatically build and install dependencies." echo "Note: OpenSSL is compiled without compression support for additional security." echo printf "%-12s %-8s %s\n" "TARGET" "VERSION" "DEPENDENCIES" printf "%-12s %-8s %s\n" "bzip2" "$(bzip2)" "None" printf "%-12s %-8s %s\n" "cyrussasl" "$(cyrussasl)" "gdbm openssl sqlite3" printf "%-12s %-8s %s\n" "expat" "$(expat)" "None" printf "%-12s %-8s %s\n" "gdbm" "$(gdbm)" "ncurses openssl readline" printf "%-12s %-8s %s\n" "libffi" "$(libffi)" "None" printf "%-12s %-8s %s\n" "ncurses" "$(ncurses)" "None" printf "%-12s %-8s %s\n" "openldap" "$(openldap)" "cyrussasl openssl" printf "%-12s %-8s %s\n" "openssl" "$(openssl)" "None" printf "%-12s %-8s %s\n" "readline" "$(readline)" "ncurses" printf "%-12s %-8s %s\n" "sqlite3" "$(sqlite3)" "readline" printf "%-12s %-8s %s\n" "python3" "$(python3)" "bzip2 expat gdbm libffi ncurses openssl readline sqlite3 xz zlib" printf "%-12s %-8s %s\n" "xz" "$(xz)" "None" printf "%-12s %-8s %s\n" "zlib" "$(zlib)" "None" echo echo "Python module targets:" printf "%-12s %-8s %s\n" "ansible" "auto" "None" printf "%-12s %-8s %s\n" "python-ldap" "auto" "openldap python-update" echo echo "Special build targets:" echo "all Synonym for \`python3 ansible python-ldap\`" echo "help Displays this message" echo "clean Removes temp source directories" echo "python-update Updates pip, setuptools and wheel to latest verions" echo echo "Set these environment vars to any non-null value to turn them on:" echo -e "NOCOLORS Disable logging $(GRE)co$(NC)$(YEL)lo$(NC)$(RED)rs$(NC)" echo "NOTESTS Skip 'make check' and 'make test'" echo "NOPREREQS Skip building prerequisites." echo "VERBOSE Show debug messages." all: python3 ansible python-ldap prebuild: echo -e "$(GRE)INFO$(NC): Build parameters:" echo -e "$(GRE)INFO$(NC): PREFIX=$(PREFIX)" echo -e "$(GRE)INFO$(NC): PATH=$(PATH)" echo -e "$(GRE)INFO$(NC): LDFLAGS=$(LDFLAGS)" echo -e "$(GRE)INFO$(NC): CFLAGS=$(CFLAGS)" echo -e "$(GRE)INFO$(NC): CPPFLAGS=$(CPPFLAGS)" echo -e "$(GRE)INFO$(NC): PKG_CONFIG_PATH=$(PKG_CONFIG_PATH)" if [[ ! -d "$(PREFIX)" ]]; then echo -e "$(GRE)INFO$(NC): Creating directory $(PREFIX)"; mkdir -p "$(PREFIX)"; fi bzip2: prebuild echo "#########################################" echo -e "$(GRE)INFO$(NC): Building bzip2 $(bzip2)" echo -e "$(GRE)INFO$(NC): bzip2file=$(bzip2file)" echo -e "$(GRE)INFO$(NC): bzip2source=$(bzip2source)" test -f "$(bzip2file)" \ && echo -e "$(GRE)INFO$(NC): Found $(bzip2file)" \ || (echo -e "$(GRE)INFO$(NC): Retrieving $(bzip2source)"; curl -Lso "$(bzip2file)" "$(bzip2source)") tar -xf "$(bzip2file)" # If bin/bz{egrep,fgrep,less,cmp} already exists, then the bzip2 install process fails and aborts the entire build. # # Makefile-libbz2_so builds a Linux ELF shared library, used to link to other apps dynamically. cd "$(bzip2dir)" \ && make -f Makefile-libbz2_so \ && rm -f "$(PREFIX)"/bin/bz{egrep,fgrep,less,cmp} \ && make install PREFIX="$(PREFIX)" ifndef NOPREREQS cyrussasl: prebuild gdbm openssl sqlite3 else cyrussasl: prebuild endif # This is the bootstrap version of cyrus-sasl, built without openldap. # With this, openldap can build with SASL support, allowing us to rebuild # with cyrussasl_ldap to have both linked to the other. echo "#########################################" echo -e "$(GRE)INFO$(NC): Building cyrussasl $(cyrussasl) without OpenLDAP support" echo -e "$(GRE)INFO$(NC): cyrussaslfile=$(cyrussaslfile)" echo -e "$(GRE)INFO$(NC): cyrussaslsource=$(cyrussaslsource)"I mean, ncurses-6.2 test -f "$(cyrussaslfile)" \ && echo -e "$(GRE)INFO$(NC): Found $(cyrussaslfile)" \ || (echo -e "$(GRE)INFO$(NC): Retrieving $(cyrussaslsource)"; curl -Lso "$(cyrussaslfile)" "$(cyrussaslsource)") tar -xf "$(cyrussaslfile)" # The build didn't seem to be honoring my CFLAGS to set the rpath, so I forced the issue with CC # # Setting both --with-plugindir and SASL_PATH hoping at least one of them will bake into the libs. # I'm not holding my breath, though. SASL_PATH may need to be exported at runtime. cd "$(cyrussasldir)" \ && ./configure \ --prefix="$(PREFIX)" \ --enable-shared \ --enable-static \ --with-dblib=gdbm \ --with-gdbm="$(PREFIX)" \ --with-openssl="$(PREFIX)" \ --with-sqlite3="$(PREFIX)" \ --with-plugindir="$(PREFIX)/lib/sasl2" \ CC="gcc -Wl,-rpath,$(PREFIX)/lib" \ SASL_PATH="$(PREFIX)/lib/sasl2" \ && make \ && ( \ [[ -n "$$NOTESTS" ]] \ && echo -e "$(YEL)WARN$(NC): Skipping make check" \ || (echo -e "$(GRE)INFO$(NC): Running 'make check'" && make check) \ || echo -e "$(RED)ERROR$(NC): make check failed, please check log." \ ) \ && make install ifndef NOPREREQS cyrussasl_ldap: prebuild gdbm openssl sqlite3 else cyrussasl_ldap: prebuild endif echo "#########################################" echo -e "$(GRE)INFO$(NC): Building cyrussasl $(cyrussasl) with OpenLDAP support" echo -e "$(GRE)INFO$(NC): cyrussaslfile=$(cyrussaslfile)" echo -e "$(GRE)INFO$(NC): cyrussaslsource=$(cyrussaslsource)"I mean, ncurses-6.2 test -f "$(cyrussaslfile)" \ && echo -e "$(GRE)INFO$(NC): Found $(cyrussaslfile)" \ || (echo -e "$(GRE)INFO$(NC): Retrieving $(cyrussaslsource)"; curl -Lso "$(cyrussaslfile)" "$(cyrussaslsource)") mkdir "$(cyrussasldir)_ldap" tar -xf "$(cyrussaslfile)" -C "$(cyrussasldir)_ldap" --strip-components 1 # The build didn't seem to be honoring my CFLAGS to set the rpath, so I forced the issue with CC # # Setting both --with-plugindir and SASL_PATH hoping at least one of them will bake into the libs. # I'm not holding my breath, though. SASL_PATH may need to be exported at runtime. cd "$(cyrussasldir)_ldap" \ && ./configure \ --prefix="$(PREFIX)" \ --enable-shared \ --enable-static \ --with-dblib=gdbm \ --with-gdbm="$(PREFIX)" \ --with-ldap="$(PREFIX)" \ --with-openssl="$(PREFIX)" \ --with-sqlite3="$(PREFIX)" \ --with-plugindir="$(PREFIX)/lib/sasl2" \ CC="gcc -Wl,-rpath,$(PREFIX)/lib" \ SASL_PATH="$(PREFIX)/lib/sasl2" \ && make \ && ( \ [[ -n "$$NOTESTS" ]] \ && echo -e "$(YEL)WARN$(NC): Skipping make check" \ || (echo -e "$(GRE)INFO$(NC): Running 'make check'" && make check) \ || echo -e "$(RED)ERROR$(NC): make check failed, please check log." \ ) \ && make install expat: prebuild echo "#########################################" echo -e "$(GRE)INFO$(NC): Building expat $(expat)" echo -e "$(GRE)INFO$(NC): expatfile=$(expatfile)" echo -e "$(GRE)INFO$(NC): expatsource=$(expatsource)" test -f "$(expatfile)" \ && echo -e "$(GRE)INFO$(NC): Found $(expatfile)" \ || (echo -e "$(GRE)INFO$(NC): Retrieving $(expatsource)"; curl -Lso "$(expatfile)" "$(expatsource)") tar -xf "$(expatfile)" cd "$(expatdir)" \ && ./configure \ --prefix="$(PREFIX)" \ --enable-shared \ --enable-static \ && make \ && ( \ [[ -n "$$NOTESTS" ]] \ && echo -e "$(YEL)WARN$(NC): Skipping make check" \ || (echo -e "$(GRE)INFO$(NC): Running 'make check'" && make check) \ || echo -e "$(RED)ERROR$(NC): make check failed, please check log." \ ) \ && make install ifndef NOPREREQS gdbm: prebuild ncurses openssl readline else gdbm: prebuild endif echo "#########################################" echo -e "$(GRE)INFO$(NC): Building gdbm $(gdbm)" echo -e "$(GRE)INFO$(NC): gdbmfile=$(gdbmfile)" echo -e "$(GRE)INFO$(NC): gdbmsource=$(gdbmsource)" test -f "$(gdbmfile)" \ && echo -e "$(GRE)INFO$(NC): Found $(gdbmfile)" \ || (echo -e "$(GRE)INFO$(NC): Retrieving $(gdbmsource)"; curl -Lso "$(gdbmfile)" "$(gdbmsource)") tar -xf "$(gdbmfile)" # Python's _gdm looks for $(PREFIX)/include/gdbm/ndbm.h # so --enable-libgdbm-compat and COMPATINCLUDEDIR are necessary. # # LIBS is used to massage it into successfully finding # libtinfow and libncursesw for readline and ncurses cd "$(gdbmdir)" \ && LIBS="-ltinfow -lncursesw" \ COMPATINCLUDEDIR="$(PREFIX)/include/gdbm" \ ./configure \ --prefix="$(PREFIX)" \ --enable-libgdbm-compat \ --with-readline \ && make \ && ( \ [[ -n "$$NOTESTS" ]] \ && echo -e "$(YEL)WARN$(NC): Skipping make check" \ || (echo -e "$(GRE)INFO$(NC): Running 'make check'" && make check) \ || echo -e "$(RED)ERROR$(NC): make check failed, please check log." \ ) \ && make install libffi: prebuild echo "#########################################" echo -e "$(GRE)INFO$(NC): Building libffi $(libffi)" echo -e "$(GRE)INFO$(NC): libffifile=$(libffifile)" echo -e "$(GRE)INFO$(NC): libffisource=$(libffisource)" test -f "$(libffifile)" \ && echo -e "$(GRE)INFO$(NC): Found $(libffifile)" \ || (echo -e "$(GRE)INFO$(NC): Retrieving $(libffisource)"; curl -Lso "$(libffifile)" "$(libffisource)") tar -xf "$(libffifile)" cd "$(libffidir)" \ && ./configure \ --prefix="$(PREFIX)" \ --enable-shared \ --enable-static \ && make \ && ( \ [[ -n "$$NOTESTS" ]] \ && echo -e "$(YEL)WARN$(NC): Skipping make check" \ || (echo -e "$(GRE)INFO$(NC): Running 'make check'" && make check) \ || echo -e "$(RED)ERROR$(NC): make check failed, please check log." \ ) \ && make install ncurses: prebuild echo "#########################################" echo -e "$(GRE)INFO$(NC): Building ncurses $(ncurses)" echo -e "$(GRE)INFO$(NC): ncursesfile=$(ncursesfile)" echo -e "$(GRE)INFO$(NC): ncursessource=$(ncursessource)" test -f "$(ncursesfile)" \ && echo -e "$(GRE)INFO$(NC): Found $(ncursesfile)" \ || (echo -e "$(GRE)INFO$(NC): Retrieving $(ncursessource)"; curl -Lso "$(ncursesfile)" "$(ncursessource)") tar -xf "$(ncursesfile)" cd "$(ncursesdir)" \ && ./configure \ --prefix="$(PREFIX)" \ --with-shared \ --with-profile \ --with-cxx-shared \ --with-termlib \ --enable-rpath \ --enable-termcap \ --enable-symlinks \ --enable-broken_linker \ --enable-widec \ --enable-ext-colors \ --enable-ext-mouse \ --enable-ext-putwin \ --enable-no-padding \ --enable-signed-char \ --enable-sigwinch \ --enable-tcap-names \ --with-pthread \ --enable-pthreads-eintr \ --enable-weak-symbols \ --enable-reentrant \ --enable-opaque-curses \ --enable-opaque-form \ --enable-opaque-menu \ --enable-opaque-panel \ --enable-hard-tabs \ --enable-xmc-glitch \ && make \ && make install # This bit of ridiculousness is to deal with the circular dependency between cyrussasl and openldap. # # If we're not building pre-reqs then it can just build, using the "openldap" target. # # If we are building pre-reqs then we need to build cyrussasl without ldap first, build _openldap, # then build cyrussasl again but with ldap support. ifndef NOPREREQS openldap: prebuild cyrussasl _openldap cyrussasl_ldap openssl _openldap: prebuild else openldap: prebuild endif echo "#########################################" echo -e "$(GRE)INFO$(NC): Building openldap $(openldap)" echo -e "$(GRE)INFO$(NC): openldapfile=$(openldapfile)" echo -e "$(GRE)INFO$(NC): openldapsource=$(openldapsource)" test -f "$(openldapfile)" \ && echo -e "$(GRE)INFO$(NC): Found $(openldapfile)" \ || (echo -e "$(GRE)INFO$(NC): Retrieving $(openldapsource)"; curl -Lso "$(openldapfile)" "$(openldapsource)") tar -xf "$(openldapfile)" # BerkeleyDB appears to be a mess of license hell. OpenLDAP refuses to use any modern version. # So, disablinig bdb and hdb to avoid the dependency. cd "$(openldapdir)" \ && ./configure \ --prefix="$(PREFIX)" \ --enable-spasswd \ --disable-bdb \ --disable-hdb \ --with-cyrus-sasl \ --with-tls \ && make \ && ( \ [[ -n "$$NOTESTS" ]] \ && echo -e "$(YEL)WARN$(NC): Skipping make test" \ || (echo -e "$(GRE)INFO$(NC): Running 'make test'" && make test) \ || echo -e "$(RED)ERROR$(NC): make test failed, please check log." \ ) \ && make install openssl: prebuild echo "#########################################" echo -e "$(GRE)INFO$(NC): Building openssl $(openssl)" echo -e "$(GRE)INFO$(NC): opensslfile=$(opensslfile)" echo -e "$(GRE)INFO$(NC): opensslsource=$(opensslsource)" test -f "$(opensslfile)" \ && echo -e "$(GRE)INFO$(NC): Found $(opensslfile)" \ || (echo -e "$(GRE)INFO$(NC): Retrieving $(opensslsource)"; curl -Lso "$(opensslfile)" "$(opensslsource)") tar -xf "$(opensslfile)" # Adding no-comp, as I have seen hints that compression may have unforseen consequences on security. # # Using "install_sw install_ssldirs" instead of just "install" to avoid installing the documentation. cd "$(openssldir)" \ && ./config \ --prefix="$(PREFIX)" \ --openssldir="$(PREFIX)" \ threads \ shared \ no-comp \ "$(CFLAGS)" \ && make depend \ && make \ && echo -e "$(YEL)WARN$(NC): Skipping make check" \ && make install_sw install_ssldirs ifndef NOPREREQS python3: prebuild bzip2 expat gdbm libffi ncurses openssl readline sqlite3 xz zlib else python3: prebuild endif echo "#########################################" echo -e "$(GRE)INFO$(NC): Building python3 $(python3)" echo -e "$(GRE)INFO$(NC): python3file=$(python3file)" echo -e "$(GRE)INFO$(NC): python3source=$(python3source)" test -f "$(python3file)" \ && echo -e "$(GRE)INFO$(NC): Found $(python3file)" \ || (echo -e "$(GRE)INFO$(NC): Retrieving $(python3source)"; curl -Lso "$(python3file)" "$(python3source)") tar -xf "$(python3file)" cd "$(python3dir)" \ && ./configure \ --prefix="$(PREFIX)" \ --enable-big-digits \ --enable-ipv6 \ --enable-optimizations \ --enable-profiling \ --enable-shared \ --with-doc-strings \ --with-ensurepip=install \ --with-system-expat="$(PREFIX)" \ --with-dbmliborder=gdbm \ --with-openssl="$(PREFIX)" \ --oldincludedir="$(PREFIX)/include" \ "CFLAGS=$(CFLAGS) -I$(PREFIX)/include/ncursesw" \ "CPPFLAGS=$(CFLAGS) -I$(PREFIX)/include/ncursesw" \ "LDFLAGS=$(LDFLAGS)" \ && make \ "CFLAGS=$(CFLAGS) -I$(PREFIX)/include/ncursesw" \ "CPPFLAGS=$(CFLAGS) -I$(PREFIX)/include/ncursesw" \ "LDFLAGS=$(LDFLAGS)" \ && ( \ [[ -n "$$NOTESTS" ]] \ && echo -e "$(YEL)WARN$(NC): Skipping make check" \ || (echo -e "$(GRE)INFO$(NC): Running 'make test'" && make test) \ || echo -e "$(RED)ERROR$(NC): make test failed, please check log." \ ) \ && make install echo -n -e "$(GRE)INFO$(NC): Testing if Python runs with --version: " "$(PREFIX)/bin/python3" --version ifndef NOPREREQS readline: prebuild ncurses else readline: prebuild endif echo "#########################################" echo -e "$(GRE)INFO$(NC): Building readline $(readline)" echo -e "$(GRE)INFO$(NC): readlinefile=$(readlinefile)" echo -e "$(GRE)INFO$(NC): readlinesource=$(readlinesource)" test -f "$(readlinefile)" \ && echo -e "$(GRE)INFO$(NC): Found $(readlinefile)" \ || (echo -e "$(GRE)INFO$(NC): Retrieving $(readlinesource)"; curl -Lso "$(readlinefile)" "$(readlinesource)") tar -xf "$(readlinefile)" cd "$(readlinedir)" \ && ./configure \ --prefix="$(PREFIX)" \ --with-curses="$(PREFIX)" \ --enable-shared \ --enable-static \ && make \ && make install ifndef NOPREREQS sqlite3: prebuild readline else sqlite3: prebuild endif echo "#########################################" echo -e "$(GRE)INFO$(NC): Building sqlite3 $(sqlite3)" echo -e "$(GRE)INFO$(NC): sqlite3file=$(sqlite3file)" echo -e "$(GRE)INFO$(NC): sqlite3source=$(sqlite3source)" test -f "$(sqlite3file)" \ && echo -e "$(GRE)INFO$(NC): Found $(sqlite3file)" \ || (echo -e "$(GRE)INFO$(NC): Retrieving $(sqlite3source)"; curl -Lso "$(sqlite3file)" "$(sqlite3source)") tar -xf "$(sqlite3file)" cd "$(sqlite3dir)" \ && ./configure \ --prefix="$(PREFIX)" \ --enable-shared \ --enable-static \ --enable-readline \ --enable-threadsafe \ --enable-dynamic-extensions \ && make \ && make install xz: prebuild echo "#########################################" echo -e "$(GRE)INFO$(NC): Building xz $(xz)" echo -e "$(GRE)INFO$(NC): xzfile=$(xzfile)" echo -e "$(GRE)INFO$(NC): xzsource=$(xzsource)" test -f "$(xzfile)" \ && echo -e "$(GRE)INFO$(NC): Found $(xzfile)" \ || (echo -e "$(GRE)INFO$(NC): Retrieving $(xzsource)"; curl -Lso "$(xzfile)" "$(xzsource)") tar -xf "$(xzfile)" cd "$(xzdir)" \ && ./configure \ --prefix="$(PREFIX)" \ && make \ && ( \ [[ -n "$$NOTESTS" ]] \ && echo -e "$(YEL)WARN$(NC): Skipping make check" \ || (echo -e "$(GRE)INFO$(NC): Running 'make check'" && make check) \ || echo -e "$(RED)ERROR$(NC): make check failed, please check log." \ ) \ && make install zlib: prebuild echo "#########################################" echo -e "$(GRE)INFO$(NC): Building zlib $(zlib)" echo -e "$(GRE)INFO$(NC): zlibfile=$(zlibfile)" echo -e "$(GRE)INFO$(NC): zlibsource=$(zlibsource)" test -f "$(zlibfile)" \ && echo -e "$(GRE)INFO$(NC): Found $(zlibfile)" \ || (echo -e "$(GRE)INFO$(NC): Retrieving $(zlibsource)"; curl -Lso "$(zlibfile)" "$(zlibsource)") tar -xf "$(zlibfile)" cd "$(zlibdir)" \ && ./configure \ --prefix="$(PREFIX)" \ --64 \ --shared \ --libdir="$(PREFIX)/lib" \ --sharedlibdir="$(PREFIX)/lib" \ && make \ && ( \ [[ -n "$$NOTESTS" ]] \ && echo -e "$(YEL)WARN$(NC): Skipping make check" \ || (echo -e "$(GRE)INFO$(NC): Running 'make check'" && make check) \ || echo -e "$(RED)ERROR$(NC): make check failed, please check log." \ ) \ && make install python-update: echo -e "$(GRE)INFO$(NC): Executing $(PREFIX)/bin/python3 -m pip install --upgrade pip setuptools wheel" "$(PREFIX)/bin/python3" -m pip install --upgrade pip setuptools wheel ifndef NOPREREQS ansible: python-update else ansible: endif echo "#########################################" echo -e "$(GRE)INFO$(NC): Executing $(PREFIX)/bin/pip install --upgrade ansible" "$(PREFIX)/bin/pip" install --upgrade ansible ifndef NOPREREQS python-ldap: openldap python-update else python-ldap: endif echo "#########################################" echo -e "$(GRE)INFO$(NC): Executing $(PREFIX)/bin/pip install --upgrade python-ldap" "$(PREFIX)/bin/pip" install --upgrade python-ldap clean: echo -e "$(GRE)INFO$(NC): Clean starting" ifneq ($(wildcard $(bzip2dir)/.),) echo -e "$(GRE)INFO$(NC): Removing $(bzip2dir)" rm -rf "$(bzip2dir)" endif ifneq ($(wildcard $(cyrussasldir)/.),) echo -e "$(GRE)INFO$(NC): Removing $(cyrussasldir)" rm -rf "$(cyrussasldir)" endif ifneq ($(wildcard $(cyrussasldir)_ldap/.),) echo -e "$(GRE)INFO$(NC): Removing $(cyrussasldir)_ldap" rm -rf "$(cyrussasldir)_ldap" endif ifneq ($(wildcard $(expatdir)/.),) echo -e "$(GRE)INFO$(NC): Removing $(expatdir)" rm -rf "$(expatdir)" endif ifneq ($(wildcard $(gdbmdir)/.),) echo -e "$(GRE)INFO$(NC): Removing $(gdbmdir)" rm -rf "$(gdbmdir)" endif ifneq ($(wildcard $(libffidir)/.),) echo -e "$(GRE)INFO$(NC): Removing $(libffidir)" rm -rf "$(libffidir)" endif ifneq ($(wildcard $(ncursesdir)/.),) echo -e "$(GRE)INFO$(NC): Removing $(ncursesdir)" rm -rf "$(ncursesdir)" endif ifneq ($(wildcard $(openldapdir)/.),) echo -e "$(GRE)INFO$(NC): Removing $(openldapdir)" rm -rf "$(openldapdir)" endif ifneq ($(wildcard $(openssldir)/.),) echo -e "$(GRE)INFO$(NC): Removing $(openssldir)" rm -rf "$(openssldir)" endif ifneq ($(wildcard $(python3dir)/.),) echo -e "$(GRE)INFO$(NC): Removing $(python3dir)" rm -rf "$(python3dir)" endif ifneq ($(wildcard $(readlinedir)/.),) echo -e "$(GRE)INFO$(NC): Removing $(readlinedir)" rm -rf "$(readlinedir)" endif ifneq ($(wildcard $(sqlite3dir)/.),) echo -e "$(GRE)INFO$(NC): Removing $(sqlite3dir)" rm -rf "$(sqlite3dir)" endif ifneq ($(wildcard $(xzdir)/.),) echo -e "$(GRE)INFO$(NC): Removing $(xzdir)" rm -rf "$(xzdir)" endif ifneq ($(wildcard $(zlibdir)/.),) echo -e "$(GRE)INFO$(NC): Removing $(zlibdir)" rm -rf "$(zlibdir)" endif echo -e "$(GRE)INFO$(NC): Clean complete"