summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FS/FS/Record.pm21
-rw-r--r--FS/FS/contact.pm4
-rw-r--r--FS/FS/cust_main.pm36
-rw-r--r--FS/FS/part_pkg/base_rate.pm97
-rw-r--r--FS/FS/prospect_main.pm6
-rw-r--r--FS/MANIFEST1
-rw-r--r--INSTALL3
-rwxr-xr-xbin/megapop.pl (renamed from etc/megapop.pl)0
-rw-r--r--debian/OLD/config (renamed from debian/config)0
-rw-r--r--debian/OLD/cron.d (renamed from debian/cron.d)0
-rw-r--r--debian/OLD/dbconfig-common.install (renamed from debian/dbconfig-common.install)0
-rw-r--r--debian/OLD/dbconfig-common.upgrade (renamed from debian/dbconfig-common.upgrade)0
-rw-r--r--debian/OLD/freeside.apache-alias.conf (renamed from debian/freeside.apache-alias.conf)0
-rw-r--r--debian/OLD/postinst (renamed from debian/postinst)0
-rw-r--r--debian/OLD/postrm (renamed from debian/postrm)0
-rw-r--r--debian/OLD/prerm (renamed from debian/prerm)0
-rw-r--r--debian/TODO61
-rw-r--r--debian/changelog6
-rw-r--r--debian/compat2
-rw-r--r--debian/control20
-rw-r--r--debian/copyright2
-rw-r--r--debian/freeside.docs1
-rw-r--r--debian/init.d.ex157
-rw-r--r--debian/init.d.lsb.ex281
-rwxr-xr-xdebian/rules174
-rw-r--r--debian/templates0
26 files changed, 218 insertions, 654 deletions
diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm
index 16031e1bc..42af68ca5 100644
--- a/FS/FS/Record.pm
+++ b/FS/FS/Record.pm
@@ -2513,10 +2513,29 @@ sub ut_name {
# warn "ut_name allowed alphanumerics: +(sort grep /\w/, map { chr() } 0..255), "\n";
$self->getfield($field) =~ /^([\w \,\.\-\']+)$/
or return gettext('illegal_name'). " $field: ". $self->getfield($field);
- $self->setfield($field,$1);
+ my $name = $1;
+ $name =~ s/^\s+//;
+ $name =~ s/\s+$//;
+ $name =~ s/\s+/ /g;
+ $self->setfield($field, $name);
'';
}
+=item ut_namen COLUMN
+
+Check/untaint proper names; allows alphanumerics, spaces and the following
+punctuation: , . - '
+
+May not be null.
+
+=cut
+
+sub ut_namen {
+ my( $self, $field ) = @_;
+ return $self->setfield($field, '') if $self->getfield($field) =~ /^$/;
+ $self->ut_name($field);
+}
+
=item ut_zip COLUMN
Check/untaint zip codes.
diff --git a/FS/FS/contact.pm b/FS/FS/contact.pm
index f84af425b..8fcd724a0 100644
--- a/FS/FS/contact.pm
+++ b/FS/FS/contact.pm
@@ -326,8 +326,8 @@ sub check {
|| $self->ut_foreign_keyn('custnum', 'cust_main', 'custnum')
|| $self->ut_foreign_keyn('locationnum', 'cust_location', 'locationnum')
|| $self->ut_foreign_keyn('classnum', 'contact_class', 'classnum')
- || $self->ut_textn('last')
- || $self->ut_textn('first')
+ || $self->ut_namen('last')
+ || $self->ut_namen('first')
|| $self->ut_textn('title')
|| $self->ut_textn('comment')
|| $self->ut_enum('disabled', [ '', 'Y' ])
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index be910c6a9..bcb8fc0ed 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -1792,6 +1792,12 @@ sub check {
|| $self->ut_enum('locale', [ '', FS::Locales->locales ])
;
+ my $company = $self->company;
+ $company =~ s/^\s+//;
+ $company =~ s/\s+$//;
+ $company =~ s/\s+/ /g;
+ $self->company($company);
+
#barf. need message catalogs. i18n. etc.
$error .= "Please select an advertising source."
if $error =~ /^Illegal or empty \(numeric\) refnum: /;
@@ -5080,12 +5086,12 @@ sub process_censustract_update {
}
#starting to take quite a while for big dbs
+# (JRNL: journaled so it only happens once per database)
# - seq scan of h_cust_main (yuck), but not going to index paycvv, so
-# - seq scan of cust_main on signupdate... index signupdate? will that help?
-# - seq scan of cust_main on paydate... index on substrings? maybe set an
-# upgrade journal flag now that we have that, yyyy-m-dd paydates are ancient
-# - seq scan of cust_main on payinfo.. certainly not going toi ndex that...
-# upgrade journal again? this is also an ancient problem
+# JRNL seq scan of cust_main on signupdate... index signupdate? will that help?
+# JRNL seq scan of cust_main on paydate... index on substrings? maybe set an
+# JRNL seq scan of cust_main on payinfo.. certainly not going toi ndex that...
+# JRNL leading/trailing spaces in first, last, company
# - otaker upgrade? journal and call it good? (double check to make sure
# we're not still setting otaker here)
#
@@ -5140,6 +5146,26 @@ sub _upgrade_data { #class method
local($ignore_banned_card) = 1;
local($skip_fuzzyfiles) = 1;
local($import) = 1; #prevent automatic geocoding (need its own variable?)
+
+ unless ( FS::upgrade_journal->is_done('cust_main__trimspaces') ) {
+
+ foreach my $cust_main ( qsearch({
+ 'table' => 'cust_main',
+ 'hashref' => {},
+ 'extra_sql' => 'WHERE '.
+ join(' OR ',
+ map "$_ LIKE ' %' OR $_ LIKE '% ' OR $_ LIKE '% %'",
+ qw( first last company )
+ ),
+ }) ) {
+ my $error = $cust_main->replace;
+ die $error if $error;
+ }
+
+ FS::upgrade_journal->set_done('cust_main__trimspaces');
+
+ }
+
$class->_upgrade_otaker(%opts);
FS::cust_main::Location->_upgrade_data(%opts);
diff --git a/FS/FS/part_pkg/base_rate.pm b/FS/FS/part_pkg/base_rate.pm
deleted file mode 100644
index 43a050610..000000000
--- a/FS/FS/part_pkg/base_rate.pm
+++ /dev/null
@@ -1,97 +0,0 @@
-package FS::part_pkg::base_rate;
-
-use strict;
-use vars qw(@ISA %info);
-#use FS::Record qw(qsearch);
-use FS::part_pkg;
-
-@ISA = qw(FS::part_pkg);
-
-%info = (
- 'name' => 'Base rate (anniversary billing, Times units ordered)',
- # XXX it multiplies recurring fee by cust_pkg option "units", how to
- # express that
- 'shortname' => 'Bulk (manual from "units" option)',
- 'inherit_fields' => [ 'global_Mixin' ],
- 'fields' => {
- 'externalid' => { 'name' => 'Optional External ID',
- 'default' => '',
- },
- },
- 'fieldorder' => [ qw( externalid ) ],
- 'weight' => 52,
-);
-
-sub price_info {
- my $self = shift;
- my $conf = new FS::Conf;
- my $money_char = $conf->config('money_char') || '$';
- my $setup = $self->option('setup_fee') || 0;
- my $recur = $self->option('recur_fee', 1) || 0;
- my $str = '';
- $str = $money_char . $setup . ' one-time' if $setup;
- $str .= ', ' if ($setup && $recur);
- $str .= $money_char . $recur . ' recurring per unit ' if $recur;
- $str;
-}
-
-
-sub calc_setup {
- my($self, $cust_pkg, $sdate, $details ) = @_;
-
- my $i = 0;
- my $count = $self->option( 'additional_count', 'quiet' ) || 0;
- while ($i < $count) {
- push @$details, $self->option( 'additional_info' . $i++ );
- }
-
- $self->option('setup_fee');
-}
-
-sub calc_recur {
- my($self, $cust_pkg) = @_;
- $self->base_recur($cust_pkg);
-}
-
-sub base_recur {
- my($self, $cust_pkg) = @_;
- my $units = $cust_pkg->option('units') ? $cust_pkg->option('units') : 1 ;
- # default to 1 if not found
- sprintf("%.2f",
- ($self->option('recur_fee') * $units )
- );
-}
-
-sub calc_remain {
- my ($self, $cust_pkg, %options) = @_;
- my $time = $options{'time'} || time;
- my $next_bill = $cust_pkg->getfield('bill') || 0;
- return 0 if ! $self->base_recur($cust_pkg)
- || ! $next_bill
- || $next_bill < $time;
-
- my %sec = (
- 'h' => 3600, # 60 * 60
- 'd' => 86400, # 60 * 60 * 24
- 'w' => 604800, # 60 * 60 * 24 * 7
- 'm' => 2629744, # 60 * 60 * 24 * 365.2422 / 12
- );
-
- $self->freq =~ /^(\d+)([hdwm]?)$/
- or die 'unparsable frequency: '. $self->freq;
- my $freq_sec = $1 * $sec{$2||'m'};
- return 0 unless $freq_sec;
-
- sprintf("%.2f", $self->base_recur($cust_pkg) * ( $next_bill - $time ) / $freq_sec );
-
-}
-
-sub is_free_options {
- qw( setup_fee recur_fee );
-}
-
-sub is_prepaid {
- 0; #no, we're postpaid
-}
-
-1;
diff --git a/FS/FS/prospect_main.pm b/FS/FS/prospect_main.pm
index b5d51d333..a04af860d 100644
--- a/FS/FS/prospect_main.pm
+++ b/FS/FS/prospect_main.pm
@@ -208,6 +208,12 @@ sub check {
;
return $error if $error;
+ my $company = $self->company;
+ $company =~ s/^\s+//;
+ $company =~ s/\s+$//;
+ $company =~ s/\s+/ /g;
+ $self->company($company);
+
$self->SUPER::check;
}
diff --git a/FS/MANIFEST b/FS/MANIFEST
index 3ef42b1f2..4d6bb120d 100644
--- a/FS/MANIFEST
+++ b/FS/MANIFEST
@@ -149,7 +149,6 @@ FS/part_pkg/sqlradacct_hour.pm
FS/part_pkg/subscription.pm
FS/part_pkg/voip_sqlradacct.pm
FS/part_pkg/voip_cdr.pm
-FS/part_pkg/base_rate.pm
FS/part_pkg/base_delayed.pm
FS/part_pop_local.pm
FS/part_referral.pm
diff --git a/INSTALL b/INSTALL
deleted file mode 100644
index 4ea167893..000000000
--- a/INSTALL
+++ /dev/null
@@ -1,3 +0,0 @@
-See:
-
-http://www.freeside.biz/mediawiki/index.php/Freeside:1.7:Documentation#Installation_and_upgrades
diff --git a/etc/megapop.pl b/bin/megapop.pl
index e2930fb55..e2930fb55 100755
--- a/etc/megapop.pl
+++ b/bin/megapop.pl
diff --git a/debian/config b/debian/OLD/config
index 4ffa236f3..4ffa236f3 100644
--- a/debian/config
+++ b/debian/OLD/config
diff --git a/debian/cron.d b/debian/OLD/cron.d
index f86db1b76..f86db1b76 100644
--- a/debian/cron.d
+++ b/debian/OLD/cron.d
diff --git a/debian/dbconfig-common.install b/debian/OLD/dbconfig-common.install
index 31b5d1439..31b5d1439 100644
--- a/debian/dbconfig-common.install
+++ b/debian/OLD/dbconfig-common.install
diff --git a/debian/dbconfig-common.upgrade b/debian/OLD/dbconfig-common.upgrade
index cae9adbfe..cae9adbfe 100644
--- a/debian/dbconfig-common.upgrade
+++ b/debian/OLD/dbconfig-common.upgrade
diff --git a/debian/freeside.apache-alias.conf b/debian/OLD/freeside.apache-alias.conf
index fdd4340e9..fdd4340e9 100644
--- a/debian/freeside.apache-alias.conf
+++ b/debian/OLD/freeside.apache-alias.conf
diff --git a/debian/postinst b/debian/OLD/postinst
index 5d045508a..5d045508a 100644
--- a/debian/postinst
+++ b/debian/OLD/postinst
diff --git a/debian/postrm b/debian/OLD/postrm
index c00844543..c00844543 100644
--- a/debian/postrm
+++ b/debian/OLD/postrm
diff --git a/debian/prerm b/debian/OLD/prerm
index 4c1748936..4c1748936 100644
--- a/debian/prerm
+++ b/debian/OLD/prerm
diff --git a/debian/TODO b/debian/TODO
index 15fed6914..d2928e629 100644
--- a/debian/TODO
+++ b/debian/TODO
@@ -1,20 +1,57 @@
+--- High ---
+
+web stuff going to /var/www/freeside/masondocs oops
+
+apache configs going to
+./etc/freeside/apache2/freeside-rt.conf
+?? oh there's links etc. check
+
+file
+./and..?/
+in freeside-lib? oops wtf
+also
+./default_conf/
+and
+/#for/
+
+test actually installing!
+- FS files
+- /var/www/ files
+- what else should package install?
+ - init script
+ - apache config
+ - /usr/local/etc/freeside/default_conf for new installs
+
+test RT was missing, but we're cheating more now by ignoring a huge remap
+to deb policy-comliant paths. get it working
+
+init.d/freeside-init
+htetc/handler.pl
+
+#copied to /usr/local/etc/freeside by make install-docs
+htetc/htpasswd.logout
+
+init.d/insserv-override-apache2
+
+etc/longtable.sty
+
+--- Medium ---
test) freeside-webui /etc/apache/conf.d/freeside.conf
AuthUserFile is wrong (just fucked)
-test its working) somes sort of Alias /freeside /usr/share/freeside/www is needed
-
test in postinst) freeside package var/cache/freeside/cache.<datasrc is missing>
-test RT is missing. doh. get it working.
-
-test actually installing!
+--- Low ---
---- rc2... right? ---
+bin/* ? Anything here needed in a live customer install should be moved to FS/bin so it installs as part of the packaging.
freeside-selfservice-client doesn't install at all
-start freeside-sqlradius-radacctd from /etc/default/freeside too
+--- Debian ---
+
+redo & test its working) somes sort of Alias /freeside /usr/share/freeside/www is needed
+/var/www/freeside -> /usr/lib/freeside and Alias in apache
Added to README.Debian... do something else?
Ensure apache is set to run as User freeside.
@@ -24,15 +61,9 @@ init.d.ex or init.d.lsb.ex
finish
-RT install locations (or for now: disable for unstable, enable for
-experiemental. but try to get it finished off in time for lenny)
+RT install locations (? maybe our RT libraries shouldn't conflict with
+upstream ones?)
debian/copyright administrivia
-AGPL drama
-
upload
-
-AGPL drama or silent waiting for days or years
-
-profit! err
diff --git a/debian/changelog b/debian/changelog
index d070c46c9..0aadb48ff 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+freeside (3.0~20130205-1) UNRELEASED; urgency=low
+
+ * Another stab at packaging.
+
+ -- Ivan Kohler <ivan-debian@420.am> Tue, 05 Feb 2013 17:00:36 -0800
+
freeside (2.1.1-1) UNRELEASED; urgency=low
* New upstream release
diff --git a/debian/compat b/debian/compat
index 7ed6ff82d..45a4fb75d 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-5
+8
diff --git a/debian/control b/debian/control
index 4ea4815d2..157240659 100644
--- a/debian/control
+++ b/debian/control
@@ -5,20 +5,22 @@ Maintainer: Ivan Kohler <ivan-debian@420.am>
Build-Depends: debhelper (>= 5), perl (>= 5.8)
Standards-Version: 3.7.2
Homepage: http://www.freeside.biz/freeside
-Vcs-Browser: http://www.freeside.biz/cgi-bin/viewvc.cgi/freeside/
-Vcs-Cvs: :pserver:anonymous:anonymous@cvs.420.am:/home/cvs/cvsroot freeside
+#Vcs-Browser: http://www.freeside.biz/cgi-bin/viewvc.cgi/freeside/
+#Vcs-Cvs: :pserver:anonymous:anonymous@cvs.420.am:/home/cvs/cvsroot freeside
Package: freeside
Architecture: all
-Pre-Depends: freeside-lib, dbconfig-common
+Pre-Depends: freeside-lib
+# dbconfig-common
Depends: ${perl:Depends}, ${shlibs:Depends}, ${misc:Depends}, freeside-webui, debconf, adduser (>= 3.11)
Recommends: cron
Suggests: gnupg
Description: Billing and trouble ticketing for service providers
- Freeside is a web-based billing and trouble ticketing application. It
- includes features for ISPs, hosting providers, and VoIP providers, but can
- also be used as a generic customer database, invoicing and membership
- application. If you like buzzwords, call it an "BSS/OSS and CRM solution".
+ Freeside is a web-based billing, trouble ticketing and network monitoring
+ application. It includes features for ISPs and WISPs, hosting providers and
+ VoIP providers, but can also be used as a generic customer database, invoicing
+ and membership application. If you like buzzwords, you can call it a
+ "BSS/OSS and CRM solution".
Package: freeside-lib
Architecture: all
@@ -28,7 +30,9 @@ Suggests: libbusiness-onlinepayment-perl
Description: Libraries for Freeside billing and trouble ticketing
Freeside is a web-based billing and trouble ticketing application.
.
- This package provides the perl libraries and command line utilities.
+ This package provides the perl libraries and command line utilities. Also,
+ the init script and daemons used by the system are currently provided by this
+ package.
#Package: freeside-bin
#Architecture: all
diff --git a/debian/copyright b/debian/copyright
index c409cb99e..e521a701a 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -9,7 +9,7 @@ Upstream Author(s):
Copyright:
-Copyright (C) 2005-2008 Freeside Internet Services, Inc.
+Copyright (C) 2005-2013 Freeside Internet Services, Inc.
Copyright (C) 2000-2005 Ivan Kohler
Copyright (C) 1999 Silicon Interactive Software Design
All rights reserved
diff --git a/debian/freeside.docs b/debian/freeside.docs
index e845566c0..f4a511b64 100644
--- a/debian/freeside.docs
+++ b/debian/freeside.docs
@@ -1 +1,2 @@
README
+AGPL
diff --git a/debian/init.d.ex b/debian/init.d.ex
deleted file mode 100644
index 2480f515d..000000000
--- a/debian/init.d.ex
+++ /dev/null
@@ -1,157 +0,0 @@
-#! /bin/sh
-#
-# skeleton example file to build /etc/init.d/ scripts.
-# This file should be used to construct scripts for /etc/init.d.
-#
-# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
-# Modified for Debian
-# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
-# Further changes by Javier Fernandez-Sanguino <jfs@debian.org>
-#
-# Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl
-#
-
-PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
-DAEMON=/usr/sbin/freeside
-NAME=freeside
-DESC=freeside
-
-test -x $DAEMON || exit 0
-
-LOGDIR=/var/log/freeside
-PIDFILE=/var/run/$NAME.pid
-DODTIME=1 # Time to wait for the server to die, in seconds
- # If this value is set too low you might not
- # let some servers to die gracefully and
- # 'restart' will not work
-
-# Include freeside defaults if available
-if [ -f /etc/default/freeside ] ; then
- . /etc/default/freeside
-fi
-
-set -e
-
-running_pid()
-{
- # Check if a given process pid's cmdline matches a given name
- pid=$1
- name=$2
- [ -z "$pid" ] && return 1
- [ ! -d /proc/$pid ] && return 1
- cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1`
- # Is this the expected child?
- [ "$cmd" != "$name" ] && return 1
- return 0
-}
-
-running()
-{
-# Check if the process is running looking at /proc
-# (works for all users)
-
- # No pidfile, probably no daemon present
- [ ! -f "$PIDFILE" ] && return 1
- # Obtain the pid and check it against the binary name
- pid=`cat $PIDFILE`
- running_pid $pid $NAME || return 1
- return 0
-}
-
-force_stop() {
-# Forcefully kill the process
- [ ! -f "$PIDFILE" ] && return
- if running ; then
- kill -15 $pid
- # Is it really dead?
- [ -n "$DODTIME" ] && sleep "$DODTIME"s
- if running ; then
- kill -9 $pid
- [ -n "$DODTIME" ] && sleep "$DODTIME"s
- if running ; then
- echo "Cannot kill $LABEL (pid=$pid)!"
- exit 1
- fi
- fi
- fi
- rm -f $PIDFILE
- return 0
-}
-
-case "$1" in
- start)
- echo -n "Starting $DESC: "
- start-stop-daemon --start --quiet --pidfile $PIDFILE \
- --exec $DAEMON -- $DAEMON_OPTS
- if running then
- echo "$NAME."
- else
- echo " ERROR."
- fi
- ;;
- stop)
- echo -n "Stopping $DESC: "
- start-stop-daemon --stop --quiet --pidfile $PIDFILE \
- --exec $DAEMON
- echo "$NAME."
- ;;
- force-stop)
- echo -n "Forcefully stopping $DESC: "
- force_stop
- if ! running then
- echo "$NAME."
- else
- echo " ERROR."
- fi
- ;;
- #reload)
- #
- # If the daemon can reload its config files on the fly
- # for example by sending it SIGHUP, do it here.
- #
- # If the daemon responds to changes in its config file
- # directly anyway, make this a do-nothing entry.
- #
- # echo "Reloading $DESC configuration files."
- # start-stop-daemon --stop --signal 1 --quiet --pidfile \
- # /var/run/$NAME.pid --exec $DAEMON
- #;;
- force-reload)
- #
- # If the "reload" option is implemented, move the "force-reload"
- # option to the "reload" entry above. If not, "force-reload" is
- # just the same as "restart" except that it does nothing if the
- # daemon isn't already running.
- # check wether $DAEMON is running. If so, restart
- start-stop-daemon --stop --test --quiet --pidfile \
- /var/run/$NAME.pid --exec $DAEMON \
- && $0 restart \
- || exit 0
- ;;
- restart)
- echo -n "Restarting $DESC: "
- start-stop-daemon --stop --quiet --pidfile \
- /var/run/$NAME.pid --exec $DAEMON
- [ -n "$DODTIME" ] && sleep $DODTIME
- start-stop-daemon --start --quiet --pidfile \
- /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
- echo "$NAME."
- ;;
- status)
- echo -n "$LABEL is "
- if running ; then
- echo "running"
- else
- echo " not running."
- exit 1
- fi
- ;;
- *)
- N=/etc/init.d/$NAME
- # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
- echo "Usage: $N {start|stop|restart|force-reload|status|force-stop}" >&2
- exit 1
- ;;
-esac
-
-exit 0
diff --git a/debian/init.d.lsb.ex b/debian/init.d.lsb.ex
deleted file mode 100644
index 12231294e..000000000
--- a/debian/init.d.lsb.ex
+++ /dev/null
@@ -1,281 +0,0 @@
-#!/bin/sh
-#
-# Example init.d script with LSB support.
-#
-# Please read this init.d carefully and modify the sections to
-# adjust it to the program you want to run.
-#
-# Copyright (c) 2007 Javier Fernandez-Sanguino <jfs@debian.org>
-#
-# This is free software; you may redistribute it and/or modify
-# it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2,
-# or (at your option) any later version.
-#
-# This is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License with
-# the Debian operating system, in /usr/share/common-licenses/GPL; if
-# not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA 02111-1307 USA
-#
-### BEGIN INIT INFO
-# Provides: freeside
-# Required-Start: $network $local_fs
-# Required-Stop:
-# Should-Start: $named
-# Should-Stop:
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Short-Description: <Enter a short description of the sortware>
-# Description: <Enter a long description of the software>
-# <...>
-# <...>
-### END INIT INFO
-
-PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
-
-DAEMON=/usr/sbin/freeside # Introduce the server's location here
-NAME=#PACKAGE # Introduce the short server's name here
-DESC=#PACKAGE # Introduce a short description here
-LOGDIR=/var/log/freeside # Log directory to use
-
-PIDFILE=/var/run/$NAME.pid
-
-test -x $DAEMON || exit 0
-test -x $DAEMON_WRAPPER || exit 0
-
-. /lib/lsb/init-functions
-
-# Default options, these can be overriden by the information
-# at /etc/default/$NAME
-DAEMON_OPTS="" # Additional options given to the server
-
-DODTIME=10 # Time to wait for the server to die, in seconds
- # If this value is set too low you might not
- # let some servers to die gracefully and
- # 'restart' will not work
-
-LOGFILE=$LOGDIR/$NAME.log # Server logfile
-#DAEMONUSER=freeside # Users to run the daemons as. If this value
- # is set start-stop-daemon will chuid the server
-
-# Include defaults if available
-if [ -f /etc/default/$NAME ] ; then
- . /etc/default/$NAME
-fi
-
-# Use this if you want the user to explicitly set 'RUN' in
-# /etc/default/
-#if [ "x$RUN" != "xyes" ] ; then
-# log_failure_msg "$NAME disabled, please adjust the configuration to your needs "
-# log_failure_msg "and then set RUN to 'yes' in /etc/default/$NAME to enable it."
-# exit 1
-#fi
-
-# Check that the user exists (if we set a user)
-# Does the user exist?
-if [ -n "$DAEMONUSER" ] ; then
- if getent passwd | grep -q "^$DAEMONUSER:"; then
- # Obtain the uid and gid
- DAEMONUID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $3}'`
- DAEMONGID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $4}'`
- else
- log_failure_msg "The user $DAEMONUSER, required to run $NAME does not exist."
- exit 1
- fi
-fi
-
-
-set -e
-
-running_pid() {
-# Check if a given process pid's cmdline matches a given name
- pid=$1
- name=$2
- [ -z "$pid" ] && return 1
- [ ! -d /proc/$pid ] && return 1
- cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1`
- # Is this the expected server
- [ "$cmd" != "$name" ] && return 1
- return 0
-}
-
-running() {
-# Check if the process is running looking at /proc
-# (works for all users)
-
- # No pidfile, probably no daemon present
- [ ! -f "$PIDFILE" ] && return 1
- pid=`cat $PIDFILE`
- running_pid $pid $DAEMON_WRAPPER || return 1
- return 0
-}
-
-start_server() {
-# Start the process using the wrapper
- if [ -z "$DAEMONUSER" ] ; then
- start-stop-daemon --start --quiet --pidfile $PIDFILE \
- --exec $DAEMON -- $DAEMON_OPTS
- errcode=$?
- else
-# if we are using a daemonuser then change the user id
- start-stop-daemon --start --quiet --pidfile $PIDFILE \
- --chuid $DAEMONUSER \
- --exec $DAEMON -- $DAEMON_OPTS
- errcode=$?
- fi
- return $errcode
-}
-
-stop_server() {
-# Stop the process using the wrapper
- if [ -z "$DAEMONUSER" ] ; then
- start-stop-daemon --stop --quiet --pidfile $PIDFILE \
- --exec $DAEMON
- errcode=$
- else
-# if we are using a daemonuser then look for process that match
- start-stop-daemon --stop --quiet --pidfile $PIDFILE \
- --user $DAEMONUSER \
- --exec $DAEMON
- errcode=$
- fi
-
- return $errcode
-}
-
-reload_server() {
- [ ! -f "$PIDFILE" ] && return 1
- pid=`cat $PIDFILE` # This is the daemon's pid
- # Send a SIGHUP
- kill -1 $pid
- return $?
-}
-
-force_stop() {
-# Force the process to die killing it manually
- [ ! -e "$PIDFILE" ] && return
- if running ; then
- kill -15 $pid
- # Is it really dead?
- sleep "$DIETIME"s
- if running ; then
- kill -9 $pid
- sleep "$DIETIME"s
- if running ; then
- echo "Cannot kill $NAME (pid=$pid)!"
- exit 1
- fi
- fi
- fi
- rm -f $PIDFILE
-}
-
-
-case "$1" in
- start)
- log_daemon_msg "Starting $DESC " "$NAME"
- # Check if it's running first
- if running ; then
- log_progress_msg "apparently already running"
- log_end_msg 0
- exit 0
- fi
- if start_server && running ; then
- # It's ok, the server started and is running
- log_end_msg 0
- else
- # Either we could not start it or it is not running
- # after we did
- # NOTE: Some servers might die some time after they start,
- # this code does not try to detect this and might give
- # a false positive (use 'status' for that)
- log_end_msg 1
- fi
- ;;
- stop)
- log_daemon_msg "Stopping $DESC" "$NAME"
- if running ; then
- # Only stop the server if we see it running
- stop_server
- log_end_msg $?
- else
- # If it's not running don't do anything
- log_progress_msg "apparently not running"
- log_end_msg 0
- exit 0
- fi
- ;;
- force-stop)
- # First try to stop gracefully the program
- $0 stop
- if running; then
- # If it's still running try to kill it more forcefully
- log_daemon_msg "Stopping (force) $DESC" "$NAME"
- force_stop
- log_end_msg $?
- fi
- ;;
- restart|force-reload)
- log_daemon_msg "Restarting $DESC" "$NAME"
- stop_server
- # Wait some sensible amount, some server need this
- [ -n "$DIETIME" ] && sleep $DIETIME
- start_server
- running
- log_end_msg $?
- ;;
- status)
-
- log_daemon_msg "Checking status of $DESC" "$NAME"
- if running ; then
- log_progress_msg "running"
- log_end_msg 0
- else
- log_progress_msg "apparently not running"
- log_end_msg 1
- exit 1
- fi
- ;;
- # Use this if the daemon cannot reload
- reload)
- log_warning_msg "Reloading $NAME daemon: not implemented, as the daemon"
- log_warning_msg "cannot re-read the config file (use restart)."
- ;;
- # And this if it cann
- #reload)
- #
- # If the daemon can reload its config files on the fly
- # for example by sending it SIGHUP, do it here.
- #
- # If the daemon responds to changes in its config file
- # directly anyway, make this a do-nothing entry.
- #
- # log_daemon_msg "Reloading $DESC configuration files" "$NAME"
- # if running ; then
- # reload_server
- # if ! running ; then
- # Process died after we tried to reload
- # log_progress_msg "died on reload"
- # log_end_msg 1
- # exit 1
- # fi
- # else
- # log_progress_msg "server is not running"
- # log_end_msg 1
- # exit 1
- # fi
- #;;
-
- *)
- N=/etc/init.d/$NAME
- echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2
- exit 1
- ;;
-esac
-
-exit 0
diff --git a/debian/rules b/debian/rules
index d37dfd1c5..a8835e5fe 100755
--- a/debian/rules
+++ b/debian/rules
@@ -12,30 +12,37 @@ PERL ?= /usr/bin/perl
#PACKAGE = $(shell dh_listpackages)
PACKAGE = freeside
TMP = $(CURDIR)/debian/$(PACKAGE)
-DBC_SCRIPTS = $(TMP)/usr/share/dbconfig-common/scripts/freeside
+#DBC_SCRIPTS = $(TMP)/usr/share/dbconfig-common/scripts/freeside
-#this is gotten from dbconfig-common
-DB_TYPE = db_type_is_configured_during_pkg_install_by_dbconfig-common_not_at_build_time
+##this is gotten from dbconfig-common
+#DB_TYPE = db_type_is_configured_during_pkg_install_by_dbconfig-common_not_at_build_time
#no chance, it doesn't get backslash-interpolted now...
-#DEBVERSION = `head -1 debian/changelog | cut -d')' -f1 | cut -c11-`
-DEBVERSION = 1.7.3~rc2-1
-export VERSION = $(DEBVERSION) (Debian)
+##DEBVERSION = `head -1 debian/changelog | cut -d')' -f1 | cut -c11-`
+#DEBVERSION = 1.7.3~rc2-1
+#export VERSION = $(DEBVERSION) (Debian)
-export FREESIDE_CONF = /etc/freeside
-export FREESIDE_LOG = /var/log/freeside
-export FREESIDE_LOCK = /var/lock/freeside
-export FREESIDE_CACHE = $(TMP)/var/cache/freeside
-FREESIDE_CACHE = $(TMP)/var/cache/freeside
+#export FREESIDE_CONF = /etc/freeside
+#export FREESIDE_LOG = /var/log/freeside
+#export FREESIDE_LOCK = /var/lock/freeside
+#export FREESIDE_CACHE = $(TMP)/var/cache/freeside
+#FREESIDE_CACHE = $(TMP)/var/cache/freeside
#XXX huh?
-export FREESIDE_EXPORT = /var/spool/freeside
+#export FREESIDE_EXPORT = /var/spool/freeside
+
+export FREESIDE_CONF = $(TMP)/usr/local/etc/freeside
+export FREESIDE_LOG = $(TMP)/usr/local/etc/freeside
+export FREESIDE_LOCK = $(TMP)/usr/local/etc/freeside
+export FREESIDE_CACHE = $(TMP)/usr/local/etc/freeside
+export FREESIDE_EXPORT = $(TMP)/usr/local/etc/freeside
#XXX own subdir?
-export MASON_HANDLER = $(TMP)-webui/usr/share/freeside/handler.pl
+#export MASON_HANDLER = $(TMP)-webui/usr/share/freeside/handler.pl
+export MASON_HANDLER=$(TMP)-webui/usr/local/etc/freeside/handler.pl
-export APACHE_VERSION = 2
-export FREESIDE_DOCUMENT_ROOT = $(TMP)-webui/usr/share/freeside/www
+#export FREESIDE_DOCUMENT_ROOT = $(TMP)-webui/usr/share/freeside/www
+export FREESIDE_DOCUMENT_ROOT = $(TMP)-webui/var/www/freeside
export INIT_FILE = $(TMP).init
export INIT_INSTALL = /bin/true
export HTTPD_RESTART = /bin/true
@@ -49,22 +56,22 @@ export INSTALLGROUP = adm
export SELFSERVICE_MACHINES =
#prompt ? XXX these are runtime, not buildtime :/
-export RT_DOMAIN = `dnsdomainname`
-export RT_TIMEZONE = `cat /etc/timezone`
+#export RT_DOMAIN = `dnsdomainname`
+#export RT_TIMEZONE = `cat /etc/timezone`
-export HOSTNAME = `hostname -f`
-export FREESIDE_URL = http://$(HOSTNAME)/freeside/
+#export HOSTNAME = `hostname -f`
+#export FREESIDE_URL = http://$(HOSTNAME)/freeside/
#specific to deb pkg, for purposes of saving off a permanent copy of default
#config for postinst and that sort of thing
-export DIST_CONF = $(TMP)/usr/share/freeside/default_conf
+#export DIST_CONF = $(TMP)/usr/share/freeside/default_conf
#XXX yuck. proper RT layout is entirely necessary
#this seems to infect way to much of RT with the build location, requiring
# a kludge to hack it out afterwords. look into using fakeroot (didn't
# realize it would need to be explicit argh)
# (but leaving it for now, otherwise can't get RT to put files where we need em)
-export RT_PATH = $(TMP)/var/opt/freeside/rt
+#export RT_PATH = $(TMP)/var/opt/freeside/rt
# This has to be exported to make some magic below work.
export DH_OPTIONS
@@ -114,14 +121,14 @@ install-stamp: build-stamp
#false laziness w/install-perl-modules now
#install this for postinst later (no create-config)
- install -d $(DIST_CONF)
+ ##install -d $(DIST_CONF)
#install conf/[a-z]* $(DEFAULT_CONF)
#CVS is not [a-z]
- install `ls -d conf/[a-z]* | grep -v CVS` $(DIST_CONF)
+ ##install `ls -d conf/[a-z]* | grep -v CVS` $(DIST_CONF)
install -d $(FREESIDE_DOCUMENT_ROOT)
install -d $(FREESIDE_CACHE)/masondata #MASONDATA
- $(MAKE) -e install-docs
+ $(MAKE) -e DESTDIR=$(TMP)-webui install-docs
#hack the build dir out of Freeside too. oh yeah, sucky.
perl -p -i -e "\
@@ -131,71 +138,75 @@ install-stamp: build-stamp
${TMP}/usr/share/perl5/FS/*/* \
${TMP}/usr/bin/*
- rm -r $(FREESIDE_DOCUMENT_ROOT).*
+ #rm -r $(FREESIDE_DOCUMENT_ROOT).*
install -d $(APACHE_CONF)
- install debian/freeside.apache-alias.conf $(APACHE_CONF)/freeside-alias.conf
- FREESIDE_DOCUMENT_ROOT=/usr/share/freeside/www MASON_HANDLER=/usr/share/freeside/handler.pl FREESIDE_CONF=/etc/freeside $(MAKE) -e install-apache
+ #install debian/freeside.apache-alias.conf $(APACHE_CONF)/freeside-alias.conf
+ #FREESIDE_DOCUMENT_ROOT=/usr/share/freeside/www MASON_HANDLER=/usr/share/freeside/handler.pl FREESIDE_CONF=/etc/freeside $(MAKE) -e install-apache
+ $(MAKE) -e install-apache
$(MAKE) -e install-init
#RT
#(configure-rt)
-
- # XXX need to adjust db-type, db-database, db-rt-user, db-rt-pass
- # based on info from dbc
- ( cd rt; \
- cp config.layout.in config.layout; \
- perl -p -i -e "\
- s'%%%FREESIDE_DOCUMENT_ROOT%%%'${FREESIDE_DOCUMENT_ROOT}'g;\
- s'%%%MASONDATA%%%'${FREESIDE_CACHE}/masondata'g;\
- " config.layout; \
- ./configure --prefix=${RT_PATH} \
- --enable-layout=Freeside \
- --with-db-type=Pg \
- --with-db-dba=freeside \
- --with-db-database=_DBC_DBNAME_ \
- --with-db-rt-user=_DBC_DBUSER_ \
- --with-db-rt-pass=_DBC_DBPASS_ \
- --with-web-user=freeside \
- --with-web-group=freeside \
- --with-rt-group=freeside \
- )
-
- #(create-rt)
- install -d $(RT_PATH)
- ( cd rt; make install )
- #hack the build dir out of RT. yeah, sucky.
- perl -p -i -e "\
- s'${TMP}''g;\
- " ${RT_PATH}/etc/RT_Config.pm \
- ${RT_PATH}/lib/RT.pm \
- ${RT_PATH}/bin/mason_handler.fcgi \
- ${RT_PATH}/bin/mason_handler.scgi \
- ${RT_PATH}/bin/standalone_httpd \
- ${RT_PATH}/bin/webmux.pl \
- ${RT_PATH}/bin/rt-crontool \
- ${RT_PATH}/sbin/rt-dump-database \
- ${RT_PATH}/sbin/rt-setup-database
-
- #hack @INC dir out of RT (well, handler.pl) too.
- perl -p -i -e "\
- s'/opt/rt3/'/var/opt/freeside/rt/'g;\
- " ${TMP}-webui/usr/share/freeside/handler.pl
-
- mv ${RT_PATH}/etc/RT_Config.pm ${RT_PATH}/etc/RT_Config.pm.dbc
-
- perl -p -i -e "\
- s'%%%RT_DOMAIN%%%'${RT_DOMAIN}'g;\
- s'%%%RT_TIMEZONE%%%'${RT_TIMEZONE}'g;\
- s'%%%FREESIDE_URL%%%'${FREESIDE_URL}'g;\
- " ${RT_PATH}/etc/RT_SiteConfig.pm
-
- install -D debian/dbconfig-common.install $(DBC_SCRIPTS)/install/pgsql
- install -D debian/dbconfig-common.install $(DBC_SCRIPTS)/install/mysql
+ $(MAKE) -e configure-rt
+
+ ## XXX need to adjust db-type, db-database, db-rt-user, db-rt-pass
+ ## based on info from dbc
+ #( cd rt; \
+ # cp config.layout.in config.layout; \
+ # perl -p -i -e "\
+ # s'%%%FREESIDE_DOCUMENT_ROOT%%%'${FREESIDE_DOCUMENT_ROOT}'g;\
+ # s'%%%MASONDATA%%%'${FREESIDE_CACHE}/masondata'g;\
+ # " config.layout; \
+ # ./configure --prefix=${RT_PATH} \
+ # --enable-layout=Freeside \
+ # --with-db-type=Pg \
+ # --with-db-dba=freeside \
+ # --with-db-database=_DBC_DBNAME_ \
+ # --with-db-rt-user=_DBC_DBUSER_ \
+ # --with-db-rt-pass=_DBC_DBPASS_ \
+ # --with-web-user=freeside \
+ # --with-web-group=freeside \
+ # --with-rt-group=freeside \
+ #)
+
+ ##(create-rt)
+ #$(MAKE) -e create-rt
+
+ #install -d $(RT_PATH)
+ #( cd rt; make install )
+ ##hack the build dir out of RT. yeah, sucky.
+ #perl -p -i -e "\
+ # s'${TMP}''g;\
+ #" ${RT_PATH}/etc/RT_Config.pm \
+ # ${RT_PATH}/lib/RT.pm \
+ # ${RT_PATH}/bin/mason_handler.fcgi \
+ # ${RT_PATH}/bin/mason_handler.scgi \
+ # ${RT_PATH}/bin/standalone_httpd \
+ # ${RT_PATH}/bin/webmux.pl \
+ # ${RT_PATH}/bin/rt-crontool \
+ # ${RT_PATH}/sbin/rt-dump-database \
+ # ${RT_PATH}/sbin/rt-setup-database
+ #
+ ##hack @INC dir out of RT (well, handler.pl) too.
+ #perl -p -i -e "\
+ # s'/opt/rt3/'/var/opt/freeside/rt/'g;\
+ #" ${TMP}-webui/usr/share/freeside/handler.pl
+
+ #mv ${RT_PATH}/etc/RT_Config.pm ${RT_PATH}/etc/RT_Config.pm.dbc
+
+ #perl -p -i -e "\
+ # s'%%%RT_DOMAIN%%%'${RT_DOMAIN}'g;\
+ # s'%%%RT_TIMEZONE%%%'${RT_TIMEZONE}'g;\
+ # s'%%%FREESIDE_URL%%%'${FREESIDE_URL}'g;\
+ #" ${RT_PATH}/etc/RT_SiteConfig.pm
+
+ #install -D debian/dbconfig-common.install $(DBC_SCRIPTS)/install/pgsql
+ #install -D debian/dbconfig-common.install $(DBC_SCRIPTS)/install/mysql
- install -D debian/dbconfig-common.upgrade $(DBC_SCRIPTS)/upgrade/pgsql/$(DEBVERSION)
- install -D debian/dbconfig-common.upgrade $(DBC_SCRIPTS)/upgrade/mysql/$(DEBVERSION)
+ #install -D debian/dbconfig-common.upgrade $(DBC_SCRIPTS)/upgrade/pgsql/$(DEBVERSION)
+ #install -D debian/dbconfig-common.upgrade $(DBC_SCRIPTS)/upgrade/mysql/$(DEBVERSION)
dh_install
@@ -207,7 +218,6 @@ binary-arch:
binary-indep: build install
dh_testdir
dh_testroot
- dh_installchangelogs ChangeLog
dh_installdocs #freeside.docs README AGPL
dh_installexamples eg/*
# dh_installmenu
diff --git a/debian/templates b/debian/templates
deleted file mode 100644
index e69de29bb..000000000
--- a/debian/templates
+++ /dev/null