1
# Makefile written for the Debian package.
2
# Based on the Remi Perrot's one, done for
6
# For a better maintenance, we'll create by hand each
7
# bugzilla's sub directories.
9
BUGZILLA_PERLDIR= $(DESTDIR)/usr/share/perl5
10
BUGZILLA_CONFIG = $(DESTDIR)/etc/bugzilla3
11
BUGZILLA_CGIDIR = $(DESTDIR)/usr/lib/cgi-bin/bugzilla3
12
BUGZILLA_ROOT = $(DESTDIR)/usr/share/bugzilla3
13
BUGZILLA_WWW = $(BUGZILLA_ROOT)/web
14
BUGZILLA_LIBDIR = $(BUGZILLA_ROOT)
15
BUGZILLA_DATADIR = $(DESTDIR)/var/lib/bugzilla3
16
BUGZILLA_CONTRIB= $(BUGZILLA_ROOT)/contrib
21
pl_files = runtests.pl
22
lib_perlscripts = checksetup.pl collectstats.pl email_in.pl importxml.pl mod_perl.pl testserver.pl whineatnews.pl whine.pl
24
static_files = *.dtd *.js *.txt
26
# Where to find the sources.
27
BUGZILLA_TAR = $(shell ls -1 bugzilla-?.?.?.tar.gz | head -n 1)
28
BUGZILLA_TARDIR = $(subst .tar.gz,,$(BUGZILLA_TAR))
29
BUGZILLA_SRCDIR = bugzilla-srcdir
31
BUGZILLA_DE = $(shell ls -1 germzilla-*.tar.gz | head -n 1)
32
BUGZILLA_BE = $(shell ls -1 bugzilla-be-*.tar.gz | head -n 1)
33
BUGZILLA_BG = $(shell ls -1 bugzilla-bg-*.tar.gz | head -n 1)
34
BUGZILLA_FR = $(shell ls -1 bugzilla-*.fr.tar.gz | head -n 1)
35
BUGZILLA_RU = $(shell ls -1 bugzilla-*-ru-*.tar.gz | head -n 1)
37
INSTALL = /usr/bin/install
39
extractsrc: $(BUGZILLA_SRCDIR)
40
$(BUGZILLA_SRCDIR): $(BUGZILLA_TAR)
41
tar -xzf $(BUGZILLA_TAR)
42
test -d $(BUGZILLA_TARDIR)
43
tar -C $(BUGZILLA_TARDIR)/template -xzf $(BUGZILLA_DE)
44
test -d $(BUGZILLA_TARDIR)/template/de
45
tar -C $(BUGZILLA_TARDIR) -xzf $(BUGZILLA_FR)
46
test -d $(BUGZILLA_TARDIR)/template/fr
47
tar -C $(BUGZILLA_TARDIR) --transform "s/bugzilla[^\/]\+\///g" -xzf $(BUGZILLA_RU)
48
test -d $(BUGZILLA_TARDIR)/template/ru
49
tar -C $(BUGZILLA_TARDIR) -xzf $(BUGZILLA_BG)
50
test -d $(BUGZILLA_TARDIR)/template/bg
51
tar -C $(BUGZILLA_TARDIR) --transform "s/bugzilla[^\/]\+\///g" -xzf $(BUGZILLA_BE)
52
test -d $(BUGZILLA_TARDIR)/template/be
53
find $(BUGZILLA_TARDIR)/template -name "*.tmpl" -exec chmod a-x {} \;
54
mv $(BUGZILLA_TARDIR) $(BUGZILLA_SRCDIR)
56
install: install_static_dirs install_static_files install_lib_files \
57
install_cgi install_template install_contrib
60
install_fr_FIXME: extractsrc
61
@echo "Extracting french templates"
62
$(INSTALL) -d $(BUGZILLA_ROOT)/template
63
tar zxf l10n/fr.tar.gz -C $(BUGZILLA_ROOT)/template
66
install_contrib: extractsrc
67
$(INSTALL) -d $(BUGZILLA_CONTRIB)
68
$(INSTALL) -m 0755 $(BUGZILLA_SRCDIR)/contrib/recode.pl $(BUGZILLA_CONTRIB)
69
# $(INSTALL) -m 0755 $(BUGZILLA_SRCDIR)/contrib/*.pl $(BUGZILLA_CONTRIB)
70
# $(INSTALL) -m 0644 $(BUGZILLA_SRCDIR)/contrib/*.pm $(BUGZILLA_CONTRIB)
71
# $(INSTALL) -m 0755 $(BUGZILLA_SRCDIR)/contrib/*.py $(BUGZILLA_CONTRIB)
72
# $(INSTALL) -m 0644 $(BUGZILLA_SRCDIR)/contrib/README* $(BUGZILLA_CONTRIB)
73
# $(INSTALL) -m 0644 $(BUGZILLA_SRCDIR)/contrib/*.html $(BUGZILLA_CONTRIB)
74
# $(INSTALL) -m 0755 $(BUGZILLA_SRCDIR)/contrib/*.sh $(BUGZILLA_CONTRIB)
75
# $(INSTALL) -m 0755 $(BUGZILLA_SRCDIR)/contrib/*.rb $(BUGZILLA_CONTRIB)
76
# $(INSTALL) -d $(BUGZILLA_CONTRIB)/bugzilla-submit
77
# cp $(BUGZILLA_SRCDIR)/contrib/bugzilla-submit/* $(BUGZILLA_CONTRIB)/bugzilla-submit
78
# $(INSTALL) -d $(BUGZILLA_CONTRIB)/cmdline
79
# cp $(BUGZILLA_SRCDIR)/contrib/cmdline/* $(BUGZILLA_CONTRIB)/cmdline
80
# $(INSTALL) -d $(BUGZILLA_CONTRIB)/gnatsparse
81
# $(INSTALL) -m 0644 $(BUGZILLA_SRCDIR)/contrib/gnatsparse/README $(BUGZILLA_CONTRIB)/gnatsparse
82
# $(INSTALL) -m 0755 $(BUGZILLA_SRCDIR)/contrib/gnatsparse/*.py $(BUGZILLA_CONTRIB)/gnatsparse
85
install_static_dirs: extractsrc
86
@cd $(BUGZILLA_SRCDIR) && for this_dir in `find skins -type d` ; do \
87
install -d -m 0755 -o root -g root $(BUGZILLA_WWW)/$$this_dir ;\
89
@cd $(BUGZILLA_SRCDIR) && for this_dir in `find js -type d` ; do \
90
install -d -m 0755 -o root -g root $(BUGZILLA_WWW)/$$this_dir ;\
92
@cd $(BUGZILLA_SRCDIR) && for this_dir in `find data -type d` duplicates webdot; do \
93
install -d -m 0755 -o root -g root $(BUGZILLA_DATADIR)/$$this_dir ;\
95
@cd $(BUGZILLA_SRCDIR) && for this_dir in `find skins -type d` ; do \
96
install -d -m 0755 -o root -g root $(BUGZILLA_WWW)/$$this_dir ;\
100
install_template: extractsrc
101
@cd $(BUGZILLA_SRCDIR) && for this_dir in `find template -type d` ; do \
102
install -d -m 0755 -o root -g root $(BUGZILLA_DATADIR)/$$this_dir ;\
104
@cd $(BUGZILLA_SRCDIR) && for this_file in `find template -type f` ; do \
105
install -m 0644 -o root -g root $$this_file $(BUGZILLA_DATADIR)/`dirname $$this_file` ;\
109
install_static_files: extractsrc
110
$(INSTALL) -d -m 0755 -o root -g root $(BUGZILLA_WWW)
111
cd $(BUGZILLA_SRCDIR) && $(INSTALL) -m 0644 -o root -g root $(static_files) $(BUGZILLA_WWW)
112
@cd $(BUGZILLA_SRCDIR) && for this_file in `find skins -type f` ; do \
113
install -m 0644 -o root -g root $$this_file $(BUGZILLA_WWW)/`dirname $$this_file` ;\
115
$(INSTALL) -m 0644 -o root -g root $(BUGZILLA_SRCDIR)/images/padlock.png $(BUGZILLA_WWW)
116
@cd $(BUGZILLA_SRCDIR) && for this_file in `find js -type f` ; do \
117
install -m 0644 -o root -g root $$this_file $(BUGZILLA_WWW)/`dirname $$this_file` ;\
119
# The tricky point here, is to leave "params" alone, that's a conffile now
120
# We'll handle it by hand in postinst.
121
@cd $(BUGZILLA_SRCDIR) && for this_file in `find data -type f -name '!params'` ; do \
122
install -m 0644 -o root -g root $$this_file $(BUGZILLA_DATADIR)/`dirname $$this_file` ;\
124
@cd $(BUGZILLA_SRCDIR) && for this_file in `find skins -type f` ; do \
125
install -m 0644 -o root -g root $$this_file $(BUGZILLA_WWW)/`dirname $$this_file` ;\
129
install_lib_files: extractsrc
130
cd $(BUGZILLA_SRCDIR) && $(INSTALL) -m 0644 -o root -g root $(lib_files) $(BUGZILLA_ROOT)
131
cd $(BUGZILLA_SRCDIR) && $(INSTALL) -m 0755 -o root -g root $(pl_files) $(BUGZILLA_ROOT)
132
$(INSTALL) -d -m 0755 -o root -g root $(BUGZILLA_ROOT)/lib
133
cd $(BUGZILLA_SRCDIR) && $(INSTALL) -m 0755 -o root -g root $(lib_perlscripts) $(BUGZILLA_ROOT)/lib
134
$(INSTALL) -d -m 0755 -o root -g root $(BUGZILLA_PERLDIR)
135
@cd $(BUGZILLA_SRCDIR) && for this_dir in `find $(lib_dir) -type d` ; do \
136
install -d -m 0755 -o root -g root $(BUGZILLA_PERLDIR)/$$this_dir ;\
138
@cd $(BUGZILLA_SRCDIR) && for this_file in `find $(lib_dir) -type f` ; do \
139
install -m 0644 -o root -g root $$this_file $(BUGZILLA_PERLDIR)/`dirname $$this_file` ;\
141
$(INSTALL) -d -m 0755 -o root -g root $(BUGZILLA_DATADIR)
144
install_cgi: extractsrc
145
$(INSTALL) -d -m 0755 -o root -g root $(BUGZILLA_CGIDIR)
146
cd $(BUGZILLA_SRCDIR) && $(INSTALL) -m 0755 -o root -g root $(cgi_files) $(BUGZILLA_CGIDIR)
150
rm -rf $(BUGZILLA_SRCDIR) bugzilla-srcdir
153
dpkg-buildpackage -rfakeroot -us -uc