%define name setarch %define version 1.3 %define release 1mdk Summary: Personality setter Name: %{name} Version: %{version} Release: %{release} Source0: %{name}-%{version}.tar.bz2 Patch0: setarch-1.3-linux64.patch.bz2 License: GPL Obsoletes: linux32 Provides: linux32 Group: System/Kernel and hardware BuildRoot: %{_tmppath}/%{name}-buildroot %description This utility tells the kernel to report a different architecture than the current one, then runs a program in that environment. %prep %setup -q %patch0 -p1 -b .linux64 %build %{__cc} -o setarch setarch.c $RPM_OPT_FLAGS %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%{_bindir} $RPM_BUILD_ROOT%{_mandir}/man8 install -m444 setarch.8 $RPM_BUILD_ROOT%{_mandir}/man8 install -s -m555 setarch $RPM_BUILD_ROOT%{_bindir} LINKS="linux32" %ifarch s390 s390x LINKS="$LINKS s390 s390x" %endif %ifarch x86_64 i386 LINKS="$LINKS i386 x86_64" %endif %ifarch ppc ppc64 LINKS="$LINKS ppc ppc64 ppc32" %endif %ifarch sparc sparc64 LINKS="$LINKS sparc sparc64 sparc32" %endif %ifarch ia64 LINKS="$LINKS i386 ia64" %endif %ifarch x86_64 ppc64 sparc64 ia64 LINKS="$LINKS linux64" %endif for I in $LINKS; do ln $RPM_BUILD_ROOT%{_bindir}/setarch $RPM_BUILD_ROOT%{_bindir}/$I echo ".so setarch.8" > $RPM_BUILD_ROOT%{_mandir}/man8/$I.8 done %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %{_bindir}/* %{_mandir}/man8/*.8* %changelog * Wed Feb 11 2004 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 1.3-1mdk - First Mandrake Linux package