[exim-cvs] cvs commit: exim/exim-course/rpm README exim-cour…

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Tony Finch
Datum:  
To: exim-cvs
Betreff: [exim-cvs] cvs commit: exim/exim-course/rpm README exim-course.spec
fanf2 2005/07/01 23:44:19 BST

  Modified files:
    exim-course/rpm      README exim-course.spec 
  Log:
  Various fixes arising from the trial run-through with ph10 and timj.


  Revision  Changes    Path
  1.2       +8 -3      exim/exim-course/rpm/README
  1.3       +52 -15    exim/exim-course/rpm/exim-course.spec


  Index: README
  ===================================================================
  RCS file: /home/cvs/exim/exim-course/rpm/README,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- README    20 Jun 2005 18:32:07 -0000    1.1
  +++ README    1 Jul 2005 22:44:19 -0000    1.2
  @@ -5,17 +5,22 @@
   9.3. This installation needs some further adaptation for the course:


   Standard SUSE RPMs to add:
  -  SpamAssassin
  -  ClamAV
  +  clamav
  +  db-devel
  +  (we also need spamassassin but that is installed by default)
  +
   PWF Linux RPMs to remove:
  -  pwf-refresh (reset PWF machine to standard config)
     pwf-idlecheck (auto-reboot to Windows)
  +  pwf-exim


   Add a custom RPM to do the following:
     reset root password for use by course attendees
     create non-privileged users
  +  remove root from /etc/aliases
  +  ensure spamd and clamd are running
     install Exim source
  +  install eicar.com


This directory includes the source for the latter RPM.

-$Cambridge: exim/exim-course/rpm/README,v 1.1 2005/06/20 18:32:07 fanf2 Exp $
+$Cambridge: exim/exim-course/rpm/README,v 1.2 2005/07/01 22:44:19 fanf2 Exp $

  Index: exim-course.spec
  ===================================================================
  RCS file: /home/cvs/exim/exim-course/rpm/exim-course.spec,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -u -r1.2 -r1.3
  --- exim-course.spec    21 Jun 2005 14:20:54 -0000    1.2
  +++ exim-course.spec    1 Jul 2005 22:44:19 -0000    1.3
  @@ -1,4 +1,4 @@
  -# $Cambridge: exim/exim-course/rpm/exim-course.spec,v 1.2 2005/06/21 14:20:54 fanf2 Exp $
  +# $Cambridge: exim/exim-course/rpm/exim-course.spec,v 1.3 2005/07/01 22:44:19 fanf2 Exp $
   #
   # The RPM spec file for the package which customizes PWF Linux for the
   # Exim course. This is a little bit sketchy and assumes a working
  @@ -10,28 +10,27 @@
   License:      GPL
   Group:        Development/Sources
   Autoreqprov:  on
  -Version:      4.51
  +Version:      4.52
   Release:      1
   Summary:      Customize PWF Linux for the Exim course
   BuildRoot:    %{_tmppath}/%{name}-%{version}-build
  +Provides:     smtp_daemon


%description
This package customizes PWF Linux for the Exim course. It sets up the
necessary users and passwords, and instals the Exim source code in
the home directory of the "course" user.

-Two unprivileged users are required for the course:
+Three unprivileged users are required for the course:

-(1) The "course" user is used for most of the course. It is a member
+(1) The "exim" user.
+
+(2) The "course" user is used for most of the course. It is a member
of the Exim group.

-(2) The "peon" user is for occasions when a totally unpriveleged user
+(3) The "peon" user is for occasions when a totally unpriveleged user
is required.

-For the purposes of the course, the Exim user and group are set to
-the PWF Linux default of "mail", which means we do not have to change
-the permissions on /var/spool/exim.
-
The password for "root", "course", and "peon" are all reset to a
course-specific password.

@@ -44,10 +43,17 @@
%install
# ensure clean install tree
rm -rf ${RPM_BUILD_ROOT}
-mkdir -p ${RPM_BUILD_ROOT}
+mkdir -p ${RPM_BUILD_ROOT}/usr/sbin
+cat <<EOF >> ${RPM_BUILD_ROOT}/usr/sbin/sendmail
+#!/bin/sh
+echo sendmail is not installed
+exit 1
+EOF
+chmod +x ${RPM_BUILD_ROOT}/usr/sbin/sendmail

# Please create a package with no files.
%files
+/usr/sbin/sendmail

   %pre
   : do nothing
  @@ -58,13 +64,19 @@
   # chosen the user and group numbers fairly randomly after checking
   # with uxsup that they are un-allocated.
   usermod -p '$1$pwf-exim$4pRtduTjWYyznvCbRN.Nr.' root
  +groupadd -g 876 exim
  +useradd -c 'Exim user' \
  +        -d /usr/exim \
  +        -g 876 -u 876 \
  +        -G exim \
  +        exim
   groupadd -g 864 course
   useradd -p '$1$pwf-exim$4pRtduTjWYyznvCbRN.Nr.' \
           -c 'Exim course user' \
           --create-home \
           -d /home/course \
           -g 864 -u 864 \
  -        -G course,mail \
  +        -G course,exim \
           course
   groupadd -g 888 peon
   useradd -p '$1$pwf-exim$4pRtduTjWYyznvCbRN.Nr.' \
  @@ -76,8 +88,19 @@
           peon
   # pre-fetch the Exim source code
   # NOTE: keep in sync with package version above!
  -wget -O /home/course/exim-4.51.tar.gz \
  -  ftp://ftp.csx.cam.ac.uk/pub/software/email/exim/exim4/exim-4.51.tar.gz
  +wget -O /home/course/exim-4.52.tar.gz \
  +  ftp://ftp.csx.cam.ac.uk/pub/software/email/exim/exim4/exim-4.52.tar.gz
  +# create eicar.com
  +echo > /home/course/eicar.com \
  +  'X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*'
  +# remove root from the aliases file that pwfcfg2 uses to reset the
  +# machine's configuration at boot time
  +. /etc/pwf-linux/pwfcfg2
  +mv ${PWFCFG_LOC}/etc/aliases ${PWFCFG_LOC}/etc/aliases.orig
  +sed '/^root:/d' ${PWFCFG_LOC}/etc/aliases.orig > ${PWFCFG_LOC}/etc/aliases
  +# turn on SpamAssassin and ClamAV
  +chkconfig spamd on
  +chkconfig clamd on


%preun
: do nothing
@@ -85,14 +108,28 @@
%postun
# Zap the root password. The proper PWF root password will be reset
# when the machines are re-ghosted after the course.
-usermod -p '$1$pwf-exim$BzVb3sCeX9zk9jXThlL/G/' root
+usermod -p '$1$pwf-exim$c1aEla82zUFh/GxSx4ddC.' root
# Just blitz the other users
-userdel --remove-home course
userdel --remove-home peon
-groupdel course
+userdel --remove-home course
+userdel --remove-home exim
groupdel peon
+groupdel course
+groupdel exim
+# restore the aliases file
+. /etc/pwf-linux/pwfcfg2
+mv ${PWFCFG_LOC}/etc/aliases.orig ${PWFCFG_LOC}/etc/aliases
+# turn off SpamAssassin and ClamAV
+chkconfig spamd off
+chkconfig clamd off

%changelog
+* Fri Jul 01 2005 - fanf@???
+- add exim user
+- create eicar.com
+- remove root from /etc/aliases
+- ensure spamd and clamd are running
+- fix dependencies by providing the right things
* Mon Jun 21 2005 - fanf@???
- fix scriptlet bugs
* Mon Jun 20 2005 - fanf@???