From 15ca10d4ce66ca9f0f2220ab18d88ed1c65b023f Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Thu, 11 Sep 2014 13:25:21 +0400 Subject: [PATCH] changes to the spec file to compile on x86_64, x86, armv6hj_hardfp, armv7a_hardfp also makes this spec file less distribution specific: * no glibc-static on rhel4/5 * xorg-devel is called xorg-x11-devel on rhel4 thus requierements are changed to search for header files, not package names. --- voc.spec | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/voc.spec b/voc.spec index 23ebe5ef..9de0943a 100644 --- a/voc.spec +++ b/voc.spec @@ -15,6 +15,8 @@ # OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER # TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. +# +#some changes added by Norayr Chilingarian %define _prefix /opt/%{name}-%{version} %define _bindir %{_prefix}/bin @@ -33,8 +35,12 @@ Packager: %{packer} Group: Development/Languages Source: http://oberon.vishap.am/voc/voc-1.0.src.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-build -BuildArch: i686 -BuildRequires: glibc-static, libX11-devel +#BuildArch: i686 +#mases this .spec more generic +BuildArch: %{_arch} +#BuildRequires: glibc-devel, libX11-devel +#makes this more portable across different distributions +BuildRequires: /usr/include/X11/Xlib.h /usr/lib/libc.a %description Vishap's Oberon Compiler (voc) uses a C backend to drive compilation @@ -47,7 +53,19 @@ echo Building %{name}-%{version}-%{release} %setup -q -n %{name} %build -%{__make} -f makefile.linux.gcc.x86 +#choose corresponding makefile depending on architecture. +if [ %{_arch} == "i386" ] || [ %{_arch} == "i686" ] +then + %{__make} -f makefile.linux.gcc.x86 +elif [ %{_arch} == "armv6hl" ] +then + %{__make} -f makefile.linux.gcc.armv6j_hardfp +elif [ %{_arch} == "armv7" ] +then + %{__make} -f makefile.linux.gcc.armv7a_hardfp +else + %{__make} -f makefile.linux.gcc.%{_arch} +fi %install %{__install} -d %{buildroot}/%{_prefix}/bin