Radix cross Linux 3pp sources

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

423 Commits   0 Branches   0 Tags
#
# FAKEROOT:
#
# Debian sources:
#   https://sources.debian.org/src/fakeroot
#
# GitLab:
#   https://salsa.debian.org/clint/fakeroot
#
# Clone:
#   https://salsa.debian.org/clint/fakeroot.git
#
# Branch:
#   upstream
#
# tags:
#   upstream/1.26, ...
#
#
# NOTE:
#   This Makefile repacks source packages due to build required man pages.
#   Rebuilding passes using po4a utility which should be installed in system.
#

url        = https://salsa.debian.org/clint

repo_name  = fakeroot
pkg_name   = fakeroot
suffix     = tar.xz

versions   = 1.25.2 1.26 1.29 1.30.1 1.31

# List of tags to be extracted:
TAGS       = $(addprefix upstream/, $(versions))

git_repo   = .git_clone
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 version in $(versions) ; do \
	  tag=upstream/`echo $$version` ; \
	  if [ ! -f $(pkg_name)-$$version.$(suffix) ]; then \
	    echo -e "\n======= Creating '$(repo_name)-$$version.$(suffix)' snapshot =======" ; \
	    ( cd $(repo_name) && \
	      git archive --format=tar --prefix=$(pkg_name)-$$version/ $$tag | \
	      xz >../$(pkg_name)-$$version.$(suffix) ) ; \
	    tar xJf $(pkg_name)-$$version.$(suffix) ; \
	    ( cd $(pkg_name)-$$version/doc ; \
	      echo -e "\n======= build required man pages for available languages =======" ; \
	      po4a -k 0 --rm-backups --variable 'srcdir=../doc/' po4a/po4a.cfg ) ; \
	    tar cJf $(pkg_name)-$$version.$(suffix) $(pkg_name)-$$version ; \
	    rm -rf $(pkg_name)-$$version ; \
	  fi ; \
	done

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

repository_clean: $(defconfigs) $(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)