-
Notifications
You must be signed in to change notification settings - Fork 66
/
mhvtl-utils.spec
216 lines (169 loc) · 6.81 KB
/
mhvtl-utils.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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# Disable the building of the debug package(s).
%define debug_package %{nil}
# config.sh parses '_firmwarepath' to define FIRMWAREDIR in parent Makefile
%global _firmwarepath /usr/lib/firmware
# Compat path macros
# pilfered from https://src.fedoraproject.org/rpms/snapd/blob/master/f/snapd.spec
%{!?_systemdgeneratordir: %global _systemdgeneratordir %{_prefix}/lib/systemd/system-generators}
%define _unpackaged_files_terminate_build 0
%define mhvtl_home_dir /opt/mhvtl
Summary: Virtual tape library. kernel pseudo HBA driver + userspace daemons
%define real_name mhvtl
Name: mhvtl-utils
%define real_version 2023-03-10
%define minor 1
Version: 1.7
Release: %{minor}%{?dist}
License: GPL
Group: System/Kernel
URL: http://sites.google.com/site/linuxvtl2/
Source: mhvtl-%{real_version}.tgz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-build-%(%{__id_u} -n)
Recommends: lsscsi mtx mt-st
Requires:sg3_utils
Requires: policycoreutils
BuildRequires: systemd
BuildRequires: systemd-rpm-macros
BuildRequires: zlib-devel
%{?systemd_requires}
%{?systemd_ordering}
Obsoletes: mhvtl <= %{version}-%{release}
Provides: mhvtl = %{version}-%{release}
%description
A Virtual tape library and tape drives:
Used to emulate hardware robot & tape drives:
VTL consists of a pseudo HBA kernel driver and user-space daemons which
function as the SCSI target.
Communication between the kernel module and the daemons is achieved
via /dev/mhvtl? device nodes.
The kernel module is based on the scsi_debug driver.
The SSC/SMC target daemons have been written from scratch.
%prep
%setup -n %{real_name}-%{version}
%post
/sbin/semanage fcontext -a -t systemd_unit_file_t %{_unitdir}/mhvtl-load-modules.service
/sbin/semanage fcontext -a -t systemd_unit_file_t %{_unitdir}/[email protected]
/sbin/semanage fcontext -a -t systemd_unit_file_t %{_unitdir}/[email protected]
/sbin/semanage fcontext -a -t systemd_unit_file_t %{_unitdir}/mhvtl.target
/sbin/restorecon -R -v %{_unitdir}
/bin/systemctl daemon-reload
%{service_add_post mhvtl.target mhvtl-load-modules.service [email protected] [email protected]}
/bin/systemctl start mhvtl.target
/bin/systemctl enable mhvtl.target
make_vtl_media --config-dir=%{_sysconfdir}/mhvtl --home-dir=/opt/mhvtl --mktape-path=%{_bindir}
%postun
/sbin/ldconfig
/bin/systemctl daemon-reload
#%{service_del_postun mhvtl.target mhvtl-load-modules.service [email protected] [email protected]}
%pre
#%{service_add_pre mhvtl.target mhvtl-load-modules.service [email protected] [email protected]}
%preun
/bin/systemctl stop mhvtl.target
/bin/systemctl disable mhvtl.target
#%{service_del_preun mhvtl.target mhvtl-load-modules.service [email protected] [email protected]}
%build
make MHVTL_HOME_PATH=%{mhvtl_home_dir} VERSION=%{version} EXTRAVERSION=%{minor} \
SYSTEMD_GENERATOR_DIR=%{_systemdgeneratordir} \
SYSTEMD_SERVICE_DIR=%{_unitdir}
%install
%make_install \
MHVTL_HOME_PATH=%{mhvtl_home_dir} VERSION=%{version} EXTRAVERSION=%{minor} LIBDIR=%{_libdir} \
SYSTEMD_GENERATOR_DIR=%{_systemdgeneratordir} \
SYSTEMD_SERVICE_DIR=%{_unitdir}
install -d -m 755 %{buildroot}%{_sbindir}
ln -s %{_sbindir}/service %{buildroot}/%{_sbindir}/rc%{name}
install -d -m 755 %{buildroot}/var/lib/%{name}
%clean
%{__rm} -rf %{buildroot}
%files
%defattr(-, root, root, 0755)
%doc INSTALL README etc/library_contents.sample
%doc %{_mandir}/man1/mktape.1*
%doc %{_mandir}/man1/edit_tape.1*
%doc %{_mandir}/man1/vtlcmd.1*
%doc %{_mandir}/man1/vtllibrary.1*
%doc %{_mandir}/man1/vtltape.1*
%doc %{_mandir}/man1/preload_tape.1*
%doc %{_mandir}/man1/dump_tape.1*
%doc %{_mandir}/man1/make_vtl_media.1*
%doc %{_mandir}/man1/mhvtl_kernel_mod_build.1*
%doc %{_mandir}/man1/tapeexerciser.1*
%doc %{_mandir}/man1/update_device.conf.1*
%doc %{_mandir}/man1/generate_device_conf.1*
%doc %{_mandir}/man1/generate_library_contents.1*
%doc %{_mandir}/man5/device.conf.5*
%doc %{_mandir}/man5/mhvtl.conf.5*
%doc %{_mandir}/man5/library_contents.5*
%{_bindir}/vtlcmd
%{_bindir}/mktape
%{_bindir}/edit_tape
%{_bindir}/dump_tape
%{_bindir}/preload_tape
%{_bindir}/tapeexerciser
%{_bindir}/make_vtl_media
%{_bindir}/mhvtl_kernel_mod_build
%{_bindir}/update_device.conf
%{_bindir}/generate_device_conf
%{_bindir}/generate_library_contents
%{_libdir}/libvtlscsi.so
%{_libdir}/libvtlcart.so
%{_firmwarepath}/mhvtl/mhvtl_kernel.tgz
%dir %{_sysconfdir}/mhvtl
%config(noreplace) %{_sysconfdir}/mhvtl/mhvtl.conf
%config(noreplace) %{_sysconfdir}/mhvtl/device.conf
%config(noreplace) %{_sysconfdir}/mhvtl/library_contents.10
%config(noreplace) %{_sysconfdir}/mhvtl/library_contents.30
%{_systemdgeneratordir}/mhvtl-device-conf-generator
%{_unitdir}/mhvtl-load-modules.service
%{_unitdir}/[email protected]
%{_unitdir}/[email protected]
%{_unitdir}/mhvtl.target
%dir %{mhvtl_home_dir}
%ghost %{mhvtl_home_dir}/*
%defattr(755, root, root, 0755)
%{_bindir}/vtltape
%{_bindir}/vtllibrary
%defattr(-, root, root, 755)
%dir /opt/mhvtl/
%changelog
* Fri Mar 10 2023 Mark Harvey <[email protected]> - 1.7-1
- Updated to release 1.7-1 (2023-03-10).
* Thu Mar 10 2022 Mark Harvey <[email protected]> - 1.7-0
- Updated to release 1.7-0 (2022-03-10).
* Thu Oct 07 2021 Mark Harvey <[email protected]> - 1.6-4
- Updated to release 1.6-4 (2021-10-07).
* Tue Mar 03 2020 Mark Harvey <[email protected]> - 1.6-3
- Updated to release 1.6-3 (2020-03-10).
* Sun Oct 06 2019 Mark Harvey <[email protected]> - 1.6-2
- Updated to release 1.6-2 (2019-10-06).
* Thu Mar 10 2016 Mark Harvey <[email protected]> - 1.5-4
- Updated to release 1.5-4 (2016-03-10).
* Tue Apr 14 2015 Mark Harvey <[email protected]> - 1.5-3
- Updated to release 1.5-3 (2015-04-14).
* Sun Sep 7 2014 Mark Harvey <[email protected]> - 1.5-2
- Updated to release 1.5-2 (2014-09-04).
* Sun Apr 13 2014 Mark Harvey <[email protected]> - 1.5-0
- Updated to release 1.5-0 (2014-04-13).
* Sun Oct 20 2013 Mark Harvey <[email protected]> - 1.4-10
- Updated to release 1.4-10 (2013-10-20).
* Thu Aug 29 2013 Mark Harvey <[email protected]> - 1.4-9
- Updated to release 1.4-9 (2013-08-29).
* Sat Jun 29 2013 Mark Harvey <[email protected]> - 1.4-8
- Updated to release 1.4-8 (2013-06-29).
* Fri Mar 22 2013 Mark Harvey <[email protected]> - 1.4-7
- Updated to release 1.4-7 (2013-03-22).
* Thu Jan 31 2013 Mark Harvey <[email protected]> - 1.4-6
- Updated to release 1.4-6 (2013-01-31).
* Sat Jan 12 2013 Mark Harvey <[email protected]> - 1.4-5
- Updated to release 1.4-5 (2013-01-12).
* Mon Aug 13 2012 Mark Harvey <[email protected]> - 1.4-4
- Updated to release 1.4-4 (2012-09-13).
* Wed Aug 8 2012 Mark Harvey <[email protected]> - 1.4-1
- Updated to release 1.4-1 (2012-08-08).
* Wed Aug 1 2012 Mark Harvey <[email protected]> - 1.4-0
- Updated to release 1.4 (2012-08-01).
- install using Makefile
* Thu Jun 21 2012 Dag Wieers <[email protected]> - 1.3-1
- Updated to release 1.3 (2012-06-15).
* Thu Aug 05 2010 Dag Wieers <[email protected]> - 0.18-11
- Initial build of the kmod package.