File: Makefile

package info (click to toggle)
bugzilla 3.0.4.1-2%2Blenny2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,328 kB
  • ctags: 29
  • sloc: sh: 525; makefile: 160; perl: 98
file content (154 lines) | stat: -rw-r--r-- 6,673 bytes parent folder | download
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# Makefile written for the Debian package.
# Based on the Remi Perrot's one, done for 
# the 2.18 release.

# Destination paths
# For a better maintenance, we'll create by hand each
# bugzilla's sub directories.
DESTDIR		= 
BUGZILLA_PERLDIR= $(DESTDIR)/usr/share/perl5
BUGZILLA_CONFIG = $(DESTDIR)/etc/bugzilla3
BUGZILLA_CGIDIR = $(DESTDIR)/usr/lib/cgi-bin/bugzilla3
BUGZILLA_ROOT	= $(DESTDIR)/usr/share/bugzilla3
BUGZILLA_WWW	= $(BUGZILLA_ROOT)/web
BUGZILLA_LIBDIR = $(BUGZILLA_ROOT)
BUGZILLA_DATADIR = $(DESTDIR)/var/lib/bugzilla3
BUGZILLA_CONTRIB= $(BUGZILLA_ROOT)/contrib

# Source paths
cgi_files	= *.cgi
lib_files	= *.pm 
pl_files	= runtests.pl 
lib_perlscripts	= checksetup.pl collectstats.pl email_in.pl importxml.pl mod_perl.pl testserver.pl whineatnews.pl whine.pl
lib_dir		= Bugzilla
static_files	= *.dtd *.js *.txt 

# Where to find the sources.
BUGZILLA_TAR    = $(shell ls -1 bugzilla-?.?.?.tar.gz | head -n 1)
BUGZILLA_TARDIR = $(subst .tar.gz,,$(BUGZILLA_TAR))
BUGZILLA_SRCDIR = bugzilla-srcdir

BUGZILLA_DE = $(shell ls -1 germzilla-*.tar.gz | head -n 1)
BUGZILLA_BE = $(shell ls -1 bugzilla-be-*.tar.gz | head -n 1)
BUGZILLA_BG = $(shell ls -1 bugzilla-bg-*.tar.gz | head -n 1)
BUGZILLA_FR = $(shell ls -1 bugzilla-*.fr.tar.gz | head -n 1)
BUGZILLA_RU = $(shell ls -1 bugzilla-*-ru-*.tar.gz | head -n 1)

INSTALL = /usr/bin/install

extractsrc:	$(BUGZILLA_SRCDIR)
$(BUGZILLA_SRCDIR):	$(BUGZILLA_TAR)
	tar -xzf $(BUGZILLA_TAR)
	test -d $(BUGZILLA_TARDIR)
	tar -C $(BUGZILLA_TARDIR)/template -xzf $(BUGZILLA_DE)
	test -d $(BUGZILLA_TARDIR)/template/de
	tar -C $(BUGZILLA_TARDIR) -xzf $(BUGZILLA_FR)
	test -d $(BUGZILLA_TARDIR)/template/fr
	tar -C $(BUGZILLA_TARDIR) --transform "s/bugzilla[^\/]\+\///g" -xzf $(BUGZILLA_RU)
	test -d $(BUGZILLA_TARDIR)/template/ru
	tar -C $(BUGZILLA_TARDIR) -xzf $(BUGZILLA_BG)
	test -d $(BUGZILLA_TARDIR)/template/bg
	tar -C $(BUGZILLA_TARDIR) --transform "s/bugzilla[^\/]\+\///g" -xzf $(BUGZILLA_BE)
	test -d $(BUGZILLA_TARDIR)/template/be
	find $(BUGZILLA_TARDIR)/template -name "*.tmpl" -exec chmod a-x {} \;
	mv $(BUGZILLA_TARDIR) $(BUGZILLA_SRCDIR)

install: install_static_dirs install_static_files install_lib_files \
	 install_cgi install_template install_contrib


install_fr_FIXME:	extractsrc
	@echo "Extracting french templates"
	$(INSTALL) -d $(BUGZILLA_ROOT)/template
	tar zxf l10n/fr.tar.gz -C $(BUGZILLA_ROOT)/template 


install_contrib:	extractsrc
	$(INSTALL) -d $(BUGZILLA_CONTRIB)
	$(INSTALL) -m 0755 $(BUGZILLA_SRCDIR)/contrib/recode.pl $(BUGZILLA_CONTRIB)
#	$(INSTALL) -m 0755 $(BUGZILLA_SRCDIR)/contrib/*.pl $(BUGZILLA_CONTRIB)
#	$(INSTALL) -m 0644 $(BUGZILLA_SRCDIR)/contrib/*.pm $(BUGZILLA_CONTRIB)
#	$(INSTALL) -m 0755 $(BUGZILLA_SRCDIR)/contrib/*.py $(BUGZILLA_CONTRIB)
#	$(INSTALL) -m 0644 $(BUGZILLA_SRCDIR)/contrib/README* $(BUGZILLA_CONTRIB)
#	$(INSTALL) -m 0644 $(BUGZILLA_SRCDIR)/contrib/*.html $(BUGZILLA_CONTRIB)
#	$(INSTALL) -m 0755 $(BUGZILLA_SRCDIR)/contrib/*.sh $(BUGZILLA_CONTRIB)
#	$(INSTALL) -m 0755 $(BUGZILLA_SRCDIR)/contrib/*.rb $(BUGZILLA_CONTRIB)
#	$(INSTALL) -d $(BUGZILLA_CONTRIB)/bugzilla-submit
#	cp $(BUGZILLA_SRCDIR)/contrib/bugzilla-submit/* $(BUGZILLA_CONTRIB)/bugzilla-submit
#	$(INSTALL) -d $(BUGZILLA_CONTRIB)/cmdline
#	cp $(BUGZILLA_SRCDIR)/contrib/cmdline/* $(BUGZILLA_CONTRIB)/cmdline
#	$(INSTALL) -d $(BUGZILLA_CONTRIB)/gnatsparse
#	$(INSTALL) -m 0644 $(BUGZILLA_SRCDIR)/contrib/gnatsparse/README $(BUGZILLA_CONTRIB)/gnatsparse
#	$(INSTALL) -m 0755 $(BUGZILLA_SRCDIR)/contrib/gnatsparse/*.py $(BUGZILLA_CONTRIB)/gnatsparse


install_static_dirs:	extractsrc
	@cd $(BUGZILLA_SRCDIR) && for this_dir in `find skins -type d` ; do \
		install -d -m 0755 -o root -g root $(BUGZILLA_WWW)/$$this_dir ;\
	done
	@cd $(BUGZILLA_SRCDIR) && for this_dir in `find js -type d` ; do \
		install -d -m 0755 -o root -g root $(BUGZILLA_WWW)/$$this_dir ;\
	done
	@cd $(BUGZILLA_SRCDIR) && for this_dir in `find data -type d` duplicates webdot; do \
		install -d -m 0755 -o root -g root $(BUGZILLA_DATADIR)/$$this_dir ;\
	done
	@cd $(BUGZILLA_SRCDIR) && for this_dir in `find skins -type d` ; do \
		install -d -m 0755 -o root -g root $(BUGZILLA_WWW)/$$this_dir ;\
	done


install_template:	extractsrc
	@cd $(BUGZILLA_SRCDIR) && for this_dir in `find template -type d` ; do \
		install -d -m 0755 -o root -g root $(BUGZILLA_DATADIR)/$$this_dir ;\
	done
	@cd $(BUGZILLA_SRCDIR) && for this_file in `find template -type f` ; do \
		install -m 0644 -o root -g root $$this_file $(BUGZILLA_DATADIR)/`dirname $$this_file` ;\
	done


install_static_files:	extractsrc
	$(INSTALL) -d -m 0755 -o root -g root $(BUGZILLA_WWW)
	cd $(BUGZILLA_SRCDIR) && $(INSTALL) -m 0644 -o root -g root $(static_files) $(BUGZILLA_WWW)
	@cd $(BUGZILLA_SRCDIR) && for this_file in `find skins -type f` ; do \
		install -m 0644 -o root -g root $$this_file $(BUGZILLA_WWW)/`dirname $$this_file` ;\
	done
	$(INSTALL) -m 0644 -o root -g root $(BUGZILLA_SRCDIR)/images/padlock.png $(BUGZILLA_WWW)
	@cd $(BUGZILLA_SRCDIR) && for this_file in `find js -type f` ; do \
		install -m 0644 -o root -g root $$this_file $(BUGZILLA_WWW)/`dirname $$this_file` ;\
	done
	# The tricky point here, is to leave "params" alone, that's a conffile now 
	# We'll handle it by hand in postinst.
	@cd $(BUGZILLA_SRCDIR) && for this_file in `find data -type f -name '!params'` ; do \
		install -m 0644 -o root -g root $$this_file $(BUGZILLA_DATADIR)/`dirname $$this_file` ;\
	done
	@cd $(BUGZILLA_SRCDIR) && for this_file in `find skins -type f` ; do \
		install -m 0644 -o root -g root $$this_file $(BUGZILLA_WWW)/`dirname $$this_file` ;\
	done


install_lib_files:	extractsrc
	cd $(BUGZILLA_SRCDIR) && $(INSTALL) -m 0644 -o root -g root $(lib_files) $(BUGZILLA_ROOT)
	cd $(BUGZILLA_SRCDIR) && $(INSTALL) -m 0755 -o root -g root $(pl_files) $(BUGZILLA_ROOT)
	$(INSTALL) -d -m 0755 -o root -g root $(BUGZILLA_ROOT)/lib
	cd $(BUGZILLA_SRCDIR) && $(INSTALL) -m 0755 -o root -g root $(lib_perlscripts) $(BUGZILLA_ROOT)/lib
	$(INSTALL) -d -m 0755 -o root -g root $(BUGZILLA_PERLDIR)
	@cd $(BUGZILLA_SRCDIR) && for this_dir in `find $(lib_dir) -type d` ; do \
		install -d -m 0755 -o root -g root $(BUGZILLA_PERLDIR)/$$this_dir ;\
	done
	@cd $(BUGZILLA_SRCDIR) && for this_file in `find $(lib_dir) -type f` ; do \
		install -m 0644 -o root -g root $$this_file $(BUGZILLA_PERLDIR)/`dirname $$this_file` ;\
	done
	$(INSTALL) -d -m 0755 -o root -g root $(BUGZILLA_DATADIR)


install_cgi:	extractsrc
	$(INSTALL) -d -m 0755 -o root -g root $(BUGZILLA_CGIDIR)
	cd $(BUGZILLA_SRCDIR) && $(INSTALL) -m 0755 -o root -g root $(cgi_files) $(BUGZILLA_CGIDIR)


clean:
	rm -rf $(BUGZILLA_SRCDIR) bugzilla-srcdir

deb:
	dpkg-buildpackage -rfakeroot -us -uc