5 GIT_URL
= git
://git.bogomips.org
/local-openid.git
7 GIT-VERSION-FILE
: .FORCE-GIT-VERSION-FILE
9 -include GIT-VERSION-FILE
11 pkg_extra
:= GIT-VERSION-FILE NEWS ChangeLog
12 manifest
: $(pkg_extra
)
18 for i in
$@
$(pkg_extra
) $(man1_paths
); \
19 do echo
$$i; done
) | LC_ALL
=C
sort > $@
+
20 cmp
$@
+ $@ || mv
$@
+ $@
23 NEWS
: GIT-VERSION-FILE
24 $(RAKE
) -s news_rdoc
> $@
+
28 ChangeLog
: LOG_VERSION
= \
29 $(shell git rev-parse
-q
"$(GIT_VERSION)" >/dev
/null
2>&1 && \
30 echo
$(GIT_VERSION
) || git describe
)
32 ChangeLog
: log_range
= v
$(SINCE
)..
$(LOG_VERSION
)
34 ChangeLog
: GIT-VERSION-FILE
35 @echo
"ChangeLog from $(GIT_URL) ($(log_range))" > $@
+
37 git log
$(log_range
) | sed
-e
's/^/ /' >> $@
+
40 news_atom
:= http
://bogomips.org
/local-openid
/NEWS.atom.xml
41 cgit_atom
:= http
://git.bogomips.org
/cgit
/local-openid.git
/atom
/?h
=master
42 atom
= <link rel
="alternate" title
="Atom feed" href
="$(1)" \
43 type
="application/atom+xml"/>
45 doc
: .document NEWS ChangeLog
46 find bin lib
-type f
-name
'*.rbc' -exec
rm -f
'{}' ';'
47 rdoc
-a
-t
"$(shell sed -ne '1s/^= //p' README)"
48 install -m644 COPYING doc
/COPYING
49 install -m644
$(shell grep
'^[A-Z]' .document
) doc
/
51 '$$_.gsub!("</title>",%q{\&$(call atom,$(cgit_atom))})' \
54 '$$_.gsub!("</title>",%q{\&$(call atom,$(news_atom))})' \
55 doc
/NEWS.html doc
/README.html
56 $(RAKE
) -s news_atom
> doc
/NEWS.atom.xml
57 cd doc
&& ln README.html tmp
&& mv tmp index.html
61 $(RM
) -r doc ChangeLog NEWS
62 $(MAKE
) doc LOG_VERSION
=$(shell git tag
-l | tail
-1)
63 @awk
'BEGIN{RS="=== ";ORS=""}NR==2{sub(/\n$$/,"");print RS""$$0 }' \
65 find doc
/images doc
/js
-type f | \
66 TZ
=UTC xargs touch
-d
'1970-01-01 00:00:00' doc
/rdoc.css
68 chmod
644 $$(find doc
-type f
)
69 $(RSYNC
) -av
--delete doc
/ bogomips.org
:/srv
/bogomips
/local-openid
/
70 git ls-files | xargs touch
74 rfpackage
:= local-openid
75 pkggem
:= pkg
/$(rfpackage
)-$(VERSION
).gem
76 pkgtgz
:= pkg
/$(rfpackage
)-$(VERSION
).tgz
77 release_notes
:= release_notes-
$(VERSION
)
78 release_changes
:= release_changes-
$(VERSION
)
80 release-notes
: $(release_notes
)
81 release-changes
: $(release_changes
)
83 $(RAKE
) -s release_changes
> $@
+
84 $(VISUAL
) $@
+ && test -s
$@
+ && mv
$@
+ $@
86 GIT_URL
=$(GIT_URL
) $(RAKE
) -s release_notes
> $@
+
87 $(VISUAL
) $@
+ && test -s
$@
+ && mv
$@
+ $@
89 # ensures we're actually on the tagged $(VERSION), only used for release
91 test x
"$(shell umask)" = x0022
92 git rev-parse
--verify refs
/tags/v
$(VERSION
)^
{}
93 git diff-index
--quiet HEAD^
0
94 test `git rev-parse --verify HEAD^0` = \
95 `git rev-parse --verify refs/tags/v$(VERSION)^{}`
98 -git ls-tree
-r HEAD | awk
'/^100644 / {print $$NF}' | xargs chmod
644
99 -git ls-tree
-r HEAD | awk
'/^100755 / {print $$NF}' | xargs chmod
755
103 install-gem
: $(pkggem
)
104 gem
install $(CURDIR
)/$<
106 $(pkggem
): manifest fix-perms
107 gem build
$(rfpackage
).gemspec
111 $(pkgtgz
): distdir
= $(basename $@
)
112 $(pkgtgz
): HEAD
= v
$(VERSION
)
113 $(pkgtgz
): manifest fix-perms
114 @
test -n
"$(distdir)"
117 tar cf
- `cat .manifest` |
(cd
$(distdir
) && tar xf
-)
118 cd pkg
&& tar c
$(basename $(@F
)) | gzip
-9 > $(@F
)+
121 package
: $(pkgtgz
) $(pkggem
)
123 test-release
: verify package
$(release_notes
) $(release_changes
)
124 release
: verify package
$(release_notes
) $(release_changes
)
125 # make tgz release on RubyForge
126 rubyforge add_release
-f
-n
$(release_notes
) -a
$(release_changes
) \
127 $(rfproject
) $(rfpackage
) $(VERSION
) $(pkgtgz
)
128 # push gem to Gemcutter
130 # in case of gem downloads from RubyForge releases page
131 -rubyforge add_file \
132 $(rfproject
) $(rfpackage
) $(VERSION
) $(pkggem
)
134 gem install-gem
: GIT-VERSION-FILE
135 $(MAKE
) $@ VERSION
=$(GIT_VERSION
)
138 # Create gzip variants of the same timestamp as the original so nginx
139 # "gzip_static on" can serve the gzipped versions directly.
140 doc_gz
: docs
= $(shell find doc
-type f
! -regex
'^.*\.\(gif\|jpg\|png\|gz\)$$')
142 touch doc
/NEWS.atom.xml
-d
"$$(awk 'NR==1{print $$4,$$5,$$6}' NEWS)"
143 for i in
$(docs
); do \
144 gzip
--rsyncable
-9 < $$i > $$i.gz
; touch
-r
$$i $$i.gz
; done
145 .PHONY
: .FORCE-GIT-VERSION-FILE doc manifest