source: branches/fc17-dev/server/fedora/specs/openafs-systemd.spec.patch @ 2195

Last change on this file since 2195 was 2195, checked in by ezyang, 12 years ago
Merge changes from trunk.
File size: 5.4 KB
  • openafs.spec

    old new  
    225225Packager: OpenAFS Gatekeepers <openafs-gatekeepers@openafs.org>
    226226Group: Networking/Filesystems
    227227BuildRequires: %{?kdepend:%{kdepend}, } pam-devel, ncurses-devel, flex, bison
     228%if 0%{?fedora} >= 15
     229BuildRequires: systemd-units
     230%endif
    228231%if 0%{?fedora}
    229232BuildRequires: perl-devel perl-ExtUtils-Embed
    230233%endif
     
    326329%package client
    327330Provides: scripts-openafs-client
    328331Requires: binutils, openafs = %{version}
     332%if 0%{?fedora} >= 15
     333Requires: systemd-units
     334Requires(post): systemd-units, systemd-sysv
     335Requires(preun): systemd-units
     336Requires(postun): systemd-units
     337%endif
    329338
    330339%if %{fedorakmod}
    331340Requires: %{name}-kmod >= %{version}
     
    350359Requires: openafs = %{version}
    351360Summary: OpenAFS Filesystem Server
    352361Group: Networking/Filesystems
     362%if 0%{?fedora} >= 15
     363Requires: systemd-units
     364Requires(post): systemd-units, systemd-sysv
     365Requires(preun): systemd-units
     366Requires(postun): systemd-units
     367%endif
    353368
    354369%description server
    355370The AFS distributed filesystem.  AFS is a distributed filesystem
     
    10051020mkdir -p $RPM_BUILD_ROOT%{_sbindir}
    10061021mkdir -p $RPM_BUILD_ROOT%{_libdir}
    10071022mkdir -p $RPM_BUILD_ROOT/etc/sysconfig
     1023%if 0%{?fedora} < 15
    10081024mkdir -p $RPM_BUILD_ROOT%{initdir}
     1025%else
     1026mkdir -p $RPM_BUILD_ROOT%{_unitdir}
     1027mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/modules
     1028%endif
    10091029mkdir -p $RPM_BUILD_ROOT/etc/openafs
    10101030mkdir -p $RPM_BUILD_ROOT%{pamdir}
    10111031mkdir -p $RPM_BUILD_ROOT%{_prefix}/afs/etc
     
    10351055
    10361056# Copy root.client config files
    10371057install -m 755 src/packaging/RedHat/openafs.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/openafs
     1058%if 0%{?fedora} < 15
    10381059install -m 755 src/packaging/RedHat/openafs-client.init $RPM_BUILD_ROOT%{initdir}/openafs-client
    10391060install -m 755 src/packaging/RedHat/openafs-server.init $RPM_BUILD_ROOT%{initdir}/openafs-server
     1061%else
     1062install -m 755 src/packaging/RedHat/openafs-client.service $RPM_BUILD_ROOT%{_unitdir}/openafs-client.service
     1063install -m 755 src/packaging/RedHat/openafs-client.modules $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/modules/openafs-client.modules
     1064install -m 755 src/packaging/RedHat/openafs-server.service $RPM_BUILD_ROOT%{_unitdir}/openafs-server.service
     1065%endif
    10401066
    10411067# Copy PAM modules
    10421068install -m 755 ${sysname}/dest/lib/pam* $RPM_BUILD_ROOT%{pamdir}
     
    13181344fi
    13191345
    13201346%post client
     1347%if 0%{?fedora} < 15
    13211348chkconfig --add openafs-client
     1349%else
     1350if [ $1 -eq 1 ] ; then
     1351    # Initial installation
     1352    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
     1353fi
     1354%endif
    13221355if [ ! -d /afs ]; then
    13231356        mkdir /afs
    13241357        chown root.root /afs
     
    13351368
    13361369%post server
    13371370#on an upgrade, don't enable if we were disabled
     1371%if 0%{?fedora} < 15
    13381372if [ $1 = 1 ] ; then
    13391373  chkconfig --add openafs-server
    13401374fi
    13411375%{initdir}/openafs-server condrestart
     1376%else
     1377if [ $1 -eq 1 ] ; then
     1378    # Initial installation
     1379    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
     1380fi
     1381%endif
    13421382
    13431383%if %{build_authlibs}
    13441384%post authlibs
     
    13541394fi
    13551395
    13561396%preun client
     1397%if 0%{?fedora} < 15
    13571398if [ $1 = 0 ] ; then
    13581399        %{initdir}/openafs-client stop
    13591400        chkconfig --del openafs-client
    13601401fi
     1402%else
     1403if [ $1 -eq 0 ] ; then
     1404        # Package removal, not upgrade
     1405        /bin/systemctl --no-reload disable openafs-client.service > /dev/null 2>&1 || :
     1406        /bin/systemctl stop openafs-client.service > /dev/null 2>&1 || :
     1407fi
     1408%endif
    13611409
    13621410%preun server
     1411%if 0%{?fedora} < 15
    13631412if [ $1 = 0 ] ; then
    13641413        %{initdir}/openafs-server stop
    13651414        chkconfig --del openafs-server
    13661415fi
     1416%else
     1417if [ $1 -eq 0 ] ; then
     1418        /bin/systemctl --no-reload disable openafs-server.service > /dev/null 2>&1 || :
     1419        /bin/systemctl stop openafs-server.service > /dev/null 2>&1 || :
     1420fi
     1421%endif
     1422
     1423%if 0%{?fedora} >= 15
     1424%postun client
     1425/bin/systemctl daemon-reload >/dev/null 2>&1 || :
     1426
     1427%postun server
     1428/bin/systemctl daemon-reload >/dev/null 2>&1 || :
     1429%endif
    13671430
    13681431%if %{build_dkmspkg}
    13691432%post -n dkms-%{name}
     
    14211484%endif
    14221485%endif
    14231486
     1487%if 0%{?fedora} >= 15
     1488%triggerun -- openafs-client < 1.6.0-1
     1489# Save the current service runlevel info
     1490# User must manually run systemd-sysv-convert --apply httpd
     1491# to migrate them to systemd targets
     1492/usr/bin/systemd-sysv-convert --save openafs-client >/dev/null 2>&1 ||:
     1493
     1494# Run this because the SysV package being removed won't do it
     1495/sbin/chkconfig --del openafs-client >/dev/null 2>&1 || :
     1496
     1497%triggerun -- openafs-server < 1.6.0-1
     1498# Save the current service runlevel info
     1499# User must manually run systemd-sysv-convert --apply httpd
     1500# to migrate them to systemd targets
     1501/usr/bin/systemd-sysv-convert --save openafs-server >/dev/null 2>&1 ||:
     1502
     1503# Run this because the SysV package being removed won't do it
     1504/sbin/chkconfig --del openafs-server >/dev/null 2>&1 || :
     1505%endif
     1506
    14241507##############################################################################
    14251508###
    14261509### file lists
     
    14581541%{pamdir}/pam_afs.krb.so
    14591542%{pamdir}/pam_afs.so.1
    14601543%{pamdir}/pam_afs.so
     1544%if 0%{?fedora} < 15
    14611545%{initdir}/openafs-client
     1546%else
     1547%{_unitdir}/openafs-client.service
     1548%{_sysconfdir}/sysconfig/modules/openafs-client.modules
     1549%endif
    14621550%{_mandir}/man1/cmdebug.*
    14631551%{_mandir}/man1/copyauth.*
    14641552%{_mandir}/man1/up.*
     
    15061594%{_sbindir}/vldb_check
    15071595%{_sbindir}/vldb_convert
    15081596%{_sbindir}/voldump
     1597%if 0%{?fedora} < 15
    15091598%{initdir}/openafs-server
     1599%else
     1600%{_unitdir}/openafs-server.service
     1601%endif
    15101602%{_mandir}/man5/AuthLog.*
    15111603%{_mandir}/man5/BackupLog.*
    15121604%{_mandir}/man5/BosConfig.*
Note: See TracBrowser for help on using the repository browser.