From e6dff1da890d5bb5a982c7c23225e5d90afc7660 Mon Sep 17 00:00:00 2001 From: Dragan Dosen Date: Fri, 26 Mar 2010 19:59:12 +0100 Subject: [PATCH] Prilagodba paketa za novi paket squirrelmail-change-pass. Dio paketa koji sadrzi sam change_pass dodatak (plugin) prebacen je u zasebni paket - squirrelmail-change-pass. --- debian/README.CARNet => README.CARNet | 25 +-- change_pass/README | 1 - change_pass/config_example.php | 9 - change_pass/doc/.htaccess | 1 - change_pass/doc/COPYING | 281 --------------------------- change_pass/doc/ChangeLog | 144 -------------- change_pass/doc/FAQ | 26 --- change_pass/doc/INSTALL | 59 ------ change_pass/doc/README | 36 ---- change_pass/doc/index.php | 13 -- change_pass/functions.php | 141 -------------- change_pass/index.php | 13 -- change_pass/options.php | 127 ------------ change_pass/setup.php | 34 ---- change_pass/version | 2 - debian/changelog.CARNet => changelog.CARNet | 0 debian/changelog | 7 +- debian/compat | 2 +- debian/control | 14 +- debian/dirs | 1 - debian/docs | 9 +- debian/examples | 1 - debian/install | 1 - debian/postinst | 145 +++++++------- debian/postrm | 5 + debian/prerm | 12 -- debian/rules | 56 ++---- 27 files changed, 125 insertions(+), 1040 deletions(-) rename debian/README.CARNet => README.CARNet (55%) delete mode 100644 change_pass/README delete mode 100644 change_pass/config_example.php delete mode 100644 change_pass/doc/.htaccess delete mode 100644 change_pass/doc/COPYING delete mode 100644 change_pass/doc/ChangeLog delete mode 100644 change_pass/doc/FAQ delete mode 100644 change_pass/doc/INSTALL delete mode 100644 change_pass/doc/README delete mode 100644 change_pass/doc/index.php delete mode 100644 change_pass/functions.php delete mode 100644 change_pass/index.php delete mode 100644 change_pass/options.php delete mode 100644 change_pass/setup.php delete mode 100644 change_pass/version rename debian/changelog.CARNet => changelog.CARNet (100%) delete mode 100644 debian/dirs delete mode 100644 debian/examples delete mode 100644 debian/install create mode 100644 debian/postrm diff --git a/debian/README.CARNet b/README.CARNet similarity index 55% rename from debian/README.CARNet rename to README.CARNet index e34b51b..91974d7 100644 --- a/debian/README.CARNet +++ b/README.CARNet @@ -1,15 +1,16 @@ squirrelmail-change-pass-cn --------------------------- -Ovaj paket donosi change_pass dodatak (plugin) za SquirrelMail. +Ovaj paket sadrzi dodatne CARNetove postavke za SquirrelMail +change_pass dodatak (plugin). -Izvorni kod change_pass dodatka preuzet je sa adrese: +Izvorni kod change_pass dodatka moze se preuzeti na lokaciji: http://www.squirrelmail.org/plugin_view.php?id=21 -squirrelmail-change-pass-cn paket automatski aktivira change_pass -dodatak unutar SquirrelMail konfiguracije, a zatim vrsi podesavanje -poppassd servisa. +squirrelmail-change-pass-cn paket vrsi konfiguraciju change_pass +dodatka, aktivira isti unutar SquirrelMail konfiguracije, te +podesava poppassd servis. Konfiguracija poppassd servisa nalazi se u datoteci: @@ -19,30 +20,30 @@ Pristup poppassd servisu kontrolira se kroz datoteke: /etc/hosts.allow i /etc/hosts.deny -Zbog sigurnosnih razloga, pristup poppassd servisu ogranicen je +Zbog sigurnosnih razloga, pristup poppassd servisu ogranicen je na localhost (127.0.0.1). change_pass dodatak moguce je konfigurirati kroz konfiguracijske datoteke: - /usr/share/squirrelmail/plugins/change_pass/config.php + /etc/squirrelmail/config_change_pass.php (glavna datoteka) -ili +odnosno - /etc/squirrelmail/config_change_pass.php + /usr/share/squirrelmail/plugins/change_pass/config.php Paket automatski podesava minimalnu duzinu zaporke na 8 znakova - -duzina zaporke nije odredjena PAM konfiguracijom, vec je definirana +duzina zaporke nije odredjena PAM konfiguracijom, vec je zadana u konfiguracijskoj datoteci za change_pass dodatak (varijabla $min_pass_length). Dokumentacija se nalazi unutar direktorija: - /usr/share/doc/squirrelmail-change-pass-cn/ + /usr/share/doc/squirrelmail-change-pass/ Izvorni odrzavatelj paketa: Zoran Dzelajlija . Trenutno odrzava: Dragan Dosen . - -- Dragan Dosen Mon, 8 Feb 2010 22:29:11 +0100 + -- Dragan Dosen Fri, 26 Mar 2010 19:50:12 +0100 diff --git a/change_pass/README b/change_pass/README deleted file mode 100644 index dd0e567..0000000 --- a/change_pass/README +++ /dev/null @@ -1 +0,0 @@ -See the documentation in the doc/ directory. diff --git a/change_pass/config_example.php b/change_pass/config_example.php deleted file mode 100644 index ba9b67a..0000000 --- a/change_pass/config_example.php +++ /dev/null @@ -1,9 +0,0 @@ - -- Code cleanups and changes -- Updated version number to 3.0 - -* Sat Jan 17 2009 Seth Randall -- Considerable rewrite - -* Sat Jun 23 2007 Seth Randall -- Added Bahasa Melayu translation by zamri - -* Sat Jun 9 2007 Seth Randall -- Updated version to 2.7a-1.4.x - -* Mon Jun 4 2007 Seth Randall -- Added Korean translation by LEE CHANG MIN . -- Added Dutch translation by Sander Eerkes . - -* Sun Jun 3 2007 Seth Randall -- Added Swedish translation by Erik Lindgren . - -* Wed Oct 4 2006 Tomas Kuliavas -- Added Norwegian Bokmal translation by Svein Olav Bjerkeset - . SquirrelMail tracker #1525721. - -* Sat Nov 19 2005 Seth Randall - -- Added FAQ -- Updated INSTALL and README files -- Added Slovenian translation (sl_SI) from "Sasa Stupar -- Added Czech translation (cs_CZ) from "Martin Å louf" -- Updated Italian translation (it_IT) from "Salvatore Bocchetti" - -* Mon Jul 18 2005 Seth Randall - -- Added Finnish translation (fi_FI) from "Kari Mattsson" - -* Thu Sep 16 2004 Seth Randall - -- Added Italian translation (it_IT) from "magomarcelo" - -* Wed Jul 21 2004 Seth Randall - -- Added option to specify a poppass server if it's different than the imap server -- Changed version number to 2.7-1.4.x - -* Wed Jun 30 2004 Seth Randall - -- Added Brazilian Portuguese translation (pt_BR) from "Edinardo Potrich" - -* Thu Dec 18 2003 Seth Randall - -- Minor updates to some translations -- Changed version number to 2.6-1.4.x - -* Wed Dec 17 2003 Seth Randall - -- Added French translation (fr_FR) from "Ludovic Marcotte" - -* Sun Dec 7 2003 Seth Randall - -- Added German translation (de_DE) from "Steffen Beyer" -- Accept 3xx codes after pass command (arguably wrong, but the poppass daemon - in the ports collection does it that way) -- Changed version number to 2.5-1.4.x - -* Sat Nov 8 2003 Seth Randall - -- Added Bulgarian translation (bg_BG) from "Marian Popov" - -* Mon Oct 20 2003 Seth Randall - -- Changed version number to 2.4-1.4.x - -* Wed Oct 1 2003 Seth Randall - -- Added Polish translation (pl_PL) from "Sebastian Turzynski" - -* Thu Sep 25 2003 Seth Randall - -- Added Spanish (es_ES) translation from "grana canal10" -- Explicitly define SQ_SESSION as the source of onetimepad - -* Fri Sep 19 2003 Seth Randall - -- Added translation support (thanks to Ruben Leote Mendes) -- Added Portuguese (Portugal) (pt_PT) translation from "Ruben Leote Mendes" -- Added change_pass_version in setup.php -- Changed version number to 2.3-1.4.x - -* Thu Jul 10 2003 Seth Randall - -- Removed poppassd software -- Added proper handling of 2xx and 3xx responses -- Changed version number to 2.2-1.4.x - -* Fri Apr 25 2003 Seth Randall - -- Added support for 300 after "user" command (thanks to Richard Gee) -- Added version file -- Changed version number to 2.1-1.4.x - -* Mon Apr 7 2003 Seth Randall - -- Updated for SquirrelMail 1.4.x -- Changed version number to 2.0-1.4.x - -* Tue Jan 7 2003 Seth Randall - -- Added courierpassd -- Changed version number to 1.5 - -* Wed Dec 18 2002 Seth Randall - -- Removed debug code -- Added a poppassd for some BSDs -- Changed version number to 1.4a - -* Thu Sep 26 2002 Seth Randall - -- Updated for SquirrelMail 1.2.8 -- Changed version number to 1.4 - -* Mon Mar 26 2001 Tyler Akins - -- Now uses the mail server address instead of hardcoding "localhost" -- Now forwards to correct URL (removes errors if you want to change your - password twice in a row) -- Changed version number to 1.3 - -* Tue Feb 6 2001 Tyler Akins - -- Added debug mode -- Better error message -- Better error checking -- No need to log out and back in after password change -- Changed version number to 1.2 - -* Tue Jan 23 2001 Tyler Akins - -- Changed variable and function names using change_pass_ as a prefix to - avoid conflict with other plugins as has been mentioned in the plugins - mailing list -- Changed version number to 1.1 diff --git a/change_pass/doc/FAQ b/change_pass/doc/FAQ deleted file mode 100644 index 8c5ec52..0000000 --- a/change_pass/doc/FAQ +++ /dev/null @@ -1,26 +0,0 @@ -Q. I get an error saying "ERROR: Connection refused (111)" - -A. You don't have a poppass daemon running on the server you've selected. - Make certain you have followed the installation steps in the INSTALL - document and tested it as shown below. - -Q. The plugin does not seem to work - -A. Make sure you can change the password manually. - To test, try telneting into the daemon and changing a password: - - $ telnet localhost 106 - Trying 127.0.0.1... - Connected to localhost. - Escape character is '^]'. - 200 poppassd v1.8.1 hello, who are you? - user - 200 Your password please. - pass - 200 Your new password please. - newpass - 200 Password changed, thank-you. - quit - 200 Bye. - Connection closed by foreign host. - diff --git a/change_pass/doc/INSTALL b/change_pass/doc/INSTALL deleted file mode 100644 index 53ef501..0000000 --- a/change_pass/doc/INSTALL +++ /dev/null @@ -1,59 +0,0 @@ -Installing change_pass -====================== -0) NOTE: This plugin is not needed for SquirrelMail 1.5.0 or above. - The functionality it provides is already included in the - change_password plugin that is part of 1.5.x. - -1) Start with untaring the file into the plugins directory. - Here is an example for the 3.0 version of the change_pass plugin. - - $ cd plugins - $ tar -zxf change_pass-3.0-1.4.0.tar.gz - -2) By default, the plugin will connect to the IMAP server configured - for SquirrelMail on port 106 to change passwords. - If you need to change any of the following: - IP address of your poppass server - poppass server port number (if not 106) - minimum or maximum password length - you will need to create a configuration file. - - Decide if you want to store the plugin configuration file - in the plugin directory or in the main SquirrelMail config - directory. - - A) To store the configuration file in the plugin directory, - change into the change_pass directory, copy config_example.php - to config.php and edit config.php, making adjustments as - you deem necessary. - - $ cd change_pass - $ cp config_example.php config.php - $ vi config.php - - B) To store the configuration file in the main SquirrelMail - config directory, change into the change_pass directory, - copy config_example.php to ../../config/config_change_pass.php - and edit ../../config/config_change_pass.php, making - adjustments as you deem necessary. - - $ cd change_pass - $ cp config_example.php ../../config/config_change_pass.php - $ vi ../../config/config_change_pass.php - -3) Go to your config directory and run conf.pl. Choose - option 8 and move the plugin from the "Available Plugins" - category to the "Installed Plugins" category. Save and - exit. - - $ cd ../../../../config/ - $ ./conf.pl - -4) If not being used with SquirrelMail 1.4.16+, - please verify that you have the "Compatibility" plugin - installed (but not necessarily activated). - -5) Translations are not included in this package. To get a - translation, download the language pack needed from: - - http://www.squirrelmail.org/download.php diff --git a/change_pass/doc/README b/change_pass/doc/README deleted file mode 100644 index 92d644c..0000000 --- a/change_pass/doc/README +++ /dev/null @@ -1,36 +0,0 @@ -change_pass plugin for SquirrelMail -=================================== -Version 3.0, 2009/05/09 - -Ritchie Low -Tyler Akins -Seth Randall - -Description -=========== -This is a Squirrelmail plugin to change password using the Poppassd service - -You can get poppassd compliant services from the following places: -Pawel Krawczyk http://ipsec.pl/meta/pawel-krawczyk-projekty-open-source.html (Supports PAM) -Andrew Stevenson ftp://ftp.ugh.net.au/pub/unix/poppwd -NetWin http://netwinsite.com/poppassd/ (Changes /etc/passwd) -Kerberos http://kpoppassd.sourceforge.net (Thank to Michael G. Rozman this link) -HP-UX 11.x http://barney.gonzaga.edu/~awithers/poppassd/ (link from above site) -BSD users should try the one from the ports collection for their brand of BSD first. -Courier users should try courierpassd at http://www.arda.homeunix.net/store/ - -poppassd must be running on your whatever server handles the passwords for your -mail server for this plugin to work. Other than that, you just need to add -this plugin to SquirrelMail (using the perl script or by editing config.php -by hand), and all should be fine. For full installation instructions, -see the INSTALL file. - -To change the server or port poppassd listens on, see the INSTALL file. - -If you experience problems, please see the INSTALL file and FAQ - -License -======= - -This plugin is released under the GNU General Public -License (see COPYING for details). diff --git a/change_pass/doc/index.php b/change_pass/doc/index.php deleted file mode 100644 index 5fbde0d..0000000 --- a/change_pass/doc/index.php +++ /dev/null @@ -1,13 +0,0 @@ - _("Change Password"), - 'url' => sqm_baseuri() . 'plugins/change_pass/options.php', - 'desc' => _("Use this to change your email password."), - 'js' => FALSE - ); - sq_change_text_domain('squirrelmail'); -} - -function change_pass_dochange($change_pass_old, $change_pass_new, $debug = false) { - global $username, $imapServerAddress; - $poppass_server = $imapServerAddress; - $poppass_port = 106; - - if(!@include(SM_PATH . 'config/config_change_pass.php')) { - @include(SM_PATH . 'plugins/change_pass/config.php'); - } - - $error_messages = array(); - - $pop_socket = @fsockopen($poppass_server, $poppass_port, $errno, $errstr); - if (!$pop_socket) { - sq_change_text_domain('change_pass'); - $error_messages[] = sprintf(_("Connection error: %s"), "$errstr ($errno)"); - sq_change_text_domain('squirrelmail'); - return $error_messages; - } - - // Look for a 2xx result to continue - $result = change_pass_readfb($pop_socket, $debug); - if(preg_match('/^2\d\d/', $result)) { - // Send the username whose password to change - if(fwrite($pop_socket, "user $username\r\n")) { - $result = change_pass_readfb($pop_socket, $debug); - if(preg_match('/^[23]\d\d/', $result)) { - // Send the users current password - if(fwrite($pop_socket, "pass $change_pass_old\r\n")) { - $result = change_pass_readfb($pop_socket, $debug); - if(preg_match('/^[23]\d\d/', $result)) { - // Send the new password - if(fwrite($pop_socket, "newpass $change_pass_new\r\n")) { - $result = change_pass_readfb($pop_socket, $debug); - if(!preg_match('/^2\d\d/', $result)) { - sq_change_text_domain('change_pass'); - $error_messages[] = _("Password change was not successful!"); - sq_change_text_domain('squirrelmail'); - } else { - change_pass_closeport($pop_socket, $debug); - sqauth_save_password($change_pass_new); - session_write_close(); - header('Location: ' . sqm_baseuri() . 'src/options.php?optmode=submit&optpage=change_pass&plugin_change_pass=1'); - exit; - } - } - } - } - } - } - } - change_pass_closeport($pop_socket, $debug); - return $error_messages; -} - -function change_pass_closeport($pop_socket, $debug = false) { - if ($debug) { - $messages[] = "Closing Connection"; - } - fputs($pop_socket, "quit\r\n"); - fclose($pop_socket); -} - -function change_pass_readfb($pop_socket, $debug = false) { - $strResp = ''; - $result = ''; - - if (!feof($pop_socket)) { - $strResp = fgets($pop_socket, 1024); - $result = substr(trim($strResp), 0, 3); // 200, 300, 500 - if($debug) { - $messages[] = "--> $strResp"; - } - } - return $result; -} - -function change_pass_info_real() { - return array( - 'english_name' => 'Change Password', - 'authors' => array( - 'Richie Low' => array(), - 'Tyler Akins' => array(), - 'Seth Randall' => array( - 'email' => 'indiri69@users.sourceforge.net', - 'sm_site_username' => 'randall', - ), - ), - 'version' => '3.0', - 'required_sm_version' => '1.4.0', - 'requires_configuration' => 0, - 'requires_source_patch' => 0, - 'required_plugins' => array(), - 'per_version_requirements' => array( - '1.5.0' => SQ_INCOMPATIBLE, - '1.4.16' => array( - 'required_plugins' => array() - ), - '1.4.0' => array( - 'required_plugins' => array( - 'compatibility' => array( - 'version' => '2.0.13', - 'activate' => FALSE - ) - ) - ) - ), - 'summary' => 'Change passwords using a poppass daemon', - 'details' => 'Works with a compatible poppass daemon to allow users to change their passwords.' - ); -} - -function change_pass_loadinfo_real() { - global $optpage, $optpage_name; - - if ($optpage == 'change_pass') { - // i18n: is displayed after "Successfully Saved Options:" - sq_change_text_domain('change_pass'); - $optpage_name = _("User's Password"); - sq_change_text_domain('squirrelmail'); - } -} diff --git a/change_pass/index.php b/change_pass/index.php deleted file mode 100644 index 5fbde0d..0000000 --- a/change_pass/index.php +++ /dev/null @@ -1,13 +0,0 @@ - $max_pass_length) { - $error_messages[] = sprintf(_("Your new password should be %s to %s characters long."), - $min_pass_length, $max_pass_length); - } - } - } - - $old_pass = sqauth_read_password(); - if(!isset($error_messages['cp_no_old']) && $change_pass_old != $old_pass) { - $error_messages['cp_wrong_old'] = _("Your current password is not correct."); - } - - if(count($error_messages) == 0) { - $error_messages = change_pass_dochange($change_pass_old, $change_pass_new, $debug); - if(count($error_messages) == 0) { - $showform = false; - } - } - sq_change_text_domain('squirrelmail'); -} -displayPageHeader($color, ''); -sq_change_text_domain('change_pass'); - -echo - html_tag('table', "\n" . - html_tag('tr', "\n" . - html_tag('td', '' . _("Change Password") . '', 'center', $color[0]) - ), - 'center', $color[9], 'width="95%" border="0" cellpadding="1" cellspacing="0"') . "
\n"; - -if(count($error_messages) > 0) { - echo html_tag('table', '', 'center', '', 'width="100%" border="0" cellpadding="1" cellspacing="0"'); - echo html_tag('tr'); - echo html_tag('td', '', 'center'); - echo html_tag('ul'); - foreach($error_messages as $line) { - echo html_tag('li', htmlspecialchars($line), '', '', 'style="color: ' . $color[2] . '"'); - } - echo html_tag('/ul'); - echo html_tag('tr', html_tag('td', ' ')) . "\n"; - echo html_tag('/table'); -} - -if($showform) { - echo addForm($PHP_SELF); - echo - html_tag('table', "\n" . - html_tag('tr', "\n" . - html_tag('td', _("Current Password:"), 'right') . - html_tag('td', addPwField('change_pass_old', ''), 'left') - ) . - html_tag('tr', "\n" . - html_tag('td', _("New Password:"), 'right') . - html_tag('td', addPwField('change_pass_new', ''), 'left') - ) . - html_tag('tr', "\n" . - html_tag('td', _("Verify New Password:"), 'right') . - html_tag('td', addPwField('change_pass_verify', ''), 'left') - ) . - html_tag('tr', "\n" . - html_tag('td', addSubmit(_('Change Password'), 'change_pass_form'), 'center', '', 'colspan="2"') - ), - 'center', '', 'border="0" cellpadding="1" cellspacing="0"') . "\n"; - echo html_tag('/form'); - echo html_tag('/body'); - echo html_tag('/html'); -} -sq_change_text_domain('squirrelmail'); diff --git a/change_pass/setup.php b/change_pass/setup.php deleted file mode 100644 index a9f58fc..0000000 --- a/change_pass/setup.php +++ /dev/null @@ -1,34 +0,0 @@ - Mon, 8 Feb 2010 22:29:11 +0100 + -- Dragan Dosen Fri, 26 Mar 2010 19:50:12 +0100 squirrelmail-change-pass-cn (3.0-1) stable; urgency=low diff --git a/debian/compat b/debian/compat index b8626c4..1e8b314 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -4 +6 diff --git a/debian/control b/debian/control index d65a85d..380c717 100644 --- a/debian/control +++ b/debian/control @@ -2,13 +2,13 @@ Source: squirrelmail-change-pass-cn Section: web Priority: optional Maintainer: Dragan Dosen -Build-Depends: debhelper (>= 4.0.0) -Standards-Version: 3.7.2 +Build-Depends: debhelper (>= 6) +Standards-Version: 3.7.3 Package: squirrelmail-change-pass-cn Architecture: all -Depends: squirrelmail-cn (>= 2:1.4.15-2lenny1), squirrelmail-compatibility (>= 2.0.12-1), xinetd-cn (>= 1:2.3.14-3lenny1), poppassd (>= 1.8.5-3.2), carnet-tools-cn (>= 2.8.1), ${misc:Depends} -Description: change passwords from SquirrelMail via poppassd - change_pass is a SquirrelMail plugin that lets you change your - password using poppassd service. This is pretty safe if the - IMAP server is localhost. +Depends: squirrelmail-cn (>= 2:1.4.15-2lenny1), squirrelmail-change-pass (>= 3.0-1), xinetd-cn (>= 1:2.3.14-3lenny1), poppassd (>= 1.8.5-3.2), carnet-tools-cn (>= 2.8.1), ${misc:Depends} +Description: SquirrelMail plugin: Change Password + Change passwords using a poppass daemon. + . + This is a basic CARNet Debian customization package. diff --git a/debian/dirs b/debian/dirs deleted file mode 100644 index e395a86..0000000 --- a/debian/dirs +++ /dev/null @@ -1 +0,0 @@ -/usr/share/squirrelmail/plugins diff --git a/debian/docs b/debian/docs index 0169e3c..d92e2d1 100644 --- a/debian/docs +++ b/debian/docs @@ -1,7 +1,2 @@ -change_pass/doc/ChangeLog -change_pass/doc/README -change_pass/doc/FAQ -change_pass/doc/INSTALL -change_pass/doc/COPYING -debian/changelog.CARNet -debian/README.CARNet +README.CARNet +changelog.CARNet diff --git a/debian/examples b/debian/examples deleted file mode 100644 index d42df99..0000000 --- a/debian/examples +++ /dev/null @@ -1 +0,0 @@ -change_pass/config_example.php diff --git a/debian/install b/debian/install deleted file mode 100644 index b5d666c..0000000 --- a/debian/install +++ /dev/null @@ -1 +0,0 @@ -change_pass /usr/share/squirrelmail/plugins diff --git a/debian/postinst b/debian/postinst index f515ad7..75d66d1 100644 --- a/debian/postinst +++ b/debian/postinst @@ -70,33 +70,53 @@ if ! egrep -q '^poppassd:' /etc/hosts.allow; then fi -# Configure SquirrelMail change_pass plugin - using defaults, -# no configuration files if earlier version is older than 3.0-1. +# First of all, do the backup. +# +done_backup=0 +for cpconf_file in $SQCPCONF $CPCONF; do + if [ -f "$cpconf_file" ] && [ ! -L "$cpconf_file" ]; then + cp_echo "CN: Doing backup for $cpconf_file" + cp_backup_conffile -d "/var/backups/$PKG" -p $cpconf_file + done_backup=1 + fi +done +if [ $done_backup -eq 1 ]; then + cp_echo "CN: Backup is located in directory: /var/backups/$PKG/" +fi + + +# Remove change_pass configuration files if earlier version is +# older than 3.0-1. # if [ "$2" ] && dpkg --compare-versions $2 lt 3.0-1; then cp_echo "CN: This version of change_pass plugin contains major changes." - cp_echo "CN: For detailed description, see documentation in /usr/share/doc/$PKG/." - - if [ -f "$SQCPCONF" ]; then - mv -f "$SQCPCONF" "$SQCPCONF.cn-old" - cp_echo "CN: Old $SQCPCONF disabled and renamed to $SQCPCONF.cn-old." - fi - if [ -f "$CPCONF" ]; then - mv -f "$CPCONF" "$CPCONF.cn-old" - cp_echo "CN: Old $CPCONF disabled and renamed to $CPCONF.cn-old." - fi + for cpconf_file in $SQCPCONF $CPCONF; do + if [ -f "$cpconf_file" ] || [ -L "$cpconf_file" ]; then + rm -f $cpconf_file + cp_echo "CN: Removed old $cpconf_file" + fi + done fi -# Check for change_pass configuration file and notify user about +# Check for change_pass configuration files and notify user about # minimum password length configuration. # -if [ ! -f "$SQCPCONF" ] && [ ! -f "$CPCONF" ]; then +if egrep -q '^\$plugins\[[0-9]+\][\ ]*=[\ ]*'\''change_pass'\' "$SQCONF"; then + /usr/sbin/squirrelmail-configure --remove-plugin change_pass +fi + +if [ ! -f "$SQCPCONF" ]; then - # Configuration file does not exist. - cp_echo "CN: Generating new file $CPCONF" - cat > "$CPCONF" < "$SQCPCONF" </dev/null`" ]; then - invoke-rc.d xinetd restart || exit $? - else - /etc/init.d/xinetd restart || exit $? - fi - fi + if [ -x "/etc/init.d/xinetd" ]; then + if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then + invoke-rc.d xinetd restart || exit $? + else + /etc/init.d/xinetd restart || exit $? + fi + fi fi diff --git a/debian/postrm b/debian/postrm new file mode 100644 index 0000000..0c6b285 --- /dev/null +++ b/debian/postrm @@ -0,0 +1,5 @@ +#!/bin/sh -e + +#DEBHELPER# + +exit 0 diff --git a/debian/prerm b/debian/prerm index 950fc16..909db7d 100644 --- a/debian/prerm +++ b/debian/prerm @@ -28,21 +28,9 @@ case "$1" in # configuration. # if egrep -q '^\$plugins\[[0-9]+\][\ ]*=[\ ]*'\''change_pass'\' "$SQCONF"; then - cp_echo "CN: Disabling SquirrelMail change_pass plugin in $SQCONF" /usr/sbin/squirrelmail-configure --remove-plugin change_pass fi - # Backup change_pass configuration file (if any) and notify user. - # - if [ -f "$CPCONF" ]; then - cp_echo "CN: Doing backup for $CPCONF" - cp_backup_conffile -d "/var/backups/$PKG" -p $CPCONF - cp_echo "CN: Backup is located in directory: /var/backups/$PKG/" - rm -f $CPCONF - rm -f $CPCONF.cn-old - cp_echo "CN: Configuration for SquirrelMail change_pass plugin has been removed." - fi - # Remove poppassd service from xinetd. # if [ -f /etc/xinetd.d/poppassd ]; then diff --git a/debian/rules b/debian/rules index b7c199b..c22b759 100755 --- a/debian/rules +++ b/debian/rules @@ -1,63 +1,34 @@ #!/usr/bin/make -f -# -*- makefile -*- -# Sample debian/rules that uses debhelper. -# This file was originally written by Joey Hess and Craig Small. -# As a special exception, when this file is copied by dh-make into a -# dh-make output file, you may use that output file without restriction. -# This special exception was added by Craig Small in version 0.37 of dh-make. -#export DH_VERBOSE=1 +PACKAGE = $(shell dh_listpackages) +TMP = $(CURDIR)/debian/$(PACKAGE) -configure: configure-stamp -configure-stamp: - dh_testdir - touch configure-stamp - -build: build-stamp - -build-stamp: configure-stamp - dh_testdir - touch build-stamp +build: clean: dh_testdir dh_testroot - rm -f build-stamp configure-stamp - dh_clean + dh_clean + rm -f install-stamp -install: build +install: build install-stamp +install-stamp: dh_testdir dh_testroot - dh_clean -k - dh_installdirs - -binary-indep: build install + dh_clean + touch install-stamp binary-arch: build install + +binary-indep: build install dh_testdir dh_testroot - dh_installchangelogs dh_installdocs - dh_install -X.svn -Xchange_pass/doc -Xchange_pass/config_example.php -Xchange_pass/README - dh_installexamples -# dh_install -# dh_installmenu - dh_installdebconf -# dh_installlogrotate -# dh_installemacsen -# dh_installpam -# dh_installmime -# dh_installinit -# dh_installcron -# dh_installinfo - dh_installman + dh_installchangelogs dh_link -# dh_strip dh_compress dh_fixperms -# dh_perl -# dh_python -# dh_makeshlibs + dh_installdebconf dh_installdeb dh_shlibdeps dh_gencontrol @@ -65,4 +36,3 @@ binary-arch: build install dh_builddeb binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install configure -- 1.7.10.4