Radix cross Linux 3pp sources

RcL sources – is a tree of Third Party and Radix source tarballs

423 Commits   0 Branches   0 Tags
#
# Project Home:
# ============
# http://site.icu-project.org
#
# ICU Documentation:
# =================
# http://icu-project.org/apiref/icu4c
#
# Clone:
# =====
# git clone https://github.com/unicode-org/icu.git
#

url        = https://github.com/unicode-org

repo_name  = icu

#
# List of tags to be extracted:
# ============================
#                                               hash | tag
#            ----------------------------------------+-----
revisions  = fd123bf023882f07bfacf51c39111be2f946d8f8:65.1
revisions += 84e1f26ea77152936e70d53178a816dbfbf69989:68.2
revisions += ff3514f257ea10afe7e710e9f946f68d256704b1:72.1
revisions += 5861e1fd52f1d7673eee38bc3c965aa18b336062:73.1
revisions += 8eca245c7484ac6cc179e3e5f7c1ea7680810f39:76.1

git_repo   = .git_clone

suffix     = tar.xz

versions   = $(foreach tag, $(revisions), $(shell echo $(tag) | cut -f 2 -d ':'))

tarballs   = $(addsuffix .$(suffix), $(addprefix $(repo_name)4c-, $(versions)))
sha1s      = $(addsuffix .sha1sum, $(tarballs))

TARGETS = repository_clean

all: $(TARGETS)

.PHONY: downloads_clean repository_clean

$(git_repo):
	@echo -e "\n======= Clone $(repo_name).git repository =======\n"
	@rm -rf $(repo_name)
	@git clone $(url)/$(repo_name).git $(repo_name)
	@touch $@

$(tarballs): $(git_repo)
	@for revision in $(revisions) ; do \
	  hash=`echo $$revision    | cut -f 1 -d ':'` ; \
	  version=`echo $$revision | cut -f 2 -d ':'` ; \
	  if [ ! -f $(repo_name)-$$version.$(suffix) ]; then \
	    echo -e "\n======= Creating '$(repo_name)-$$version.$(suffix)' snapshot =======" ; \
	    ( cd $(repo_name) && \
	      git archive --format=tar --prefix=$(repo_name)-$$version/ $$hash | \
	      xz >../$(repo_name)-$$version.$(suffix) ) ; \
	  fi ; \
	  tar xJf $(repo_name)-$$version.$(suffix) ; \
	  ( cd $(repo_name)-$$version ; \
	    if [ -L $(repo_name)4c/LICENSE -a -r LICENSE ] ; then \
	      rm -f $(repo_name)4c/LICENSE ; \
	      cp LICENSE $(repo_name)4c    ; \
	    fi ; \
	    mv $(repo_name)4c $(repo_name)4c-$$version ; \
	    tar cJvf ../$(repo_name)4c-$$version.$(suffix) $(repo_name)4c-$$version ) ; \
	  rm -rf $(repo_name)-$$version  $(repo_name)-$$version.$(suffix) ; \
	done

$(sha1s): %.$(suffix).sha1sum : %.$(suffix)
	@for tarball in $< ; do \
	  echo -e "\n======= Calculation the '$$tarball' sha1sum =======" ; \
	  sha1sum --binary $$tarball > $$tarball.sha1sum ; \
	done

repository_clean: $(sha1s)
	@echo -e "\n======= Remove cloned $(repo_name).git repository =======\n"
	@rm -rf $(git_repo) $(repo_name)

downloads_clean:
	@rm -rf $(tarballs) $(sha1s)
	@rm -rf $(git_repo) $(repo_name)