/
hlinktest.spec
53 lines (46 loc) · 950 Bytes
/
hlinktest.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
%bcond_with unpackaged_dirs
%bcond_with unpackaged_files
%bcond_with unpackaged_excludes
%bcond_with owned_dir
Summary: Testing hard link behavior
Name: hlinktest
Version: 1.0
Release: 1
License: Testing
Group: Testing
BuildArch: noarch
Provides: /bin/sh
%description
%install
rm -rf %{buildroot}
mkdir -p $RPM_BUILD_ROOT/foo
cat << EOF >> $RPM_BUILD_ROOT/foo/hello
#!/bin/sh
echo %{name}-%{version}
EOF
cd $RPM_BUILD_ROOT/foo
cat hello > copyllo
cat hello > aaaa
ln aaaa zzzz
chmod a+x hello copyllo
for f in foo bar world; do
ln hello hello-${f}
done
%if %{with unpackaged_dirs}
mkdir -p $RPM_BUILD_ROOT/zoo/
%endif
%if %{with unpackaged_files}
touch $RPM_BUILD_ROOT/toot
%endif
%if %{with unpackaged_excludes}
touch $RPM_BUILD_ROOT/teet
%endif
%files
%defattr(-,root,root)
%if %{with owned_dir}
%dir /foo
%endif
/foo/*
%if %{with unpackaged_excludes}
%exclude /teet
%endif