-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathopenafs-kmod.spec
197 lines (158 loc) · 6.11 KB
/
openafs-kmod.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# Openafs Spec $Revision$
%define pkgrel 1
%define afsvers 1.6.11
Summary: OpenAFS distributed filesystem
Name: openafs-kmod
Version: 1.6.11
Release: %{pkgrel}%{?dist}
License: IBM Public License
URL: http://www.openafs.org
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Group: Networking/Filesystems
BuildRequires: pam-devel, flex, bison
ExclusiveArch: %{ix86} x86_64
Source0: http://www.openafs.org/dl/openafs/%{afsvers}/openafs-%{afsvers}-src.tar.bz2
Source10: http://www.openafs.org/dl/openafs/%{afsvers}/RELNOTES-%{afsvers}
Source11: http://www.openafs.org/dl/openafs/%{afsvers}/ChangeLog
Source13: find-installed-kversion.sh
Source14: openafs-kmodtool
%description
The AFS distributed filesystem. AFS is a distributed filesystem
allowing cross-platform sharing of files among multiple computers.
Facilities are provided for access control, authentication, backup and
administrative management.
This package provides the kernel module for the OpenAFS client
%define dkms_version %{version}-%{pkgrel}%{?dist}
%{expand:%(sh %{SOURCE13})}
%{expand:%(sh %{SOURCE14} rpmtemplate openafs %{kversion} /usr/sbin/depmod "")}
%package -n dkms-openafs
Summary: DKMS-ready kernel source for AFS distributed filesystem
Group: Development/Kernel
Provides: openafs-kernel = %{version}
Provides: openafs-kmod = %{version}
Requires(pre): dkms
Requires(pre): flex, bison, gcc
Requires(post): dkms
Requires: openafs-kmod-common = %{version}
%description -n dkms-openafs
The AFS distributed filesystem. AFS is a distributed filesystem
allowing cross-platform sharing of files among multiple computers.
Facilities are provided for access control, authentication, backup and
administrative management.
This package provides the source code to allow DKMS to build an
AFS kernel module.
%package docs
Summary: OpenAFS kernel module documentation
Group: Networking/Filesystems
Requires: openafs-kmod-common = %{version}
%description docs
The AFS distributed filesystem. AFS is a distributed filesystem
allowing cross-platform sharing of files among multiple computers.
Facilities are provided for access control, authentication, backup and
administrative management.
This package provides the documentation for the AFS kernel module.
##############################################################################
#
# PREP
#
##############################################################################
%prep
# Just for logging purposes
echo '%kversion'
# Install OpenAFS src and doc
%setup -q -n openafs-%{afsvers}
##############################################################################
#
# building
#
##############################################################################
%build
case %{_arch} in
x86_64) sysname=amd64_linux26 ;;
i386|i486|i586|i686|athlon) sysname=i386_linux26 ;;
*) sysname=%{_arch}_linux26 ;;
esac
./configure --with-afs-sysname=${sysname} \
--prefix=%{_prefix} \
--libdir=%{_libdir} \
--bindir=%{_bindir} \
--sbindir=%{_sbindir} \
--with-linux-kernel-packaging \
--with-linux-kernel-headers=/usr/src/kernels/%{kversion}.%{_target_cpu} \
|| exit 1
make dest_only_libafs MPS=SP
# Build the libafs tree
make only_libafs_tree || exit 1
##############################################################################
#
# installation
#
##############################################################################
%install
case %{_arch} in
x86_64) sysname=amd64_linux26 ;;
i386|i486|i586|i686|athlon) sysname=i386_linux26 ;;
*) sysname=%{_arch}_linux26 ;;
esac
srcdir=${sysname}/dest/root.client/lib/modules/%{kversion}.%{_target_cpu}/extra/openafs
dstdir=$RPM_BUILD_ROOT/lib/modules/%{kversion}.%{_target_cpu}/extra/openafs
[ $RPM_BUILD_ROOT != / ] && rm -rf $RPM_BUILD_ROOT
install -D -m 755 ${srcdir}/openafs.ko ${dstdir}/openafs.ko
# copy Release notes and changelog into src dir
cp %{SOURCE10} %{SOURCE11} .
#
# install dkms source
#
install -d -m 755 $RPM_BUILD_ROOT%{_prefix}/src
cp -a libafs_tree $RPM_BUILD_ROOT%{_prefix}/src/openafs-%{dkms_version}
cat > $RPM_BUILD_ROOT%{_prefix}/src/openafs-%{dkms_version}/dkms.conf <<"EOF"
PACKAGE_VERSION="%{dkms_version}"
# Items below here should not have to change with each driver version
PACKAGE_NAME="openafs"
MAKE[0]='./configure --with-linux-kernel-headers=${kernel_source_dir} --with-linux-kernel-packaging && make && mv src/libafs/MODLOAD-*/openafs.ko .'
CLEAN="make -C src/libafs clean"
BUILT_MODULE_NAME[0]="openafs"
DEST_MODULE_LOCATION[0]="/extra/openafs/"
STRIP[0]=no
AUTOINSTALL=yes
EOF
##############################################################################
###
### clean
###
##############################################################################
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && \
rm -fr $RPM_BUILD_ROOT
##############################################################################
###
### scripts
###
##############################################################################
%post -n dkms-openafs
dkms add -m openafs -v %{dkms_version} --rpm_safe_upgrade
dkms build -m openafs -v %{dkms_version} --rpm_safe_upgrade
dkms install -m openafs -v %{dkms_version} --rpm_safe_upgrade
%preun -n dkms-openafs
dkms remove -m openafs -v %{dkms_version} --rpm_safe_upgrade --all ||:
##############################################################################
###
### file lists
###
##############################################################################
%files docs
%defattr(-,root,root)
%doc src/LICENSE README README.DEVEL README.GIT NEWS RELNOTES-%{afsvers} ChangeLog
%files -n dkms-openafs
%defattr(-,root,root)
%{_prefix}/src/openafs-%{dkms_version}
##############################################################################
###
### openafs-kmod.spec change log
###
##############################################################################
%changelog
* Mon Mar 02 2015 Jonathan S. Billings <[email protected]> - 1.6.11-1.1
- Rebuilt for 1.6.11
* Wed Oct 1 2014 Jonathan S. Billings <[email protected]> - 1.6.9-1
- Created initial spec file