1 | NAME = mkcd |
---|
2 | VERSION:=$(shell rpm -q --qf %{VERSION} --specfile $(NAME).spec) |
---|
3 | RELEASE:=$(shell rpm -q --qf %{RELEASE} --specfile $(NAME).spec) |
---|
4 | TAG := $(shell echo "V$(VERSION)_$(RELEASE)" | tr -- '-.' '__') |
---|
5 | |
---|
6 | DOC = mkcd |
---|
7 | |
---|
8 | ALL = |
---|
9 | HTML_STYLE = "/usr/share/sgml/docbook/xsl-stylesheets-1.61.3/html/docbook.xsl" |
---|
10 | PDF_STYLE = "/usr/share/sgml/docbook/xsl-stylesheets-1.61.3/fo/docbook.xsl" |
---|
11 | TXT_STYLE = |
---|
12 | TEX_STYLE = |
---|
13 | |
---|
14 | PERL_VENDORLIB=$(shell eval "`perl -V:installvendorlib`"; echo $$installvendorlib) |
---|
15 | |
---|
16 | install: $(ALL) |
---|
17 | install -d $(PREFIX)/usr/bin |
---|
18 | install mkcd $(PREFIX)/usr/bin |
---|
19 | install clean-rpmsrate $(PREFIX)/usr/bin |
---|
20 | install -d $(PREFIX)/$(PERL_VENDORLIB)/Mkcd |
---|
21 | for i in Config.pm Build.pm Commandline.pm Disc.pm Functions.pm Group.pm List.pm Optimize.pm Package.pm Tools.pm; do install pm/Mkcd/$$i $(PREFIX)/$(PERL_VENDORLIB)/Mkcd/; done |
---|
22 | |
---|
23 | doc: $(DOC).html $(DOC).pdf $(DOC).ps $(DOC).txt |
---|
24 | |
---|
25 | clean: |
---|
26 | -rm -f *~ pm/Mkcd/*~ doc/*~ mkcd*.tar.bz2 |
---|
27 | |
---|
28 | $(DOC).html: $(DOC).xml |
---|
29 | xsltproc -o $@ $(HTML_STYLE) $< |
---|
30 | |
---|
31 | $(DOC).txt: $(DOC).html |
---|
32 | lynx -dump $(DOC).html |
---|
33 | |
---|
34 | $(DOC).ps: $(DOC).tex |
---|
35 | pdf2ps $(DOC).pdf $(DOC).ps |
---|
36 | |
---|
37 | $(DOC).pdf: $(DOC).fo |
---|
38 | java -classpath $(CLASSOATH) org.apache.fop.apps.Fop $(DOC).fo $(DOC).pdf |
---|
39 | |
---|
40 | $(DOC).fo: $(DOC).xml pdf.xsl |
---|
41 | xsl-c -in $(DOC).xml -xsl "file://$(PDF_STYLE)" -out $(DOC).fo |
---|
42 | |
---|
43 | # rules to build a test rpm |
---|
44 | |
---|
45 | localrpm: localdist buildrpm |
---|
46 | |
---|
47 | localdist: cleandist dir localcopy tar |
---|
48 | |
---|
49 | cleandist: clean |
---|
50 | rm -rf $(NAME)-$(VERSION) $(NAME)-$(VERSION).tar.bz2 |
---|
51 | |
---|
52 | dir: |
---|
53 | mkdir $(NAME)-$(VERSION) |
---|
54 | |
---|
55 | localcopy: |
---|
56 | find . -not -name "$(NAME)-$(VERSION)"|cpio -pd $(NAME)-$(VERSION)/ |
---|
57 | find $(NAME)-$(VERSION) -type d -name CVS -o -name .cvsignore -o -name unused |xargs rm -rf |
---|
58 | |
---|
59 | tar: |
---|
60 | tar cf $(NAME)-$(VERSION).tar $(NAME)-$(VERSION) |
---|
61 | bzip2 -9f $(NAME)-$(VERSION).tar |
---|
62 | rm -rf $(NAME)-$(VERSION) |
---|
63 | |
---|
64 | buildrpm: |
---|
65 | rpm -ta $(NAME)-$(VERSION).tar.bz2 |
---|
66 | |
---|
67 | # rules to build a distributable rpm |
---|
68 | |
---|
69 | rpm: changelog cvstag dist buildrpm |
---|
70 | |
---|
71 | dist: cleandist dir export tar |
---|
72 | |
---|
73 | export: |
---|
74 | cvs export -d $(NAME)-$(VERSION) -r $(TAG) $(NAME) |
---|
75 | |
---|
76 | cvstag: |
---|
77 | cvs tag $(CVSTAGOPT) $(TAG) |
---|
78 | |
---|
79 | changelog: ../common/username |
---|
80 | cvs2cl -U ../common/username -I ChangeLog --accum -W 400 |
---|
81 | rm -f ChangeLog.bak |
---|
82 | cvs commit -m "Generated by cvs2cl the `date '+%d_%b'`" ChangeLog |
---|