RT# 81249 - Fixed error where empty field becomes 0.
[freeside.git] / Makefile
1 #!/usr/bin/make
2
3 #solaris and perhaps other very weirdass /bin/sh
4 #SHELL="/bin/ksh"
5
6 DB_TYPE = Pg
7 #DB_TYPE = mysql
8
9 DB_USER = freeside
10 DB_PASSWORD=
11
12 DATASOURCE = DBI:${DB_TYPE}:dbname=freeside
13
14 #changable now (some things which should go to the others still go to CONF)
15 FREESIDE_CONF = /usr/local/etc/freeside
16 FREESIDE_LOG = /usr/local/etc/freeside
17 FREESIDE_LOCK = /usr/local/etc/freeside
18 FREESIDE_CACHE = /usr/local/etc/freeside
19 FREESIDE_EXPORT = /usr/local/etc/freeside
20
21 MASON_HANDLER = ${FREESIDE_CONF}/handler.pl
22 MASONDATA = ${FREESIDE_CACHE}/masondata
23
24 #where to put the default configuraiton used by freeside-setup to initialize
25 #a new database (not used after that).  primarily of interest to distro
26 #package maintainers
27 DIST_CONF = ${FREESIDE_CONF}/default_conf
28
29 #mod_perl v2 1.999_22 on Apache 2.0 through 2.3 (Debian ancient through 7.x)
30 #APACHE_VERSION=2
31 #Apache 2.4 (Debian 8.x)
32 #APACHE_VERSION=2.4
33 APACHE_VERSION := $(shell /usr/sbin/apache2 -v | grep -q '\/2\.4\.' && echo '2.4' || echo '2')
34
35 #deb (-7 and upgrades)
36 #FREESIDE_DOCUMENT_ROOT = /var/www/freeside
37 #deb (new installs of 8+) (plus needs more work w/new auth)
38 #FREESIDE_DOCUMENT_ROOT = /var/www/html/freeside
39 FREESIDE_DOCUMENT_ROOT := $(shell [ ${APACHE_VERSION} = '2.4' ] && echo '/var/www/html/freeside' || echo '/var/www/freeside')
40
41 #redhat, fedora, mandrake
42 #FREESIDE_DOCUMENT_ROOT = /var/www/html/freeside
43 #freebsd
44 #FREESIDE_DOCUMENT_ROOT = /usr/local/www/data/freeside
45 #openbsd
46 #FREESIDE_DOCUMENT_ROOT = /var/www/htdocs/freeside
47 #suse
48 #FREESIDE_DOCUMENT_ROOT = /srv/www/htdocs/freeside
49 #apache
50 #FREESIDE_DOCUMENT_ROOT = /usr/local/apache/htdocs/freeside
51
52 #deb, redhat, fedora, mandrake, suse, others?
53 INIT_FILE = /etc/init.d/freeside
54 #freebsd
55 #INIT_FILE = /usr/local/etc/rc.d/011.freeside.sh
56
57 #deb
58 INIT_INSTALL = PATH=${PATH}:/sbin /usr/sbin/update-rc.d freeside defaults 23 01
59 #redhat, fedora
60 #INIT_INSTALL = /sbin/chkconfig freeside on
61 #not necessary (freebsd)
62 #INIT_INSTALL = /usr/bin/true
63
64 #deb, suse
65 #HTTPD_RESTART = /etc/init.d/apache restart
66 #deb w/apache2
67 HTTPD_RESTART = /etc/init.d/apache2 restart
68 #redhat, fedora, mandrake
69 #HTTPD_RESTART = /etc/init.d/httpd restart
70 #freebsd
71 #HTTPD_RESTART = /usr/local/etc/rc.d/apache.sh stop || true; sleep 10; /usr/local/etc/rc.d/apache.sh start
72 #openbsd
73 #HTTPD_RESTART = kill -TERM `cat /var/www/logs/httpd.pid`; sleep 10; /usr/sbin/httpd -u -DSSL
74 #apache
75 #HTTPD_RESTART = /usr/local/apache/bin/apachectl stop; sleep 10; /usr/local/apache/bin/apachectl startssl
76
77 #(an include directory, not a file, "Include /etc/apache/conf.d" in httpd.conf)
78 #deb (3.1+), apache2
79 #APACHE_CONF = /etc/apache2/conf.d
80 #debian unstable/8.0+, apache2.4
81 #APACHE_CONF = /etc/apache2/conf-available
82 APACHE_CONF := $(shell [ ${APACHE_VERSION} = '2.4' ] && echo '/etc/apache2/conf-available' || echo '/etc/apache2/conf.d')
83
84 INSSERV_OVERRIDE = /etc/insserv/overrides
85
86 FREESIDE_RESTART = ${INIT_FILE} restart
87
88 #deb, redhat, fedora, mandrake, suse, others?
89 INSTALLGROUP = root
90 #freebsd, openbsd
91 #INSTALLGROUP = wheel
92
93 #edit the stuff below to have the daemons start
94
95 QUEUED_USER=fs_queue
96 API_USER = fs_api
97
98 SELFSERVICE_USER = fs_selfservice
99 #never run on the same machine in production!!!
100 SELFSERVICE_MACHINES = 
101 # SELFSERVICE_MACHINES = www.example.com
102 # SELFSERVICE_MACHINES = web1.example.com web2.example.com
103
104 #user with sudo access on SELFSERVICE_MACHINES for automated self-service
105 #installation.
106 SELFSERVICE_INSTALL_USER = ivan
107 SELFSERVICE_INSTALL_USERADD = /usr/sbin/useradd
108 #SELFSERVICE_INSTALL_USERADD = "/usr/sbin/pw useradd"
109
110 #RT_ENABLED = 0
111 RT_ENABLED = 1
112 RT_DOMAIN = example.com
113 RT_TIMEZONE = US/Pacific
114 #RT_TIMEZONE = US/Eastern
115 FREESIDE_URL = "http://localhost/freeside/"
116
117 #for now, same db as specified in DATASOURCE... eventually, otherwise?
118 RT_DB_DATABASE = freeside
119
120 #TORRUS_ENABLED = 1
121
122 # for auto-version updates, so we can "make release" more things automatically
123 RPM_SPECFILE = rpm/freeside.spec
124
125 #---
126
127 #rt/config.layout.in
128 RT_PATH = /opt/rt3
129
130 #only used for dev kludge now, not a big deal
131 FREESIDE_PATH = `pwd`
132 PERL_INC_DEV_KLUDGE = /usr/local/share/perl/5.24.1/
133
134 VERSION := `grep '^$$VERSION' FS/FS.pm | cut -d\' -f2`
135 TAG := freeside_`grep '^$$VERSION' FS/FS.pm | cut -d\' -f2 | perl -pe 's/\./_/g'`
136
137 #DEBVERSION = `echo ${VERSION} | perl -pe 's/(\d)([a-z])/\1~\2/'`-1
138
139 TEXMFHOME := "\$$TEXMFHOME"
140
141 ver:
142         @echo "${VERSION}"
143
144 tag:
145         @echo "${TAG}"
146
147 help:
148         @echo "supported targets:"
149         @echo "                   create-database create-config"
150         @echo "                   install deploy"
151         @echo "                   configure-rt create-rt"
152         @echo "                   clean help"
153         @echo
154         @echo "                   install-docs install-perl-modules"
155         @echo "                   install-init install-apache"
156         @echo "                   install-rt install-texmf"
157         @echo "                   install-selfservice update-selfservice"
158         @echo
159         @echo "                   dev dev-docs dev-perl-modules"
160         @echo
161         @echo "                   masondocs alldocs docs"
162         @echo "                   wikiman"
163         @echo "                   perl-modules"
164         #@echo
165         #@echo "                   upload-docs release"
166
167
168 masondocs: httemplate/* httemplate/*/* httemplate/*/*/* httemplate/*/*/*/*
169         rm -rf masondocs
170         cp -pr httemplate masondocs
171         touch masondocs
172
173 alldocs: masondocs
174
175 docs:
176         make masondocs
177
178 wikiman:
179         chmod a+rx ./bin/pod2x
180         ./bin/pod2x
181
182 install-docs: docs
183         #ancient attempt to avoid overwriting customer modifications directly to production web files that's overlived its usefulness
184         #[ -e ${FREESIDE_DOCUMENT_ROOT} ] && mv ${FREESIDE_DOCUMENT_ROOT} ${FREESIDE_DOCUMENT_ROOT}.`date +%Y%m%d%H%M%S` || true
185         #cp -r masondocs ${FREESIDE_DOCUMENT_ROOT}
186         [ -h ${FREESIDE_DOCUMENT_ROOT} ] && rm ${FREESIDE_DOCUMENT_ROOT} || true
187         mkdir -p ${FREESIDE_DOCUMENT_ROOT}
188         cp -r masondocs/* masondocs/.htaccess ${FREESIDE_DOCUMENT_ROOT}
189         chown -R freeside:freeside ${FREESIDE_DOCUMENT_ROOT}
190         install -D htetc/handler.pl ${MASON_HANDLER}
191         perl -p -i -e "\
192           s|%%%FREESIDE_EXPORT%%%|${FREESIDE_EXPORT}|g;\
193           s'%%%RT_ENABLED%%%'${RT_ENABLED}'g; \
194         " ${MASON_HANDLER} || true
195         mkdir -p ${FREESIDE_EXPORT}/profile
196         chown freeside ${FREESIDE_EXPORT}/profile
197         rm -rf ${MASONDATA}/*
198         mkdir ${MASONDATA}/cache || true
199         mkdir ${MASONDATA}/obj || true
200         chown -f -R freeside ${MASONDATA} || true
201
202 dev-docs:
203         [ -e ${FREESIDE_DOCUMENT_ROOT} ] && mv ${FREESIDE_DOCUMENT_ROOT} ${FREESIDE_DOCUMENT_ROOT}.`date +%Y%m%d%H%M%S` || true
204         ln -s ${FREESIDE_PATH}/httemplate ${FREESIDE_DOCUMENT_ROOT}
205         cp htetc/handler.pl ${MASON_HANDLER}
206         perl -p -i -e "\
207           s'###use Module::Refresh;###'use Module::Refresh;'; \
208           s'###Module::Refresh->refresh;###'Module::Refresh->refresh;'; \
209           s|%%%FREESIDE_EXPORT%%%|${FREESIDE_EXPORT}|g;\
210           s'%%%RT_ENABLED%%%'${RT_ENABLED}'g; \
211         " ${MASON_HANDLER} || true
212
213 perl-modules:
214         cd FS; \
215         [ -e Makefile ] || perl Makefile.PL; \
216         make; \
217         perl -p -i -e "\
218           s|%%%FREESIDE_CONF%%%|${FREESIDE_CONF}|g;\
219           s|%%%FREESIDE_CACHE%%%|${FREESIDE_CACHE}|g;\
220           s|%%%FREESIDE_LOG%%%|${FREESIDE_LOG}|g;\
221           s'%%%FREESIDE_DOCUMENT_ROOT%%%'${FREESIDE_DOCUMENT_ROOT}'g; \
222           s'%%%RT_ENABLED%%%'${RT_ENABLED}'g; \
223           s'%%%RT_PATH%%%'${RT_PATH}'g; \
224           s'%%%MASONDATA%%%'${MASONDATA}'g;\
225           s/%%%SELFSERVICE_USER%%%/${SELFSERVICE_USER}/g;\
226         " blib/lib/FS/*.pm;\
227         perl -p -i -e "\
228           s/%%%SELFSERVICE_USER%%%/${SELFSERVICE_USER}/g;\
229           s/%%%SELFSERVICE_MACHINES%%%/${SELFSERVICE_MACHINES}/g;\
230           s|%%%FREESIDE_EXPORT%%%|${FREESIDE_EXPORT}|g;\
231         " blib/lib/FS/Cron/*.pm;\
232         perl -p -i -e "\
233           s|%%%FREESIDE_CONF%%%|${FREESIDE_CONF}|g;\
234           s|%%%FREESIDE_EXPORT%%%|${FREESIDE_EXPORT}|g;\
235           s|%%%FREESIDE_LOG%%%|${FREESIDE_LOG}|g;\
236         " blib/lib/FS/part_export/*.pm;\
237         perl -p -i -e "\
238           s|%%%FREESIDE_CACHE%%%|${FREESIDE_CACHE}|g;\
239         " blib/lib/FS/cust_main/*.pm blib/lib/FS/cust_pkg/*.pm blib/lib/FS/contact/*.pm;\
240         perl -p -i -e "\
241           s|%%%FREESIDE_LOG%%%|${FREESIDE_LOG}|g;\
242         " blib/lib/FS/Daemon/*.pm;\
243         perl -p -i -e "\
244           s|%%%FREESIDE_CONF%%%|${FREESIDE_CONF}|g;\
245           s|%%%FREESIDE_LOG%%%|${FREESIDE_LOG}|g;\
246           s|%%%FREESIDE_LOCK%%%|${FREESIDE_LOCK}|g;\
247           s|%%%FREESIDE_CACHE%%%|${FREESIDE_CACHE}|g;\
248           s|%%%FREESIDE_EXPORT%%%|${FREESIDE_EXPORT}|g;\
249           s|%%%DIST_CONF%%%|${DIST_CONF}|g;\
250         " blib/script/*
251
252 install-perl-modules: perl-modules install-rt-initialdata
253         [ -L ${PERL_INC_DEV_KLUDGE}/FS ] \
254           && rm ${PERL_INC_DEV_KLUDGE}/FS \
255           && mv ${PERL_INC_DEV_KLUDGE}/FS.old ${PERL_INC_DEV_KLUDGE}/FS \
256           || true
257         cd FS; \
258         make install UNINST=1
259         #install this for freeside-setup
260         install -d $(DIST_CONF)
261         #install conf/[a-z]* $(DEFAULT_CONF)
262         #CVS is not [a-z]
263         install `ls -d conf/[a-z]* | grep -v CVS | grep -v '^conf/registries'` $(DIST_CONF)
264
265 dev-perl-modules: perl-modules
266         [ -d ${PERL_INC_DEV_KLUDGE}/FS -a ! -L ${PERL_INC_DEV_KLUDGE}/FS ] \
267           && mv ${PERL_INC_DEV_KLUDGE}/FS ${PERL_INC_DEV_KLUDGE}/FS.old \
268           || true
269
270         rm -rf ${PERL_INC_DEV_KLUDGE}/FS
271         ln -sf ${FREESIDE_PATH}/FS/blib/lib/FS ${PERL_INC_DEV_KLUDGE}/FS
272
273 install-texmf:  
274         mkdir -p /usr/local/share/texmf/tex/latex
275         install -D -o freeside -m 444 etc/*.sty \
276           /usr/local/share/texmf/tex/latex/
277         texhash /usr/local/share/texmf
278
279 install-init:
280         #[ -e ${INIT_FILE} ] || install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-init ${INIT_FILE}
281         install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-init ${INIT_FILE}
282         perl -p -i -e "\
283           s/%%%QUEUED_USER%%%/${QUEUED_USER}/g;\
284           s/%%%API_USER%%%/${API_USER}/g;\
285           s/%%%SELFSERVICE_USER%%%/${SELFSERVICE_USER}/g;\
286           s/%%%SELFSERVICE_MACHINES%%%/${SELFSERVICE_MACHINES}/g;\
287         " ${INIT_FILE}
288         ${INIT_INSTALL}
289
290 install-apache:
291         [ -e ${APACHE_CONF}/freeside-base.conf ] && rm ${APACHE_CONF}/freeside-base.conf || true
292         [ -d ${APACHE_CONF} ] && \
293           ( install -o root -m 755 htetc/freeside-base${APACHE_VERSION}.conf ${APACHE_CONF} && \
294             ( [ ${RT_ENABLED} -eq 1 ] && install -o root -m 755 htetc/freeside-rt.conf ${APACHE_CONF} || true ) && \
295             ( [ ${TORRUS_ENABLED} -eq 1 ] && install -o root -m 755 htetc/freeside-torrus.conf ${APACHE_CONF} || true ) && \
296             perl -p -i -e "\
297               s'%%%FREESIDE_DOCUMENT_ROOT%%%'${FREESIDE_DOCUMENT_ROOT}'g; \
298               s'%%%FREESIDE_CONF%%%'${FREESIDE_CONF}'g; \
299               s'%%%MASON_HANDLER%%%'${MASON_HANDLER}'g; \
300             " ${APACHE_CONF}/freeside-*.conf \
301           ) || true
302         [ -d ${APACHE_CONF} ] && [ -x /usr/sbin/a2enconf ] && ( /usr/sbin/a2enconf freeside-base${APACHE_VERSION} ) || true
303         [ -d ${APACHE_CONF} ] && [ ${APACHE_VERSION} = '2.4' ] && [ -x /usr/sbin/a2disconf ] && ( /usr/sbin/a2disconf freeside-base2 ) || true
304         [ -d ${APACHE_CONF} ] && [ -x /usr/sbin/a2enconf ] && [ ${RT_ENABLED} -eq 1 ] && ( /usr/sbin/a2enconf freeside-rt ) || true
305         [ -d ${INSSERV_OVERRIDE} ] && [ -x /sbin/insserv ] && ( install -o root -m 755 init.d/insserv-override-apache2 ${INSSERV_OVERRIDE}/apache2 && insserv -d ) || true
306
307 install-selfservice:
308         [ -e ~freeside ] || cp -pr /etc/skel ~freeside && chown -R freeside ~freeside
309         [ -e ~freeside/.ssh/id_rsa.pub ] || su - freeside -c 'ssh-keygen'
310         for MACHINE in ${SELFSERVICE_MACHINES}; do \
311           scp -r fs_selfservice/FS-SelfService ${SELFSERVICE_INSTALL_USER}@$$MACHINE:. ;\
312           ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "cd FS-SelfService; perl Makefile.PL && make" ;\
313           ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "cd FS-SelfService; sudo make install" ;\
314           scp ~freeside/.ssh/id_rsa.pub ${SELFSERVICE_INSTALL_USER}@$$MACHINE:. ;\
315           ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "sudo ${SELFSERVICE_INSTALL_USERADD} freeside; sudo install -d -o freeside -m 755 ~freeside/.ssh/; sudo install -o freeside -m 600 ./id_rsa.pub ~freeside/.ssh/authorized_keys" ;\
316            ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "sudo install -o freeside -d /usr/local/freeside" ;\
317         done
318
319 update-selfservice:
320         for MACHINE in ${SELFSERVICE_MACHINES}; do \
321           RSYNC_RSH=ssh rsync -rlptz fs_selfservice/FS-SelfService/ ${SELFSERVICE_INSTALL_USER}@$$MACHINE:FS-SelfService ;\
322           ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "cd FS-SelfService; make clean; perl Makefile.PL && make" ;\
323           ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "cd FS-SelfService; sudo make install" ;\
324         done
325
326 install-chown:
327         chown freeside "${FREESIDE_CACHE}/counters.${DATASOURCE}"
328         chown freeside "${FREESIDE_CACHE}/cache.${DATASOURCE}"
329         chown freeside "${FREESIDE_EXPORT}/export.${DATASOURCE}"
330
331 install: install-perl-modules install-docs install-init install-apache install-rt install-torrus install-texmf install-chown
332
333 deploy: install
334         ${HTTPD_RESTART}
335         ${FREESIDE_RESTART}
336
337 dev: dev-perl-modules dev-docs
338
339 create-database:
340         perl -e 'use DBIx::DataSource qw( create_database ); create_database( "${DATASOURCE}", "${DB_USER}", "${DB_PASSWORD}" ) or die $$DBIx::DataSource::errstr;'
341
342 create-config: install-perl-modules
343         [ -e ${FREESIDE_CONF} ] && mv ${FREESIDE_CONF} ${FREESIDE_CONF}.`date +%Y%m%d%H%M%S` || true
344         install -d -o freeside ${FREESIDE_CONF}
345
346         touch ${FREESIDE_CONF}/secrets
347         chown freeside ${FREESIDE_CONF}/secrets
348         chmod 600 ${FREESIDE_CONF}/secrets
349
350         /bin/echo -e "${DATASOURCE}\n${DB_USER}\n${DB_PASSWORD}" >${FREESIDE_CONF}/secrets
351         chmod 600 ${FREESIDE_CONF}/secrets
352         chown freeside ${FREESIDE_CONF}/secrets
353
354         mkdir "${FREESIDE_CACHE}/counters.${DATASOURCE}"
355         chown freeside "${FREESIDE_CACHE}/counters.${DATASOURCE}"
356
357         mkdir "${FREESIDE_CACHE}/cache.${DATASOURCE}"
358         chown freeside "${FREESIDE_CACHE}/cache.${DATASOURCE}"
359
360         mkdir "${FREESIDE_EXPORT}/export.${DATASOURCE}"
361         chown freeside "${FREESIDE_EXPORT}/export.${DATASOURCE}"
362
363         #install this for freeside-setup
364         install -d $(DIST_CONF)
365         #install conf/[a-z]* $(DEFAULT_CONF)
366         #CVS is not [a-z]
367         install `ls -d conf/[a-z]* | grep -v CVS | grep -v '^conf/registries'` $(DIST_CONF)
368
369
370 configure-rt:
371         cd rt; \
372         cp config.layout.in config.layout; \
373         perl -p -i -e "\
374           s'%%%FREESIDE_DOCUMENT_ROOT%%%'${FREESIDE_DOCUMENT_ROOT}'g;\
375           s'%%%MASONDATA%%%'${MASONDATA}'g;\
376         " config.layout; \
377         ./configure --enable-layout=Freeside\
378                     --with-db-type=${DB_TYPE} \
379                     --with-db-dba=${DB_USER} \
380                     --with-db-database=${RT_DB_DATABASE} \
381                     --with-db-rt-user=${DB_USER} \
382                     --with-db-rt-pass="${DB_PASSWORD}" \
383                     --with-web-user=freeside \
384                     --with-web-group=freeside \
385                     --with-rt-group=freeside \
386                     --with-web-handler=modperl2
387
388 create-rt: configure-rt
389         [ -d /opt           ] || mkdir /opt           #doh
390         [ -d /opt/rt3       ] || mkdir /opt/rt3       #
391         [ -d /opt/rt3/share ] || mkdir /opt/rt3/share #
392         cd rt; make install
393         rt/sbin/rt-setup-database --dba '${DB_USER}' \
394                                   --dba-password '${DB_PASSWORD}' \
395                                   --action schema \
396          || true
397         rt/sbin/rt-setup-database --dba-password '${DB_PASSWORD}' \
398                                   --action coredata \
399         && rt/sbin/rt-setup-database --dba-password '${DB_PASSWORD}' \
400                                      --action insert \
401                                      --datafile ${RT_PATH}/etc/initialdata \
402         || true
403
404 install-rt: 
405         if [ ${RT_ENABLED} -eq 1 ]; then ( cd rt; make install ); fi
406         if [ ${RT_ENABLED} -eq 1 ]; then cp -r rt/share/static/images ${FREESIDE_DOCUMENT_ROOT}/rt/NoAuth/ ;fi
407         if [ ${RT_ENABLED} -eq 1 ]; then perl -p -i -e "\
408           s'%%%RT_DOMAIN%%%'${RT_DOMAIN}'g;\
409           s'%%%RT_TIMEZONE%%%'${RT_TIMEZONE}'g;\
410           s'%%%FREESIDE_URL%%%'${FREESIDE_URL}'g;\
411         " ${RT_PATH}/etc/RT_SiteConfig.pm; fi
412         if [ ${RT_ENABLED} -eq 1 ]; then \
413           chown -R freeside:freeside ${RT_PATH}/etc; fi
414
415 install-rt-initialdata:
416         if [ ${RT_ENABLED} -eq 1 ] && [ -d ${RT_PATH} ]; then \
417           chown -R freeside:freeside ${RT_PATH}/etc; \
418           install -D -o freeside -g freeside -m 0440 rt/etc/initialdata \
419           ${RT_PATH}/etc/initialdata; fi
420
421 configure-torrus:
422         cd torrus; \
423         torrus_user=freeside var_user=freeside var_group=freeside ./configure
424
425 install-torrus:
426         if [ ${TORRUS_ENABLED} -eq 1 ]; then ( cd torrus; \
427           make; \
428           make install; \
429           perl -p -i -e "\
430             s'%%%FREESIDE_URL%%%'${FREESIDE_URL}'g;\
431           " /usr/local/etc/torrus/conf/torrus-siteconfig.pl; \
432           torrus clearcache \
433         );fi
434
435 clean:
436         rm -rf masondocs
437         rm -rf httemplate/docs/man
438         rm -rf pod2htmi.tmp
439         rm -rf pod2htmd.tmp
440         -cd FS; \
441         make clean
442         -cd fs_selfservice/FS-SelfService; \
443         make clean
444
445 #these are probably only useful if you're me...
446
447 #release: upload-docs
448 .PHONY: release
449 release:
450         # Update the changelog
451         #./bin/cvs2cl
452         #cvs commit -m "Updated for ${VERSION}" ChangeLog
453
454         # Update the RPM specfile
455         #cvs edit ${RPM_SPECFILE}
456         #perl -p -i -e "s/\d+[^\}]+/${VERSION}/ if /%define\s+version\s+(\d+[^\}]+)\}/;" ${RPM_SPECFILE}
457         #perl -p -i -e "s/\d+[^\}]+/1/ if /%define\s+release\s+(\d+[^\}]+)\}/;" ${RPM_SPECFILE}
458         #cvs commit -m "Updated for ${VERSION}" ${RPM_SPECFILE}
459
460         # Update the Debian changelog
461         #cvs edit debian/changelog
462         #dch -v ${DEBVERSION} -p "New upstream release"
463         #cvs commit -m "Updated for ${VERSION}" debian/changelog
464
465         # Make sure other people's changes are pulled in!
466         git pull
467
468         # Tag the release
469         git tag -f ${TAG}
470
471         #cd /home/ivan
472         git archive --prefix=freeside-${VERSION}/ ${TAG} | gzip -9 >freeside-${VERSION}.tar.gz
473
474         scp freeside-${VERSION}.tar.gz ivan@freeside.biz:/var/www/www.freeside.biz/freeside/
475         mv freeside-${VERSION}.tar.gz ..
476
477         #these things failing should not make release target fail, so: "|| true"
478
479         #kick off vmware update
480         #./BUILD_VMWARE_APPLIANCE ${$TAG} || true
481
482         #kick off deb package update
483
484         #kick off rpm package update too?
485
486         #update web demo?
487
488         #update web demo self-service?
489