summaryrefslogtreecommitdiff
path: root/packages/a/debianutils/Makefile
blob: 3a7d474404e8535dbc3fef3d9d7e893c4a9d4569 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#
# Project Home:
# ============
#   https://packages.qa.debian.org/d/debianutils.html
#
# Downloads:
# =========
#   ftp://ftp.de.debian.org/debian/pool/main/d/debianutils
#
# NOTE: there is continuation on GitLab: https://salsa.debian.org/debian/debianutils
#

url        = https://salsa.debian.org/debian

repo_name  = debianutils
pkg_name   = debianutils

#
# List of tags to be extracted:
# ============================
#                                               hash | tag
#            ----------------------------------------+-----
revisions  = ed618f21f29f45d5112dc9d649c64672de2c3761:4.9:debian/4.9
revisions += 30e9cf773a0924ac46a5ab107b2809cd4ccd141e:4.10:debian/4.10
revisions += 3e8c46f59fd60562b8f56affdd83015aa2f08b5c:4.11:debian/4.11
revisions += 1b9341db97c8743fd68579a3f3daa6e6b2584741:4.11.2:debian/4.11.2
revisions += e8ce1c62d831299e97b5017f95bef717b4130d3c:5.0.1.2:debian/5.0.1-2
revisions += 9ce402eab0ce149c2202bf74ed7e1e76a04bde0b:5.1.2:debian/5.1-2
revisions += 90f631713e7d8d987f3e7da233da98cda4fac772:5.2.2:debian/5.2-2
revisions += 0c99be5da1ad9fee78aad3ac7c7ea2df9dec1c29:5.4.4:debian/5.4-4
revisions += 4c420893485ad07d771c327ef899819d4846408f:5.5.1:debian/5.5-1
revisions += df967b34d6d0bacf38c163f312a5267c3d28167b:5.6.0.1:debian/5.6-0.1
revisions += 72d3e2023ec17f79b0d1611bbeab33615f6be7f0:5.7.0.3:debian/5.7-0.3

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 $(pkg_name)-$$version.$(suffix) ]; then \
	    echo -e "\n======= Creating '$(repo_name)-$$version.$(suffix)' snapshot =======" ; \
	    ( cd $(repo_name) && \
	      git archive --format=tar --prefix=$(pkg_name)-$$version/ $$hash | \
	      xz >../$(pkg_name)-$$version.$(suffix) ) ; \
	    tar xJf $(pkg_name)-$$version.$(suffix) ; \
	    ( cd $(pkg_name)-$$version ; \
	      autoreconf -vif ; \
	      rm -rf autom4te.cache .git* *~ ) ; \
	    tar cJf $(pkg_name)-$$version.$(suffix) $(pkg_name)-$$version ; \
	    rm -rf $(pkg_name)-$$version ; \
	  fi ; \
	done

$(sha1s): %.tar.xz.sha1sum : %.tar.xz
	@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)