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 $(TMP)/usr/local/etc/freeside/
126 install -d $(FREESIDE_CACHE)/masondata #MASONDATA
128 # Install configuration files, hack what to do???
129 $(MAKE) -e DESTDIR=$(TMP) create-config
132 $(MAKE) -e DESTDIR=$(TMP)-webui install-docs
134 # Create Apache configurations
135 install -d $(APACHE_CONF)
136 $(MAKE) -e DESTDIR=$(APACHE_CONF) install-apache
138 #Hack the build dir out of apache config
141 s'${TMP}(-webui)?''g;\
142 " $(TMP)-webui/etc/freeside/apache2/*
145 $(MAKE) -e DESTDIR=$(TMP) install-init
147 #hack the build dir out of Freeside too. oh yeah, sucky.
149 s'${TMP}(-webui)?''g;\
150 " ${TMP}/usr/local/etc/freeside/handler.pl \
151 ${TMP}/usr/share/perl5/FS/* \
152 ${TMP}/usr/share/perl5/FS/*/* \
155 #hack the build dur out of lib
158 s'${TMP}(-webui)?''g;\
159 " ${TMP}/usr/local/etc/freeside/handler.pl \
160 ${TMP}-lib/usr/share/perl5/FS/*.pm \
161 ${TMP}-lib/usr/share/perl5/FS/*/*.pm
163 #hack the build dir out of Freeside binaries
167 " ${TMP}-lib/usr/bin/* \
172 cp config.layout.in config.layout; \
174 s'%%%FREESIDE_DOCUMENT_ROOT%%%'${FREESIDE_DOCUMENT_ROOT}'g;\
175 s'%%%MASONDATA%%%'${FREESIDE_CACHE}/masondata'g;\
177 ./configure --prefix=${RT_PATH} \
178 --enable-layout=Freeside \
180 --with-db-dba=freeside \
181 --with-db-database=freeside \
182 --with-db-rt-user=freeside \
183 --with-db-rt-pass="" \
184 --with-web-user=freeside \
185 --with-web-group=freeside \
186 --with-rt-group=freeside \
187 --with-web-handler=modperl2 )
190 #$(MAKE) -e create-rt
191 install -d $(RT_PATH)
192 ( cd rt; make install )
194 ##hack the build dir out of RT. yeah, sucky.
197 s'${TMP}(-webui)''g;\
199 " ${TMP}/opt/rt3/etc/*.pm \
200 ${TMP}/opt/rt3/lib/*.pm \
201 ${TMP}/opt/rt3/lib/RT/*.pm \
202 ${TMP}/opt/rt3/etc/upgrade/* \
203 ${TMP}/opt/rt3/sbin/* \
204 ${TMP}/opt/rt3/bin/* \
206 # Default RT Settings
208 s'%%%RT_DOMAIN%%%'${RT_DOMAIN}'g;\
209 s'%%%RT_TIMEZONE%%%'${RT_TIMEZONE}'g;\
210 s'%%%FREESIDE_URL%%%'${FREESIDE_URL}'g;\
211 " ${RT_PATH}/etc/RT_SiteConfig.pm
218 # We have nothing to do here for an architecture-independent package
220 binary-indep: build install
223 dh_installdeb install
224 dh_installdocs #freeside.docs README AGPL
225 dh_installexamples eg/*
228 # dh_installlogrotate
229 dh_installinit --no-start
242 binary: binary-indep binary-arch
243 .PHONY: build clean binary-indep binary-arch binary install