]>
Commit | Line | Data |
---|---|---|
26da8144 | 1 | Summary: Consistent/persistent storage device access through symlinking |
2 | Name: devlabel | |
3 | Version: 0.48.01 | |
4 | Release: 1 | |
5 | License: GPL | |
6 | Group: System Environment/Base | |
7 | Group: Applications/System | |
c905129a | 8 | Source0: http://linux.dell.com/devlabel/permalink/%{name}-%{version}.tar.gz |
26da8144 | 9 | # Source0-md5: 1a4032b942d8b47544da1957374a9786 |
10 | Requires: sed grep awk textutils fileutils diffutils coreutils mktemp | |
11 | Requires: initscripts > 6.97-1 | |
12 | Requires: util-linux | |
13 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
14 | ||
15 | %description | |
16 | This package contains the devlabel implementation. It allows for | |
17 | consistent mounting of devices. This is accomplished through tagging a | |
18 | unique identifier to each device/symlink combination and confirming | |
19 | that the identifier still matches the device name before it allows the | |
20 | symlink mapping to proceed. | |
21 | ||
22 | %prep | |
23 | ||
24 | %setup -q | |
25 | ||
26 | %build | |
27 | gcc $RPM_OPT_FLAGS -o scsi_unique_id scsi_unique_id.c | |
28 | gcc $RPM_OPT_FLAGS -o partition_uuid -luuid partition_uuid.c | |
29 | ||
30 | %pre | |
31 | [ -d /var/lib/devlabel ] && rm -rf /var/lib/devlabel >/dev/null 2>&1 | |
32 | if [ -e /etc/sysconfig/devlabel ]; then | |
33 | devlabel_version=`devlabel -v 2>/dev/null` | |
34 | old_format="" | |
35 | version_major=`echo $devlabel_version | awk {'print $2'} | cut -d '.' -f 1-1` | |
36 | version_minor=`echo $devlabel_version | awk {'print $2'} | cut -d '.' -f 2-2` | |
37 | [ -z "$version_minor" ] && old_format="true" | |
38 | [ -z "$old_format" ] && [ "$version_major" -eq 0 ] && [ "$version_minor" -lt 37 ] && old_format="true" | |
39 | if [ -n "$old_format" ]; then | |
40 | /sbin/devlabel restart >/dev/null 2>&1 || : | |
41 | fi | |
42 | fi | |
43 | ||
44 | %triggerpostun -- devlabel <= 0.38.07-1 | |
45 | if [ -e /etc/sysconfig/devlabel ]; then | |
46 | /sbin/devlabel reverseremap --force >/dev/null 2>&1 || : | |
47 | fi | |
48 | ||
49 | %install | |
50 | rm -rf $RPM_BUILD_ROOT | |
51 | if [ "$RPM_BUILD_ROOT" != "/" ]; then | |
52 | rm -rf $RPM_BUILD_ROOT | |
53 | fi | |
54 | install -d $RPM_BUILD_ROOT/{sbin,usr/bin,usr/share/man/man8,etc/sysconfig,etc/sysconfig/devlabel.d} | |
55 | install -m 755 devlabel $RPM_BUILD_ROOT/sbin/devlabel | |
56 | install -m 755 scsi_unique_id $RPM_BUILD_ROOT%{_bindir} | |
57 | install -m 755 partition_uuid $RPM_BUILD_ROOT%{_bindir} | |
58 | install devlabel.8.gz $RPM_BUILD_ROOT%{_mandir}/man8 | |
59 | install sysconfig.devlabel $RPM_BUILD_ROOT/etc/sysconfig/devlabel | |
60 | install ignore_list $RPM_BUILD_ROOT/etc/sysconfig/devlabel.d | |
61 | install ignore_list $RPM_BUILD_ROOT/etc/sysconfig/devlabel.d/proc_partitions | |
62 | ||
63 | %clean | |
64 | if [ "$RPM_BUILD_ROOT" != "/" ]; then | |
65 | rm -rf $RPM_BUILD_ROOT | |
66 | fi | |
67 | ||
68 | %files | |
69 | %defattr(644,root,root,755) | |
70 | %attr(755,root,root) %{_sbindir}/devlabel | |
71 | %attr(755,root,root) %{_bindir}/scsi_unique_id | |
72 | %attr(755,root,root) %{_bindir}/partition_uuid | |
73 | /etc/sysconfig/devlabel.d | |
74 | %config(noreplace) /etc/sysconfig/devlabel | |
75 | %{_mandir}/man8/devlabel.8* | |
76 | %doc AUTHORS COPYING |