| [2090] | 1 | --- openafs.spec.orig   2011-12-11 04:48:08.257676312 -0500 | 
|---|
|  | 2 | +++ openafs.spec        2011-12-11 04:49:43.101175888 -0500 | 
|---|
|  | 3 | @@ -225,6 +225,9 @@ | 
|---|
| [2011] | 4 | Packager: OpenAFS Gatekeepers <openafs-gatekeepers@openafs.org> | 
|---|
|  | 5 | Group: Networking/Filesystems | 
|---|
| [2090] | 6 | BuildRequires: %{?kdepend:%{kdepend}, } pam-devel, ncurses-devel, flex, bison | 
|---|
|  | 7 | +%if 0%{?fedora} >= 15 | 
|---|
|  | 8 | +BuildRequires: systemd-units | 
|---|
|  | 9 | +%endif | 
|---|
| [2011] | 10 | %if 0%{?fedora} | 
|---|
|  | 11 | BuildRequires: perl-devel perl-ExtUtils-Embed | 
|---|
|  | 12 | %endif | 
|---|
| [2090] | 13 | @@ -326,6 +329,12 @@ | 
|---|
| [2011] | 14 | %package client | 
|---|
|  | 15 | Provides: scripts-openafs-client | 
|---|
|  | 16 | Requires: binutils, openafs = %{version} | 
|---|
|  | 17 | +%if 0%{?fedora} >= 15 | 
|---|
|  | 18 | +Requires: systemd-units | 
|---|
|  | 19 | +Requires(post): systemd-units, systemd-sysv | 
|---|
|  | 20 | +Requires(preun): systemd-units | 
|---|
|  | 21 | +Requires(postun): systemd-units | 
|---|
|  | 22 | +%endif | 
|---|
|  | 23 |  | 
|---|
|  | 24 | %if %{fedorakmod} | 
|---|
|  | 25 | Requires: %{name}-kmod >= %{version} | 
|---|
| [2090] | 26 | @@ -350,6 +359,12 @@ | 
|---|
| [2011] | 27 | Requires: openafs = %{version} | 
|---|
|  | 28 | Summary: OpenAFS Filesystem Server | 
|---|
|  | 29 | Group: Networking/Filesystems | 
|---|
|  | 30 | +%if 0%{?fedora} >= 15 | 
|---|
|  | 31 | +Requires: systemd-units | 
|---|
|  | 32 | +Requires(post): systemd-units, systemd-sysv | 
|---|
|  | 33 | +Requires(preun): systemd-units | 
|---|
|  | 34 | +Requires(postun): systemd-units | 
|---|
|  | 35 | +%endif | 
|---|
|  | 36 |  | 
|---|
|  | 37 | %description server | 
|---|
|  | 38 | The AFS distributed filesystem.  AFS is a distributed filesystem | 
|---|
| [2090] | 39 | @@ -1005,7 +1020,12 @@ | 
|---|
| [2011] | 40 | mkdir -p $RPM_BUILD_ROOT%{_sbindir} | 
|---|
|  | 41 | mkdir -p $RPM_BUILD_ROOT%{_libdir} | 
|---|
|  | 42 | mkdir -p $RPM_BUILD_ROOT/etc/sysconfig | 
|---|
|  | 43 | +%if 0%{?fedora} < 15 | 
|---|
|  | 44 | mkdir -p $RPM_BUILD_ROOT%{initdir} | 
|---|
|  | 45 | +%else | 
|---|
|  | 46 | +mkdir -p $RPM_BUILD_ROOT%{_unitdir} | 
|---|
|  | 47 | +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/modules | 
|---|
|  | 48 | +%endif | 
|---|
|  | 49 | mkdir -p $RPM_BUILD_ROOT/etc/openafs | 
|---|
|  | 50 | mkdir -p $RPM_BUILD_ROOT%{pamdir} | 
|---|
|  | 51 | mkdir -p $RPM_BUILD_ROOT%{_prefix}/afs/etc | 
|---|
| [2090] | 52 | @@ -1035,8 +1055,14 @@ | 
|---|
| [2011] | 53 |  | 
|---|
|  | 54 | # Copy root.client config files | 
|---|
|  | 55 | install -m 755 src/packaging/RedHat/openafs.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/openafs | 
|---|
|  | 56 | +%if 0%{?fedora} < 15 | 
|---|
|  | 57 | install -m 755 src/packaging/RedHat/openafs-client.init $RPM_BUILD_ROOT%{initdir}/openafs-client | 
|---|
|  | 58 | install -m 755 src/packaging/RedHat/openafs-server.init $RPM_BUILD_ROOT%{initdir}/openafs-server | 
|---|
|  | 59 | +%else | 
|---|
|  | 60 | +install -m 755 src/packaging/RedHat/openafs-client.service $RPM_BUILD_ROOT%{_unitdir}/openafs-client.service | 
|---|
|  | 61 | +install -m 755 src/packaging/RedHat/openafs-client.modules $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/modules/openafs-client.modules | 
|---|
|  | 62 | +install -m 755 src/packaging/RedHat/openafs-server.service $RPM_BUILD_ROOT%{_unitdir}/openafs-server.service | 
|---|
|  | 63 | +%endif | 
|---|
|  | 64 |  | 
|---|
|  | 65 | # Copy PAM modules | 
|---|
|  | 66 | install -m 755 ${sysname}/dest/lib/pam* $RPM_BUILD_ROOT%{pamdir} | 
|---|
| [2090] | 67 | @@ -1318,7 +1344,14 @@ | 
|---|
| [2011] | 68 | fi | 
|---|
|  | 69 |  | 
|---|
|  | 70 | %post client | 
|---|
|  | 71 | +%if 0%{?fedora} < 15 | 
|---|
|  | 72 | chkconfig --add openafs-client | 
|---|
|  | 73 | +%else | 
|---|
|  | 74 | +if [ $1 -eq 1 ] ; then | 
|---|
|  | 75 | +    # Initial installation | 
|---|
|  | 76 | +    /bin/systemctl daemon-reload >/dev/null 2>&1 || : | 
|---|
|  | 77 | +fi | 
|---|
|  | 78 | +%endif | 
|---|
|  | 79 | if [ ! -d /afs ]; then | 
|---|
|  | 80 | mkdir /afs | 
|---|
|  | 81 | chown root.root /afs | 
|---|
| [2090] | 82 | @@ -1335,10 +1368,17 @@ | 
|---|
| [2011] | 83 |  | 
|---|
|  | 84 | %post server | 
|---|
|  | 85 | #on an upgrade, don't enable if we were disabled | 
|---|
|  | 86 | +%if 0%{?fedora} < 15 | 
|---|
|  | 87 | if [ $1 = 1 ] ; then | 
|---|
|  | 88 | chkconfig --add openafs-server | 
|---|
|  | 89 | fi | 
|---|
|  | 90 | %{initdir}/openafs-server condrestart | 
|---|
|  | 91 | +%else | 
|---|
|  | 92 | +if [ $1 -eq 1 ] ; then | 
|---|
|  | 93 | +    # Initial installation | 
|---|
|  | 94 | +    /bin/systemctl daemon-reload >/dev/null 2>&1 || : | 
|---|
|  | 95 | +fi | 
|---|
|  | 96 | +%endif | 
|---|
|  | 97 |  | 
|---|
|  | 98 | %if %{build_authlibs} | 
|---|
|  | 99 | %post authlibs | 
|---|
| [2090] | 100 | @@ -1354,16 +1394,39 @@ | 
|---|
| [2011] | 101 | fi | 
|---|
|  | 102 |  | 
|---|
|  | 103 | %preun client | 
|---|
|  | 104 | +%if 0%{?fedora} < 15 | 
|---|
|  | 105 | if [ $1 = 0 ] ; then | 
|---|
|  | 106 | %{initdir}/openafs-client stop | 
|---|
|  | 107 | chkconfig --del openafs-client | 
|---|
|  | 108 | fi | 
|---|
|  | 109 | +%else | 
|---|
|  | 110 | +if [ $1 -eq 0 ] ; then | 
|---|
|  | 111 | +       # Package removal, not upgrade | 
|---|
|  | 112 | +       /bin/systemctl --no-reload disable openafs-client.service > /dev/null 2>&1 || : | 
|---|
|  | 113 | +       /bin/systemctl stop openafs-client.service > /dev/null 2>&1 || : | 
|---|
|  | 114 | +fi | 
|---|
|  | 115 | +%endif | 
|---|
|  | 116 |  | 
|---|
|  | 117 | %preun server | 
|---|
|  | 118 | +%if 0%{?fedora} < 15 | 
|---|
|  | 119 | if [ $1 = 0 ] ; then | 
|---|
|  | 120 | %{initdir}/openafs-server stop | 
|---|
|  | 121 | chkconfig --del openafs-server | 
|---|
|  | 122 | fi | 
|---|
|  | 123 | +%else | 
|---|
|  | 124 | +if [ $1 -eq 0 ] ; then | 
|---|
|  | 125 | +       /bin/systemctl --no-reload disable openafs-server.service > /dev/null 2>&1 || : | 
|---|
|  | 126 | +       /bin/systemctl stop openafs-server.service > /dev/null 2>&1 || : | 
|---|
|  | 127 | +fi | 
|---|
|  | 128 | +%endif | 
|---|
|  | 129 | + | 
|---|
| [2090] | 130 | +%if 0%{?fedora} >= 15 | 
|---|
| [2011] | 131 | +%postun client | 
|---|
|  | 132 | +/bin/systemctl daemon-reload >/dev/null 2>&1 || : | 
|---|
|  | 133 | + | 
|---|
|  | 134 | +%postun server | 
|---|
|  | 135 | +/bin/systemctl daemon-reload >/dev/null 2>&1 || : | 
|---|
| [2090] | 136 | +%endif | 
|---|
| [2011] | 137 |  | 
|---|
|  | 138 | %if %{build_dkmspkg} | 
|---|
|  | 139 | %post -n dkms-%{name} | 
|---|
| [2090] | 140 | @@ -1421,6 +1484,26 @@ | 
|---|
| [2011] | 141 | %endif | 
|---|
|  | 142 | %endif | 
|---|
|  | 143 |  | 
|---|
| [2090] | 144 | +%if 0%{?fedora} >= 15 | 
|---|
| [2011] | 145 | +%triggerun -- openafs-client < 1.6.0-1 | 
|---|
|  | 146 | +# Save the current service runlevel info | 
|---|
|  | 147 | +# User must manually run systemd-sysv-convert --apply httpd | 
|---|
|  | 148 | +# to migrate them to systemd targets | 
|---|
|  | 149 | +/usr/bin/systemd-sysv-convert --save openafs-client >/dev/null 2>&1 ||: | 
|---|
|  | 150 | + | 
|---|
| [2089] | 151 | +# Run this because the SysV package being removed won't do it | 
|---|
| [2011] | 152 | +/sbin/chkconfig --del openafs-client >/dev/null 2>&1 || : | 
|---|
|  | 153 | + | 
|---|
|  | 154 | +%triggerun -- openafs-server < 1.6.0-1 | 
|---|
|  | 155 | +# Save the current service runlevel info | 
|---|
|  | 156 | +# User must manually run systemd-sysv-convert --apply httpd | 
|---|
|  | 157 | +# to migrate them to systemd targets | 
|---|
|  | 158 | +/usr/bin/systemd-sysv-convert --save openafs-server >/dev/null 2>&1 ||: | 
|---|
|  | 159 | + | 
|---|
| [2089] | 160 | +# Run this because the SysV package being removed won't do it | 
|---|
| [2011] | 161 | +/sbin/chkconfig --del openafs-server >/dev/null 2>&1 || : | 
|---|
| [2090] | 162 | +%endif | 
|---|
| [2011] | 163 | + | 
|---|
|  | 164 | ############################################################################## | 
|---|
|  | 165 | ### | 
|---|
|  | 166 | ### file lists | 
|---|
| [2090] | 167 | @@ -1458,7 +1541,12 @@ | 
|---|
| [2011] | 168 | %{pamdir}/pam_afs.krb.so | 
|---|
|  | 169 | %{pamdir}/pam_afs.so.1 | 
|---|
|  | 170 | %{pamdir}/pam_afs.so | 
|---|
|  | 171 | +%if 0%{?fedora} < 15 | 
|---|
|  | 172 | %{initdir}/openafs-client | 
|---|
|  | 173 | +%else | 
|---|
|  | 174 | +%{_unitdir}/openafs-client.service | 
|---|
|  | 175 | +%{_sysconfdir}/sysconfig/modules/openafs-client.modules | 
|---|
|  | 176 | +%endif | 
|---|
|  | 177 | %{_mandir}/man1/cmdebug.* | 
|---|
|  | 178 | %{_mandir}/man1/copyauth.* | 
|---|
|  | 179 | %{_mandir}/man1/up.* | 
|---|
| [2090] | 180 | @@ -1506,7 +1594,11 @@ | 
|---|
| [2011] | 181 | %{_sbindir}/vldb_check | 
|---|
|  | 182 | %{_sbindir}/vldb_convert | 
|---|
|  | 183 | %{_sbindir}/voldump | 
|---|
|  | 184 | +%if 0%{?fedora} < 15 | 
|---|
|  | 185 | %{initdir}/openafs-server | 
|---|
|  | 186 | +%else | 
|---|
|  | 187 | +%{_unitdir}/openafs-server.service | 
|---|
|  | 188 | +%endif | 
|---|
|  | 189 | %{_mandir}/man5/AuthLog.* | 
|---|
|  | 190 | %{_mandir}/man5/BackupLog.* | 
|---|
|  | 191 | %{_mandir}/man5/BosConfig.* | 
|---|