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