#DBC_SCRIPTS = $(TMP)/usr/share/dbconfig-common/scripts/freeside
##this is gotten from dbconfig-common
-#DB_TYPE = db_type_is_configured_during_pkg_install_by_dbconfig-common_not_at_build_time
+DB_TYPE = Pg
+
+#Data source
+DATASOURCE = DBI:${DB_TYPE}:dbname=freeside
#no chance, it doesn't get backslash-interpolted now...
##DEBVERSION = `head -1 debian/changelog | cut -d')' -f1 | cut -c11-`
export FREESIDE_LOCK = $(TMP)/usr/local/etc/freeside
export FREESIDE_CACHE = $(TMP)/usr/local/etc/freeside
export FREESIDE_EXPORT = $(TMP)/usr/local/etc/freeside
-expory FREESIDE_SS = $(TMP)/usr/share/docs/freeside
+export FREESIDE_SS = $(TMP)/usr/share/docs/freeside
+export DIST_CONF = ${FREESIDE_CONF}/default_conf
#XXX own subdir?
#export MASON_HANDLER = /usr/share/freeside/handler.pl
dh_testdir
# Add commands to compile the package here
- ( cd FS/ && $(PERL) Makefile.PL INSTALLDIRS=vendor )
-
- $(MAKE) -e DESTDIR=${TMP}-lib perl-modules
+ ( cd FS/ && $(PERL) Makefile.PL INSTALLDIRS=vendor && $(MAKE) )
+ $(MAKE) perl-modules
+ #install this for freeside-setup
+ install -d $(DIST_CONF)
+ install `ls -d conf/[a-z]* | grep -v CVS | grep -v '^conf/registries'` $(DIST_CONF)
#TEST#
# Add here commands to install package into
# debian/<package>-whatever.
- ( cd FS/ && $(MAKE) -e DESTDIR=$(TMP)-lib install )
-
install -d $(FREESIDE_DOCUMENT_ROOT)
install -d $(TMP)-webui/usr/local/etc/freeside/
+ install -d $(TMP)/usr/local/etc/freeside/
install -d $(FREESIDE_CACHE)/masondata #MASONDATA
- $(MAKE) -e DESTDIR=$(TMP)-webui install-docs
+# install -d $(TMP)-lib/usr/bin
+
+ ( cd FS/ && $(MAKE) -e DESTDIR=${TMP}-lib install)
+
+ # Install configuration files
+ install -d -o freeside ${FREESIDE_CONF}
+
+ touch ${FREESIDE_CONF}/secrets
+ chown freeside ${FREESIDE_CONF}/secrets
+ chmod 600 ${FREESIDE_CONF}/secrets
+ /bin/echo -e "${DATASOURCE}\n${DB_USER}\n${DB_PASSWORD}" >${FREESIDE_CONF}/secrets
+ chmod 600 ${FREESIDE_CONF}/secrets
+ chown freeside ${FREESIDE_CONF}/secrets
- # Ugly hack, why is handler.pl not being "handled" by install-docs
- install -D htetc/handler.pl DESTDIR=$(FREESIDE_CACHE)
+ mkdir "${FREESIDE_CACHE}/counters.${DATASOURCE}"
+ chown freeside "${FREESIDE_CACHE}/counters.${DATASOURCE}"
+
+ mkdir "${FREESIDE_CACHE}/cache.${DATASOURCE}"
+ chown freeside "${FREESIDE_CACHE}/cache.${DATASOURCE}"
+
+ mkdir "${FREESIDE_EXPORT}/export.${DATASOURCE}"
+ chown freeside "${FREESIDE_EXPORT}/export.${DATASOURCE}"
+
+ #install this for freeside-setup
+ install -d $(DIST_CONF)
+ #install conf/[a-z]* $(DEFAULT_CONF)
+ #CVS is not [a-z]
+ install `ls -d conf/[a-z]* | grep -v CVS | grep -v '^conf/registries'` $(DIST_CONF)
+
+ # Install interfaces
+ $(MAKE) -e DESTDIR=$(TMP)-webui install-docs
# Create Apache configurations
install -d $(APACHE_CONF)
s'${TMP}(-webui)?''g;\
" $(TMP)-webui/etc/freeside/apache2/*
- # Install configuration files, hack what to do???
- $(MAKE) -e DESTDIR=$(TMP) create-config
+ # Install init
$(MAKE) -e DESTDIR=$(TMP) install-init
#hack the build dir out of Freeside too. oh yeah, sucky.
perl -p -i -e "\
s'${TMP}(-webui)?''g;\
- " ${TMP}-webui/usr/share/freeside/handler.pl \
+ " ${TMP}/usr/local/etc/freeside/handler.pl \
${TMP}/usr/share/perl5/FS/* \
${TMP}/usr/share/perl5/FS/*/* \
${TMP}/usr/bin/*
- #back the build dur out of lib
+ #hack the build dur out of lib
perl -p -i -e "\
s'${TMP}-lib?''g;\
s'${TMP}(-webui)?''g;\
- " ${TMP}-webui/usr/local/etc/freeside/handler.pl \
+ " ${TMP}/usr/local/etc/freeside/handler.pl \
${TMP}-lib/usr/share/perl5/FS/*.pm \
${TMP}-lib/usr/share/perl5/FS/*/*.pm
perl -p -i -e "\
s'${TMP}?''g;\
" ${TMP}-lib/usr/bin/* \
+ ${TMP}/usr/local/etc/freeside/handler.pl
#RT Config
--with-web-handler=modperl2 )
##(create-rt)
- #$(MAKE) -e create-rt
+ #$(MAKE) -e DESTDIR=${TMP}-lib create-rt
install -d $(RT_PATH)
- ( cd rt; make install )
+ install -d $(RT_PATH)/share
+
+ ( cd rt; $(MAKE) install )
##hack the build dir out of RT. yeah, sucky.
dh_install
- touch $@
+ #touch $@
binary-arch:
# We have nothing to do here for an architecture-independent package
dh_link
dh_compress
dh_fixperms
- dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb