Radix cross Linux 3pp sources

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

423 Commits   0 Branches   0 Tags
author: kx <kx@radix-linux.su> 2025-03-01 17:14:54 +0300 committer: kx <kx@radix-linux.su> 2025-03-01 17:14:54 +0300 commit: a95612ed3e4a5718d5176a48b382ed60dbb2025d parent: cdea2ed27b0b187307299827fb6995dee272d622
Commit Summary:
pcre2-10.45
Diffstat:
1 file changed, 35 insertions, 22 deletions
diff --git a/packages/l/pcre2/Makefile b/packages/l/pcre2/Makefile
index d0dd1c6..44fd2c9 100644
--- a/packages/l/pcre2/Makefile
+++ b/packages/l/pcre2/Makefile
@@ -3,42 +3,57 @@
 # ============
 # https://www.pcre.org/
 #
-# Files:
-# =====
-# https://sourceforge.net/projects/pcre/files/
-#
-# Downloads:
-# =========
-# https://sourceforge.net/projects/pcre/files/${VERSION}/pcre-${VERSION}.tar.bs2
+# GitHub:
+# ======
+# https://github.com/PCRE2Project/pcre2.git
 #
 
-url         = https://downloads.sourceforge.net/project/pcre/pcre2
+url         = https://github.com/PCRE2Project
+
+repo_name  = pcre2
+pkg_name   = pcre2
+suffix     = tar.xz
 
-versions    = 10.33 10.36 10.37
+versions    = 10.45
 
-pkgname     = pcre2
-suffix      = tar.bz2
+git_repo   = .git_clone
+tarballs   = $(addsuffix .tar.xz, $(addprefix $(pkg_name)-, $(versions)))
+sha1s      = $(addsuffix .sha1sum, $(tarballs))
 
-tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
-sha1s       = $(addsuffix .sha1sum, $(tarballs))
+TARGETS = repository_clean
 
 
-all: $(tarballs) $(sha1s)
+all: $(TARGETS)
 
-.PHONY: downloads_clean
+.PHONY: downloads_clean repository_clean
 
-$(tarballs):
-	@echo -e "\n======= Downloading source tarballs =======\n"
-	@for tarball in $(tarballs) ; do \
-	  version=`echo $$tarball | sed 's/\([a-zA-Z0-9]*\)\-\([0-9]*[.0-9]*[.0-9]*\)\(\..*\)/\2/'` ; \
-	  wget -N $(url)/$$version/$$tarball ; \
+$(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=pcre2-`echo $$version` ; \
+	  if [ ! -f $(repo_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) ) ; \
+	  fi ; \
 	done
 
-$(sha1s): %.$(suffix).sha1sum : %.$(suffix)
+$(sha1s): %.tar.xz.sha1sum : %.tar.xz
 	@for tarball in $< ; do \
-	  echo -e "\n======= Calculation the '$$tarball' sha1sum =======\n" ; \
+	  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)