Ignore:
Timestamp:
Nov 22, 2011, 12:24:41 AM (12 years ago)
Author:
quentin
Message:
Package afsagent systemd and get rid of rc.local sysname hack
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/fc15-dev/server/fedora/specs/tokensys.spec

    r1836 r2063  
    1111%define debug_package %{nil}
    1212Prereq: /usr/bin/kinit, /usr/bin/aklog
     13Requires(post): systemd-units
     14Requires(preun): systemd-units
     15Requires(postun): systemd-units
     16BuildRequires: systemd-units
    1317
    1418%description
     
    1721Contains:
    1822 - A shell script for renewing the scripts AFS credentials <renew>
    19  - A crontab for calling the renew script <crontab>
     23 - A shell script for configuring scripts AFS <scripts-afsagent-startup>
     24 - systemd units for running the above
    2025See http://scripts.mit.edu/wiki for more information.
    2126
     
    2429
    2530%build
    26 ./configure --with-kinit=/usr/bin/kinit --with-aklog=/usr/bin/aklog
     31./configure --with-kinit=/usr/bin/kinit --with-aklog=/usr/bin/aklog --with-fs=/usr/bin/fs
    2732
    2833%install
    2934[ $RPM_BUILD_ROOT != / ] && rm -rf $RPM_BUILD_ROOT
    3035install -D renew $RPM_BUILD_ROOT/home/afsagent/renew
    31 install -D crontab $RPM_BUILD_ROOT/etc/cron.d/afsagent
     36install -D scripts-afsagent-startup $RPM_BUILD_ROOT/usr/local/libexec/scripts-afsagent-startup
     37install -D scripts-afsagent-startup.service $RPM_BUILD_ROOT%{_unitdir}/scripts-afsagent-startup.service
     38install -D scripts-afsagent.service $RPM_BUILD_ROOT%{_unitdir}/scripts-afsagent.service
     39install -D scripts-afsagent.timer $RPM_BUILD_ROOT%{_unitdir}/scripts-afsagent.timer
    3240
    3341%clean
     
    3543
    3644%files
    37 %defattr(0600, root, root)
    38 /etc/cron.d/afsagent
     45%defattr(0644,root,root)
     46%{_unitdir}/*.service
     47%{_unitdir}/*.timer
    3948%defattr(0755, afsagent, afsagent)
    4049/home/afsagent/renew
     50/usr/local/libexec/scripts-afsagent-startup
    4151
    4252%pre
     
    4454useradd -u 101 -g 101 afsagent || [ $? -eq 9 ]
    4555
     56%post
     57/bin/systemctl enable scripts-afsagent-startup.service >/dev/null 2>&1 || :
     58/bin/systemctl enable scripts-afsagent.service >/dev/null 2>&1 || :
     59/bin/systemctl enable scripts-afsagent.timer >/dev/null 2>&1 || :
     60
     61if [ $1 -eq 1 ] ; then
     62    # Initial installation
     63    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
     64fi
     65
     66%preun
     67if [ $1 -eq 0 ] ; then
     68    # Package removal, not upgrade
     69    /bin/systemctl --no-reload disable scripts-afsagent-startup.service > /dev/null 2>&1 || :
     70    /bin/systemctl --no-reload disable scripts-afsagent.service > /dev/null 2>&1 || :
     71    /bin/systemctl --no-reload disable scripts-afsagent.timer > /dev/null 2>&1 || :
     72    /bin/systemctl stop scripts-afsagent-startup.service > /dev/null 2>&1 || :
     73    /bin/systemctl stop scripts-afsagent.service > /dev/null 2>&1 || :
     74    /bin/systemctl stop scripts-afsagent.timer > /dev/null 2>&1 || :
     75fi
     76
    4677%postun
     78/bin/systemctl daemon-reload >/dev/null 2>&1 || :
     79if [ $1 -ge 1 ] ; then
     80    # Package upgrade, not uninstall
     81    /bin/systemctl try-restart scripts-afsagent.service >/dev/null 2>&1 || :
     82fi
     83
    4784if [ "$1" = "0" ] ; then
    4885   userdel -r afsagent
     
    5087
    5188%changelog
     89* Mon Nov 21 2011  Quentin Smith <quentin@mit.edu>
     90- add systemd units
     91- remove crontab
     92
    5293* Tue Aug 17 2010  Geoffrey Thomas <geofft@mit.edu>
    5394- aklog csail as well
Note: See TracChangeset for help on using the changeset viewer.