| [1] | 1 | Summary: scripts.mit.edu AFS administration system | 
|---|
 | 2 | Group: Applications/System | 
|---|
 | 3 | Name: tokensys | 
|---|
| [926] | 4 | Version: 0.%{scriptsversion} | 
|---|
| [120] | 5 | Release: 0 | 
|---|
| [1] | 6 | Vendor: The scripts.mit.edu Team (scripts@mit.edu) | 
|---|
 | 7 | URL: http://scripts.mit.edu | 
|---|
 | 8 | License: GPL | 
|---|
| [89] | 9 | Source: %{name}.tar.gz | 
|---|
| [1] | 10 | BuildRoot: %{_tmppath}/%(%{__id_u} -n)-%{name}-%{version}-root | 
|---|
 | 11 | %define debug_package %{nil} | 
|---|
| [1836] | 12 | Prereq: /usr/bin/kinit, /usr/bin/aklog | 
|---|
| [2063] | 13 | Requires(post): systemd-units | 
|---|
 | 14 | Requires(preun): systemd-units | 
|---|
 | 15 | Requires(postun): systemd-units | 
|---|
 | 16 | BuildRequires: systemd-units | 
|---|
| [1] | 17 |  | 
|---|
| [89] | 18 | %description | 
|---|
| [1] | 19 |  | 
|---|
 | 20 | scripts.mit.edu AFS administration system | 
|---|
 | 21 | Contains: | 
|---|
| [89] | 22 |  - A shell script for renewing the scripts AFS credentials <renew> | 
|---|
| [2063] | 23 |  - A shell script for configuring scripts AFS <scripts-afsagent-startup> | 
|---|
 | 24 |  - systemd units for running the above | 
|---|
| [1] | 25 | See http://scripts.mit.edu/wiki for more information. | 
|---|
 | 26 |  | 
|---|
 | 27 | %prep | 
|---|
 | 28 | %setup -q -n %{name} | 
|---|
 | 29 |  | 
|---|
 | 30 | %build | 
|---|
| [2063] | 31 | ./configure --with-kinit=/usr/bin/kinit --with-aklog=/usr/bin/aklog --with-fs=/usr/bin/fs | 
|---|
| [1] | 32 |  | 
|---|
 | 33 | %install | 
|---|
 | 34 | [ $RPM_BUILD_ROOT != / ] && rm -rf $RPM_BUILD_ROOT | 
|---|
 | 35 | install -D renew $RPM_BUILD_ROOT/home/afsagent/renew | 
|---|
| [2063] | 36 | install -D scripts-afsagent-startup $RPM_BUILD_ROOT/usr/local/libexec/scripts-afsagent-startup | 
|---|
 | 37 | install -D scripts-afsagent-startup.service $RPM_BUILD_ROOT%{_unitdir}/scripts-afsagent-startup.service | 
|---|
 | 38 | install -D scripts-afsagent.service $RPM_BUILD_ROOT%{_unitdir}/scripts-afsagent.service | 
|---|
 | 39 | install -D scripts-afsagent.timer $RPM_BUILD_ROOT%{_unitdir}/scripts-afsagent.timer | 
|---|
| [1] | 40 |  | 
|---|
 | 41 | %clean | 
|---|
 | 42 | [ $RPM_BUILD_ROOT != / ] && rm -rf $RPM_BUILD_ROOT | 
|---|
 | 43 |  | 
|---|
 | 44 | %files | 
|---|
| [2063] | 45 | %defattr(0644,root,root) | 
|---|
 | 46 | %{_unitdir}/*.service | 
|---|
 | 47 | %{_unitdir}/*.timer | 
|---|
| [1] | 48 | %defattr(0755, afsagent, afsagent) | 
|---|
 | 49 | /home/afsagent/renew | 
|---|
| [2063] | 50 | /usr/local/libexec/scripts-afsagent-startup | 
|---|
| [1] | 51 |  | 
|---|
 | 52 | %pre | 
|---|
| [920] | 53 | groupadd -g 101 afsagent || [ $? -eq 9 ] | 
|---|
 | 54 | useradd -u 101 -g 101 afsagent || [ $? -eq 9 ] | 
|---|
| [1] | 55 |  | 
|---|
| [2063] | 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 |  | 
|---|
 | 61 | if [ $1 -eq 1 ] ; then  | 
|---|
 | 62 |     # Initial installation  | 
|---|
 | 63 |     /bin/systemctl daemon-reload >/dev/null 2>&1 || : | 
|---|
 | 64 | fi | 
|---|
 | 65 |  | 
|---|
 | 66 | %preun | 
|---|
 | 67 | if [ $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 || : | 
|---|
 | 75 | fi | 
|---|
 | 76 |  | 
|---|
| [1] | 77 | %postun | 
|---|
| [2063] | 78 | /bin/systemctl daemon-reload >/dev/null 2>&1 || : | 
|---|
 | 79 | if [ $1 -ge 1 ] ; then | 
|---|
 | 80 |     # Package upgrade, not uninstall | 
|---|
 | 81 |     /bin/systemctl try-restart scripts-afsagent.service >/dev/null 2>&1 || : | 
|---|
 | 82 | fi | 
|---|
 | 83 |  | 
|---|
| [919] | 84 | if [ "$1" = "0" ] ; then | 
|---|
 | 85 |    userdel -r afsagent | 
|---|
 | 86 | fi | 
|---|
| [1] | 87 |  | 
|---|
 | 88 | %changelog | 
|---|
| [2063] | 89 | * Mon Nov 21 2011  Quentin Smith <quentin@mit.edu> | 
|---|
 | 90 | - add systemd units | 
|---|
 | 91 | - remove crontab | 
|---|
 | 92 |  | 
|---|
| [1594] | 93 | * Tue Aug 17 2010  Geoffrey Thomas <geofft@mit.edu> | 
|---|
 | 94 | - aklog csail as well | 
|---|
 | 95 |  | 
|---|
| [919] | 96 | * Wed Dec 31 2008  Quentin Smith <quentin@mit.edu> | 
|---|
 | 97 | - only remove afsagent user on erase | 
|---|
| [920] | 98 | - ignore preexisting user | 
|---|
| [1] | 99 |  | 
|---|
| [282] | 100 | * Wed Apr 11 2007  Joe Presbrey <presbrey@mit.edu> | 
|---|
 | 101 | - crontab moved system-wide (/etc/cron.d) to isolate from fail-over cron service | 
|---|
 | 102 |  | 
|---|
| [1] | 103 | * Sat Sep 30 2006  Jeff Arnold <jbarnold@MIT.EDU> 0.00 | 
|---|
 | 104 | - initial prerelease version | 
|---|