forked from davidhrbac/specs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iscsitarget.spec
154 lines (122 loc) · 4.3 KB
/
iscsitarget.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
%define snapshotrev 1266
# Generate version information for kernel module
%{!?kernel: %define kernel %(uname -r)}
%define kver %(echo %{kernel} | sed -e 's/smp//' -e 's/bigmem//' -e 's/enterprise//')
%define ktype %(echo kernel-%{kernel}|sed -e 's/%{kver}//' -e 's/-$//')
%define krel %(echo %{kver} | sed -e 's/-/_/g')
Summary: iSCSI Enterprise Target
Name: iscsitarget
Version: 0.4.13
Release: %{?snapshotrev: 0.%{snapshotrev}.}1
License: GPL
Group: System Environment/Daemons
URL: http://sourceforge.net/projects/iscsitarget/
Packager: Bastiaan Bakker <[email protected]>
%if %{snapshotrev}
Source0: http://www.zaal.org/iscsi/iet/%{version}/r%{snapshotrev}.tar.gz
%else
Source0: %{name}-%{version}.tar.gz
%endif
Patch1: %{name}-r1266-condrestart.patch
# kernel compatibility patches
# unlocked_ioctl API change
Patch2610: %{name}-0.4.12-kernel-compat-2.6.10.patch
# __nlmsg_put API change
Patch2612: %{name}-r1257-kernel-compat-2.6.12.patch
BuildRequires: %{ktype}-devel = %{kver}, gcc, /usr/bin/install, openssl-devel
Requires: %{name}-kernel-module = %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
%define servicename iscsi-target
%description
iSCSI Enterprise Target
%package %{ktype}
Summary: iSCSI Enterprise Target kernel module
Group: System Environment/Kernel
Release: %{release}_%{krel}
Requires: %{ktype} = %{kver}
Provides: %{name}-kernel-module
%description %{ktype}
iSCSI Enterprise Target kernel module
%prep
%setup %{?snapshotrev: -n r%{snapshotrev}}
%patch1 -p0
%patch2610 -p0
%patch2612 -p0
%build
make KERNELSRC=/lib/modules/%{kernel}/build
%install
%{__rm} -rf %{buildroot}
install -d %{buildroot}/etc/rc.d/init.d
ln -s rc.d/init.d %{buildroot}/etc/init.d
make install KERNELSRC=/lib/modules/%{kernel}/build DISTDIR=%{buildroot}
rm %{buildroot}/etc/init.d
install -m 644 -D etc/ietd.conf %{buildroot}/etc/ietd.conf
install -m 644 -D etc/initiators.allow %{buildroot}/etc/initiators.allow
install -m 644 -D etc/initiators.deny %{buildroot}/etc/initiators.deny
install -m 644 -D doc/manpages/ietd.8 %{buildroot}%{_mandir}/man8/ietd.8
install -m 644 -D doc/manpages/ietd.conf.5 %{buildroot}%{_mandir}/man5/ietd.conf.5
%clean
%{__rm} -rf %{buildroot}
%post
umask 022
/sbin/chkconfig --add %{servicename}
exit 0
%preun
umask 022
if [ "$1" = 0 ]; then
/sbin/service %{servicename} stop &>/dev/null
/sbin/chkconfig --del %{servicename}
fi
exit 0
%postun
if [ "$1" != 0 ]; then
/sbin/service %{servicename} condrestart 2>&1 > /dev/null
fi
exit 0
%post %{ktype}
/sbin/depmod %{kernel} -A
%preun %{ktype}
modprobe -r -q --set-version %{kernel} iscsi_trgt
/sbin/depmod %{kernel} -A
%files
%defattr(-, root, root, 0755)
/usr/sbin/ietd
/usr/sbin/ietadm
/etc/rc.d/init.d/iscsi-target
%defattr(-, root, root, 0644)
%config(noreplace) /etc/ietd.conf
%config(noreplace) /etc/initiators.allow
%config(noreplace) /etc/initiators.deny
%doc COPYING README
%{_mandir}/man?/*
%files %{ktype}
%defattr(-, root, root, 0744)
/lib/modules/%{kernel}/kernel/iscsi/iscsi_trgt.ko
%changelog
* Mon Nov 21 2005 Bastiaan Bakker <[email protected]> - 0.4.13-0.1266.1
- upstream snapshot 1266
- added condrestart patch
- stop and start service on update or removal
* Sun Nov 13 2005 Bastiaan Bakker <[email protected]> - 0.4.13-0.1264.2
- run %post and %preun for kernel package, not main package
* Sun Nov 13 2005 Bastiaan Bakker <[email protected]> - 0.4.13-0.1264.1
- updated to snapshot 1264
* Thu Nov 03 2005 Bastiaan Bakker <[email protected]> - 0.4.12-6
- added openssl-devel build requirement
- removed '.ko' extension in modprobe command
* Wed Nov 02 2005 Bastiaan Bakker <[email protected]> - 0.4.12-5
- fixed kernel-devel BuildRequires
* Fri Sep 23 2005 Bastiaan Bakker <[email protected]> - 0.4.12-4
- fixed modprobe -r 'FATAL' message
- run depmod with correct kernel version
* Fri Sep 23 2005 Bastiaan Bakker <[email protected]> - 0.4.12-3
- added config files
- set kernel module file permissions to 744
- fixed provides/requires of kernel module
- removed BuildArch restriction
* Thu Sep 22 2005 Bastiaan Bakker <[email protected]> - 0.4.12-2
- create separate subpackage for kernel module
- include man pages
- added kernel compatibility patch for kernels < 2.6.11
* Wed Aug 03 2005 Bastiaan Bakker <[email protected]>
- First version.