2 # $Id: Makefile,v 1.37 2007/11/19 05:29:25 nakano Exp $
4 # Build macro for JM project. If something don't work well,
5 # please refer the description in admin/JM-CVS/JM-CVS.sgml.
12 MKRWWW=bin/mkmanweb.perl
13 MKPWWW=bin/mkpodweb.perl
14 MKDIST=bin/mkdist.perl
15 MKSPDIST=bin/mksplitdist.perl
22 JMRELEASE := $(shell date +"%Y%m%d")
23 DIST := man-pages-ja-$(JMRELEASE)
25 JMRPMDIST := jman_pages-$(JMVER)-$(JMRELEASE)
26 JMRPMSRC := $(TMPDIR)/$(DIST).tar.gz
27 JMRPMSPEC=jman_pages.spec
28 JMRPM_BUILD_ROOT=$(TMPDIR)/man-pages-ja-root
33 periodic: chkcvs roff html web cgi
35 all: periodic archive-install
38 # update check for CVS checkout
43 cvs-release-modified cvs-status-modified: chkcvs
48 roff: www-roff-modified
50 www-roff-modified: cvs-status-modified
52 $(RSYNC) -a $(ROFFSRC)/ $(WWWROFF)
54 $(RSYNC) -a $(PODSRC)/ $(WWWPOD)
60 html: www-html-modified
62 www-html-modified: cvs-release-modified
65 $(MKRWWW) $(ROFFSRC) $(WWWHTML) $(MAN2HTML)
66 $(MKPWWW) $(PODSRC) $(WWWHTML) $(POD2HTML)
74 WWWROOT=$(WWWROOT) CGIROOT=$(CGIROOT) WORKDIR=$(TMPDIR)\
78 $(MAKE) -C admin/cgi/\
79 WWWROOT=$(WWWROOT) CGIROOT=$(CGIROOT)\
83 # archive related rules
85 archive-install: latest-archive-modified
86 -$(RM) www/man-pages-ja-*.tar.gz www/per-pkg/*.gz
88 cp $(TMPDIR)/$(DIST).tar.gz www/
90 cp $(TMPDIR)/man-pages-ja-*-$(JMRELEASE).tar.gz www/per-pkg
92 -cp $(RPMROOT)/RPMS/noarch/$(JMRPMDIST).noarch.rpm www/rpm
93 -cp $(RPMROOT)/SRPMS/$(JMRPMDIST).src.rpm www/rpm
95 make -C www/ DATE=$(JMRELEASE)\
96 WWWROOT=$(WWWROOT) CGIROOT=$(CGIROOT)\
97 download.html index.html
99 WWWROOT=$(WWWROOT) CGIROOT=$(CGIROOT)\
102 latest-archive-modified: tarball rpm
107 tarball: $(TMPDIR)/$(DIST).tar.gz
109 $(TMPDIR)/$(DIST).tar.gz:
110 $(MKDIST) . $(TMPDIR)/$(DIST) $(POD2MAN)
111 $(MAKE) -f Makefile.dist install
112 (cd $(TMPDIR); tar czf $(DIST).tar.gz $(DIST))
113 $(MKSPDIST) $(TMPDIR)/$(DIST)
114 touch latest-archive-modified
119 rpm: $(RPMROOT)/RPMS/noarch/$(JMRPMDIST).noarch.rpm
121 $(RPMROOT)/RPMS/noarch/$(JMRPMDIST).noarch.rpm: $(JMRPMSRC)
122 mkdir -p $(RPMROOT)/SOURCES
123 mkdir -p $(RPMROOT)/SPECS
124 mkdir -p $(RPMROOT)/BUILD
125 mkdir -p $(RPMROOT)/RPMS/noarch
126 mkdir -p $(RPMROOT)/SRPMS
127 mkdir -p $(RPMROOT)/db
128 mkdir -p $(RPMROOT)/tmp
129 cp $(JMRPMSRC) $(RPMROOT)/SOURCES/
130 sed -e "s/@@version@@/$(JMVER)/" \
131 -e "s/@@release@@/$(JMRELEASE)/" \
132 -e "s%@@buildroot@@%$(JMRPM_BUILD_ROOT)%" \
133 www/rpm/$(JMRPMSPEC) > $(RPMROOT)/SPECS/$(JMRPMSPEC)
134 $(RPM) --dbpath $(RPMROOT)/db --rebuilddb
135 $(RPMB) --define "buildroot $(JMRPM_BUILD_ROOT)" \
136 --dbpath $(RPMROOT)/db \
137 --define "_topdir $(RPMROOT)" \
138 --define "_tmppath $(RPMROOT)/tmp" \
139 --define "_mandir /usr/share/man" -ba \
140 $(RPMROOT)/SPECS/$(JMRPMSPEC)
141 touch latest-archive-modified
149 rm -f pod2htmd.tmp pod2htmi.tmp
150 $(MAKE) -C admin/cgi/ clean
151 $(MAKE) -C www/ clean
152 $(MAKE) -f Makefile.dist clean
153 rm -rf $(JMRPM_BUILD_ROOT)
154 rm -rf $(RPMROOT)/BUILD/$(DIST)
155 for i in $(JMRPMSRC); do \
156 rm -f $(RPMROOT)/SOURCES/`basename $$i` ; \
160 $(RM) -rf $(WWWROOT)/*
161 $(RM) -rf $(CGIROOT)/*