[exim-cvs] cvs commit: exim/exim-course/rpm Makefile exim-co…

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Tony Finch
Dátum:  
Címzett: exim-cvs
Tárgy: [exim-cvs] cvs commit: exim/exim-course/rpm Makefile exim-course.spec
fanf2 2005/06/20 19:21:55 BST

  Added files:
    exim-course/rpm      Makefile exim-course.spec 
  Log:
  Makefile and spec file for the RPM that customizes PWF Linux for
  the Exim course.


  Revision  Changes    Path
  1.1       +29 -0     exim/exim-course/rpm/Makefile (new)
  1.1       +94 -0     exim/exim-course/rpm/exim-course.spec (new)


Index: Makefile
====================================================================
# $Cambridge: exim/exim-course/rpm/Makefile,v 1.1 2005/06/20 18:21:55 fanf2 Exp $
#
# Build the rpm that customizes PWF Linux for the Exim course.
# This file assumes gnu make.

  name    :=    $(shell sed '/^Name:/!d;s/.* \([^ ]*\)/\1/' *.spec)
  version    :=    $(shell sed '/^Version:/!d;s/.* \([^ ]*\)/\1/' *.spec)
  release    :=    $(shell sed '/^Release:/!d;s/.* \([^ ]*\)/\1/' *.spec)


  NVR    =    ${name}-${version}-${release}


  spec    =    ${name}.spec


  TOP    =    /usr/src/packages
  SPEC    =    ${TOP}/SPECS/${name}.spec


  RPM    =    ${TOP}/RPMS/${NVR}.rpm
  SRPM    =    ${TOP}/SRPMS/${NVR}.src.rpm


  ${RPM} ${SRPM}: ${SPEC}
      rpmbuild -ba ${SPEC}


  ${SPEC}: ${spec}
      cp ${spec} ${SPEC}


  clean:
      rm -rf ${SPEC} ${RPM} ${SRPM} /var/tmp/${name}*


# eof

Index: exim-course.spec
====================================================================
# $Cambridge: exim/exim-course/rpm/exim-course.spec,v 1.1 2005/06/20 18:21:55 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
# environment rather than specifying the dependencies in full detail.

# norootforbuild

  Name:         exim-course
  License:      GPL
  Group:        Development/Sources
  Autoreqprov:  on
  Version:      4.51
  Release:      0
  Summary:      Customize PWF Linux for the Exim course
  BuildRoot:    %{_tmppath}/%{name}-%{version}-build


%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:

(1) 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
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.

%prep
: do nothing

%build
: do nothing

%install
# ensure clean install tree
rm -rf ${RPM_BUILD_ROOT}
mkdir -p ${RPM_BUILD_ROOT}

# Please create a package with no files.
%files

%pre
: do nothing

  %post
  # These crypted passwords are semi-public so it's reasonably OK to
  # leave them in CVS. We can change them each year if necessary. I have
  # 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
  useradd -p '$1$pwf-exim$4pRtduTjWYyznvCbRN.Nr.' \
          -c 'Exim course user' \
          --create-home \
          -d /home/course \
          -g 864 -u 864 \
          -G course,mail \
          course
  useradd -p '$1$pwf-exim$4pRtduTjWYyznvCbRN.Nr.' \
          -c 'unprivileged user' \
          --create-home \
          -d /home/peon \
          -g 888 -u 888 \
          -G peon \
          peon
  # pre-fetch the Exim source code
  wget -O ${RPM_BUILD_ROOT}/home/course/exim-${version}.tar.gz \
    ftp://ftp.csx.cam.ac.uk/pub/software/email/exim/exim4/exim-${version}.tar.gz


%preun
# 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
# Just blitz the other users
userdel --remove-home course
userdel --remove-home peon

%postun
: do nothing

%changelog
* Mon Jun 20 2005 - fanf@???
- initial cut

# eof