File exfat-nofuse-dkms.spec of Package exfat-nofuse-dkms

%define realname exfat-nofuse
%define srcext   tar.bz2

Name:          %{realname}-dkms
Version:       1.2.9
Release:       wiz%{?extraver:0.}1%{?dist}
License:       GPL-2.0
Group:         System/Kernel
Summary:       exFAT Filesystem Driver

Requires:      dkms kernel-devel

%if 0%{?opensuse_bs}
BuildRequires: dkms
%endif
%if 0%{?sles_version}
BuildRequires: -post-build-checks
%endif
%if 0%{?suse_version} && ! 0%{?sles_version}
BuildArch:     noarch
%endif
BuildRoot:     %{_tmppath}/%{name}-%{version}-build
Source:        %{realname}-%{version}.%{srcext}

%description
exFAT Filesystem Driver

%prep
%setup -n %{realname}-%{version}

%build

%install
%{__sed} -ri '1 i\CONFIG_EXFAT_FS = m' Makefile
%{__install} -d -m755 %{buildroot}/usr/src/%{realname}-%{version}
set -- *
%{__cp} * %{buildroot}/usr/src/%{realname}-%{version}/
cat > %{buildroot}/usr/src/%{realname}-%{version}/dkms.conf <<EOF
PACKAGE_NAME=%{realname}
PACKAGE_VERSION=%{version}
AUTOINSTALL=yes

BUILT_MODULE_NAME=exfat

DEST_MODULE_LOCATION=/updates
EOF

%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}

%files
%defattr(-,root,root)
%dir /usr/src/%{realname}-%{version}
/usr/src/%{realname}-%{version}/*

%post
dkms add -q -m %{realname} -v %{version} || :

%preun
dkms remove -q --all -m %{realname} -v %{version} || :

%changelog
openSUSE Build Service is sponsored by