Sources

The Tree of Radix and Third Party Sources

1388 Commits   0 Branches   11 Tags
author: kx <kx@radix.pro> 2021-05-02 12:07:54 +0300 committer: kx <kx@radix.pro> 2021-05-02 12:07:54 +0300 commit: 77150634b1d36efba458a25e35a9da8c58d38e05 parent: 4d273de4e5252c26b2531bc242fdbcb6d0f4954b
Commit Summary:
ppp-2.4.9
Diffstat:
1 file changed, 45 insertions, 18 deletions
diff --git a/packages/n/ppp/Makefile b/packages/n/ppp/Makefile
index bfef83c..95d24f4 100644
--- a/packages/n/ppp/Makefile
+++ b/packages/n/ppp/Makefile
@@ -1,39 +1,71 @@
 #
 # Project Home:
 # ============
-# https://ppp.samba.org
+# https://github.com/ppp-project/ppp
 #
-# Downloads:
-# =========
-# ftp://ftp.samba.org/pub/ppp
-# https://download.samba.org/pub/ppp
+# GitHub:
+# ======
+# https://github.com/ppp-project/ppp
 #
+# Clone:
+# =====
+# https://github.com/ppp-project/ppp.git
+#
+
+url        = https://github.com/ppp-project
+
+repo_name  = ppp
+
+#
+# List of tags to be extracted:
+# ============================
+#                                               hash | tag
+#            ----------------------------------------+-----
+revisions  = 4fb319056f168bb8379865b91b4fd3e1ada73f1e:2.4.9
+
+git_repo   = .git_clone
 
-url         = https://download.samba.org/pub/ppp
+suffix     = tar.xz
 
-versions    = 2.4.5 2.4.7 2.4.9
-pkgname     = ppp
-suffix      = tar.gz
+versions   = $(foreach tag, $(revisions), $(shell echo $(tag) | cut -f 2 -d ':'))
 
-tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
-sha1s       = $(addsuffix .sha1sum, $(tarballs))
+tarballs   = $(addsuffix .$(suffix), $(addprefix $(repo_name)-, $(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 \
-	  wget -N $(url)/$$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 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 =======\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)