%define name p2c %define version 1.22 %define release 9mdk Summary: A Pascal to C translator. Name: %{name} Version: %{version} Release: %{release} Copyright: distributable Group: Development/Other Source: ftp://csvax.cs.caltech.edu/pub/p2c-1.22.tar.bz2 URL: http://qa.mandrakesoft.com Patch0: p2c-1.20-misc.patch.bz2 Patch1: p2c-1.20-br.patch.bz2 Patch2: p2c-newpatch.patch.bz2 BuildRoot: %{_tmppath}/%{name}-root Obsoletes: basic %description P2c is a system for translating Pascal programs into the C language. P2c accepts input source files in certain Pascal dialects: HP Pascal, Turbo/UCSD Pascal, DEC VAX Pascal, Oregon Software Pascal/2, Macintosh Programmer's Workshop Pascal and Sun/Berkeley Pascal. P2c outputs a set of .c and .h files which make up a C program equivalent to the original Pascal program. The C program can then be compiled using a standard C compiler, such as gcc. Install the p2c package if you need a program for translating Pascal code into C code. %package devel Summary: Files for p2c Pascal to C translator development. Group: Development/Other %description devel The p2c-devel package contains the files necessary for development of the p2c Pascal to C translation system. Install the p2c-devel package if you want to do p2c development. %prep %setup -q #%patch0 -p1 -b .misc #%patch1 -p1 -b .br %patch2 -p1 -b .new mkdir src/shlib mkdir include ln -s ../src include/p2c %build cp src/sys.p2crc src/p2crc make RPM_OPTS="$RPM_OPT_FLAGS" make RPM_OPTS="$RPM_OPT_FLAGS" shlib -C src %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/usr/{bin,lib,man/man1.bz2,include} make install RPM_INSTALL=$RPM_BUILD_ROOT strip $RPM_BUILD_ROOT/usr/bin/p2c find $RPM_BUILD_ROOT/ -type 'f'|grep -E '.*[0-9]($|x)' | xargs file \ | grep troff | cut -d: -f1 | xargs bzip2 -9 for i in `find $RPM_BUILD_ROOT/ -type 'f' -perm '+a=x' ! -name 'lib*so*'`; do file $i |grep -q "not stripped" && strip $i done #move the man page mkdir $RPM_BUILD_ROOT/usr/share mv $RPM_BUILD_ROOT/usr/man $RPM_BUILD_ROOT/usr/share %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) #%doc %_docdir/p2c-1.22 /usr/bin/* /usr/lib/libp2c.so* /usr/lib/p2c %{_mandir}/man1/p2c.1.bz2 %files devel %defattr(-,root,root) /usr/lib/libp2c.a /usr/include/p2c %changelog * Sun Feb 3 2002 Daouda LO <daouda@mandrakesoft.com> 1.22-9mdk - rebuild ( cleanup - URL tag ... ) * Tue Mar 6 2001 Daouda Lo <daouda@mandrakesoft.com> 1.22-8mdk - spec clean up - rebuild -> add p2cc - replace buildroot dir * Tue Aug 29 2000 Etienne Faure <etienne@mandrakesoft.com> 1.22-7mdk - use _mandir macro * Mon Apr 3 2000 Adam Lebsack <adam@mandrakesoft.com> 1.22-6mdk - Release build. * Mon Nov 29 1999 Axalon Bloodstone <axalon@linux-mandrake.com> - move defattr to before doc * Wed May 05 1999 Bernhard Rosenkraenzer <bero@mandrakesoft.com> - Mandrake adaptions * Mon Apr 12 1999 Preston Brown <pbrown@redhat.com> - fixed group. * Sun Mar 21 1999 Michael Maher <mike@redhat.com> - Merged patched tar ball on gribble with original installation. Was missing important parts of make files. - Fixed many errors in Makefiles. - moved 'basic' stuff into doc * Fri Dec 18 1998 Cristian Gafton <gafton@redhat.com> - build for glibc 2.1 - buildroot - binary files and man page should really be in the main package, not -devel * Tue May 05 1998 Prospector System <bugs@redhat.com> - translations modified for de, fr, tr * Thu Jul 10 1997 Erik Troan <ewt@redhat.com> - built against glibc