Changeset 1237
- Timestamp:
- 03/11/06 16:09:50 (2 years ago)
- Files:
-
- trunk/debian/control (modified) (1 diff)
- trunk/debian/dirs (modified) (1 diff)
- trunk/debian/postinst (modified) (1 diff)
- trunk/debian/postrm (modified) (3 diffs)
- trunk/debian/rules (modified) (5 diffs)
- trunk/mm_cfg.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/debian/control
r1232 r1237 10 10 Section: admin 11 11 Architecture: any 12 Pre-Depends: alternc (>= 0.9.3)13 Depends: mailman (>= 2.1), debconf (>= 0.5.00)12 Pre-Depends: alternc (>= 0.9.4) 13 Depends: mailman (>= 2.1), mysql-client 14 14 Description: Mailman module for AlternC 15 15 AlternC is a hosting software suite based on Valentin trunk/debian/dirs
r1196 r1237 1 /etc/alternc/templates/mailman 2 /usr/lib/alternc 3 /usr/share/alternc/install 4 /usr/share/doc/alternc-mailman 5 /var/alternc/bureau/admin 1 6 /var/alternc/bureau/class 2 /var/alternc/bureau/ admin7 /var/alternc/bureau/locales/en_US/LC_MESSAGES 3 8 /var/alternc/bureau/locales/fr_FR/LC_MESSAGES 4 /var/alternc/bureau/locales/en_US/LC_MESSAGES5 9 /var/alternc/cgi-bin 6 /usr/lib/alternc 7 /usr/share/doc/alternc-mailman 8 /usr/share/alternc/install/etc/mailman 10 /var/backups/alternc trunk/debian/postinst
r1219 r1237 1 #!/bin/sh -e1 #!/bin/sh 2 2 3 # Cette fonction regarde si un fichier de config ($1) a déjà reçu une modif 4 # de config, et sinon, lui ajoute la ligne voulue là où la balise le demande. 3 set -e 4 5 CONFIGFILE="/etc/alternc/local.sh" 6 MENUFILE="/etc/alternc/menulist.txt" 7 MAILMAN_SCRIPT="/var/lib/mailman/mail/mailman" 8 MAILMAN_CONFIG="/etc/mailman/mm_cfg.py" 9 MAILMAN_CONFIG_TEMPLATE="/etc/alternc/templates/mailman/mm_cfg.py" 10 MAILMAN_CONFIG_BACKUP="/var/backups/alternc/etc-mailman-mm_cfg.py" 11 MAILMAN_SCRIPT="/var/lib/mailman/mail/mailman" 12 13 # Add mailman aliases to the apache configuration file given as argument 5 14 function configure { 6 if grep -vqs "\*\*\*MAILMAN\*\*\*" $1 7 then 8 # 1. on déplace le fichier 9 rm -f $1.alternc_mailman 15 if ! grep -Eq "\*\*\*MAILMAN\*\*\*" $1; then 16 cp -a -f $1.tmp 10 17 sed -e "s/\*\*\*ALTERNC_ALIASES\*\*\*/&\\ 11 18 # ***MAILMAN*** \\ 12 19 Alias \/marchives\/ \/var\/lib\/mailman\/archives\/public\/ \\ 13 Alias \/mimages\/ \/usr\/share\/images\/mailman\//" < $1 >$1.alternc_mailman14 mv -f $1. alternc_mailman$120 Alias \/mimages\/ \/usr\/share\/images\/mailman\//" < $1 > $1.tmp 21 mv -f $1.tmp $1 15 22 fi 16 23 } 17 24 18 25 26 case "$1" in 27 configure) 28 . "$CONFIGFILE" 19 29 20 if [ "$1" = "configure" ] 21 then 22 QUIT=0 23 # is "AlternC" package properly installed ? 24 if [ -f /etc/alternc/alternc.conf ] 25 then 26 # is Alternc package properly CONFIGURED by the user ? 27 (grep "^exit" /etc/alternc/alternc.conf) || (QUIT=1) 28 else 29 QUIT=1 30 echo "Installing mysql table" 31 mysql -u"$MYSQL_USER" -p"$MYSQL_PASS" -h"$MYSQL_HOST" "$MYSQL_DATABASE" \ 32 < /usr/share/alternc/install/mailman.sql 33 34 # Install generated mailman configuration if it has not been modified since 35 # last package configuration 36 if [ -f "$MAILMAN_CONFIG_BACKUP" ]; then 37 if ! diff -q "$MAILMAN_CONFIG" "$MAILMAN_CONFIG_BACKUP"; then 38 echo "$MAILMAN_CONFIG has been modified since last alternc-mailman" 39 echo "configuration. You should merge your changes to" 40 echo "$MAILMAN_CONFIG_TEMPLATE and delete $MAILMAN_CONFIG_BACKUP" 41 exit 1 42 fi 30 43 fi 31 if [ ! -f /etc/alternc/local.sh ] 32 then 33 QUIT=1 44 sed -e "s/%%fqdn%%/$FQDN/" < "$MAILMAN_CONFIG_TEMPLATE" > "$MAILMAN_CONFIG" 45 cp -a -f "$MAILMAN_CONFIG" "$MAILMAN_CONFIG_BACKUP" 46 47 # Create the "mailman" list if it does not exist yet 48 if [ ! -d /var/lib/mailman/lists/mailman ]; then 49 /var/lib/mailman/bin/newlist -q mailman "root@$FQDN" "$MYSQL_PASS" 50 ( echo "INSERT INTO mailman 51 VALUES (NULL, 2000, 'mailman', '${FQDN}', 'mailman');" 52 echo "INSERT INTO mail_domain 53 VALUES ('${user}@${FQDN}', '${user}_${FQDN}', 2000, 0, 1);" 54 echo "INSERT INTO mail_alias 55 VALUES ('${user}_${FQDN}', 56 '\"| $MAILMAN_SCRIPT post mailman\"');" 57 for kind in request owner admin bounces confirm join \ 58 leave subscribe unsubscribe; do 59 echo "INSERT INTO mail_domain 60 VALUES ('mailman-${kind}@${FQDN}', 61 'mailman-${kind}_${FQDN}', 2000, 0, 1);" 62 echo "INSERT INTO mail_alias 63 VALUES ('mailman-${kind}_${FQDN}', 64 '\"| $MAILMAN_SCRIPT ${kind} mailman\"');" 65 done 66 ) | mysql -f -u"$MYSQL_USER" -p"$MYSQL_PASS" -h"$MYSQL_HOST" \ 67 "$MYSQL_DATABASE" || true 34 68 fi 35 69 70 # Refresh apache configuration 71 configure /etc/alternc/templates/apache/httpd.conf 72 configure /etc/alternc/templates/apache-ssl/httpd.conf 73 ln -sf /usr/lib/cgi-bin/mailman /var/alternc/cgi-bin/mailman 74 alternc.install 36 75 37 if [ $QUIT -eq 0 ] 38 then 39 # Oui : on peut créer la table mailman tout de suite 40 . /etc/alternc/local.sh 41 echo "Installing mysql table" 42 mysql -u"$MYSQL_USER" -p"$MYSQL_PASS" -h"$MYSQL_HOST" "$MYSQL_DATABASE" </usr/share/alternc/install/mailman.sql || true 43 # on modifie le httpd.conf d'apache et d'apache-ssl (déjà installés) 44 echo "Configuring apache" 45 configure /etc/apache/httpd.conf 46 echo "Configuring apache-ssl" 47 configure /etc/apache-ssl/httpd.conf 48 echo "Configuration AlternC" 49 # On modifie /usr/share/alternc/install/etc/apache et apache-ssl 50 # uniquement si besoin. 51 configure /usr/share/alternc/install/etc/apache/httpd.conf 52 configure /usr/share/alternc/install/etc/apache-ssl/httpd.conf 53 # On crée le fichier mm_cfg.py dans /etc/mailman : 54 echo "Création du fichier de config mailman" 55 sed -e "s/%%fqdn%%/$FQDN/" </usr/share/alternc/install/etc/mailman/mm_cfg.py >/etc/mailman/mm_cfg.py 56 # Process the language compilation. 57 /usr/share/alternc/install/dopo.sh 58 ln -sf /usr/lib/cgi-bin/mailman /var/alternc/cgi-bin/mailman 59 # ADD Mailman menu item : 60 MENUFILE=/var/alternc/bureau/admin/menulist.txt 61 if grep -vqs "menu_mailman" $MENUFILE 62 then 63 rm -f $MENUFILE.alternc_mailman 64 sed -e "s/menu_ftp.php/&\\ 76 # Process the language compilation. 77 /usr/share/alternc/install/dopo.sh 78 79 # ADD Mailman menu item : 80 if ! grep -q "^menu_mailman.php$" "$MENUFILE"; then 81 rm -f $MENUFILE.alternc_mailman 82 sed -e "s/menu_ftp.php/&\\ 65 83 menu_mailman.php/" <$MENUFILE >$MENUFILE.alternc_mailman 66 mv -f $MENUFILE.alternc_mailman $MENUFILE 67 fi 68 # Set nonexec on list creation / deletion via cgi-bin 69 chmod 0 /usr/lib/cgi-bin/mailman/create /usr/lib/cgi-bin/mailman/rmlist || true 70 /etc/init.d/apache restart 71 /etc/init.d/apache-ssl restart 72 else 73 # Source debconf library. 74 . /usr/share/debconf/confmodule 75 db_version 2.0 76 db_title AlternC-Mailman 77 db_fset alternc-mailman/errorinstall seen false 78 db_input medium alternc-mailman/errorinstall 79 db_go 80 # il FAUT qu'AlternC soit proprement configuré pour installer mailman 81 exit 1 84 mv -f $MENUFILE.alternc_mailman $MENUFILE 82 85 fi 83 fi 86 ;; 87 88 abort-upgrade|abort-remove|abort-deconfigure) 89 ;; 90 91 *) 92 echo "postinst called with unknown argument \`$1'" >&2 93 exit 1 94 ;; 95 esac 84 96 85 97 # dh_installdeb will replace this with shell code automatically 86 98 # generated by other debhelper scripts. 87 99 #DEBHELPER# 100 101 # vim: et sw=4 trunk/debian/postrm
r1227 r1237 1 1 #!/bin/sh -e 2 2 3 # Cette fonction regarde si un fichier de config ($1) a déjà reçu une modif 4 # de config, et si oui, lui enleve les lignes voulues 3 CONFIGFILE="/etc/alternc/local.sh" 4 MENUFILE="/etc/alternc/menulist.txt" 5 6 # Remove mailman aliases to the apache configuration file given as argument 5 7 function unconfigure { 6 if grep -qs "\*\*\*MAILMAN\*\*\*" $1 7 then 8 # 1. on déplace le fichier 9 rm -f $1.alternc_mailman 10 cat $1 | grep -v "\*\*\*MAILMAN\*\*\*" | grep -v " Alias /marchives/ /var/lib/mailman/archives/public/" | grep -v "Alias /mimages/ /usr/share/images/mailman/" >$1.alternc_mailman 8 if grep -Eqs "\*\*\*MAILMAN\*\*\*" $1; then 9 cp -a -f $1.alternc_mailman 10 cat $1 | grep -v "\*\*\*MAILMAN\*\*\*" | 11 grep -v " Alias /marchives/ /var/lib/mailman/archives/public/" | 12 grep -v "Alias /mimages/ /usr/share/images/mailman/" \ 13 > $1.alternc_mailman 11 14 mv -f $1.alternc_mailman $1 12 15 fi … … 15 18 case "$1" in 16 19 remove) 17 unconfigure /etc/apache/httpd.conf 18 unconfigure /etc/apache-ssl/httpd.conf 19 unconfigure /usr/share/alternc/install/etc/apache/httpd.conf 20 unconfigure /usr/share/alternc/install/etc/apache-ssl/httpd.conf 20 # Remove Mailman references from Apache configuration 21 unconfigure /etc/alternc/templates/apache/httpd.conf 22 unconfigure /etc/alternc/templates/apache-ssl/httpd.conf 23 alternc.install 24 21 25 rm -f /var/alternc/cgi-bin/mailman 22 MENUFILE=/var/alternc/bureau/admin/menulist.txt 23 if grep -qs "menu_mailman.php" $MENUFILE 24 then 26 27 if grep -qs "menu_mailman.php" $MENUFILE; then 25 28 rm -f $MENUFILE.alternc_mailman 26 29 cat $MENUFILE | grep -v "menu_mailman.php" >$MENUFILE.alternc_mailman … … 29 32 ;; 30 33 purge) 31 . /etc/alternc/local.sh 32 mysql -f -u"$MYSQL_USER" -p"$MYSQL_PASS" -h"$MYSQL_HOST" "$MYSQL_DATABASE" -e "DROP TABLE IF EXISTS mailman" 34 if [ -e "$CONFIGFILE" -a -x "/usr/bin/mysql" ]; then 35 . "$CONFIGFILE" 36 mysql -f -u"$MYSQL_USER" -p"$MYSQL_PASS" -h"$MYSQL_HOST" \ 37 "$MYSQL_DATABASE" -e "DROP TABLE IF EXISTS mailman" 38 fi 33 39 ;; 34 40 esac 35 # purge36 41 37 42 # dh_installdeb will replace this with shell code automatically trunk/debian/rules
r1226 r1237 1 1 #!/usr/bin/make -f 2 # Sample debian/rules that uses debhelper.3 # This file is public domain software, originally written by Joey Hess.4 #5 # This version is for a multibinary package. It also allows you to build any6 # of the binary packages independantly, via binary-<package> targets.7 2 8 3 # Uncomment this to turn on verbose mode. 9 export DH_VERBOSE=1 10 11 ######################################## 12 ## TODO 13 ## Virer les lignes # inutiles ou historiques (marquées ##) 14 4 #export DH_VERBOSE=1 15 5 16 6 # This has to be exported to make some magic below work. … … 20 10 build-stamp: 21 11 dh_testdir 22 23 # compilation et installation des binaires 24 pushd src; make; popd 25 12 make -C src 26 13 touch build-stamp 27 14 … … 30 17 dh_testroot 31 18 rm -f build-stamp 32 33 # Add here commands to clean up after the build process. 34 #-$(MAKE) clean 35 #-$(MAKE) distclean 36 pushd src; make clean; popd 37 19 make -C src clean 38 20 dh_clean 39 21 40 install: DH_OPTIONS=41 22 install: build 42 23 dh_testdir … … 44 25 dh_clean -k 45 26 dh_installdirs 46 47 48 # Add here commands to install the package into debian/tmp.49 #$(MAKE) prefix=`pwd`/debian/tmp/usr install50 51 27 cp -r bureau debian/tmp/var/alternc/ 52 28 chown root:www-data -R debian/tmp/var/alternc 53 29 chmod -R 0640 debian/tmp/var/alternc 54 30 chmod -R a+X debian/tmp/var/alternc 55 56 31 # Install the binaries : -r-sr-sr-x 57 install -m 06555 -o list -g list src/mailman.create src/mailman.delete src/mailman.list debian/tmp/usr/lib/alternc/58 59 install -m 0644 mm_cfg.py debian/tmp/usr/share/alternc/install/etc/mailman/32 install -m 06555 -o list -g list \ 33 src/mailman.create src/mailman.delete src/mailman.list \ 34 debian/tmp/usr/lib/alternc/ 60 35 install -m 0644 mailman.sql debian/tmp/usr/share/alternc/install/ 61 62 36 # Remove any remaining CVS dir ;) 63 37 find debian/tmp/ -depth -name "CVS" -exec rm -rf {} \; 64 # dh_install --prefix=install/alternc65 66 # This single target is used to build all the packages, all at once, or67 # one at a time. So keep in mind: any options passed to commands here will68 # affect _all_ packages. Anything you want to only affect one package69 # should be put in another target, such as the install target.70 38 71 39 binary-common: build install … … 74 42 dh_installchangelogs 75 43 dh_installdocs 76 # dh_installexamples77 # dh_installmenu78 dh_installdebconf79 # dh_installlogrotate80 # dh_installemacsen81 # dh_installpam82 # dh_installmime83 # dh_installinit84 # dh_installman85 dh_installcron86 # dh_installinfo87 # dh_undocumented88 # dh_installman89 44 dh_strip 90 45 dh_link 91 46 dh_compress 92 dh_fixperms --exclude mailman.delete --exclude mailman.create --exclude mailman.list 93 94 95 # dh_makeshlibs 47 dh_fixperms --exclude mailman.delete \ 48 --exclude mailman.create --exclude mailman.list 96 49 dh_installdeb 97 50 dh_perl 98 # dh_shlibdeps99 51 dh_gencontrol -- -cdebian/control 100 52 dh_md5sums 101 53 dh_builddeb 102 54 103 # Build architecture independant packages using the common target.104 55 binary-indep: build install binary-common 105 # (Uncomment this next line if you have such packages.)106 # $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common107 56 108 # Build architecture dependant packages using the common target.109 57 binary-arch: build install binary-common 110 # $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common111 112 # Any other binary targets build just one binary package at a time.113 # binary-%: build install114 # make -f debian/rules binary-common DH_OPTIONS=-p$*115 116 # binary: binary-indep binary-arch117 # .PHONY: build clean binary-indep binary-arch binary install118 58 119 59 binary: binary-common 120 60 121 .PHONY: build clean binary install61 .PHONY: build clean binary binary-common binary-arch binary-indep install trunk/mm_cfg.py
r1218 r1237 1 1 # -*- python -*- 2 3 # WARNING! DO NOT EDIT THIS FILE! 4 # 5 # This file has been generated by alternc-mailman configuration. 6 # 7 # If you want to change anything, you should modify 8 # /etc/alternc/templates/mailman/mm_cfg.py 9 # and use 10 # dpkg-reconfigure alternc-mailman 11 # to update this file. 2 12 3 13 # Copyright (C) 1998,1999,2000 by the Free Software Foundation, Inc.
