Changeset 476 in ProjectBuilder for projects/dploy


Ignore:
Timestamp:
Jun 4, 2008, 4:42:52 PM (16 years ago)
Author:
Bruno Cornec
Message:

moving post install from %post to a dedicated external perl script

Location:
projects/dploy/pbconf/devel
Files:
14 added
4 edited

Legend:

Unmodified
Added
Removed
  • projects/dploy/pbconf/devel/dploy-common/rpm/dploy-common.spec

    r470 r476  
    4545
    4646%files
    47 %defattr(-,dploy,dploy)
     47%defattr(-,root,root)
    4848%doc ChangeLog
    4949%doc INSTALL COPYING README
     
    5353
    5454%{perlvendorlib}/*
    55 #%{_bindir}/*
    56 #%{_mandir}/man1/*
     55%{_bindir}/*
     56%{_mandir}/man1/*
    5757%{_mandir}/man3/*
    5858
    5959%pre
    6060# Create dploy Account and group if needed
    61 grep -qE '^dploy:' %{_sysconfdir}/group
     61grep -qE '^PBPROJ:' %{_sysconfdir}/group
    6262if [ $? -ne 0 ]; then
    63     groupadd dploy
     63    groupadd PBPROJ
    6464fi
    65 grep -qE '^dploy:' %{_sysconfdir}/passwd
     65grep -qE '^PBPROJ:' %{_sysconfdir}/passwd
    6666if [ $? -ne 0 ]; then
    67     useradd -g dploy dploy
     67    useradd -g PBPROJ PBPROJ
    6868fi
    6969
    7070%post
    71 # Open ssh access for dploy account with generated keys
    72 mkdir -p ~dploy/.ssh
    73 chmod 700 ~dploy/.ssh
    74 keyf=~dploy/.ssh/authorized_keys
    75 if [ -f $keyf ]; then
    76     key=`cut -d' ' -f2 %{_sysconfdir}/PBPROJ/keys/dploy_id_dsa.pub`
    77     grep -qE \'$key\' $keyf
    78     if [ $? -ne 0 ]; then
    79         cat %{_sysconfdir}/PBPROJ/keys/dploy_id_dsa.pub >> $keyf
    80     fi
    81 else
    82     cp %{_sysconfdir}/PBPROJ/keys/dploy_id_dsa.pub $keyf
    83     chown dploy:dploy $keyf
    84     chmod 600 $keyf
    85 fi
     71%{_bindir}/dploy-common-post
    8672
    8773%changelog
  • projects/dploy/pbconf/devel/dploy-dhcp/rpm/dploy-dhcp.spec

    r470 r476  
    4141#%doc INSTALL COPYING README AUTHORS NEWS
    4242%{_bindir}/*
     43%{_mandir}/man1/*
    4344
    4445%post
    45 # Include our configuration file in std dhcp.conf file
    46 #grep -qE '^include "%{_sysconfdir}/PBPROJ/dhcpd.conf";' /etc/dhcpd.conf
    47 #if [ $? -ne 0 ]; then
    48     #echo 'include "%{_sysconfdir}/PBPROJ/dhcpd.conf";' >> /etc/dhcpd.conf
    49 #fi
    50 
    51 # Give us the rights to modify the DHCP conf file
    52 chgrp dploy %{_sysconfdir}/dhcpd.conf
    53 chmod 664 %{_sysconfdir}/dhcpd.conf
    54 
    55 # Include dploy in sudoers
    56 grep -qE '^dploy ' %{_sysconfdir}/sudoers | grep %{_sysconfdir}/init.d/dhcpd
    57 if [ $? -ne 0 ]; then
    58     echo 'dploy ALL=NOPASSWD: /etc/init.d/dhcpd ?*' >> %{_sysconfdir}/sudoers
    59 fi
     46%{_bindir}/dploy-dhcp-post
    6047
    6148%changelog
  • projects/dploy/pbconf/devel/dploy-pxe/rpm/dploy-pxe.spec

    r470 r476  
    1515BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n)
    1616BuildArch:      noarch
    17 Requires:       dploy-common, tftp-server, sudo, perl, syslinux, PBDEP
     17Requires:       dploy-common, dploy-pxelinux, tftp-server, sudo, perl, PBDEP
    1818
    1919%description
     
    4141#%doc INSTALL COPYING README AUTHORS NEWS
    4242%{_bindir}/*
     43%{_mandir}/man1/*
    4344
    4445%post
    45 # Include dploy in sudoers
    46 grep -qE '^dploy ' %{_sysconfdir}/sudoers | grep /bin/umount
    47 if [ $? -ne 0 ]; then
    48     echo 'dploy ALL=NOPASSWD: /bin/mount -o loop ?*' >> %{_sysconfdir}/sudoers
    49     echo 'dploy ALL=NOPASSWD: /bin/umount ?*' >> %{_sysconfdir}/sudoers
    50 fi
    51 
    52 # Setup all required paths for tftpboot environment
    53 pathpxe=`grep pathpxe %{_sysconfdir}/PBPROJ/dploy.conf | cut -d= -f2`
    54 for p in $pathpxe $pathpxe/../mondorescue $pathpxe/../linuxcoe; do
    55     if [ ! -d $p ]; then
    56         mkdir -p $p
    57     fi
    58     chgrp dploy $p
    59     chmod 775 $p
    60 done
     46%{_bindir}/dploy-pxe-post
    6147
    6248%changelog
  • projects/dploy/pbconf/devel/dploy.pb

    r445 r476  
    5353# List of files per pkg on which to apply filters
    5454# Files are mentioned relatively to pbroot/defpkgdir
    55 filteredfiles dploy-dhcp = install.sh,bin/dploy-add2dhcp
    56 filteredfiles dploy-pxe = install.sh,bin/dploy-add2pxe
    57 filteredfiles dploy-common = install.sh,Makefile.PL
     55filteredfiles dploy-dhcp = install.sh,bin/dploy-add2dhcp,dploy-dhcp-post
     56filteredfiles dploy-pxe = install.sh,bin/dploy-add2pxe,dploy-pxe-post
     57filteredfiles dploy-common = install.sh,Makefile.PL,bin/dploy-common-post
    5858#filteredfiles pkg1-doc = configure.in
Note: See TracChangeset for help on using the changeset viewer.