Sources

The Tree of Radix and Third Party Sources

1313 Commits   0 Branches   11 Tags
author: kx <kx@radix.pro> 2021-11-25 08:43:25 +0300 committer: kx <kx@radix.pro> 2021-11-25 08:43:25 +0300 commit: 7c216814f87796f4b7cec783c7f71369e0484548 parent: 5404ba36f8b41c4c7bc6daf4398216f92482813c
Commit Summary:
libffi-3.4.2
Diffstat:
2 files changed, 69 insertions, 17 deletions
diff --git a/packages/l/libffi/Makefile b/packages/l/libffi/Makefile
index a46b234..13d4e90 100644
--- a/packages/l/libffi/Makefile
+++ b/packages/l/libffi/Makefile
@@ -1,38 +1,65 @@
 #
 # Project Home:
 # ============
-# http://sourceware.org/libffi/
+# https://github.com/libffi/libffi
 #
-# Downloads:
-# =========
-# ftp://sourceware.org/pub/libffi/
+# GitHub:
+# ======
+# https://github.com/libffi/libffi
+# https://github.com/libffi/libffi.git
 #
 
-url         = ftp://sourceware.org/pub/libffi
+url         = https://github.com/libffi/libffi.git
 
-versions    = 3.0.12 3.0.13 3.2.1 3.3
-pkgname     = libffi
-suffix      = tar.gz
+repo_name   = libffi
 
-tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+versions    = 3.4.2
+suffix      = tar.xz
+
+TAGS        = $(versions)
+
+git_repo    = .git_clone
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(repo_name)-, $(versions)))
 sha1s       = $(addsuffix .sha1sum, $(tarballs))
 
+TARGETS = repository_clean
+
+all: $(TARGETS)
 
-all: $(tarballs) $(sha1s)
+.PHONY: downloads_clean repository_clean
 
-.PHONY: downloads_clean
+$(git_repo):
+	@echo -e "\n======= Clone $(repo_name).git repository =======\n"
+	@rm -rf $(repo_name)
+	@if [ "$(url)" = 'git://radix.pro' ]; then \
+	   git clone $(url)/$(repo_name).git $(repo_name) ; \
+	 else \
+	   git clone $(url) $(repo_name) ; \
+	 fi
+	@touch $@
 
-$(tarballs):
-	@echo -e "\n======= Downloading source tarballs =======\n"
-	@for tarball in $(tarballs) ; do \
-	  wget -N $(url)/$$tarball ; \
+
+$(tarballs): $(git_repo)
+	@for version in $(TAGS) ; do \
+	  tag=v`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=$(repo_name)-$$version/ $$tag | \
+	      xz >../$(repo_name)-$$version.$(suffix) ) ; \
+	  fi ; \
 	done
 
-$(sha1s): %.tar.gz.sha1sum : %.tar.gz
+$(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)
diff --git a/packages/l/libffi/Makefile.deprecated b/packages/l/libffi/Makefile.deprecated
new file mode 100644
index 0000000..a46b234
--- /dev/null
+++ b/packages/l/libffi/Makefile.deprecated
@@ -0,0 +1,38 @@
+#
+# Project Home:
+# ============
+# http://sourceware.org/libffi/
+#
+# Downloads:
+# =========
+# ftp://sourceware.org/pub/libffi/
+#
+
+url         = ftp://sourceware.org/pub/libffi
+
+versions    = 3.0.12 3.0.13 3.2.1 3.3
+pkgname     = libffi
+suffix      = tar.gz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+all: $(tarballs) $(sha1s)
+
+.PHONY: downloads_clean
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======\n"
+	@for tarball in $(tarballs) ; do \
+	  wget -N $(url)/$$tarball ; \
+	done
+
+$(sha1s): %.tar.gz.sha1sum : %.tar.gz
+	@for tarball in $< ; do \
+	  echo -e "\n======= Calculation the '$$tarball' sha1sum =======\n" ; \
+	  sha1sum --binary $$tarball > $$tarball.sha1sum ; \
+	done
+
+downloads_clean:
+	@rm -rf $(tarballs) $(sha1s)