RT 83251 - moved script
[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.24.1/
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_LOG%%%|${FREESIDE_LOG}|g;\
223           s'%%%FREESIDE_DOCUMENT_ROOT%%%'${FREESIDE_DOCUMENT_ROOT}'g; \
224           s'%%%RT_ENABLED%%%'${RT_ENABLED}'g; \
225           s'%%%RT_PATH%%%'${RT_PATH}'g; \
226           s'%%%MASONDATA%%%'${MASONDATA}'g;\
227           s/%%%SELFSERVICE_USER%%%/${SELFSERVICE_USER}/g;\
228         " blib/lib/FS/*.pm;\
229         perl -p -i -e "\
230           s/%%%SELFSERVICE_USER%%%/${SELFSERVICE_USER}/g;\
231           s/%%%SELFSERVICE_MACHINES%%%/${SELFSERVICE_MACHINES}/g;\
232           s|%%%FREESIDE_EXPORT%%%|${FREESIDE_EXPORT}|g;\
233         " blib/lib/FS/Cron/*.pm;\
234         perl -p -i -e "\
235           s|%%%FREESIDE_CONF%%%|${FREESIDE_CONF}|g;\
236           s|%%%FREESIDE_EXPORT%%%|${FREESIDE_EXPORT}|g;\
237           s|%%%FREESIDE_LOG%%%|${FREESIDE_LOG}|g;\
238         " blib/lib/FS/part_export/*.pm;\
239         perl -p -i -e "\
240           s|%%%FREESIDE_CACHE%%%|${FREESIDE_CACHE}|g;\
241         " blib/lib/FS/cust_main/*.pm blib/lib/FS/cust_pkg/*.pm blib/lib/FS/contact/*.pm;\
242         perl -p -i -e "\
243           s|%%%FREESIDE_LOG%%%|${FREESIDE_LOG}|g;\
244         " blib/lib/FS/Daemon/*.pm;\
245         perl -p -i -e "\
246           s|%%%FREESIDE_CONF%%%|${FREESIDE_CONF}|g;\
247           s|%%%FREESIDE_LOG%%%|${FREESIDE_LOG}|g;\
248           s|%%%FREESIDE_LOCK%%%|${FREESIDE_LOCK}|g;\
249           s|%%%FREESIDE_CACHE%%%|${FREESIDE_CACHE}|g;\
250           s|%%%FREESIDE_EXPORT%%%|${FREESIDE_EXPORT}|g;\
251           s|%%%DIST_CONF%%%|${DIST_CONF}|g;\
252         " blib/script/*
253
254 install-perl-modules: perl-modules install-rt-initialdata
255         [ -L ${PERL_INC_DEV_KLUDGE}/FS ] \
256           && rm ${PERL_INC_DEV_KLUDGE}/FS \
257           && mv ${PERL_INC_DEV_KLUDGE}/FS.old ${PERL_INC_DEV_KLUDGE}/FS \
258           || true
259         cd FS; \
260         make install UNINST=1
261         #install this for freeside-setup
262         install -d $(DIST_CONF)
263         #install conf/[a-z]* $(DEFAULT_CONF)
264         #CVS is not [a-z]
265         install `ls -d conf/[a-z]* | grep -v CVS | grep -v '^conf/registries'` $(DIST_CONF)
266
267 dev-perl-modules: perl-modules
268         [ -d ${PERL_INC_DEV_KLUDGE}/FS -a ! -L ${PERL_INC_DEV_KLUDGE}/FS ] \
269           && mv ${PERL_INC_DEV_KLUDGE}/FS ${PERL_INC_DEV_KLUDGE}/FS.old \
270           || true
271
272         rm -rf ${PERL_INC_DEV_KLUDGE}/FS
273         ln -sf ${FREESIDE_PATH}/FS/blib/lib/FS ${PERL_INC_DEV_KLUDGE}/FS
274
275 install-texmf:  
276         mkdir -p /usr/local/share/texmf/tex/latex
277         install -D -o freeside -m 444 etc/*.sty \
278           /usr/local/share/texmf/tex/latex/
279         texhash /usr/local/share/texmf
280
281 install-init:
282         #[ -e ${INIT_FILE} ] || install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-init ${INIT_FILE}
283         install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-init ${INIT_FILE}
284         perl -p -i -e "\
285           s/%%%QUEUED_USER%%%/${QUEUED_USER}/g;\
286           s/%%%API_USER%%%/${API_USER}/g;\
287           s/%%%SELFSERVICE_USER%%%/${SELFSERVICE_USER}/g;\
288           s/%%%SELFSERVICE_MACHINES%%%/${SELFSERVICE_MACHINES}/g;\
289         " ${INIT_FILE}
290         ${INIT_INSTALL}
291
292 install-apache:
293         [ -e ${APACHE_CONF}/freeside-base.conf ] && rm ${APACHE_CONF}/freeside-base.conf || true
294         [ -d ${APACHE_CONF} ] && \
295           ( install -o root -m 755 htetc/freeside-base${APACHE_VERSION}.conf ${APACHE_CONF} && \
296             ( [ ${RT_ENABLED} -eq 1 ] && install -o root -m 755 htetc/freeside-rt.conf ${APACHE_CONF} || true ) && \
297             ( [ ${TORRUS_ENABLED} -eq 1 ] && install -o root -m 755 htetc/freeside-torrus.conf ${APACHE_CONF} || true ) && \
298             perl -p -i -e "\
299               s'%%%FREESIDE_DOCUMENT_ROOT%%%'${FREESIDE_DOCUMENT_ROOT}'g; \
300               s'%%%FREESIDE_CONF%%%'${FREESIDE_CONF}'g; \
301               s'%%%MASON_HANDLER%%%'${MASON_HANDLER}'g; \
302             " ${APACHE_CONF}/freeside-*.conf \
303           ) || true
304         [ -d ${APACHE_CONF} ] && [ -x /usr/sbin/a2enconf ] && ( /usr/sbin/a2enconf freeside-base${APACHE_VERSION} ) || true
305         [ -d ${APACHE_CONF} ] && [ ${APACHE_VERSION} = '2.4' ] && [ -x /usr/sbin/a2disconf ] && ( /usr/sbin/a2disconf freeside-base2 ) || true
306         [ -d ${APACHE_CONF} ] && [ -x /usr/sbin/a2enconf ] && [ ${RT_ENABLED} -eq 1 ] && ( /usr/sbin/a2enconf freeside-rt ) || true
307         [ -d ${INSSERV_OVERRIDE} ] && [ -x /sbin/insserv ] && ( install -o root -m 755 init.d/insserv-override-apache2 ${INSSERV_OVERRIDE}/apache2 && insserv -d ) || true
308
309 install-selfservice:
310         [ -e ~freeside ] || cp -pr /etc/skel ~freeside && chown -R freeside ~freeside
311         [ -e ~freeside/.ssh/id_rsa.pub ] || su - freeside -c 'ssh-keygen'
312         for MACHINE in ${SELFSERVICE_MACHINES}; do \
313           scp -r fs_selfservice/FS-SelfService ${SELFSERVICE_INSTALL_USER}@$$MACHINE:. ;\
314           ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "cd FS-SelfService; perl Makefile.PL && make" ;\
315           ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "cd FS-SelfService; sudo make install" ;\
316           scp ~freeside/.ssh/id_rsa.pub ${SELFSERVICE_INSTALL_USER}@$$MACHINE:. ;\
317           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" ;\
318            ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "sudo install -o freeside -d /usr/local/freeside" ;\
319         done
320
321 update-selfservice:
322         for MACHINE in ${SELFSERVICE_MACHINES}; do \
323           RSYNC_RSH=ssh rsync -rlptz fs_selfservice/FS-SelfService/ ${SELFSERVICE_INSTALL_USER}@$$MACHINE:FS-SelfService ;\
324           ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "cd FS-SelfService; make clean; perl Makefile.PL && make" ;\
325           ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "cd FS-SelfService; sudo make install" ;\
326         done
327
328 install-chown:
329         chown freeside "${FREESIDE_CACHE}/counters.${DATASOURCE}"
330         chown freeside "${FREESIDE_CACHE}/cache.${DATASOURCE}"
331         chown freeside "${FREESIDE_EXPORT}/export.${DATASOURCE}"
332
333 install-pod2html:
334         echo "${POD2HTML_DIR}"
335         mkdir -p "${POD2HTML_DIR}"
336         perl -IFS -MFS::Misc::Pod2Html -e "FS::Misc::Pod2Html::fs_pod2html_from_src('${POD2HTML_DIR}');"
337         chown freeside:freeside -R "${POD2HTML_DIR}"
338
339 install: install-perl-modules install-docs install-init install-apache install-rt install-torrus install-texmf install-chown install-pod2html
340
341 deploy: install
342         ${HTTPD_RESTART}
343         ${FREESIDE_RESTART}
344
345 dev: dev-perl-modules dev-docs
346
347 create-database:
348         perl -e 'use DBIx::DataSource qw( create_database ); create_database( "${DATASOURCE}", "${DB_USER}", "${DB_PASSWORD}" ) or die $$DBIx::DataSource::errstr;'
349
350 create-config: install-perl-modules
351         [ -e ${FREESIDE_CONF} ] && mv ${FREESIDE_CONF} ${FREESIDE_CONF}.`date +%Y%m%d%H%M%S` || true
352         install -d -o freeside ${FREESIDE_CONF}
353
354         touch ${FREESIDE_CONF}/secrets
355         chown freeside ${FREESIDE_CONF}/secrets
356         chmod 600 ${FREESIDE_CONF}/secrets
357
358         /bin/echo -e "${DATASOURCE}\n${DB_USER}\n${DB_PASSWORD}" >${FREESIDE_CONF}/secrets
359         chmod 600 ${FREESIDE_CONF}/secrets
360         chown freeside ${FREESIDE_CONF}/secrets
361
362         mkdir "${FREESIDE_CACHE}/counters.${DATASOURCE}"
363         chown freeside "${FREESIDE_CACHE}/counters.${DATASOURCE}"
364
365         mkdir "${FREESIDE_CACHE}/cache.${DATASOURCE}"
366         chown freeside "${FREESIDE_CACHE}/cache.${DATASOURCE}"
367
368         mkdir "${FREESIDE_EXPORT}/export.${DATASOURCE}"
369         chown freeside "${FREESIDE_EXPORT}/export.${DATASOURCE}"
370
371         #install this for freeside-setup
372         install -d $(DIST_CONF)
373         #install conf/[a-z]* $(DEFAULT_CONF)
374         #CVS is not [a-z]
375         install `ls -d conf/[a-z]* | grep -v CVS | grep -v '^conf/registries'` $(DIST_CONF)
376
377
378 configure-rt:
379         cd rt; \
380         cp config.layout.in config.layout; \
381         perl -p -i -e "\
382           s'%%%FREESIDE_DOCUMENT_ROOT%%%'${FREESIDE_DOCUMENT_ROOT}'g;\
383           s'%%%MASONDATA%%%'${MASONDATA}'g;\
384         " config.layout; \
385         ./configure --enable-layout=Freeside\
386                     --with-db-type=${DB_TYPE} \
387                     --with-db-dba=${DB_USER} \
388                     --with-db-database=${RT_DB_DATABASE} \
389                     --with-db-rt-user=${DB_USER} \
390                     --with-db-rt-pass="${DB_PASSWORD}" \
391                     --with-web-user=freeside \
392                     --with-web-group=freeside \
393                     --with-rt-group=freeside \
394                     --with-web-handler=modperl2
395
396 create-rt: configure-rt
397         [ -d /opt           ] || mkdir /opt           #doh
398         [ -d /opt/rt3       ] || mkdir /opt/rt3       #
399         [ -d /opt/rt3/share ] || mkdir /opt/rt3/share #
400         cd rt; make install
401         rt/sbin/rt-setup-database --dba '${DB_USER}' \
402                                   --dba-password '${DB_PASSWORD}' \
403                                   --action schema \
404          || true
405         rt/sbin/rt-setup-database --dba-password '${DB_PASSWORD}' \
406                                   --action coredata \
407         && rt/sbin/rt-setup-database --dba-password '${DB_PASSWORD}' \
408                                      --action insert \
409                                      --datafile ${RT_PATH}/etc/initialdata \
410         || true
411
412 install-rt: 
413         if [ ${RT_ENABLED} -eq 1 ]; then ( cd rt; make install ); fi
414         if [ ${RT_ENABLED} -eq 1 ]; then cp -r rt/share/static/images ${FREESIDE_DOCUMENT_ROOT}/rt/NoAuth/ ;fi
415         if [ ${RT_ENABLED} -eq 1 ]; then perl -p -i -e "\
416           s'%%%RT_DOMAIN%%%'${RT_DOMAIN}'g;\
417           s'%%%RT_TIMEZONE%%%'${RT_TIMEZONE}'g;\
418           s'%%%FREESIDE_URL%%%'${FREESIDE_URL}'g;\
419         " ${RT_PATH}/etc/RT_SiteConfig.pm; fi
420         if [ ${RT_ENABLED} -eq 1 ]; then \
421           chown -R freeside:freeside ${RT_PATH}/etc; fi
422
423 install-rt-initialdata:
424         if [ ${RT_ENABLED} -eq 1 ] && [ -d ${RT_PATH} ]; then \
425           chown -R freeside:freeside ${RT_PATH}/etc; \
426           install -D -o freeside -g freeside -m 0440 rt/etc/initialdata \
427           ${RT_PATH}/etc/initialdata; fi
428
429 configure-torrus:
430         cd torrus; \
431         torrus_user=freeside var_user=freeside var_group=freeside ./configure
432
433 install-torrus:
434         if [ ${TORRUS_ENABLED} -eq 1 ]; then ( cd torrus; \
435           make; \
436           make install; \
437           perl -p -i -e "\
438             s'%%%FREESIDE_URL%%%'${FREESIDE_URL}'g;\
439           " /usr/local/etc/torrus/conf/torrus-siteconfig.pl; \
440           torrus clearcache \
441         );fi
442
443 clean:
444         rm -rf masondocs
445         rm -rf httemplate/docs/man
446         rm -rf pod2htmi.tmp
447         rm -rf pod2htmd.tmp
448         -cd FS; \
449         make clean
450         -cd fs_selfservice/FS-SelfService; \
451         make clean
452
453 #these are probably only useful if you're me...
454
455 #release: upload-docs
456 .PHONY: release
457 release:
458         # Update the changelog
459         #./bin/cvs2cl
460         #cvs commit -m "Updated for ${VERSION}" ChangeLog
461
462         # Update the RPM specfile
463         #cvs edit ${RPM_SPECFILE}
464         #perl -p -i -e "s/\d+[^\}]+/${VERSION}/ if /%define\s+version\s+(\d+[^\}]+)\}/;" ${RPM_SPECFILE}
465         #perl -p -i -e "s/\d+[^\}]+/1/ if /%define\s+release\s+(\d+[^\}]+)\}/;" ${RPM_SPECFILE}
466         #cvs commit -m "Updated for ${VERSION}" ${RPM_SPECFILE}
467
468         # Update the Debian changelog
469         #cvs edit debian/changelog
470         #dch -v ${DEBVERSION} -p "New upstream release"
471         #cvs commit -m "Updated for ${VERSION}" debian/changelog
472
473         # Make sure other people's changes are pulled in!
474         git pull
475
476         # Tag the release
477         git tag -f ${TAG}
478
479         #cd /home/ivan
480         git archive --prefix=freeside-${VERSION}/ ${TAG} | gzip -9 >freeside-${VERSION}.tar.gz
481
482         scp freeside-${VERSION}.tar.gz ivan@freeside.biz:/var/www/www.freeside.biz/freeside/
483         mv freeside-${VERSION}.tar.gz ..
484
485         #these things failing should not make release target fail, so: "|| true"
486
487         #kick off vmware update
488         #./BUILD_VMWARE_APPLIANCE ${$TAG} || true
489
490         #kick off deb package update
491
492         #kick off rpm package update too?
493
494         #update web demo?
495
496         #update web demo self-service?
497