author: kx <kx@radix.pro> 2021-05-07 10:28:27 +0300
committer: kx <kx@radix.pro> 2021-05-07 10:28:27 +0300
commit: 724b694d2b324dcfc64eba39827c36d93a2467d1
parent: ecbd43183dc27d2b06b3ba1b6faaf424ddffe501
Commit Summary:
Diffstat:
1 file changed, 61 insertions, 19 deletions
diff --git a/GNU/grub/Makefile b/GNU/grub/Makefile
index 538654d..b1595f4 100644
--- a/GNU/grub/Makefile
+++ b/GNU/grub/Makefile
@@ -1,38 +1,87 @@
#
# Project Home:
# ============
-# http://www.gnu.org/software/grub
+# https://www.gnu.org/software/grub
#
-# Downloads:
-# =========
-# http://www.gnu.org/software/grub/grub-download.html
-# ftp://ftp.gnu.org/gnu/grub
+# Savannah cGit:
+# =============
+# http://git.savannah.gnu.org/cgit/grub.git
#
+# Clone:
+# =====
+# git clone git://git.savannah.gnu.org/grub.git
+# git clone https://git.savannah.gnu.org/git/grub.git
+# git clone ssh://git.savannah.gnu.org/srv/git/grub.git
+#
+
+url = https://git.savannah.gnu.org/git/
+
+repo_name = grub
+pkg_name = grub
+
+#
+# List of tags to be extracted:
+# ============================
+# hash | tag
+# ----------------------------------------+-----
+revisions = 2a2e10c1b39672de3d5da037a50d5c371f49b40d:2.04
+revisions += 837fe48deb89b31710904de4e9c7dda258490e1c:2.05.1
-url = http://ftp.gnu.org/gnu/grub
+git_repo = .git_clone
+suffix = tar.xz
-versions = 2.00 2.04
-pkgname = grub
-suffix = tar.xz
+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))
-all: $(tarballs) $(sha1s)
-.PHONY: downloads_clean
+TARGETS = repository_clean
-$(tarballs):
- @echo -e "\n======= Downloading source tarballs =======\n"
- @for tarball in $(tarballs) ; do \
- wget -N $(url)/$$tarball ; \
+
+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 ; \
+ tar xJf $(pkg_name)-$${version}.$(suffix) ; \
+ ( cd $(pkg_name)-$${version} ; \
+ # ======= Remove ~rc revision ======= ; \
+ echo -e "\n======= Remove ~rc (release candidate) micro version =======" ; \
+ rc=`echo $${version} | cut -f3 -d'.'` ; \
+ if [ "x$$rc" != "x" ] ; then \
+ sed -i "s,\[[0-9]\.[0-9][0-9]~rc[1-9]*\],\[$${version}\]," configure.ac ; \
+ fi ; \
+ ./bootstrap ; rm -rf autom4te.cache .gitignore .travis.yml ) ; \
+ tar cJf $(pkg_name)-$${version}.$(suffix) $(pkg_name)-$${version} ; \
+ rm -rf $(pkg_name)-$${version} ; \
done
$(sha1s): %.$(suffix).sha1sum : %.$(suffix)
@for tarball in $< ; do \
- echo -e "\n======= Calculation the '$$tarball' sha1sum =======\n" ; \
- sha1sum --binary $$tarball > $$tarball.sha1sum ; \
+ 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)