summaryrefslogtreecommitdiff
path: root/packages/n/metamail/Makefile
blob: bd1d8a0de5b2cb60f80567ee0832f15547c1dd61 (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
#
# Project Home:
# ============
# https://www.ibiblio.org/pub/packages/solaris/sparc/html/metamail.2.7.html
#
# Downloads:
# =========
# https://ftp.funet.fi/pub/unix/mail/metamail
#

url         = https://ftp.funet.fi/pub/unix/mail/metamail

versions    = 2.7

pkgname     = metamail
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 \
	  version=`echo $$tarball | sed 's/\([a-zA-Z-]*\)\([0-9][.0-9]*\)\(\..*\)/\2/'` ; \
	  wget -N $(url)/mm$$version.tar.Z ; \
	  uncompress -c mm$$version.tar.Z | tar xf - ; \
	  chmod a-x mm$$version/src/metamail/*.c ; \
	  ( cd mm$$version ; \
	    mv src $(pkgname)-$$version ; \
	    tar czf ../$(pkgname)-$$version.$(suffix) $(pkgname)-$$version ) ; \
	  rm -rf mm$$version mm$$version.tar.Z ; \
	done

$(sha1s): %.$(suffix).sha1sum : %.$(suffix)
	@for tarball in $< ; do \
	  echo -e "\n======= Calculation the '$$tarball' sha1sum =======\n" ; \
	  sha1sum --binary $$tarball > $$tarball.sha1sum ; \
	done

downloads_clean:
	@rm -rf $(tarballs) $(sha1s)