Sources

The Tree of Radix and Third Party Sources

1388 Commits   0 Branches   11 Tags
author: kx <kx@radix.pro> 2021-05-01 15:29:53 +0300 committer: kx <kx@radix.pro> 2021-05-01 15:29:53 +0300 commit: fb46c4b3f20737a34997f1d1e5fc030e81748a5e parent: d5f057b3f2d0221dc33ee094af38442887c86715
Commit Summary:
libpsl: download tarball instead snapshot
Diffstat:
2 files changed, 73 insertions, 36 deletions
diff --git a/packages/l/libpsl/Makefile b/packages/l/libpsl/Makefile
index 458039b..94022ae 100644
--- a/packages/l/libpsl/Makefile
+++ b/packages/l/libpsl/Makefile
@@ -7,6 +7,10 @@
 # ======
 # https://github.com/rockdaboot/libpsl
 #
+# Download:
+# ========
+# https://github.com/rockdaboot/libpsl/releases/download/${VERSION}/libpsl-${VERSION}.tar.gz
+#
 # Clone:
 # =====
 # https://github.com/rockdaboot/libpsl.git
@@ -14,58 +18,30 @@
 
 url        = https://github.com/rockdaboot
 
-repo_name  = libpsl
-
-#
-# List of tags to be extracted:
-# ============================
-#                                               hash | tag
-#            ----------------------------------------+-----
-revisions  = a5e6f26cce82898c54a0caa6dda0ab924b806daf:0.21.1
-
-git_repo   = .git_clone
+versions    = 0.21.1
+pkgname     = libpsl
+suffix      = tar.gz
 
-suffix     = tar.xz
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
 
-versions   = $(foreach tag, $(revisions), $(shell echo $(tag) | cut -f 2 -d ':'))
 
-tarballs   = $(addsuffix .$(suffix), $(addprefix $(repo_name)-, $(versions)))
-sha1s      = $(addsuffix .sha1sum, $(tarballs))
+all: $(tarballs) $(sha1s)
 
-TARGETS = repository_clean
+.PHONY: downloads_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 ; \
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======\n"
+	@for tarball in $(tarballs) ; do \
+	  version=`echo $$tarball | sed 's/\([a-zA-Z-]*\)\([0-9][.][0-9]*[.][0-9]*\)\([\.].*\)/\2/'` ; \
+	  wget -N $(url)/$(pkgname)/releases/download/$${version}/$${tarball} ; \
 	done
 
 $(sha1s): %.$(suffix).sha1sum : %.$(suffix)
 	@for tarball in $< ; do \
-	  echo -e "\n======= Calculation the '$$tarball' sha1sum =======" ; \
+	  echo -e "\n======= Calculation the '$$tarball' sha1sum =======\n" ; \
 	  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)
diff --git a/packages/l/libpsl/Makefile.github b/packages/l/libpsl/Makefile.github
new file mode 100644
index 0000000..458039b
--- /dev/null
+++ b/packages/l/libpsl/Makefile.github
@@ -0,0 +1,71 @@
+#
+# Project Home:
+# ============
+# https://github.com/rockdaboot/libpsl
+#
+# GitHub:
+# ======
+# https://github.com/rockdaboot/libpsl
+#
+# Clone:
+# =====
+# https://github.com/rockdaboot/libpsl.git
+#
+
+url        = https://github.com/rockdaboot
+
+repo_name  = libpsl
+
+#
+# List of tags to be extracted:
+# ============================
+#                                               hash | tag
+#            ----------------------------------------+-----
+revisions  = a5e6f26cce82898c54a0caa6dda0ab924b806daf:0.21.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)-, $(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 ; \
+	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)