File zfs.spec of Package zfs

# debbuild doesn't define _usrsrc yet
%if %{_vendor} == "debbuild"
%global _usrsrc %{_prefix}/src
%endif

# On Debian/Ubuntu systems, /bin/sh usually points to /bin/dash,
# and we need it to be /bin/bash, so we set it here.
%if %{_vendor} == "debbuild"
%global _buildshell /bin/bash
%endif

# Set up the correct DKMS module name, following proper conventions
%if %{_vendor} == "debbuild"
%global dkmsname %{name}-dkms
%else
%global dkmsname dkms-%{name}
%endif

# Set up the correct DKMS module name, following proper conventions
%if %{_vendor} == "debbuild"
%global spldkms spl-dkms
%else
%global spldkms dkms-spl
%endif

# Set up kmod packaging
%if %{_vendor} != "debbuild"
%global kmodname %{name}-kmod
#global kernelvr %(rpm -q --qf '%{VERSION}-%{RELEASE}' `rpm -q kernel-devel | /usr/lib/rpm/redhat/rpmsort -r | head -n 1` | head -n 1)
%global kernelvra %(rpm -q --qf '%{VERSION}-%{RELEASE}.%{ARCH}' `rpm -q kernel-devel | /usr/lib/rpm/redhat/rpmsort -r | head -n 1` | head -n 1)
%global kernels %{kernelvra}
%global buildforkernels current

%global KmodsRequires      kmod-spl
%global KmodsDevelRequires kmod-spl-devel
%global KmodsMetaRequires  spl-kmod
%endif


%if %{_vendor} != "debbuild"
%global rpm_dkms_opt 1
%endif

# Set udev directory macros
%if %{_vendor} == "debbuild"
%global _udevdir /lib/udev
%global _udevrulesdir %{_udevdir}/rules.d
%else
%global _udevdir %{_prefix}/lib/udev
%endif

# dracut directory path
%global _dracutdir  %{_prefix}/lib/dracut

# initramfs-tools directory path
%global _initramfstoolsdir %{_datadir}/initramfs-tools

# default _initconfdir
%if %{_vendor} == "debbuild"
%global _initconfdir %{_sysconfdir}/default
%else
%global _initconfdir %{_sysconfdir}/sysconfig
%endif

# Setup for systemd/non-systemd logic
%if 0%{?fedora} || 0%{?rhel} >= 7 || 0%{?ubuntu} >= 1504 || 0%{?debian} >= 8
%global with_systemd 1
%else
%global with_systemd 0
%endif

%if %{_vendor} == "debbuild"
%global _unitdir /lib/systemd/system
%global _presetdir /lib/systemd/system-preset
%endif

# library names
%global zfs_sover 2
%global libname_zpool libzpool%{zfs_sover}
%global libname_zfs libzfs%{zfs_sover}
%global zfscore_sover 1

# Not a stable library yet
#global libname_zfscore libzfs_core%{zfscore_sover}

%global spl_sover 1
%global libname_nvpair libnvpair%{spl_sover}
%global libname_uutil libuutil%{spl_sover}

%if %{_vendor} == "debbuild"
%global devsuffix dev
%else
%global devsuffix devel
%endif

# development library names
%global devname_zfs libzfs-%{devsuffix}
%global devname_zpool libzpool-%{devsuffix}
%global devname_nvpair libnvpair-%{devsuffix}
%global devname_uutil libuutil-%{devsuffix}

# for Debian, set libexecdir appropriately
%if %{_vendor} == "debbuild"
%global _libexecdir %{_prefix}%{_libdir}
%endif

# for Debian, set _lib to the platform libdir
%if %{_vendor} == "debbuild"
%global _lib lib/%(dpkg-architecture -qDEB_HOST_MULTIARCH)
%endif

# kmod install path
%define _kmod_src_root %{_usrsrc}/%{name}-%{version}

Name:           zfs
Version:        0.7.13
Release:        1%{?dist}
Summary:        OpenZFS for Linux
%if %{_vendor} == "debbuild"
Group:          kernel
Packager:       Neal Gompa <ngompa@datto.com>
%else
Group:          System Environment/Kernel
%endif
License:        CDDL
URL:            http://zfsonlinux.org/
Source0:        https://github.com/zfsonlinux/zfs/releases/download/zfs-%{version}/%{name}-%{version}.tar.gz
ExclusiveArch:  %{ix86} x86_64

%if %{_vendor} == "debbuild"
BuildRequires:  libblkid-dev
BuildRequires:  libudev-dev
BuildRequires:  zlib1g-dev
BuildRequires:  uuid-dev
BuildRequires:  attr-dev
%else
BuildRequires:  libblkid-devel
BuildRequires:  libattr-devel
BuildRequires:  zlib-devel
BuildRequires:  libuuid-devel
BuildRequires:  libudev-devel
%if 0%{?fedora} >= 28
BuildRequires:  libtirpc-devel
%endif

%endif

%if 0%{?with_systemd}
# So that the autofoo can detect systemd properly
BuildRequires:  systemd
%endif

# For bash completion
Requires:       bash-completion

%if %{_vendor} == "debbuild"
# For ztest
Requires:       parted
Requires:       lsscsi
Requires:       mdadm
Requires:       bc
Requires:       ksh
Requires:       fio
Requires:       acl
Requires:       sysstat
%endif

%if %{_vendor} == "debbuild"
# Replacing the distro provided version
Provides:       zfsutils-linux
Conflicts:      zfsutils-linux
Obsoletes:      zfsutils-linux < %{version}-%{release}

# Not breaking this out into a subpackage
Provides:       %{name}-zed
Conflicts:      %{name}-zed
Obsoletes:      %{name}-zed < %{version}-%{release}
%endif

Requires:       %{libname_zpool}%{?_isa} = %{version}-%{release}
Requires:       %{libname_nvpair}%{?_isa} = %{version}-%{release}
Requires:       %{libname_uutil}%{?_isa} = %{version}-%{release}
Requires:       %{libname_zfs}%{?_isa} = %{version}-%{release}

# zfs-fuse provides the same commands and man pages that ZoL does. Renaming
# those on either side would conflict with all available documentation.
Conflicts:      zfs-fuse

%if %{_vendor} != "debbuild"
# For compatibility for packages expecting slightly other locations
Provides:         /sbin/zfs
Provides:         /sbin/zpool
Provides:         /sbin/zdb
Provides:         /sbin/ztest
Provides:         /sbin/zstreamdump
Provides:         /sbin/mount.zfs
%endif

%if %{_vendor} != "debbuild"
BuildRequires:  kmodtool-zfs
BuildRequires:  kernel-rpm-macros
BuildRequires:  kernel-devel
BuildRequires:  elfutils-libelf-devel
# Until rich deps work in buildsys
BuildRequires:  kmod-spl-uname-r
BuildRequires:  kmod-spl-devel = %{version}
BuildRequires:  kmod-spl-devel-uname-r
Provides:       %{name}-kmod-common = %{version}-%{release}
Requires:       %{kmodname} = %{version}-%{release}

# kmodtool does its magic here
%{expand:%(kmodtool --target %{_target_cpu} --kmodname %{name} --devel %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) }

%else
Requires:       %{dkmsname} = %{version}-%{release}
%endif

%description
ZFS is an advanced file system and volume manager
which was originally developed for Solaris and
is now maintained by the Illumos community.

%package -n %{dkmsname}
Summary:        Kernel module sources for %{name} managed by DKMS
%if %{_vendor} == "debbuild"
Group:          kernel
%else
Group:          System Environment/Kernel
%endif
BuildArch:      noarch
%if %{_vendor} == "debbuild"
# Ensure SPL kmods are unpacked before installing
Requires(pre):  %{spldkms} >= %{version}
# Ensure dpkg-architecture is available
Requires:       dpkg-dev
%else
Requires:       %{spldkms} = %{version}
%endif
Requires:       gcc, make, perl
Requires:       dkms >= 2.2.0.2

%if %{_vendor} != "debbuild"
Provides:       %{name}-kmod = %{version}-%{release}
Conflicts:      kmod-%{name}-devel
RemovePathPostfixes: .dkms
%endif


%description -n %{dkmsname}
This package contains the kernel module sources for
OpenZFS for Linux that is managed by DKMS.

%package -n %{libname_zpool}
Summary:        Native ZFS pool library for Linux
%if %{_vendor} == "debbuild"
Group:          libs
Provides:       %{libname_zpool}linux
Conflicts:      %{libname_zpool}linux
Obsoletes:      %{libname_zpool}linux < %{version}-%{release}
%else
Group:          System Environment/Libraries
%endif



%description -n %{libname_zpool}
This package contains the zpool library, which provides support
for managing zpools

%post -n %{libname_zpool}
/sbin/ldconfig

%postun -n %{libname_zpool}
/sbin/ldconfig

%package -n %{libname_nvpair}
Summary:        Solaris name-value library for Linux
%if %{_vendor} == "debbuild"
Group:          libs
Provides:       %{libname_nvpair}linux
Conflicts:      %{libname_nvpair}linux
Obsoletes:      %{libname_nvpair}linux < %{version}-%{release}
%else
Group:          System Environment/Libraries
%endif

%description -n %{libname_nvpair}
This package contains routines for packing and unpacking name-value
pairs.  This functionality is used to portably transport data across
process boundaries, between kernel and user space, and can be used
to write self describing data structures on disk.

%post -n %{libname_nvpair}
/sbin/ldconfig

%postun -n %{libname_nvpair}
/sbin/ldconfig

%package -n %{libname_uutil}
Summary:        Solaris userland utility library for Linux
%if %{_vendor} == "debbuild"
Group:          libs
Provides:       %{libname_uutil}linux
Conflicts:      %{libname_uutil}linux
Obsoletes:      %{libname_uutil}linux < %{version}-%{release}
%else
Group:          System Environment/Libraries
%endif

%description -n %{libname_uutil}
This library provides a variety of compatibility functions for ZFS on Linux:
 * libspl: The Solaris Porting Layer userland library, which provides APIs
   that make it possible to run Solaris user code in a Linux environment
   with relatively minimal modification.
 * libavl: The Adelson-Velskii Landis balanced binary tree manipulation
   library.
 * libefi: The Extensible Firmware Interface library for GUID disk
   partitioning.
 * libshare: NFS, SMB, and iSCSI service integration for ZFS.

%post -n %{libname_uutil}
/sbin/ldconfig

%postun -n %{libname_uutil}
/sbin/ldconfig

%package -n %{libname_zfs}
Summary:        Native ZFS filesystem library for Linux
%if %{_vendor} == "debbuild"
Group:          libs
Provides:       %{libname_zfs}linux
Conflicts:      %{libname_zfs}linux
Obsoletes:      %{libname_zfs}linux < %{version}-%{release}
%else
Group:          System Environment/Libraries
%endif

%description -n %{libname_zfs}
This package provides support for managing ZFS filesystems

%post -n %{libname_zfs}
/sbin/ldconfig

%postun -n %{libname_zfs}
/sbin/ldconfig

%package -n %{devname_zfs}
Summary:        Development headers
%if %{_vendor} == "debbuild"
Group:          libdevel
Provides:       libzfslinux-dev
Conflicts:      libzfslinux-dev
Obsoletes:      libzfslinux-dev < %{version}-%{release}
%else
Group:          Development/Libraries
%endif
Provides:       %{devname_zpool}%{?_isa}
Provides:       %{devname_nvpair}%{?_isa}
Provides:       %{devname_uutil}%{?_isa}
Requires:       %{libname_zfs}%{?_isa} = %{version}-%{release}
Requires:       %{libname_zpool}%{?_isa} = %{version}-%{release}
Requires:       %{libname_nvpair}%{?_isa} = %{version}-%{release}
Requires:       %{libname_uutil}%{?_isa} = %{version}-%{release}

%description -n %{devname_zfs}
This package contains the header files needed for building additional
applications against the ZFS libraries.

%if %{_vendor} != "debbuild"
%package test
Summary:        Test infrastructure
%if %{_vendor} == "debbuild"
Group:          kernel
%else
Group:          System Environment/Kernel
%endif
# FIXME: If made back noarch, take _isa back out
Requires:       %{name}%{?_isa} = %{version}-%{release}
Requires:       parted
Requires:       lsscsi
Requires:       mdadm
Requires:       bc
Requires:       ksh
Requires:       fio
Requires:       acl
Requires:       sysstat

# TODO: Talk to ZoL folks about fixing this to be noarch again
#BuildArch:      noarch

%description test
This package contains test infrastructure and support scripts for
validating the file system.
%endif

%package dracut
Summary:        Dracut module
%if %{_vendor} == "debbuild"
Group:          kernel
%else
Group:          System Environment/Kernel
%endif
Requires:       %{name}%{?_isa} = %{version}-%{release}
Requires:       dracut

%description dracut
This package contains a dracut module used to construct an initramfs
image which is ZFS aware.

%if %{_vendor} == "debbuild"
%package initramfs
Summary:        Initramfs module
%if %{_vendor} == "debbuild"
Group:          kernel
%else
Group:          System Environment/Kernel
%endif
Requires:       %{name}%{?_isa} = %{version}-%{release}
Requires:       initramfs-tools

%description initramfs
This package contains a initramfs module used to construct an initramfs
image which is ZFS aware.
%endif

%prep
%if %{_vendor} != "debbuild"
# error out if there was something wrong with kmodtool
%{?kmodtool_check}
# print kmodtool output for debugging purposes:
kmodtool --target %{_target_cpu} --kmodname %{name} --devel %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"}
%endif

%autosetup


%build
# Embed downstream version in module
sed -e 's/^Version:.*/Version:      %{version}/' -e 's/^Release:.*/Release:      %{release}/' -i.orig META

%if %{_vendor} != "debbuild"
cp -a ../%{name}-%{version} ../%{name}-%{version}-kmodbuild
pushd ../%{name}-%{version}-kmodbuild
	%configure --with-config=kernel --with-linux="/usr/src/kernels/%{kernelvra}" \
		   --with-udevdir=%{_udevdir} --with-udevruledir=%{_udevrulesdir} \
		   --with-dracutdir=%{_dracutdir} %{?with_systemd:--with-systemdunitdir=%{_unitdir} --with-systemdpresetdir=%{_presetdir}} \
		   --with-mounthelperdir=%{_sbindir} --disable-static
	%make_build
popd
%endif


scripts/dkms.mkconf -n %{name} -v %{version} -f dkms.conf
%configure --with-config=user --with-udevdir=%{_udevdir} --with-udevruledir=%{_udevrulesdir} \
	   --with-dracutdir=%{_dracutdir} %{?with_systemd:--with-systemdunitdir=%{_unitdir} --with-systemdpresetdir=%{_presetdir}} \
	   --with-mounthelperdir=%{_sbindir} --disable-static
%make_build

%install
INITIAL_ENVDIR=`pwd`

%if %{_vendor} != "debbuild"
pushd ../%{name}-%{version}-kmodbuild
	%make_install INSTALL_MOD_DIR=extra/%{name}
popd

# find-debuginfo.sh only considers executables
chmod u+x  %{buildroot}/lib/modules/%{kernelvra}/extra/*/*/*

# Perform UsrMove
mv %{buildroot}/lib %{buildroot}%{_prefix}

%endif

%make_install

# Kill all libtool .la files
find %{buildroot} -name "*.la" -exec rm -f {} \;

# Create source tree
make distdir

# Erase unnecessary bits from sources being installed for dkms module to save space
# Note that 0h25 is percent sign
cd %{name}-%{version}
for file in $(find cmd dracut etc lib man rpm udev tests -type f); do \
    rm "$file"; \
    test "$file" != "${file%%.in}" && printf "\x25:\n\t#\n" > "$file"; \
    true; \
done

cd $INITIAL_ENVDIR

printf "#!/bin/sh\ncp \"$@\"\n" > %{name}-%{version}/cp
chmod 755 %{name}-%{version}/cp

# Install kernel sources
mkdir -p %{buildroot}%{_usrsrc}
mv %{name}-%{version} %{buildroot}%{_usrsrc}/%{name}-%{version}.dkms
cp dkms.conf %{buildroot}%{_kmod_src_root}.dkms

%if %{_vendor} == "debbuild"
# Set to correct path
mv %{buildroot}%{_usrsrc}/%{name}-%{version}.dkms %{buildroot}%{_usrsrc}/%{name}-%{version}
%endif

# Erase initramfs-tools on non-Debian
%if %{_vendor} != "debbuild"
rm -rf %{buildroot}%{_initramfstoolsdir}
%endif

# Erase unused init files
%if 0%{?with_systemd}
rm -rf %{buildroot}%{_initconfdir}
rm -rf %{buildroot}%{_sysconfdir}/init.d
%else
rm -rf %{buildroot}%{_unitdir}
rm -rf %{buildroot}%{_presetdir}
%endif

# Install bash completion
mkdir -p %{buildroot}%{_datadir}/bash-completion/completions
install -pm 0755 contrib/bash_completion.d/zfs %{buildroot}%{_datadir}/bash-completion/completions/zfs


# FIXME: Add scriptlets for systemd and sysvinit services

%preun -n %{dkmsname}
if [  "$(dkms status -m %{name} -v %{version})" ]; then
   dkms remove -m %{name} -v %{version} --all %{?rpm_dkms_opt:--rpm_safe_upgrade}
fi

%post -n %{dkmsname}
%if %{_vendor} == "debbuild"
if [ "$1" = "configure" ]; then
%else
if [ "$1" -ge "1" ]; then
%endif
   if [ -f /usr/lib/dkms/common.postinst ]; then
      /usr/lib/dkms/common.postinst %{name} %{version}
      exit $?
   fi
fi

%if %{_vendor} == "debbuild"
%post
%if 0%{?with_systemd}
if [ "$1" = "configure" ] ; then
        # Initial installation
        systemctl preset zfs-import-cache.service zfs-import-scan.service zfs-mount.service zfs-share.service zfs.target >/dev/null 2>&1 || :
fi
%else
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
	if [ -x "/etc/init.d/zfs-share" ]; then
		update-rc.d zfs-share defaults 25 15 >/dev/null || exit $?
	fi
	if [ -x "/etc/init.d/zfs-import-cache" ]; then
		update-rc.d zfs-import-cache defaults >/dev/null
	fi
	if [ -x "/etc/init.d/zfs-import-cache" ] || [ -e "/etc/init/zfs-import-cache.conf" ]; then
		invoke-rc.d zfs-import-cache start || exit $?
	fi
	if [ -x "/etc/init.d/zfs-import-scan" ]; then
		update-rc.d zfs-import-scan defaults >/dev/null
	fi
	if [ -x "/etc/init.d/zfs-import-scan" ] || [ -e "/etc/init/zfs-import-scan.conf" ]; then
		invoke-rc.d zfs-import-scan start || exit $?
	fi
	if [ -x "/etc/init.d/zfs-mount" ]; then
		update-rc.d zfs-mount defaults >/dev/null
	fi
	if [ -x "/etc/init.d/zfs-mount" ] || [ -e "/etc/init/zfs-mount.conf" ]; then
		invoke-rc.d zfs-mount start || exit $?
	fi
fi
%endif

%preun
%if 0%{?with_systemd}
if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
        # Package removal, not upgrade
        systemctl --no-reload disable zfs-import-cache.service zfs-import-scan.service zfs-mount.service zfs-share.service zfs-zed.service zfs.target > /dev/null 2>&1 || :
        systemctl stop zfs-import-cache.service zfs-import-scan.service zfs-mount.service zfs-share.service zfs-zed.service zfs.target > /dev/null 2>&1 || :
fi
%else
if [ -x "/etc/init.d/zfs-mount" ] || [ -e "/etc/init/zfs-mount.conf" ]; then
	invoke-rc.d zfs-mount stop || exit $?
fi
if [ -x "/etc/init.d/zfs-import-scan" ] || [ -e "/etc/init/zfs-import-scan.conf" ]; then
	invoke-rc.d zfs-import-scan stop || exit $?
fi
if [ -x "/etc/init.d/zfs-import-cache" ] || [ -e "/etc/init/zfs-import-cache.conf" ]; then
	invoke-rc.d zfs-import-cache stop || exit $?
fi
%endif

%postun
%if 0%{?with_systemd}
systemctl daemon-reload >/dev/null 2>&1 || :
%else
if [ "$1" = "purge" ] ; then
	update-rc.d zfs-mount remove >/dev/null
	update-rc.d zfs-import-scan remove >/dev/null
	update-rc.d zfs-import-cache remove >/dev/null
	update-rc.d zfs-share remove >/dev/null
fi
%endif


%else
# non-Debian stuff
%post
%if 0%{?with_systemd}
%systemd_post zfs-import-cache.service zfs-import-scan.service zfs-mount.service zfs-share.service zfs-zed.service zfs.target
%else
if [ -x /sbin/chkconfig ]; then
    /sbin/chkconfig --add zfs-import
    /sbin/chkconfig --add zfs-mount
    /sbin/chkconfig --add zfs-share
    /sbin/chkconfig --add zfs-zed
fi
%endif
exit 0

%preun
%if 0%{?with_systemd}
%systemd_preun zfs-import-cache.service zfs-import-scan.service zfs-mount.service zfs-share.service zfs-zed.service zfs.target
%else
if [ $1 -eq 0 ] && [ -x /sbin/chkconfig ]; then
    /sbin/chkconfig --del zfs-import
    /sbin/chkconfig --del zfs-mount
    /sbin/chkconfig --del zfs-share
    /sbin/chkconfig --del zfs-zed
fi
%endif
exit 0

%postun
%if 0%{?with_systemd}
%systemd_postun zfs-import-cache.service zfs-import-scan.service zfs-mount.service zfs-share.service zfs-zed.service zfs.target
%endif
%endif

%files
%license COPYRIGHT DISCLAIMER OPENSOLARIS.LICENSE
%doc AUTHORS README.markdown
%{_bindir}/*
%{_sbindir}/*
%{_libexecdir}/zfs/zed.d
%{_libexecdir}/zfs/zpool.d
%{_mandir}/man1/*.1.*
%{_mandir}/man5/*.5.*
%{_mandir}/man8/*.8.*
%{_udevdir}/vdev_id
%{_udevdir}/zvol_id
%{_udevrulesdir}/*
%if 0%{?with_systemd}
%{_prefix}/lib/modules-load.d/*
%{_unitdir}/*
%{_presetdir}/*
%else
%config(noreplace) %{_sysconfdir}/init.d/*
%config(noreplace) %{_initconfdir}/zfs
%endif
%dir %{_sysconfdir}/zfs
%dir %{_sysconfdir}/zfs/zed.d
%dir %{_sysconfdir}/zfs/zpool.d
%config(noreplace) %{_sysconfdir}/zfs/zfs-functions
%config(noreplace) %{_sysconfdir}/zfs/*.example
%config(noreplace) %{_sysconfdir}/zfs/zed.d/*
%config(noreplace) %{_sysconfdir}/zfs/zpool.d/*
%config(noreplace) %{_sysconfdir}/sudoers.d/zfs
%{_datadir}/bash-completion/completions/zfs
%if %{_vendor} == "debbuild"
%{_datadir}/%{name}
%endif

%files -n %{libname_zpool}
%{_libdir}/libzpool.so.%{zfs_sover}
%{_libdir}/libzpool.so.%{zfs_sover}.*

%files -n %{libname_nvpair}
%{_libdir}/libnvpair.so.%{spl_sover}
%{_libdir}/libnvpair.so.%{spl_sover}.*

%files -n %{libname_uutil}
%{_libdir}/libuutil.so.%{spl_sover}
%{_libdir}/libuutil.so.%{spl_sover}.*

%files -n %{libname_zfs}
%{_libdir}/libzfs.so.%{zfs_sover}
%{_libdir}/libzfs.so.%{zfs_sover}.*
%{_libdir}/libzfs_core.so.%{zfscore_sover}
%{_libdir}/libzfs_core.so.%{zfscore_sover}.*


%files -n %{devname_zfs}
%license COPYRIGHT DISCLAIMER OPENSOLARIS.LICENSE
%doc AUTHORS README.markdown
%{_datadir}/pkgconfig/libzfs.pc
%{_datadir}/pkgconfig/libzfs_core.pc
%{_libdir}/*.so
%{_includedir}/*

%files -n %{dkmsname}
%license COPYRIGHT DISCLAIMER OPENSOLARIS.LICENSE
%doc AUTHORS README.markdown
%if %{_vendor} != "debbuild"
%{_kmod_src_root}.dkms
%else
%dir %{_kmod_src_root}
%{_kmod_src_root}/*
%endif

%if %{_vendor} != "debbuild"
%files test
%{_datadir}/%{name}
%endif

%files dracut
%doc contrib/dracut/README.dracut.markdown
%{_dracutdir}/modules.d/*

%if %{_vendor} == "debbuild"
%files initramfs
%doc contrib/initramfs/README.initramfs.markdown
%{_initramfstoolsdir}/*
%endif

%changelog
* Thu Apr 25 08:02:09 EDT 2019 Neal Gompa <ngompa@datto.com> - 0.7.13
- Upgrade to 0.7.13

* Wed Sep 19 15:12:01 EDT 2018 Neal Gompa <ngompa@datto.com> - 0.7.11
- Upgrade to 0.7.11

* Tue Sep 11 22:23:36 EDT 2018 Neal Gompa <ngompa@datto.com> - 0.7.10
- Upgrade to 0.7.10

* Sun Apr 15 11:32:13 EDT 2018 Neal Gompa <ngompa@datto.com>
- Don't purge scripts in source tree for DKMS subpackage

* Tue Apr 10 07:31:28 EDT 2018 Neal Gompa <ngompa@datto.com> - 0.7.8
- Upgrade to 0.7.8

* Sat Mar 31 23:13:46 EDT 2018 Neal Gompa <ngompa@datto.com>
- Don't run kmodtool in prep on Debian/Ubuntu

* Sat Mar 31 22:30:12 EDT 2018 Neal Gompa <ngompa@datto.com> - 0.7.7
- Upgrade to 0.7.7
- Always have systemd as a BuildRequires for distros intending to use systemd units
- Add dpkg-dev requirement to dkms subpackage for Debian/Ubuntu
- Drop logic for Debian/Ubuntu split-usr, as it doesn't work anymore
- Install bash completion

* Tue Feb  6 20:36:04 EST 2018 Neal Gompa <ngompa@datto.com> - 0.7.6
- Upgrade to 0.7.6

* Sun Feb  4 00:32:54 EST 2018 Neal Gompa <ngompa@datto.com>
- Add elfutils-libelf-devel to fix kmod builds

* Sun Jan 28 21:21:03 EST 2018 Neal Gompa <ngompa@datto.com> - 0.7.5
- Upgrade to 0.7.5

* Mon Jan  1 14:17:53 EST 2018 Neal Gompa <ngompa@datto.com>
- Add support for building kmods for non-Debian

* Wed Dec 13 2017 Neal Gompa <ngompa@datto.com> - 0.7.4
- Upgrade to 0.7.4
- Add compatibility file path Provides for RPM-based distributions

* Tue Oct 31 2017 Neal Gompa <ngompa@datto.com> - 0.7.3
- Upgrade to 0.7.3

* Thu Oct 12 2017 Neal Gompa <ngompa@datto.com> - 0.7.2
- Upgrade to 0.7.2

* Mon Aug 14 2017 Mark Bluemer <mbluemer@datto.com> - 0.7.1
- Upgrade to 0.7.1

* Thu Aug 03 2017 Neal Gompa <ngompa@datto.com> - 0.7.0
- Upgrade to 0.7.0

* Fri Apr 21 2017 Neal Gompa <ngompa@datto.com> - 0.6.5.9
- Upgrade to 0.6.5.9

* Sat Oct 29 2016 Neal Gompa <ngompa@datto.com> - 0.6.5.8
- Set the correct relationship for zfs-dkms for Debian/Ubuntu
- Do not version the conflicts with Debian/Ubuntu packages

* Fri Oct 28 2016 Neal Gompa <ngompa@datto.com> - 0.6.5.8
- Ensure all services are processed with preset configuration on systemd

* Wed Oct 26 2016 Neal Gompa <ngompa@datto.com> - 0.6.5.8
- Strengthen the obsoletion of packages for Debian/Ubuntu

* Tue Oct 25 2016 Neal Gompa <ngompa@datto.com> - 0.6.5.8
- Redefine libexecdir for Debian/Ubuntu
- Further define /etc/zfs in file lists

* Thu Sep 29 2016 Neal Gompa <ngompa@datto.com> - 0.6.5.8
- Initial packaging
openSUSE Build Service is sponsored by