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