6
6
# For a better maintenance, we'll create by hand each
7
7
# bugzilla's sub directories.
9
9
BUGZILLA_PERLDIR= $(DESTDIR)/usr/share/perl5
10
10
BUGZILLA_CONFIG = $(DESTDIR)/etc/bugzilla3
11
BUGZILLA_CGIDIR = $(DESTDIR)/usr/lib/cgi-bin/bugzilla3
12
11
BUGZILLA_ROOT = $(DESTDIR)/usr/share/bugzilla3
13
12
BUGZILLA_WWW = $(BUGZILLA_ROOT)/web
13
BUGZILLA_CGIDIR = $(BUGZILLA_WWW)
14
14
BUGZILLA_LIBDIR = $(BUGZILLA_ROOT)
15
BUGZILLA_DATADIR = $(DESTDIR)/var/lib/bugzilla3
15
BUGZILLA_VARDIR = $(DESTDIR)/var/lib/bugzilla3
16
BUGZILLA_DATADIR = $(DESTDIR)/var/lib/bugzilla3/data
16
17
BUGZILLA_CONTRIB= $(BUGZILLA_ROOT)/contrib
18
PKGVER := $(shell dpkg-parsechangelog |grep Version |sed -e 's,Version: \([^-]\+\).*,\1,g')
19
PKGVER := $(shell dpkg-parsechangelog |grep Version: |sed -e 's,Version: \([^-]\+\).*,\1,g')
19
20
ORIGTARGZ := bugzilla_$(PKGVER).orig.tar.gz
24
25
pl_files = runtests.pl
25
lib_perlscripts = checksetup.pl collectstats.pl email_in.pl importxml.pl mod_perl.pl testserver.pl whineatnews.pl whine.pl
26
lib_perlscripts = checksetup.pl collectstats.pl email_in.pl importxml.pl mod_perl.pl testserver.pl whineatnews.pl whine.pl sanitycheck.pl
27
28
static_files = *.dtd *.txt
29
30
# Where to find the sources.
30
BUGZILLA_TAR := $(shell ls -1 bugzilla-?.?.tar.gz bugzilla-?.?.?.tar.gz| head -n 1)
31
BUGZILLA_TAR := $(shell ls -1 bugzilla-?.?.tar.gz bugzilla-?.?.?.tar.gz bugzilla-?.?.??.tar.gz 2>/dev/null| head -n 1)
31
32
BUGZILLA_TARDIR := $(subst .tar.gz,,$(BUGZILLA_TAR))
32
33
BUGZILLA_SRCDIR = bugzilla-srcdir
34
35
BUGZILLA_DE = $(shell ls -1 germzilla-*.tar.gz | head -n 1)
35
36
BUGZILLA_BE = $(shell ls -1 bugzilla-be-*.tar.gz | head -n 1)
36
#BUGZILLA_BG = $(shell ls -1 bugzilla-bg-*.tar.gz | head -n 1)
37
BUGZILLA_BG = $(shell ls -1 bugzilla-bg-*.tar.bz2 | head -n 1)
37
38
BUGZILLA_FR = $(shell ls -1 bugzilla-*.fr.tar.gz | head -n 1)
38
39
BUGZILLA_RU = $(shell ls -1 bugzilla-*-ru-*.tar.gz | head -n 1)
39
40
BUGZILLA_CS = $(shell ls -1 bugzilla.cs.*.tar.gz | head -n 1)
47
48
tar -xzf $(BUGZILLA_TAR)
48
49
test -d $(BUGZILLA_TARDIR)
49
50
tar -C $(BUGZILLA_TARDIR)/template -xzf $(BUGZILLA_DE)
50
test -d $(BUGZILLA_TARDIR)/template/de
51
test -d $(BUGZILLA_TARDIR)/template/de/default
51
52
find $(BUGZILLA_TARDIR)/template/de -name gzversion.html.tmpl -exec cp /dev/null {} \;
52
53
tar -C $(BUGZILLA_TARDIR) -xzf $(BUGZILLA_FR)
53
test -d $(BUGZILLA_TARDIR)/template/fr
54
: # tar -C $(BUGZILLA_TARDIR) -xzf $(BUGZILLA_BG)
55
: # test -d $(BUGZILLA_TARDIR)/template/bg
54
test -d $(BUGZILLA_TARDIR)/template/fr/default
56
55
tar -C $(BUGZILLA_TARDIR) --transform "s/bugzilla[^\/]\+\///g" -xzf $(BUGZILLA_BE)
57
test -d $(BUGZILLA_TARDIR)/template/be
56
test -d $(BUGZILLA_TARDIR)/template/be/default
58
57
tar -C $(BUGZILLA_TARDIR) -xzf $(BUGZILLA_RU)
59
test -d $(BUGZILLA_TARDIR)/template/ru
58
test -d $(BUGZILLA_TARDIR)/template/ru/default
59
tar -C $(BUGZILLA_TARDIR) -xjf $(BUGZILLA_BG)
60
test -d $(BUGZILLA_TARDIR)/template/bg/default
60
61
tar -C $(BUGZILLA_TARDIR)/template --transform "s/template/cs/g" -xzf $(BUGZILLA_CS)
61
test -d $(BUGZILLA_TARDIR)/template/cs
62
test -d $(BUGZILLA_TARDIR)/template/cs/default
62
63
$(INSTALL) -d $(BUGZILLA_TARDIR)/template/ja
63
64
tar -C $(BUGZILLA_TARDIR)/template/ja -xjf $(BUGZILLA_JA)
64
65
test -d $(BUGZILLA_TARDIR)/template/ja/default
65
66
tar -C $(BUGZILLA_TARDIR) -xzf $(BUGZILLA_ZH)
66
test -d $(BUGZILLA_TARDIR)/template/zh-TW
67
test -d $(BUGZILLA_TARDIR)/template/zh-TW/default
67
68
find $(BUGZILLA_TARDIR)/template -name "*.tmpl" -exec chmod a-x {} \;
68
69
find $(BUGZILLA_TARDIR)/template -name ".cvsignore" -or -name "CVS" -or -name ".svn" -exec rm {} \;
69
70
mv $(BUGZILLA_TARDIR) $(BUGZILLA_SRCDIR)
81
82
install_contrib: extractsrc
82
$(INSTALL) -d $(BUGZILLA_CONTRIB)
83
$(INSTALL) -m 0755 $(BUGZILLA_SRCDIR)/contrib/recode.pl $(BUGZILLA_CONTRIB)
84
# $(INSTALL) -m 0755 $(BUGZILLA_SRCDIR)/contrib/*.pl $(BUGZILLA_CONTRIB)
85
# $(INSTALL) -m 0644 $(BUGZILLA_SRCDIR)/contrib/*.pm $(BUGZILLA_CONTRIB)
86
# $(INSTALL) -m 0755 $(BUGZILLA_SRCDIR)/contrib/*.py $(BUGZILLA_CONTRIB)
87
# $(INSTALL) -m 0644 $(BUGZILLA_SRCDIR)/contrib/README* $(BUGZILLA_CONTRIB)
88
# $(INSTALL) -m 0644 $(BUGZILLA_SRCDIR)/contrib/*.html $(BUGZILLA_CONTRIB)
89
# $(INSTALL) -m 0755 $(BUGZILLA_SRCDIR)/contrib/*.sh $(BUGZILLA_CONTRIB)
90
# $(INSTALL) -m 0755 $(BUGZILLA_SRCDIR)/contrib/*.rb $(BUGZILLA_CONTRIB)
91
# $(INSTALL) -d $(BUGZILLA_CONTRIB)/bugzilla-submit
92
# cp $(BUGZILLA_SRCDIR)/contrib/bugzilla-submit/* $(BUGZILLA_CONTRIB)/bugzilla-submit
93
# $(INSTALL) -d $(BUGZILLA_CONTRIB)/cmdline
94
# cp $(BUGZILLA_SRCDIR)/contrib/cmdline/* $(BUGZILLA_CONTRIB)/cmdline
95
# $(INSTALL) -d $(BUGZILLA_CONTRIB)/gnatsparse
96
# $(INSTALL) -m 0644 $(BUGZILLA_SRCDIR)/contrib/gnatsparse/README $(BUGZILLA_CONTRIB)/gnatsparse
97
# $(INSTALL) -m 0755 $(BUGZILLA_SRCDIR)/contrib/gnatsparse/*.py $(BUGZILLA_CONTRIB)/gnatsparse
83
mkdir -p $(BUGZILLA_CONTRIB)
84
cp -av $(BUGZILLA_SRCDIR)/contrib/* $(BUGZILLA_CONTRIB)
85
find $(BUGZILLA_CONTRIB) -name '*.pl' -exec chmod a+x {} \;
86
find $(BUGZILLA_CONTRIB) -name '*.sh' -exec chmod a+x {} \;
100
88
install_static_dirs: extractsrc
101
@cd $(BUGZILLA_SRCDIR) && for this_dir in `find skins -type d` ; do \
102
install -d -m 0755 -o root -g root $(BUGZILLA_WWW)/$$this_dir ;\
104
@cd $(BUGZILLA_SRCDIR) && for this_dir in `find js -type d` ; do \
105
install -d -m 0755 -o root -g root $(BUGZILLA_WWW)/$$this_dir ;\
107
@cd $(BUGZILLA_SRCDIR) && for this_dir in `find data -type d` duplicates webdot; do \
108
install -d -m 0755 -o root -g root $(BUGZILLA_DATADIR)/$$this_dir ;\
89
cd $(BUGZILLA_SRCDIR) && for this_dir in `find skins -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 js -type d` ; do \
93
$(INSTALL) -d -m 0755 -o root -g root $(BUGZILLA_WWW)/$$this_dir ;\
95
cd $(BUGZILLA_SRCDIR) && for this_dir in `find data -type d` duplicates webdot; do \
96
$(INSTALL) -d -m 0755 -o root -g root $(BUGZILLA_DATADIR)/$$this_dir ;\
112
100
install_template: extractsrc
113
@cd $(BUGZILLA_SRCDIR) && for this_dir in `find template -type d` ; do \
114
install -d -m 0755 -o root -g root $(BUGZILLA_DATADIR)/$$this_dir ;\
101
cd $(BUGZILLA_SRCDIR) && for this_dir in `find template -type d` ; do \
102
$(INSTALL) -d -m 0755 -o root -g root $(BUGZILLA_VARDIR)/$$this_dir ;\
116
@cd $(BUGZILLA_SRCDIR) && for this_file in `find template -type f` ; do \
117
install -m 0644 -o root -g root $$this_file $(BUGZILLA_DATADIR)/`dirname $$this_file` ;\
104
cd $(BUGZILLA_SRCDIR) && for this_file in `find template -type f` ; do \
105
$(INSTALL) -m 0644 -o root -g root $$this_file $(BUGZILLA_VARDIR)/`dirname $$this_file` ;\
121
109
install_static_files: extractsrc
122
$(INSTALL) -d -m 0755 -o root -g root $(BUGZILLA_DATADIR)
123
110
cd $(BUGZILLA_SRCDIR) && $(INSTALL) -m 0644 -o root -g root $(static_files) $(BUGZILLA_WWW)
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` ;\
111
cd $(BUGZILLA_SRCDIR) && for this_file in `find skins -type f` ; do \
112
$(INSTALL) -m 0644 -o root -g root $$this_file $(BUGZILLA_WWW)/`dirname $$this_file` ;\
127
114
$(INSTALL) -d -m 0755 -o root -g root $(BUGZILLA_WWW)
128
115
$(INSTALL) -m 0644 -o root -g root $(BUGZILLA_SRCDIR)/images/padlock.png $(BUGZILLA_WWW)
129
@cd $(BUGZILLA_SRCDIR) && for this_file in `find js -type f` ; do \
130
install -m 0644 -o root -g root $$this_file $(BUGZILLA_WWW)/`dirname $$this_file` ;\
132
# The tricky point here, is to leave "params" alone, that's a conffile now
133
# We'll handle it by hand in postinst.
134
@cd $(BUGZILLA_SRCDIR) && for this_file in `find data -type f -name '!params'` ; do \
135
install -m 0644 -o root -g root $$this_file $(BUGZILLA_DATADIR)/`dirname $$this_file` ;\
137
@cd $(BUGZILLA_SRCDIR) && for this_file in `find skins -type f` ; do \
138
install -m 0644 -o root -g root $$this_file $(BUGZILLA_WWW)/`dirname $$this_file` ;\
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
cd $(BUGZILLA_SRCDIR) && for this_file in `find skins -type f` ; do \
120
$(INSTALL) -m 0644 -o root -g root $$this_file $(BUGZILLA_WWW)/`dirname $$this_file` ;\
145
127
$(INSTALL) -d -m 0755 -o root -g root $(BUGZILLA_ROOT)/lib
146
128
cd $(BUGZILLA_SRCDIR) && $(INSTALL) -m 0755 -o root -g root $(lib_perlscripts) $(BUGZILLA_ROOT)/lib
147
129
$(INSTALL) -d -m 0755 -o root -g root $(BUGZILLA_PERLDIR)
148
@cd $(BUGZILLA_SRCDIR) && for this_dir in `find $(lib_dir) -type d` ; do \
149
install -d -m 0755 -o root -g root $(BUGZILLA_PERLDIR)/$$this_dir ;\
151
@cd $(BUGZILLA_SRCDIR) && for this_file in `find $(lib_dir) -type f` ; do \
152
install -m 0644 -o root -g root $$this_file $(BUGZILLA_PERLDIR)/`dirname $$this_file` ;\
154
$(INSTALL) -d -m 0755 -o root -g root $(BUGZILLA_DATADIR)
130
cd $(BUGZILLA_SRCDIR) && for this_dir in `find $(lib_dir) -type d` ; do \
131
$(INSTALL) -d -m 0755 -o root -g root $(BUGZILLA_PERLDIR)/$$this_dir ;\
133
cd $(BUGZILLA_SRCDIR) && for this_file in `find $(lib_dir) -type f` ; do \
134
$(INSTALL) -m 0644 -o root -g root $$this_file $(BUGZILLA_PERLDIR)/`dirname $$this_file` ;\
157
138
install_cgi: extractsrc