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