4 # Uncomment this to turn on verbose mode.
7 # If set to a true value then MakeMaker's prompt function will
8 # always return the default without waiting for user input.
9 #export PERL_MM_USE_DEFAULT=1
12 #PACKAGE = $(shell dh_listpackages)
14 TMP = $(CURDIR)/debian/$(PACKAGE)
15 #DBC_SCRIPTS = $(TMP)/usr/share/dbconfig-common/scripts/freeside
17 ##this is gotten from dbconfig-common
18 #DB_TYPE = db_type_is_configured_during_pkg_install_by_dbconfig-common_not_at_build_time
20 #no chance, it doesn't get backslash-interpolted now...
21 ##DEBVERSION = `head -1 debian/changelog | cut -d')' -f1 | cut -c11-`
22 #DEBVERSION = 1.7.3~rc2-1
23 #export VERSION = $(DEBVERSION) (Debian)
25 #export FREESIDE_CONF = /etc/freeside
26 #export FREESIDE_LOG = /var/log/freeside
27 #export FREESIDE_LOCK = /var/lock/freeside
28 #export FREESIDE_CACHE = $(TMP)/var/cache/freeside
29 #FREESIDE_CACHE = $(TMP)/var/cache/freeside
32 #export FREESIDE_EXPORT = /var/spool/freeside
34 export FREESIDE_CONF = $(TMP)/usr/local/etc/freeside
35 export FREESIDE_LOG = $(TMP)/usr/local/etc/freeside
36 export FREESIDE_LOCK = $(TMP)/usr/local/etc/freeside
37 export FREESIDE_CACHE = $(TMP)/usr/local/etc/freeside
38 export FREESIDE_EXPORT = $(TMP)/usr/local/etc/freeside
39 expory FREESIDE_SS = $(TMP)/usr/share/docs/freeside
42 #export MASON_HANDLER = /usr/share/freeside/handler.pl
43 export MASON_HANDLER=$(TMP)-webui/usr/local/etc/freeside/handler.pl
45 #export FREESIDE_DOCUMENT_ROOT = /usr/share/freeside/www
46 export FREESIDE_DOCUMENT_ROOT = $(TMP)-webui/var/www/freeside
47 export INIT_FILE = $(TMP).init
48 export INIT_INSTALL = /bin/true
49 export HTTPD_RESTART = /bin/true
50 #export APACHE_CONF = /etc/apache2/conf.d
51 export APACHE_CONF = $(TMP)-webui/etc/freeside/apache2
52 export FREESIDE_RESTART = /bin/true
55 export INSTALLGROUP = adm
57 export SELFSERVICE_MACHINES =
59 #prompt ? XXX these are runtime, not buildtime :/
60 export RT_DOMAIN = freeside.biz
61 export RT_TIMEZONE = US/Eastern
62 export HOSTNAME = localhost
63 export FREESIDE_URL = http://$(HOSTNAME)/freeside/
65 #specific to deb pkg, for purposes of saving off a permanent copy of default
66 #config for postinst and that sort of thing
67 #export DIST_CONF = /usr/share/freeside/default_conf
69 #XXX yuck. proper RT layout is entirely necessary
70 #this seems to infect way to much of RT with the build location, requiring
71 # a kludge to hack it out afterwords. look into using fakeroot (didn't
72 # realize it would need to be explicit argh)
73 # (but leaving it for now, otherwise can't get RT to put files where we need em)
74 export RT_PATH = $(TMP)/opt/rt3
76 # This has to be exported to make some magic below work.
79 configure: configure-stamp
82 # Add here commands to configure the package.
90 # Add commands to compile the package here
92 ( cd FS/ && $(PERL) Makefile.PL INSTALLDIRS=vendor )
94 $(MAKE) -e DESTDIR=${TMP}-lib perl-modules
103 dh_clean build-stamp install-stamp
105 # Add here commands to clean up after the build process.
107 #|| true #XXX freeside clean target fucked
111 install: install-stamp
112 install-stamp: build-stamp
118 # Add here commands to install package into
119 # debian/<package>-whatever.
121 ( cd FS/ && $(MAKE) -e DESTDIR=$(TMP)-lib install )
123 install -d $(FREESIDE_DOCUMENT_ROOT)
124 install -d $(TMP)-webui/usr/local/etc/freeside/
125 install -d $(FREESIDE_CACHE)/masondata #MASONDATA
126 $(MAKE) -e DESTDIR=$(TMP)-webui install-docs
129 # Ugly hack, why is handler.pl not being "handled" by install-docs
130 install -D htetc/handler.pl DESTDIR=$(FREESIDE_CACHE)
132 # Create Apache configurations
133 install -d $(APACHE_CONF)
134 $(MAKE) -e DESTDIR=$(APACHE_CONF) install-apache
136 #Hack the build dir out of apache config
139 s'${TMP}(-webui)?''g;\
140 " $(TMP)-webui/etc/freeside/apache2/*
142 # Install configuration files, hack what to do???
143 $(MAKE) -e DESTDIR=$(TMP) create-config
144 $(MAKE) -e DESTDIR=$(TMP) install-init
146 #hack the build dir out of Freeside too. oh yeah, sucky.
148 s'${TMP}(-webui)?''g;\
149 " ${TMP}-webui/usr/local/etc/freeside/handler.pl
151 #back the build dur out of lib
154 s'${TMP}(-webui)?''g;\
155 " ${TMP}-webui/usr/local/etc/freeside/handler.pl \
156 ${TMP}-lib/usr/share/perl5/FS/*.pm \
157 ${TMP}-lib/usr/share/perl5/FS/*/*.pm
159 #hack the build dir out of Freeside binaries
163 " ${TMP}-lib/usr/bin/* \
168 cp config.layout.in config.layout; \
170 s'%%%FREESIDE_DOCUMENT_ROOT%%%'${FREESIDE_DOCUMENT_ROOT}'g;\
171 s'%%%MASONDATA%%%'${FREESIDE_CACHE}/masondata'g;\
173 ./configure --prefix=${RT_PATH} \
174 --enable-layout=Freeside \
176 --with-db-dba=freeside \
177 --with-db-database=freeside \
178 --with-db-rt-user=freeside \
179 --with-db-rt-pass="" \
180 --with-web-user=freeside \
181 --with-web-group=freeside \
182 --with-rt-group=freeside \
183 --with-web-handler=modperl2 )
186 #$(MAKE) -e create-rt
187 install -d $(RT_PATH)
188 ( cd rt; make install )
190 ##hack the build dir out of RT. yeah, sucky.
193 s'${TMP}(-webui)''g;\
195 " ${TMP}/opt/rt3/etc/*.pm \
196 ${TMP}/opt/rt3/lib/*.pm \
197 ${TMP}/opt/rt3/lib/RT/*.pm \
198 ${TMP}/opt/rt3/etc/upgrade/* \
199 ${TMP}/opt/rt3/sbin/* \
200 ${TMP}/opt/rt3/bin/* \
202 # Default RT Settings
204 s'%%%RT_DOMAIN%%%'${RT_DOMAIN}'g;\
205 s'%%%RT_TIMEZONE%%%'${RT_TIMEZONE}'g;\
206 s'%%%FREESIDE_URL%%%'${FREESIDE_URL}'g;\
207 " ${RT_PATH}/etc/RT_SiteConfig.pm
214 # We have nothing to do here for an architecture-independent package
216 binary-indep: build install
219 dh_installdeb install
220 dh_installdocs #freeside.docs README AGPL
221 dh_installexamples eg/*
224 # dh_installlogrotate
225 dh_installinit --no-start
238 binary: binary-indep binary-arch
239 .PHONY: build clean binary-indep binary-arch binary install