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:
# ============
#   https://github.com/fedora-sysv/initscripts
#
# Clone:
# =====
#   git clone https://github.com/fedora-sysv/initscripts.git initscripts
#

url        = https://github.com/fedora-sysv

repo_name  = initscripts
pkg_name   = function-src

suffix     = tar.xz

#
# List of tags to be extracted:
#
TAGS       = r8-53
TAGS      += r8-54


git_repo   = .git_clone
versions   = $(foreach tag, $(TAGS), $(shell echo $(tag) | sed 's/r//g' | sed 's/\-/./g'))
tarballs   = $(addsuffix .$(suffix), $(addprefix $(repo_name)-, $(versions)))
tarballs  += $(addsuffix .$(suffix), $(addprefix $(pkg_name)-, $(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 tag in $(TAGS) ; do \
	  version=`echo $$tag | sed 's/r//g' | sed 's/\-/./g'` ; \
	  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/ $$tag | \
	      xz >../$(repo_name)-$$version.$(suffix) ) ; \
	  fi ; \
	  tar xJf $(repo_name)-$$version.$(suffix) ; \
	  mkdir -p $(pkg_name)-$$version/rc.d/init.d ; \
	  ( cd $(repo_name)-$$version/src ; \
	    for file in consoletype.1 consoletype.c fstab-decode.8 fstab-decode.c \
	                initlog.1 initlog.c initlog.h process.c process.h usleep.1 usleep.c ; do \
	      cp -a $$file ../../$(pkg_name)-$$version ; \
	    done ; \
	    cp -a ../rc.d/init.d/functions ../../$(pkg_name)-$$version/rc.d/init.d ; \
	  ) ; \
	  tar cJf $(pkg_name)-$$version.$(suffix) $(pkg_name)-$$version ; \
	  rm -rf $(repo_name)-$$version $(pkg_name)-$$version ; \
	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)