source: soft/build_system/build_system/mkcd/tags/V3_0_4_1mdk/Makefile @ 1

Last change on this file since 1 was 1, checked in by fasma, 12 years ago

Initial Import from Mandriva's soft revision 224062 and package revision 45733

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