#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
#
include ../../make-rules/shared-macros.mk
COMPONENT_NAME= git
COMPONENT_VERSION= 2.7.4
COMPONENT_PROJECT_URL= http://git-scm.com/
COMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.xz
COMPONENT_ARCHIVE_HASH= \
sha256:dee574defbe05ec7356a0842ddbda51315926f2fa7e39c2539f2c3dcc52e457b
COMPONENT_ARCHIVE_URL= https://www.kernel.org/pub/software/scm/git/$(COMPONENT_ARCHIVE)
COMPONENT_BUGDB= utility/git
TPNO= 27482
#
# man pages are a separate archive
#
COMPONENT_SRC_1 = $(COMPONENT_NAME)-manpages-$(COMPONENT_VERSION)
COMPONENT_ARCHIVE_1 = $(COMPONENT_SRC_1).tar.xz
COMPONENT_ARCHIVE_HASH_1 = \
sha256:d04fd81ab8aa32efbe54acd27ab5c88ef4ab615313e4cdfa793dd0065899ce25
COMPONENT_ARCHIVE_URL_1 = https://www.kernel.org/pub/software/scm/git/$(COMPONENT_ARCHIVE_1)
include $(WS_MAKE_RULES)/prep.mk
include $(WS_MAKE_RULES)/configure.mk
include $(WS_MAKE_RULES)/ips.mk
PKG_HARDLINKS += usr/lib/git-core/git
PKG_HARDLINKS += usr/lib/git-core/git-cvsserver
PKG_HARDLINKS += usr/lib/git-core/git-gui
PKG_HARDLINKS += usr/lib/git-core/git-remote-ftps
PKG_HARDLINKS += usr/lib/git-core/git-shell
PKG_HARDLINKS += usr/lib/git-core/git-upload-pack
PKG_MACROS += PYVER=$(PYTHON_VERSION)
CONFIGURE_BINDIR.64 = $(CONFIGURE_PREFIX)/bin
CONFIGURE_LIBDIR.64 = $(CONFIGURE_PREFIX)/lib
CONFIGURE_SCRIPT = $(@D)/configure
CONFIGURE_PREFIX = /usr
CONFIGURE_OPTIONS += --sysconfdir=/etc
CONFIGURE_OPTIONS += --libexecdir=/usr/lib
CONFIGURE_OPTIONS += --with-libpcre
CONFIGURE_OPTIONS += --with-perl=$(PERL)
CONFIGURE_OPTIONS += --with-python=$(PYTHON.$(PYTHON_VERSION))
CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)"
CONFIGURE_OPTIONS += CPPFLAGS="-I/usr/include/pcre"
# Build fails if environment variable PROFILE is set.
COMPONENT_BUILD_ENV+= PROFILE=
COMPONENT_INSTALL_ENV+= PROFILE=
COMPONENT_TEST_ENV+= PROFILE=
# We set prefix_SQ empty to make sure that perl's MakeMaker module doesn't grab
# the value from $prefix (set by configure) and force VENDORPREFIX to $prefix,
# thereby putting the perl modules in /usr/lib/Git.
COMPONENT_BUILD_ARGS+= prefix_SQ=
COMPONENT_INSTALL_ARGS+= prefix_SQ=
COMPONENT_INSTALL_ARGS+= INSTALL="$(INSTALL)"
# get rid of terminal escape codes in test output
COMPONENT_TEST_ENV = TERM=dumb
# many failures; keep going; later versions of git are much cleaner
COMPONENT_TEST_ARGS += -k -i
# If GITTEST_JOBS is set, then run the jobs in parallel (to that number)
COMPONENT_TEST_ARGS += $(if $(GITTEST_JOBS),-j$(GITTEST_JOBS),)
COMPONENT_TEST_TARGETS = test
# Enable tests requiring Apache
COMPONENT_TEST_TARGETS += LIB_HTTPD_PATH=/usr/apache2/2.4/bin/httpd
COMPONENT_TEST_TARGETS += LIB_HTTPD_MODULE_PATH=/usr/apache2/2.4/libexec
# Put each test result in a file; necessary if jobs run in parallel
COMPONENT_TEST_TARGETS += GIT_TEST_OPTS=--tee
COMPONENT_TEST_TARGETS += DEFAULT_TEST_TARGET=test-noclean
# Compile the test results and put that into the test output file instead
COMPONENT_POST_TEST_ACTION = \
(cd $(@D)/t/test-results; for i in *.out; do \
echo "*** $${i%.out}.sh ***"; \
cat $$i; \
done; \
cd ..; \
$(GMAKE) -s aggregate-results) &> $(BUILD_DIR)/test-$(MACH$(BITS)).out
# This runs configure but configure doesn't generate a Makefile.
# Instead a Makefile comes with git.
# Anyways viewpathing doesn't work.
# Therefore we need cloney to copy a set of files to build.
COMPONENT_PRE_CONFIGURE_ACTION = \
($(CLONEY) $(SOURCE_DIR) $(@D))
COMPONENT_PRE_CONFIGURE_ACTION += ; (cd $(@D); $(GMAKE) configure)
ASLR_MODE = $(ASLR_ENABLE)
configure: $(CONFIGURE_64)
build: $(BUILD_64)
install: $(INSTALL_64) $(BUILD_DIR)/.manpages
test: $(TEST_64)
system-test: $(SYSTEM_TESTS_NOT_IMPLEMENTED)
# These man pages come in a separate archive with no Makefile
# and Solaris likes some of them moved around hence we'll just
# do it manually here.
$(BUILD_DIR)/.manpages:
cd $(BUILD_DIR) ; $(UNPACK) $(UNPACK_ARGS) ../$(COMPONENT_ARCHIVE_1)
$(MKDIR) $(PROTOUSRSHAREMAN1DIR)
$(MKDIR) $(PROTOUSRSHAREMAN4DIR)
$(MKDIR) $(PROTOUSRSHAREMAN5DIR)
cd $(BUILD_DIR) ; for manfile in man*/* ; \
do \
filename=`basename $$manfile`; \
fname=$${filename%.*}; \
ext=$${filename##*.}; \
newext=1; \
if [ $$ext = 5 ]; then newext=4; fi; \
if [ $$ext = 7 ]; then newext=5; fi; \
$(GSED) -e 's/\\m\[blue\]//g' -e 's/\\m\[\]//g' \
-e 's/"5"/"4"/' -e 's/(5)/(4)/g' \
-e 's/"7"/"5"/' -e 's/(7)/(5)/g' $$manfile > \
$(PROTOUSRSHAREMANDIR)/man$$newext/$$fname.$$newext; \
done
$(TOUCH) $@
REQUIRED_PACKAGES += crypto/gnupg
REQUIRED_PACKAGES += library/expat
REQUIRED_PACKAGES += library/pcre
REQUIRED_PACKAGES += library/security/openssl
REQUIRED_PACKAGES += library/zlib
REQUIRED_PACKAGES += runtime/perl-512
REQUIRED_PACKAGES += runtime/python-27
REQUIRED_PACKAGES += shell/bash
REQUIRED_PACKAGES += shell/ksh93
REQUIRED_PACKAGES += system/library
REQUIRED_PACKAGES += web/curl
REQUIRED_PACKAGES += web/server/apache-24