# Tests by default. No tests: rpm -ba --define 'dotests 0' *.spec %{!?dotests: %define dotests 1} Summary: The GNU patch command, for modifying/upgrading files. Name: patch Version: 2.7.6 Release: 1 Copyright: GPL Group: Development/Tools Source: ftp://prep.ai.mit.edu/pub/gnu/patch-2.7.6.tar.gz Buildroot: /var/tmp/%{name}-root %ifarch ia64 %define DEFCCIA xlc %define DEFCC %{DEFCCIA} %else %define DEFCC xlc %endif %description The patch program applies diff files to originals. The diff command is used to compare an original to a changed file. Diff lists the changes made to the file. A person who has the original file can then use the patch command with the diff file to add the changes to their original file (patching the file). Patch should be installed because it is a common way of upgrading applications. %prep %setup -q %build # Use the default compiler for this platform - gcc otherwise #if [[ -z "$CC" ]] #then # if test "X`type %{DEFCC} 2>/dev/null`" != 'X'; then # export CC=%{DEFCC} # export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's:-fsigned-char::'` # else # export CC=gcc # fi #fi # Duplicate source for 32 & 64 bits rm -rf /tmp/%{name}-%{version}-32bit mkdir /tmp/%{name}-%{version}-32bit mv * /tmp/%{name}-%{version}-32bit mkdir 32bit mv /tmp/%{name}-%{version}-32bit/* 32bit rm -rf /tmp/%{name}-%{version}-32bit mkdir 64bit cp -rp 32bit/* 64bit/ # first build the 64-bit version cd 64bit export CC="gcc -maix64 -D_LARGE_FILES" export OBJECT_MODE=64 ./configure make "CFLAGS=$RPM_OPT_FLAGS" LDFLAGS=-s # XXX unset CPPFLAGS on (ultra?)sparc to avoid large file system support %ifarch sparc sparc64 make CPPFLAGS="" %else make %endif if [ "%{dotests}" == 1 ] then (gmake -k check || true) fi #Now build the 32-bit version cd ../32bit export CC="gcc -maix32 -D_LARGE_FILES" export OBJECT_MODE=32 ./configure make "CFLAGS=$RPM_OPT_FLAGS" LDFLAGS=-s # XXX unset CPPFLAGS on (ultra?)sparc to avoid large file system support %ifarch sparc sparc64 make CPPFLAGS="" %else make %endif if [ "%{dotests}" == 1 ] then (gmake -k check || true) fi %install rm -rf $RPM_BUILD_ROOT cd 64bit export AR="/usr/bin/ar -X64" export OBJECT_MODE=64 export CFLAGS="-maix64" ./configure --prefix=$RPM_BUILD_ROOT%{_prefix} make install prefix=$RPM_BUILD_ROOT/%{_prefix} /usr/bin/strip ${RPM_BUILD_ROOT}%{_bindir}/* || : ( cd ${RPM_BUILD_ROOT}%{_bindir} for f in patch do mv ${f} ${f}_64 done ) cd ../32bit export AR="/usr/bin/ar -X32" export OBJECT_MODE=32 export CFLAGS="-maix32" ./configure --prefix=$RPM_BUILD_ROOT%{_prefix} make install prefix=$RPM_BUILD_ROOT/%{_prefix} /usr/bin/strip ${RPM_BUILD_ROOT}%{_bindir}/* || : ( cd ${RPM_BUILD_ROOT}%{_bindir} for f in patch do mv ${f} ${f}_32 done ) # Make 64bit executable as default ( cd ${RPM_BUILD_ROOT}%{_bindir} for f in patch do ln -sf ${f}_64 ${f} done ) (cd $RPM_BUILD_ROOT mkdir -p usr/linux/bin cd usr/linux/bin ln -sf ../../..%{_prefix}/bin/* . ) %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %doc 32bit/NEWS 32bit/README %{_prefix}/bin/* /usr/linux/bin/* %{_prefix}/share/man/*/* %changelog * Tue Nov 20 2018 Harshita JAin -2.7.6-1 - Updated to latest version 2.7.6 * Fri Sep 22 2017 Sushma M Bhat -2.7.5-1 - Built 64 bit and updated to 2.7.5 version * Fri Mar 23 2001 David Clissold - STDC needed -- default compiler to xlc, not cc * Thu Mar 08 2001 Marc Stephenson - Add logic for default compiler - Rebuild against new shared objects * Fri Oct 27 2000 rpmpkg - Adapted for AIX Freeware delivery * Mon Feb 7 2000 Bill Nottingham - handle compressed manpages * Sun Jun 06 1999 Alan Cox - Fix the case where stderr isnt flushed for ask(). Now the 'no such file' appears before the skip patch question, not at the very end, Doh! * Mon Mar 22 1999 Jeff Johnson - (ultra?) sparc was getting large file system support. * Sun Mar 21 1999 Cristian Gafton - auto rebuild in the new build environment (release 7) * Fri Dec 18 1998 Cristian Gafton - build against glibc 2.1 * Tue Sep 1 1998 Jeff Johnson - bump release to preserve newer than back-ported 4.2. * Tue Jun 09 1998 Prospector System - translations modified for de, fr * Tue Jun 9 1998 Jeff Johnson - Fix for problem #682 segfault. * Fri Apr 24 1998 Prospector System - translations modified for de, fr, tr * Tue Apr 07 1998 Cristian Gafton - added buildroot * Wed Oct 21 1997 Cristian Gafton - updated to 2.5 * Mon Jun 02 1997 Erik Troan - built against glibc