RT#42043: Check for cancelled packages with a cancellation date age option [hasnt...
[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.22.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         chown -f -R freeside ${MASONDATA} || true
199
200 dev-docs:
201         [ -e ${FREESIDE_DOCUMENT_ROOT} ] && mv ${FREESIDE_DOCUMENT_ROOT} ${FREESIDE_DOCUMENT_ROOT}.`date +%Y%m%d%H%M%S` || true
202         ln -s ${FREESIDE_PATH}/httemplate ${FREESIDE_DOCUMENT_ROOT}
203         cp htetc/handler.pl ${MASON_HANDLER}
204         perl -p -i -e "\
205           s'###use Module::Refresh;###'use Module::Refresh;'; \
206           s'###Module::Refresh->refresh;###'Module::Refresh->refresh;'; \
207           s|%%%FREESIDE_EXPORT%%%|${FREESIDE_EXPORT}|g;\
208           s'%%%RT_ENABLED%%%'${RT_ENABLED}'g; \
209         " ${MASON_HANDLER} || true
210
211 perl-modules:
212         cd FS; \
213         [ -e Makefile ] || perl Makefile.PL; \
214         make; \
215         perl -p -i -e "\
216           s|%%%FREESIDE_CONF%%%|${FREESIDE_CONF}|g;\
217           s|%%%FREESIDE_CACHE%%%|${FREESIDE_CACHE}|g;\
218           s'%%%FREESIDE_DOCUMENT_ROOT%%%'${FREESIDE_DOCUMENT_ROOT}'g; \
219           s'%%%RT_ENABLED%%%'${RT_ENABLED}'g; \
220           s'%%%RT_PATH%%%'${RT_PATH}'g; \
221           s'%%%MASONDATA%%%'${MASONDATA}'g;\
222           s/%%%SELFSERVICE_USER%%%/${SELFSERVICE_USER}/g;\
223         " blib/lib/FS/*.pm;\
224         perl -p -i -e "\
225           s/%%%SELFSERVICE_USER%%%/${SELFSERVICE_USER}/g;\
226           s/%%%SELFSERVICE_MACHINES%%%/${SELFSERVICE_MACHINES}/g;\
227           s|%%%FREESIDE_EXPORT%%%|${FREESIDE_EXPORT}|g;\
228         " blib/lib/FS/Cron/*.pm;\
229         perl -p -i -e "\
230           s|%%%FREESIDE_CONF%%%|${FREESIDE_CONF}|g;\
231           s|%%%FREESIDE_EXPORT%%%|${FREESIDE_EXPORT}|g;\
232           s|%%%FREESIDE_LOG%%%|${FREESIDE_LOG}|g;\
233         " blib/lib/FS/part_export/*.pm;\
234         perl -p -i -e "\
235           s|%%%FREESIDE_CACHE%%%|${FREESIDE_CACHE}|g;\
236         " blib/lib/FS/cust_main/*.pm blib/lib/FS/cust_pkg/*.pm;\
237         perl -p -i -e "\
238           s|%%%FREESIDE_LOG%%%|${FREESIDE_LOG}|g;\
239         " blib/lib/FS/Daemon/*.pm;\
240         perl -p -i -e "\
241           s|%%%FREESIDE_CONF%%%|${FREESIDE_CONF}|g;\
242           s|%%%FREESIDE_LOG%%%|${FREESIDE_LOG}|g;\
243           s|%%%FREESIDE_LOCK%%%|${FREESIDE_LOCK}|g;\
244           s|%%%FREESIDE_CACHE%%%|${FREESIDE_CACHE}|g;\
245           s|%%%FREESIDE_EXPORT%%%|${FREESIDE_EXPORT}|g;\
246           s|%%%DIST_CONF%%%|${DIST_CONF}|g;\
247         " blib/script/*
248
249 install-perl-modules: perl-modules install-rt-initialdata
250         [ -L ${PERL_INC_DEV_KLUDGE}/FS ] \
251           && rm ${PERL_INC_DEV_KLUDGE}/FS \
252           && mv ${PERL_INC_DEV_KLUDGE}/FS.old ${PERL_INC_DEV_KLUDGE}/FS \
253           || true
254         cd FS; \
255         make install UNINST=1
256         #install this for freeside-setup
257         install -d $(DIST_CONF)
258         #install conf/[a-z]* $(DEFAULT_CONF)
259         #CVS is not [a-z]
260         install `ls -d conf/[a-z]* | grep -v CVS | grep -v '^conf/registries'` $(DIST_CONF)
261
262 dev-perl-modules: perl-modules
263         [ -d ${PERL_INC_DEV_KLUDGE}/FS -a ! -L ${PERL_INC_DEV_KLUDGE}/FS ] \
264           && mv ${PERL_INC_DEV_KLUDGE}/FS ${PERL_INC_DEV_KLUDGE}/FS.old \
265           || true
266
267         rm -rf ${PERL_INC_DEV_KLUDGE}/FS
268         ln -sf ${FREESIDE_PATH}/FS/blib/lib/FS ${PERL_INC_DEV_KLUDGE}/FS
269
270 install-texmf:  
271         install -D -o freeside -m 444 etc/*.sty \
272           /usr/local/share/texmf/tex/latex/
273         texhash /usr/local/share/texmf
274
275 install-init:
276         #[ -e ${INIT_FILE} ] || install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-init ${INIT_FILE}
277         install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-init ${INIT_FILE}
278         perl -p -i -e "\
279           s/%%%QUEUED_USER%%%/${QUEUED_USER}/g;\
280           s/%%%API_USER%%%/${API_USER}/g;\
281           s/%%%SELFSERVICE_USER%%%/${SELFSERVICE_USER}/g;\
282           s/%%%SELFSERVICE_MACHINES%%%/${SELFSERVICE_MACHINES}/g;\
283         " ${INIT_FILE}
284         ${INIT_INSTALL}
285
286 install-apache:
287         [ -e ${APACHE_CONF}/freeside-base.conf ] && rm ${APACHE_CONF}/freeside-base.conf || true
288         [ -d ${APACHE_CONF} ] && \
289           ( install -o root -m 755 htetc/freeside-base${APACHE_VERSION}.conf ${APACHE_CONF} && \
290             ( [ ${RT_ENABLED} -eq 1 ] && install -o root -m 755 htetc/freeside-rt.conf ${APACHE_CONF} || true ) && \
291             ( [ ${TORRUS_ENABLED} -eq 1 ] && install -o root -m 755 htetc/freeside-torrus.conf ${APACHE_CONF} || true ) && \
292             perl -p -i -e "\
293               s'%%%FREESIDE_DOCUMENT_ROOT%%%'${FREESIDE_DOCUMENT_ROOT}'g; \
294               s'%%%FREESIDE_CONF%%%'${FREESIDE_CONF}'g; \
295               s'%%%MASON_HANDLER%%%'${MASON_HANDLER}'g; \
296             " ${APACHE_CONF}/freeside-*.conf \
297           ) || true
298         [ -d ${APACHE_CONF} ] && [ -x /usr/sbin/a2enconf ] && ( /usr/sbin/a2enconf freeside-base${APACHE_VERSION} ) || true
299         [ -d ${APACHE_CONF} ] && [ ${APACHE_VERSION} = '2.4' ] && [ -x /usr/sbin/a2disconf ] && ( /usr/sbin/a2disconf freeside-base2 ) || true
300         [ -d ${APACHE_CONF} ] && [ -x /usr/sbin/a2enconf ] && [ ${RT_ENABLED} -eq 1 ] && ( /usr/sbin/a2enconf freeside-rt ) || true
301         [ -d ${INSSERV_OVERRIDE} ] && [ -x /sbin/insserv ] && ( install -o root -m 755 init.d/insserv-override-apache2 ${INSSERV_OVERRIDE}/apache2 && insserv -d ) || true
302
303 install-selfservice:
304         [ -e ~freeside ] || cp -pr /etc/skel ~freeside && chown -R freeside ~freeside
305         [ -e ~freeside/.ssh/id_rsa.pub ] || su - freeside -c 'ssh-keygen'
306         for MACHINE in ${SELFSERVICE_MACHINES}; do \
307           scp -r fs_selfservice/FS-SelfService ${SELFSERVICE_INSTALL_USER}@$$MACHINE:. ;\
308           ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "cd FS-SelfService; perl Makefile.PL && make" ;\
309           ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "cd FS-SelfService; sudo make install" ;\
310           scp ~freeside/.ssh/id_rsa.pub ${SELFSERVICE_INSTALL_USER}@$$MACHINE:. ;\
311           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" ;\
312            ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "sudo install -o freeside -d /usr/local/freeside" ;\
313         done
314
315 update-selfservice:
316         for MACHINE in ${SELFSERVICE_MACHINES}; do \
317           RSYNC_RSH=ssh rsync -rlptz fs_selfservice/FS-SelfService/ ${SELFSERVICE_INSTALL_USER}@$$MACHINE:FS-SelfService ;\
318           ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "cd FS-SelfService; make clean; perl Makefile.PL && make" ;\
319           ssh ${SELFSERVICE_INSTALL_USER}@$$MACHINE "cd FS-SelfService; sudo make install" ;\
320         done
321
322 install-chown:
323         chown freeside "${FREESIDE_CACHE}/counters.${DATASOURCE}"
324         chown freeside "${FREESIDE_CACHE}/cache.${DATASOURCE}"
325         chown freeside "${FREESIDE_EXPORT}/export.${DATASOURCE}"
326
327 install: install-perl-modules install-docs install-init install-apache install-rt install-torrus install-texmf install-chown
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