Skip to content

Commit

Permalink
Clean up redundant and/or considered harmful crap from testsuite specs
Browse files Browse the repository at this point in the history
Stop this gunk from getting copy-pasted around, this mostly harmful
and redundant at best.
  • Loading branch information
pmatilai committed May 4, 2022
1 parent 2bb2bd5 commit f7ffa9c
Show file tree
Hide file tree
Showing 24 changed files with 1 addition and 130 deletions.
2 changes: 0 additions & 2 deletions tests/data/SPECS/attrtest.spec
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ BuildArch: noarch
%{summary}

%install
rm -rf $RPM_BUILD_ROOT

for x in a b c d e f g h i j; do
mkdir -p $RPM_BUILD_ROOT/${x}
mkdir -p $RPM_BUILD_ROOT/${x}/dir
Expand Down
11 changes: 0 additions & 11 deletions tests/data/SPECS/buildrequires.spec
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,6 @@ echo hello
EOF
chmod a+x $RPM_BUILD_ROOT/usr/local/bin/hello

%clean
rm -rf $RPM_BUILD_ROOT

%pre

%post

%preun

%postun

%files
%defattr(-,root,root)
%doc FAQ
Expand Down
2 changes: 0 additions & 2 deletions tests/data/SPECS/captest.spec
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ BuildArch: noarch
%{summary}

%install
rm -rf $RPM_BUILD_ROOT

mkdir -p $RPM_BUILD_ROOT/a
echo "x" > $RPM_BUILD_ROOT/a/emptyCaps1
echo "x" > $RPM_BUILD_ROOT/a/emptyCaps2
Expand Down
4 changes: 0 additions & 4 deletions tests/data/SPECS/configtest.spec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ BuildArch: noarch
%{summary}

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}
case %{filetype} in
file)
Expand All @@ -30,9 +29,6 @@ dir)
;;
esac

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%{?fileattr} %{!?noconfig:%config%{?noreplace:(noreplace)}} %{_sysconfdir}/my.conf
4 changes: 0 additions & 4 deletions tests/data/SPECS/conflicttest.spec
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,9 @@ BuildArch: noarch
%{summary}

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{_datadir}
echo "%{filedata}" > $RPM_BUILD_ROOT/%{_datadir}/my.version

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%{?fileattr} %{_datadir}/my.version
5 changes: 0 additions & 5 deletions tests/data/SPECS/flangtest.spec
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,12 @@ BuildArch: noarch
%{summary}

%install
rm -rf $RPM_BUILD_ROOT

mkdir -p $RPM_BUILD_ROOT/%{_datadir}/%{name}
for f in fi de en pl none; do
echo "This is $f language" > $RPM_BUILD_ROOT/%{_datadir}/%{name}/$f.txt
done
touch $RPM_BUILD_ROOT/%{_datadir}/%{name}/empty.txt

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%lang(fi) %{_datadir}/%{name}/fi.txt
Expand Down
2 changes: 0 additions & 2 deletions tests/data/SPECS/globtest.spec
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ BuildArch: noarch
%define testdir /opt/%{name}

%install
rm -rf $RPM_BUILD_ROOT

mkdir -p $RPM_BUILD_ROOT/%{testdir}
echo "foo" > $RPM_BUILD_ROOT/%{testdir}/weird%%name
for f in bif baf zab zeb zib brace grace; do
Expand Down
1 change: 0 additions & 1 deletion tests/data/SPECS/hello-g3.spec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ mv hello hello-g3
make CFLAGS="-g3 -O2 -D_FORTIFY_SOURCE=2 %{?debug_flags}" CC=%{__cc}

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/local/bin
make DESTDIR=$RPM_BUILD_ROOT install
cp hello-g3 $RPM_BUILD_ROOT/usr/local/bin/
Expand Down
12 changes: 0 additions & 12 deletions tests/data/SPECS/hello-r2.spec
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,9 @@ Simple rpm demonstration.
make

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/local/bin
make DESTDIR=$RPM_BUILD_ROOT install

%clean
rm -rf $RPM_BUILD_ROOT

%pre

%post

%preun

%postun

%files
%defattr(-,root,root)
%doc FAQ
Expand Down
1 change: 0 additions & 1 deletion tests/data/SPECS/hello-script.spec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ BuildArch: noarch
%{summary}

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/bin
mkdir -p $RPM_BUILD_ROOT/zoot
cat << EOF > $RPM_BUILD_ROOT/usr/bin/hello
Expand Down
12 changes: 0 additions & 12 deletions tests/data/SPECS/hello.spec
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,9 @@ Simple rpm demonstration.
make

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/local/bin
make DESTDIR=$RPM_BUILD_ROOT install

%clean
rm -rf $RPM_BUILD_ROOT

%pre

%post

%preun

%postun

%files
%defattr(-,root,root)
%doc FAQ
Expand Down
12 changes: 0 additions & 12 deletions tests/data/SPECS/hello2-suid.spec
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,11 @@ mv hello hello2
make CFLAGS="-g -O2 -D_FORTIFY_SOURCE=2"

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/local/bin
# Note explicit install hello as suid
install -m 4755 hello $RPM_BUILD_ROOT/usr/local/bin
install -m 755 hello2 $RPM_BUILD_ROOT/usr/local/bin

%clean
rm -rf $RPM_BUILD_ROOT

%pre

%post

%preun

%postun

%files
# Note we don't set any attrs. We expect the suid flag to have been picked up.
/usr/local/bin/hello
Expand Down
12 changes: 0 additions & 12 deletions tests/data/SPECS/hello2.spec
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,10 @@ mv hello hello2
make CFLAGS="-g -O2 -D_FORTIFY_SOURCE=2"

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/local/bin
make DESTDIR=$RPM_BUILD_ROOT install
cp hello2 $RPM_BUILD_ROOT/usr/local/bin/

%clean
rm -rf $RPM_BUILD_ROOT

%pre

%post

%preun

%postun

%files
%defattr(-,root,root)
%doc FAQ
Expand Down
14 changes: 0 additions & 14 deletions tests/data/SPECS/hello2cp.spec
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,13 @@ make CFLAGS="-g -O1"
cp hello hello2

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/local/bin
make DESTDIR=$RPM_BUILD_ROOT install
cp hello2 $RPM_BUILD_ROOT/usr/local/bin/

%clean
rm -rf $RPM_BUILD_ROOT

%pre

%post

%preun

%postun

%files
%defattr(-,root,root)
%doc FAQ
#%readme README
#%license COPYING
%attr(0751,root,root) /usr/local/bin/hello
%attr(0751,root,root) /usr/local/bin/hello2

Expand Down
14 changes: 0 additions & 14 deletions tests/data/SPECS/hello2ln.spec
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,13 @@ Simple rpm demonstration.
make CFLAGS="-g -O1"

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/local/bin
make DESTDIR=$RPM_BUILD_ROOT install
ln $RPM_BUILD_ROOT/usr/local/bin/hello $RPM_BUILD_ROOT/usr/local/bin/hello2

%clean
rm -rf $RPM_BUILD_ROOT

%pre

%post

%preun

%postun

%files
%defattr(-,root,root)
%doc FAQ
#%readme README
#%license COPYING
%attr(0751,root,root) /usr/local/bin/hello
%attr(0751,root,root) /usr/local/bin/hello2

Expand Down
1 change: 0 additions & 1 deletion tests/data/SPECS/hlinktest.spec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Provides: /bin/sh
%description

%install
rm -rf %{buildroot}
mkdir -p $RPM_BUILD_ROOT/foo
cat << EOF >> $RPM_BUILD_ROOT/foo/hello
#!/bin/sh
Expand Down
4 changes: 1 addition & 3 deletions tests/data/SPECS/ifmultiline.spec
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ Summary: Test multiline if conditions
%{summary}

%install
rm -rf $RPM_BUILD_ROOT

mkdir -p $RPM_BUILD_ROOT/a
echo "x" > $RPM_BUILD_ROOT/a/empty\
Caps1
Expand All @@ -25,4 +23,4 @@ Caps1
/a/emptyCaps1


%changelog
%changelog
5 changes: 0 additions & 5 deletions tests/data/SPECS/poltest.spec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ License: GPL
Requires: poltest-policy
Source0: poltest-%{version}.tar.bz2
Source1: poltest-policy-%{version}.tar.bz2
Buildroot: %{_tmppath}/%{name}-%{version}-root
%description
Example for installing policy included in a package header

Expand All @@ -22,12 +21,8 @@ make CFLAGS="$RPM_OPT_FLAGS"
make -f /usr/share/selinux/devel/Makefile -C poltest-policy-%{version}

%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=%{buildroot} prefix=%{_prefix} install

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%{_bindir}/foo
Expand Down
2 changes: 0 additions & 2 deletions tests/data/SPECS/prefixtest.spec
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ RemovePathPostfixes: g:f
%define testdir /opt/%{name}

%install
rm -rf $RPM_BUILD_ROOT

mkdir -p $RPM_BUILD_ROOT/%{testdir}
echo "foo" > $RPM_BUILD_ROOT/%{testdir}/weird%%name
for f in bif baf zab zeb zib; do
Expand Down
1 change: 0 additions & 1 deletion tests/data/SPECS/replacetest.spec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ BuildArch: noarch
%{summary}

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/opt
case %{filetype} in
file)
Expand Down
1 change: 0 additions & 1 deletion tests/data/SPECS/selfconflict.spec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ BuildArch: noarch
%{summary}

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/opt/mydir/{one,two}
echo "foo" > $RPM_BUILD_ROOT/opt/mydir/one/somefile
echo "bar" > $RPM_BUILD_ROOT/opt/mydir/two/somefile
Expand Down
4 changes: 0 additions & 4 deletions tests/data/SPECS/symlinktest.spec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ BuildArch: noarch
%{summary}

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/share
%if %{with symlink}
mkdir -p $RPM_BUILD_ROOT/usr/lib/%{name}
Expand All @@ -23,9 +22,6 @@ mkdir -p $RPM_BUILD_ROOT/usr/share/%{name}
echo %{name} > $RPM_BUILD_ROOT/usr/share/%{name}/README
%endif

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%if %{with symlink}
Expand Down
2 changes: 0 additions & 2 deletions tests/data/SPECS/vattrtest.spec
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ BuildArch: noarch
%{summary}

%install
rm -rf $RPM_BUILD_ROOT

mkdir -p $RPM_BUILD_ROOT/opt/%{name}
for x in a c cn d g l m r; do
echo ${x} > $RPM_BUILD_ROOT/opt/%{name}/${x}
Expand Down
3 changes: 0 additions & 3 deletions tests/data/SPECS/versiontest.spec
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@ BuildArch: noarch
%description
%{summary}

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)

0 comments on commit f7ffa9c

Please sign in to comment.