checkpoint deb packaging wip
authorIvan Kohler <ivan@freeside.biz>
Fri, 8 Feb 2013 05:11:22 +0000 (21:11 -0800)
committerIvan Kohler <ivan@freeside.biz>
Fri, 8 Feb 2013 05:11:22 +0000 (21:11 -0800)
29 files changed:
INSTALL [deleted file]
bin/megapop.pl [new file with mode: 0755]
debian/OLD/config [new file with mode: 0644]
debian/OLD/cron.d [new file with mode: 0644]
debian/OLD/dbconfig-common.install [new file with mode: 0644]
debian/OLD/dbconfig-common.upgrade [new file with mode: 0644]
debian/OLD/freeside.apache-alias.conf [new file with mode: 0644]
debian/OLD/postinst [new file with mode: 0644]
debian/OLD/postrm [new file with mode: 0644]
debian/OLD/prerm [new file with mode: 0644]
debian/TODO
debian/changelog
debian/compat
debian/config [deleted file]
debian/control
debian/copyright
debian/cron.d [deleted file]
debian/dbconfig-common.install [deleted file]
debian/dbconfig-common.upgrade [deleted file]
debian/freeside.apache-alias.conf [deleted file]
debian/freeside.docs
debian/init.d.ex [deleted file]
debian/init.d.lsb.ex [deleted file]
debian/postinst [deleted file]
debian/postrm [deleted file]
debian/prerm [deleted file]
debian/rules
debian/templates [deleted file]
etc/megapop.pl [deleted file]

diff --git a/INSTALL b/INSTALL
deleted file mode 100644 (file)
index 4ea1678..0000000
--- 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/bin/megapop.pl b/bin/megapop.pl
new file mode 100755 (executable)
index 0000000..e2930fb
--- /dev/null
@@ -0,0 +1,114 @@
+#!/usr/bin/perl -Tw
+#
+# this will break when megapop changes the URL or format of their listing page.
+# that's stupid.  perhaps they can provide a machine-readable listing?
+
+use strict;
+use LWP::UserAgent;
+use FS::UID qw(adminsuidsetup);
+use FS::svc_acct_pop;
+
+my $url = "http://www.megapop.com/location.htm";
+
+my $user = shift or die &usage;
+adminsuidsetup($user);
+
+my %state2usps = &state2usps;
+$state2usps{'WASHINGTON STATE'} = 'WA'; #megapop's on crack
+$state2usps{'CANADA'} = 'CANADA'; #freeside's on crack
+
+my $ua = new LWP::UserAgent;
+my $request = new HTTP::Request('GET', $url);
+my $response = $ua->request($request);
+die $response->error_as_HTML unless $response->is_success;
+my $line;
+my $usps = '';
+foreach $line ( split("\n", $response->content) ) {
+  if ( $line =~ /\W(\w[\w\s]*\w)\s+LOCATIONS/i ) {
+    $usps = $state2usps{uc($1)}
+      or warn "warning: unknown state $1\n";
+  } elsif ( $line =~ /(\d{3})\-(\d{3})\-(\d{4})\s+(\w[\w\s]*\w)/ ) {
+    print "$1 $2 $3 $4 $usps\n";
+    my $svc_acct_pop = new FS::svc_acct_pop ( {
+      'city' => $4,
+      'state' => $usps,
+      'ac' => $1,
+      'exch' => $2,
+    } );
+    my $error = $svc_acct_pop->insert;
+    die $error if $error;
+  }
+}
+
+sub usage {
+  die "Usage:\n  $0 user\n";
+}
+
+sub state2usps{ (
+  'ALABAMA' => 'AL',
+  'ALASKA' => 'AK',
+  'AMERICAN SAMOA' => 'AS',
+  'ARIZONA' => 'AZ',
+  'ARKANSAS' => 'AR',
+  'CALIFORNIA' => 'CA',
+  'COLORADO' => 'CO',
+  'CONNECTICUT' => 'CT',
+  'DELAWARE' => 'DE',
+  'DISTRICT OF COLUMBIA' => 'DC',
+  'FEDERATED STATES OF MICRONESIA' => 'FM',
+  'FLORIDA' => 'FL',
+  'GEORGIA' => 'GA',
+  'GUAM' => 'GU',
+  'HAWAII' => 'HI',
+  'IDAHO' => 'ID',
+  'ILLINOIS' => 'IL',
+  'INDIANA' => 'IN',
+  'IOWA' => 'IA',
+  'KANSAS' => 'KS',
+  'KENTUCKY' => 'KY',
+  'LOUISIANA' => 'LA',
+  'MAINE' => 'ME',
+  'MARSHALL ISLANDS' => 'MH',
+  'MARYLAND' => 'MD',
+  'MASSACHUSETTS' => 'MA',
+  'MICHIGAN' => 'MI',
+  'MINNESOTA' => 'MN',
+  'MISSISSIPPI' => 'MS',
+  'MISSOURI' => 'MO',
+  'MONTANA' => 'MT',
+  'NEBRASKA' => 'NE',
+  'NEVADA' => 'NV',
+  'NEW HAMPSHIRE' => 'NH',
+  'NEW JERSEY' => 'NJ',
+  'NEW MEXICO' => 'NM',
+  'NEW YORK' => 'NY',
+  'NORTH CAROLINA' => 'NC',
+  'NORTH DAKOTA' => 'ND',
+  'NORTHERN MARIANA ISLANDS' => 'MP',
+  'OHIO' => 'OH',
+  'OKLAHOMA' => 'OK',
+  'OREGON' => 'OR',
+  'PALAU' => 'PW',
+  'PENNSYLVANIA' => 'PA',
+  'PUERTO RICO' => 'PR',
+  'RHODE ISLAND' => 'RI',
+  'SOUTH CAROLINA' => 'SC',
+  'SOUTH DAKOTA' => 'SD',
+  'TENNESSEE' => 'TN',
+  'TEXAS' => 'TX',
+  'UTAH' => 'UT',
+  'VERMONT' => 'VT',
+  'VIRGIN ISLANDS' => 'VI',
+  'VIRGINIA' => 'VA',
+  'WASHINGTON' => 'WA',
+  'WEST VIRGINIA' => 'WV',
+  'WISCONSIN' => 'WI',
+  'WYOMING' => 'WY',
+  'ARMED FORCES AFRICA' => 'AE',
+  'ARMED FORCES AMERICAS' => 'AA',
+  'ARMED FORCES CANADA' => 'AE',
+  'ARMED FORCES EUROPE' => 'AE',
+  'ARMED FORCES MIDDLE EAST' => 'AE',
+  'ARMED FORCES PACIFIC' => 'AP',
+) }
+
diff --git a/debian/OLD/config b/debian/OLD/config
new file mode 100644 (file)
index 0000000..4ffa236
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+# config script for freeside
+
+set -e
+
+# source debconf stuff
+. /usr/share/debconf/confmodule
+
+# source dbconfig-common shell library, and call the hook function
+if [ -f /usr/share/dbconfig-common/dpkg/config ]; then
+   # we support mysql and pgsql
+   dbc_dbtypes="pgsql, mysql"
+
+   # source dbconfig-common stuff
+   . /usr/share/dbconfig-common/dpkg/config 
+   dbc_go freeside $@
+fi
+
+# ... rest of your code ...
diff --git a/debian/OLD/cron.d b/debian/OLD/cron.d
new file mode 100644 (file)
index 0000000..f86db1b
--- /dev/null
@@ -0,0 +1,4 @@
+#
+# Regular cron jobs for the freeside package
+#
+0 0    * * *   freeside        /usr/bin/freeside-daily fs_daily
diff --git a/debian/OLD/dbconfig-common.install b/debian/OLD/dbconfig-common.install
new file mode 100644 (file)
index 0000000..31b5d14
--- /dev/null
@@ -0,0 +1,90 @@
+#!/bin/sh
+
+. /etc/dbconfig-common/freeside.conf
+
+DB_USER=$dbc_dbuser
+DB_PASSWORD=$dbc_dbpass
+
+# -- can't find a better place to hook this in.  dammit.
+
+[ "$dbc_dbtype" = "pgsql" ] && DB_TYPE=Pg
+[ "$dbc_dbtype" = "mysql" ] && DB_TYPE=mysql
+#XXX ask dbc about a remote database etc.
+DATASOURCE=DBI:${DB_TYPE}:dbname=${dbc_dbname}
+    
+#debian/rules
+FREESIDE_CONF=/etc/freeside
+FREESIDE_CACHE=/var/cache/freeside
+#XXX huh?
+FREESIDE_EXPORT=/var/spool/freeside
+DEFAULT_CONF=/usr/share/freeside/default_conf
+    
+#XXX this rather seriously needs proper debian-style config file handling.
+    
+#shamelessly lifted from Makefile create-config target
+[ -e ${FREESIDE_CONF} ] || install -d -o freeside ${FREESIDE_CONF}
+    
+touch ${FREESIDE_CONF}/secrets
+chown freeside ${FREESIDE_CONF}/secrets
+chmod 600 ${FREESIDE_CONF}/secrets
+    
+[ -s ${FREESIDE_CONF}/secrets ] || echo -e "${DATASOURCE}\n${DB_USER}\n${DB_PASSWORD}" >${FREESIDE_CONF}/secrets
+chmod 600 ${FREESIDE_CONF}/secrets
+chown freeside ${FREESIDE_CONF}/secrets
+    
+#XXX yuck!  this too!
+[ -e /var/opt/freeside/rt/etc/RT_Config.pm.dbc ] || cp /var/opt/freeside/rt/etc/RT_Config.pm.dbc.generic /var/opt/freeside/rt/etc/RT_Config.pm.dbc
+perl -pi.generic -e "s/^\\s*Set\\s*\\(\s*\\\$DatabaseType.*\$/Set(\\\$DatabaseType, '$DB_TYPE');/" /var/opt/freeside/rt/etc/RT_Config.pm.dbc
+mv /var/opt/freeside/rt/etc/RT_Config.pm.dbc /var/opt/freeside/rt/etc/RT_Config.pm
+perl -pi -e "\
+  s'_DBC_DBUSER_'${dbc_dbuser}'g;\
+  s'_DBC_DBPASS_'${dbc_dbpass}'g;\
+  s'_DBC_DBNAME_'${dbc_dbname}'g;\
+" /var/opt/freeside/rt/etc/RT_Config.pm
+#dunno how to hook this in where i need it...
+#dbc_generate_include="template:/var/opt/freeside/rt/etc/RT_Config.pm"
+#dbc_generate_include_args="-o template_infile=/var/opt/freeside/rt/etc/RT_Config.pm.dbc"
+           
+install -o freeside -d "${FREESIDE_CACHE}/counters.${DATASOURCE}"
+install -o freeside -d "${FREESIDE_CACHE}/cache.${DATASOURCE}"
+install -o freeside -d "${FREESIDE_EXPORT}/export.${DATASOURCE}"
+           
+if [ ! -d "${FREESIDE_CONF}/conf.${DATASOURCE}" ] ; then #don't clobber conf
+install -o freeside -d "${FREESIDE_CONF}/conf.${DATASOURCE}"
+#cp conf/[a-z]* "${FREESIDE_CONF}/conf.${DATASOURCE}"
+cp -i `ls -d ${DEFAULT_CONF}/[a-z]* | grep -v CVS` "${FREESIDE_CONF}/conf.${DATASOURCE}" #-i just in case
+chown -R freeside "${FREESIDE_CONF}/conf.${DATASOURCE}"
+fi
+       
+# -- back to your regularly schedule program... go ahead, create the db
+
+DOMAIN=`dnsdomainname`
+if [ "$DOMAIN" = "localdomain" ]; then #freeside needs a valid domain
+  DOMAIN='example.com'
+fi
+
+# XXX this should probably be handled by the _install_...
+# dpkg-statoverride or something
+chown freeside /etc/freeside
+
+su freeside -c "/usr/bin/freeside-setup -d $DOMAIN"
+su freeside -c '/usr/bin/freeside-adduser -g 1 fs_queue'
+su freeside -c '/usr/bin/freeside-adduser -g 1 fs_daily'
+su freeside -c '/usr/bin/freeside-adduser -g 1 fs_selfservice'
+su freeside -c '/usr/bin/freeside-adduser -g 1 fs_upgrade'
+
+#RT paths are bunk for deb proper
+
+chown freeside /var/opt/freeside/rt/etc/RT_Config.pm
+
+su freeside -c "/var/opt/freeside/rt/sbin/rt-setup-database --dba '$DB_USER' --dba-password '$DB_PASSWORD' --action schema"
+
+su freeside -c '/var/opt/freeside/rt/sbin/rt-setup-database --action insert_initial'
+
+su freeside -c '/var/opt/freeside/rt/sbin/rt-setup-database --action insert --datafile /var/opt/freeside/rt/etc/initialdata'
+
+#XXX this totally doesn't belong here, but what the hey
+chown -R freeside /var/cache/freeside/masondata
+
+exit 0
diff --git a/debian/OLD/dbconfig-common.upgrade b/debian/OLD/dbconfig-common.upgrade
new file mode 100644 (file)
index 0000000..cae9adb
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+su freeside -c '/usr/bin/freeside-upgrade fs_upgrade'
+#RT upgrade
diff --git a/debian/OLD/freeside.apache-alias.conf b/debian/OLD/freeside.apache-alias.conf
new file mode 100644 (file)
index 0000000..fdd4340
--- /dev/null
@@ -0,0 +1 @@
+Alias /freeside/ /usr/share/freeside/www/
diff --git a/debian/OLD/postinst b/debian/OLD/postinst
new file mode 100644 (file)
index 0000000..5d04550
--- /dev/null
@@ -0,0 +1,54 @@
+#!/bin/sh
+# postinst script for freeside
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# source debconf stuff
+. /usr/share/debconf/confmodule
+
+# source dbconfig-common stuff
+. /usr/share/dbconfig-common/dpkg/postinst 
+
+dbc_pgsql_createdb_encoding='sql_ascii'
+
+#echo "i should create the db here"
+dbc_go freeside $@
+#echo "db should be craeted now"
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <postinst> `abort-remove'
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+case "$1" in
+    configure)
+
+    a2enmod perl
+
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
diff --git a/debian/OLD/postrm b/debian/OLD/postrm
new file mode 100644 (file)
index 0000000..c008445
--- /dev/null
@@ -0,0 +1,48 @@
+#!/bin/sh
+# postrm script for freeside
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# source debconf stuff
+. /usr/share/debconf/confmodule
+
+# source dbconfig-common stuff
+if [ -f /usr/share/dbconfig-common/dpkg/postrm ]; then
+  . /usr/share/dbconfig-common/dpkg/postrm 
+  dbc_go freeside $@
+fi
+
+# summary of how this script can be called:
+#        * <postrm> `remove'
+#        * <postrm> `purge'
+#        * <old-postrm> `upgrade' <new-version>
+#        * <new-postrm> `failed-upgrade' <old-version>
+#        * <new-postrm> `abort-install'
+#        * <new-postrm> `abort-install' <old-version>
+#        * <new-postrm> `abort-upgrade' <old-version>
+#        * <disappearer's-postrm> `disappear' <overwriter>
+#          <overwriter-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+    ;;
+
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
diff --git a/debian/OLD/prerm b/debian/OLD/prerm
new file mode 100644 (file)
index 0000000..4c17489
--- /dev/null
@@ -0,0 +1,46 @@
+#!/bin/sh
+# prerm script for freeside
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# source debconf stuff
+. /usr/share/debconf/confmodule
+# source dbconfig-common stuff
+. /usr/share/dbconfig-common/dpkg/prerm 
+dbc_go freeside $@
+
+# summary of how this script can be called:
+#        * <prerm> `remove'
+#        * <old-prerm> `upgrade' <new-version>
+#        * <new-prerm> `failed-upgrade' <old-version>
+#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
+#        * <deconfigured's-prerm> `deconfigure' `in-favour'
+#          <package-being-installed> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    remove|upgrade|deconfigure)
+    ;;
+
+    failed-upgrade)
+    ;;
+
+    *)
+        echo "prerm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
index 15fed69..d2928e6 100644 (file)
@@ -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
index d070c46..0aadb48 100644 (file)
@@ -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
index 7ed6ff8..45a4fb7 100644 (file)
@@ -1 +1 @@
-5
+8
diff --git a/debian/config b/debian/config
deleted file mode 100644 (file)
index 4ffa236..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-# config script for freeside
-
-set -e
-
-# source debconf stuff
-. /usr/share/debconf/confmodule
-
-# source dbconfig-common shell library, and call the hook function
-if [ -f /usr/share/dbconfig-common/dpkg/config ]; then
-   # we support mysql and pgsql
-   dbc_dbtypes="pgsql, mysql"
-
-   # source dbconfig-common stuff
-   . /usr/share/dbconfig-common/dpkg/config 
-   dbc_go freeside $@
-fi
-
-# ... rest of your code ...
index 4ea4815..1572406 100644 (file)
@@ -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
index c409cb9..e521a70 100644 (file)
@@ -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/cron.d b/debian/cron.d
deleted file mode 100644 (file)
index f86db1b..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#
-# Regular cron jobs for the freeside package
-#
-0 0    * * *   freeside        /usr/bin/freeside-daily fs_daily
diff --git a/debian/dbconfig-common.install b/debian/dbconfig-common.install
deleted file mode 100644 (file)
index 31b5d14..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-#!/bin/sh
-
-. /etc/dbconfig-common/freeside.conf
-
-DB_USER=$dbc_dbuser
-DB_PASSWORD=$dbc_dbpass
-
-# -- can't find a better place to hook this in.  dammit.
-
-[ "$dbc_dbtype" = "pgsql" ] && DB_TYPE=Pg
-[ "$dbc_dbtype" = "mysql" ] && DB_TYPE=mysql
-#XXX ask dbc about a remote database etc.
-DATASOURCE=DBI:${DB_TYPE}:dbname=${dbc_dbname}
-    
-#debian/rules
-FREESIDE_CONF=/etc/freeside
-FREESIDE_CACHE=/var/cache/freeside
-#XXX huh?
-FREESIDE_EXPORT=/var/spool/freeside
-DEFAULT_CONF=/usr/share/freeside/default_conf
-    
-#XXX this rather seriously needs proper debian-style config file handling.
-    
-#shamelessly lifted from Makefile create-config target
-[ -e ${FREESIDE_CONF} ] || install -d -o freeside ${FREESIDE_CONF}
-    
-touch ${FREESIDE_CONF}/secrets
-chown freeside ${FREESIDE_CONF}/secrets
-chmod 600 ${FREESIDE_CONF}/secrets
-    
-[ -s ${FREESIDE_CONF}/secrets ] || echo -e "${DATASOURCE}\n${DB_USER}\n${DB_PASSWORD}" >${FREESIDE_CONF}/secrets
-chmod 600 ${FREESIDE_CONF}/secrets
-chown freeside ${FREESIDE_CONF}/secrets
-    
-#XXX yuck!  this too!
-[ -e /var/opt/freeside/rt/etc/RT_Config.pm.dbc ] || cp /var/opt/freeside/rt/etc/RT_Config.pm.dbc.generic /var/opt/freeside/rt/etc/RT_Config.pm.dbc
-perl -pi.generic -e "s/^\\s*Set\\s*\\(\s*\\\$DatabaseType.*\$/Set(\\\$DatabaseType, '$DB_TYPE');/" /var/opt/freeside/rt/etc/RT_Config.pm.dbc
-mv /var/opt/freeside/rt/etc/RT_Config.pm.dbc /var/opt/freeside/rt/etc/RT_Config.pm
-perl -pi -e "\
-  s'_DBC_DBUSER_'${dbc_dbuser}'g;\
-  s'_DBC_DBPASS_'${dbc_dbpass}'g;\
-  s'_DBC_DBNAME_'${dbc_dbname}'g;\
-" /var/opt/freeside/rt/etc/RT_Config.pm
-#dunno how to hook this in where i need it...
-#dbc_generate_include="template:/var/opt/freeside/rt/etc/RT_Config.pm"
-#dbc_generate_include_args="-o template_infile=/var/opt/freeside/rt/etc/RT_Config.pm.dbc"
-           
-install -o freeside -d "${FREESIDE_CACHE}/counters.${DATASOURCE}"
-install -o freeside -d "${FREESIDE_CACHE}/cache.${DATASOURCE}"
-install -o freeside -d "${FREESIDE_EXPORT}/export.${DATASOURCE}"
-           
-if [ ! -d "${FREESIDE_CONF}/conf.${DATASOURCE}" ] ; then #don't clobber conf
-install -o freeside -d "${FREESIDE_CONF}/conf.${DATASOURCE}"
-#cp conf/[a-z]* "${FREESIDE_CONF}/conf.${DATASOURCE}"
-cp -i `ls -d ${DEFAULT_CONF}/[a-z]* | grep -v CVS` "${FREESIDE_CONF}/conf.${DATASOURCE}" #-i just in case
-chown -R freeside "${FREESIDE_CONF}/conf.${DATASOURCE}"
-fi
-       
-# -- back to your regularly schedule program... go ahead, create the db
-
-DOMAIN=`dnsdomainname`
-if [ "$DOMAIN" = "localdomain" ]; then #freeside needs a valid domain
-  DOMAIN='example.com'
-fi
-
-# XXX this should probably be handled by the _install_...
-# dpkg-statoverride or something
-chown freeside /etc/freeside
-
-su freeside -c "/usr/bin/freeside-setup -d $DOMAIN"
-su freeside -c '/usr/bin/freeside-adduser -g 1 fs_queue'
-su freeside -c '/usr/bin/freeside-adduser -g 1 fs_daily'
-su freeside -c '/usr/bin/freeside-adduser -g 1 fs_selfservice'
-su freeside -c '/usr/bin/freeside-adduser -g 1 fs_upgrade'
-
-#RT paths are bunk for deb proper
-
-chown freeside /var/opt/freeside/rt/etc/RT_Config.pm
-
-su freeside -c "/var/opt/freeside/rt/sbin/rt-setup-database --dba '$DB_USER' --dba-password '$DB_PASSWORD' --action schema"
-
-su freeside -c '/var/opt/freeside/rt/sbin/rt-setup-database --action insert_initial'
-
-su freeside -c '/var/opt/freeside/rt/sbin/rt-setup-database --action insert --datafile /var/opt/freeside/rt/etc/initialdata'
-
-#XXX this totally doesn't belong here, but what the hey
-chown -R freeside /var/cache/freeside/masondata
-
-exit 0
diff --git a/debian/dbconfig-common.upgrade b/debian/dbconfig-common.upgrade
deleted file mode 100644 (file)
index cae9adb..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-su freeside -c '/usr/bin/freeside-upgrade fs_upgrade'
-#RT upgrade
diff --git a/debian/freeside.apache-alias.conf b/debian/freeside.apache-alias.conf
deleted file mode 100644 (file)
index fdd4340..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Alias /freeside/ /usr/share/freeside/www/
index e845566..f4a511b 100644 (file)
@@ -1 +1,2 @@
 README
+AGPL
diff --git a/debian/init.d.ex b/debian/init.d.ex
deleted file mode 100644 (file)
index 2480f51..0000000
+++ /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 (file)
index 1223129..0000000
+++ /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/postinst b/debian/postinst
deleted file mode 100644 (file)
index 5d04550..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/sh
-# postinst script for freeside
-#
-# see: dh_installdeb(1)
-
-set -e
-
-# source debconf stuff
-. /usr/share/debconf/confmodule
-
-# source dbconfig-common stuff
-. /usr/share/dbconfig-common/dpkg/postinst 
-
-dbc_pgsql_createdb_encoding='sql_ascii'
-
-#echo "i should create the db here"
-dbc_go freeside $@
-#echo "db should be craeted now"
-
-# summary of how this script can be called:
-#        * <postinst> `configure' <most-recently-configured-version>
-#        * <old-postinst> `abort-upgrade' <new version>
-#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
-#          <new-version>
-#        * <postinst> `abort-remove'
-#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
-#          <failed-install-package> <version> `removing'
-#          <conflicting-package> <version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-case "$1" in
-    configure)
-
-    a2enmod perl
-
-    ;;
-
-    abort-upgrade|abort-remove|abort-deconfigure)
-    ;;
-
-    *)
-        echo "postinst called with unknown argument \`$1'" >&2
-        exit 1
-    ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
-
diff --git a/debian/postrm b/debian/postrm
deleted file mode 100644 (file)
index c008445..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/sh
-# postrm script for freeside
-#
-# see: dh_installdeb(1)
-
-set -e
-
-# source debconf stuff
-. /usr/share/debconf/confmodule
-
-# source dbconfig-common stuff
-if [ -f /usr/share/dbconfig-common/dpkg/postrm ]; then
-  . /usr/share/dbconfig-common/dpkg/postrm 
-  dbc_go freeside $@
-fi
-
-# summary of how this script can be called:
-#        * <postrm> `remove'
-#        * <postrm> `purge'
-#        * <old-postrm> `upgrade' <new-version>
-#        * <new-postrm> `failed-upgrade' <old-version>
-#        * <new-postrm> `abort-install'
-#        * <new-postrm> `abort-install' <old-version>
-#        * <new-postrm> `abort-upgrade' <old-version>
-#        * <disappearer's-postrm> `disappear' <overwriter>
-#          <overwriter-version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-
-case "$1" in
-    purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
-    ;;
-
-    *)
-        echo "postrm called with unknown argument \`$1'" >&2
-        exit 1
-    ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
-
-
diff --git a/debian/prerm b/debian/prerm
deleted file mode 100644 (file)
index 4c17489..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/sh
-# prerm script for freeside
-#
-# see: dh_installdeb(1)
-
-set -e
-
-# source debconf stuff
-. /usr/share/debconf/confmodule
-# source dbconfig-common stuff
-. /usr/share/dbconfig-common/dpkg/prerm 
-dbc_go freeside $@
-
-# summary of how this script can be called:
-#        * <prerm> `remove'
-#        * <old-prerm> `upgrade' <new-version>
-#        * <new-prerm> `failed-upgrade' <old-version>
-#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
-#        * <deconfigured's-prerm> `deconfigure' `in-favour'
-#          <package-being-installed> <version> `removing'
-#          <conflicting-package> <version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-
-case "$1" in
-    remove|upgrade|deconfigure)
-    ;;
-
-    failed-upgrade)
-    ;;
-
-    *)
-        echo "prerm called with unknown argument \`$1'" >&2
-        exit 1
-    ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
-
-
index d37dfd1..a8835e5 100755 (executable)
@@ -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 (file)
index e69de29..0000000
diff --git a/etc/megapop.pl b/etc/megapop.pl
deleted file mode 100755 (executable)
index e2930fb..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-#!/usr/bin/perl -Tw
-#
-# this will break when megapop changes the URL or format of their listing page.
-# that's stupid.  perhaps they can provide a machine-readable listing?
-
-use strict;
-use LWP::UserAgent;
-use FS::UID qw(adminsuidsetup);
-use FS::svc_acct_pop;
-
-my $url = "http://www.megapop.com/location.htm";
-
-my $user = shift or die &usage;
-adminsuidsetup($user);
-
-my %state2usps = &state2usps;
-$state2usps{'WASHINGTON STATE'} = 'WA'; #megapop's on crack
-$state2usps{'CANADA'} = 'CANADA'; #freeside's on crack
-
-my $ua = new LWP::UserAgent;
-my $request = new HTTP::Request('GET', $url);
-my $response = $ua->request($request);
-die $response->error_as_HTML unless $response->is_success;
-my $line;
-my $usps = '';
-foreach $line ( split("\n", $response->content) ) {
-  if ( $line =~ /\W(\w[\w\s]*\w)\s+LOCATIONS/i ) {
-    $usps = $state2usps{uc($1)}
-      or warn "warning: unknown state $1\n";
-  } elsif ( $line =~ /(\d{3})\-(\d{3})\-(\d{4})\s+(\w[\w\s]*\w)/ ) {
-    print "$1 $2 $3 $4 $usps\n";
-    my $svc_acct_pop = new FS::svc_acct_pop ( {
-      'city' => $4,
-      'state' => $usps,
-      'ac' => $1,
-      'exch' => $2,
-    } );
-    my $error = $svc_acct_pop->insert;
-    die $error if $error;
-  }
-}
-
-sub usage {
-  die "Usage:\n  $0 user\n";
-}
-
-sub state2usps{ (
-  'ALABAMA' => 'AL',
-  'ALASKA' => 'AK',
-  'AMERICAN SAMOA' => 'AS',
-  'ARIZONA' => 'AZ',
-  'ARKANSAS' => 'AR',
-  'CALIFORNIA' => 'CA',
-  'COLORADO' => 'CO',
-  'CONNECTICUT' => 'CT',
-  'DELAWARE' => 'DE',
-  'DISTRICT OF COLUMBIA' => 'DC',
-  'FEDERATED STATES OF MICRONESIA' => 'FM',
-  'FLORIDA' => 'FL',
-  'GEORGIA' => 'GA',
-  'GUAM' => 'GU',
-  'HAWAII' => 'HI',
-  'IDAHO' => 'ID',
-  'ILLINOIS' => 'IL',
-  'INDIANA' => 'IN',
-  'IOWA' => 'IA',
-  'KANSAS' => 'KS',
-  'KENTUCKY' => 'KY',
-  'LOUISIANA' => 'LA',
-  'MAINE' => 'ME',
-  'MARSHALL ISLANDS' => 'MH',
-  'MARYLAND' => 'MD',
-  'MASSACHUSETTS' => 'MA',
-  'MICHIGAN' => 'MI',
-  'MINNESOTA' => 'MN',
-  'MISSISSIPPI' => 'MS',
-  'MISSOURI' => 'MO',
-  'MONTANA' => 'MT',
-  'NEBRASKA' => 'NE',
-  'NEVADA' => 'NV',
-  'NEW HAMPSHIRE' => 'NH',
-  'NEW JERSEY' => 'NJ',
-  'NEW MEXICO' => 'NM',
-  'NEW YORK' => 'NY',
-  'NORTH CAROLINA' => 'NC',
-  'NORTH DAKOTA' => 'ND',
-  'NORTHERN MARIANA ISLANDS' => 'MP',
-  'OHIO' => 'OH',
-  'OKLAHOMA' => 'OK',
-  'OREGON' => 'OR',
-  'PALAU' => 'PW',
-  'PENNSYLVANIA' => 'PA',
-  'PUERTO RICO' => 'PR',
-  'RHODE ISLAND' => 'RI',
-  'SOUTH CAROLINA' => 'SC',
-  'SOUTH DAKOTA' => 'SD',
-  'TENNESSEE' => 'TN',
-  'TEXAS' => 'TX',
-  'UTAH' => 'UT',
-  'VERMONT' => 'VT',
-  'VIRGIN ISLANDS' => 'VI',
-  'VIRGINIA' => 'VA',
-  'WASHINGTON' => 'WA',
-  'WEST VIRGINIA' => 'WV',
-  'WISCONSIN' => 'WI',
-  'WYOMING' => 'WY',
-  'ARMED FORCES AFRICA' => 'AE',
-  'ARMED FORCES AMERICAS' => 'AA',
-  'ARMED FORCES CANADA' => 'AE',
-  'ARMED FORCES EUROPE' => 'AE',
-  'ARMED FORCES MIDDLE EAST' => 'AE',
-  'ARMED FORCES PACIFIC' => 'AP',
-) }
-