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