File: Mykefile

package info (click to toggle)
adzapper 20090301.dfsg.1-0.1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 720 kB
  • ctags: 62
  • sloc: perl: 3,664; sh: 126; makefile: 50
file content (68 lines) | stat: -rw-r--r-- 2,169 bytes parent folder | download | duplicates (2)
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
weblocal        = $(HOME)/@/adzapper.sf/html
webremote       = cs1,adzapper@web.sourceforge.net:htdocs
dateptn	= [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]

_scripts: scripts/squid_redirect $(HOME)/bin/squid_redirect

_sync:
	:make _scripts

_all:	_scripts cvslog.html _oldzaps

_publish:
        :make scripts/squid_redirect
        set -uex \
        lastrel=`cs-release lastrelease` \
        tmpdir=`mkdirn $$TMPDIR/adzap` \
        hg archive -r "release-$$lastrel" -t files "$$tmpdir/adzap-$$lastrel" \
        ( set -ue \
          cd "$$tmpdir" \
          tar cf $(weblocal)/adzap-$$lastrel.tar.gz adzap-$$lastrel \
          rm -f $(weblocal)/adzap.tar.gz \
          ln -s adzap-$$lastrel.tar.gz $(weblocal)/adzap.tar.gz \
        ) \
        rm -rf "$$tmpdir" \
	bsed "/TARBALL-LINE/s/adzap-$(dateptn)/adzap-$$lastrel/g" index.html \
        hg commit -m "Update release tarball to adzap-$$lastrel." index.html
        :make $(weblocal)/index.html $(weblocal)/CHANGELOG.txt
        rsync -e ssh -avH --delete-excluded $(weblocal)/ $(webremote)/

$(weblocal)/index.html: index.html
        rewriteif $@ <$?

$(weblocal)/CHANGELOG.txt: _always
        >>$@ \
        lastrel=`cs-release lastrelease` \
        rewriteif $@ hglog -r "release-$$lastrel:0"

_freshmeat:
        :make _publish
        set -uex \
        lastrel=`cs-release lastrelease` \
        bsed "s/^# Freshmeat release.*/# Freshmeat release: $$lastrel/" scripts/squid_redirect \
        hg commit -m "Update freshmeat release string to $$lastrel." scripts/squid_redirect
        echo SKIP cs-release freshmeat-submit

scripts/squid_redirect: rc/patterns
	@( echo "##"; echo "## Last updated `date`."; echo "##" \
	   cat $? \
	 ) \\
	| rlr -f '^__DATA__' \\
		  -t '^### END AUTO __DATA__ AREA' \\
		  -i '$@' \\
		  -o '$@' \\
		  -
        set -x \
        change=`hg log -r -1: --template='{desc|firstline}\n' $?` \
        hg commit -m "$$change" $@

$(HOME)/bin/squid_redirect: scripts/$(@F)
	rewriteif <$? $@

_oldzaps:
	rsync -avH --delete zaps/. $(HOME)/@/cs@zip.com.au/html/adzap/zaps/. & \
	rsync -avH --delete zaps/. $(HOME)/@/ezos/html/cs/adzap/zaps/. & \
	wait

_always:
	:make