This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

On the RPM-spec (was: Re: gcc-2.95: Naming of the TAR file? GCC-2.95.tar.gz? gcc-2.95.tar.gz?)


Am Son, 25 Jul 1999 schrieb Arvind Sankar:
>>While on the subject of making an RPM, I used to make RPMS from the
>snapshots for RedHat Contrib|Net, and I've attached the .spec file and
>patches I needed. The .spec makes a couple of additional info files, runs
>the testsuite and packages the results, and adds libgcj to the RPM.

Well, your spec is very similar to mine, the 2 basic differences are:

1. you configure for an optional compiler in /opt/egcs, I configure for a
system compiler in /usr
2. you follow the old RH5 layout (with libstdc++-devel), I follow the the RH6
layout (with libstdc++-devel merged into gcc-c++ and a separate cpp)

I don't care about about not-installed info files, because I believe they are
not installed on purpose :-). I only make sure that all info files are built
with --no-split to reduce the clutter in the info dir.

In the meantime, following some other discussions, I think the best approach
would really be to have 2 separate specs, one for use as a system compiler
(like mine) and one for use as an optional compiler (in /opt/gcc, /usr/local,
etc), cause the requirements during install are quite different. The
purpose/pitfalls of each spec should be clearly documented in it's header.

I already integrated some stuff out of your spec into my spec, and your spec
needs some overhaul egcs -> gcc :-). The only real nits I found in your spec,
you are building inside the sourcedir and you don't support any multilibbed
target yet (look for %ifarch ppc/alpha in my spec). I think we should
synchronize a bit and then put up the specs for download (maybe in the
FTP infrastructure dir, with links from the FAQ/install pages).

What do you think?

Franz.
 
#
# this spec-file requires rpm-3.0 or newer
#
%define GCC_VERSION 2.95
%define STDC_VERSION 2.10.0
%define target_alias %{_target_cpu}-linux
%define OBJDIR $RPM_BUILD_DIR/obj-gcc-$RPM_ARCH

Summary: GNU Compiler Collection - Core package including C compiler
Name: gcc
Version: %{GCC_VERSION}
Release: 0
Copyright: GPL
Group: Development/Languages
Source: ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{GCC_VERSION}/gcc-%{GCC_VERSION}.tar.gz
Buildroot: /var/tmp/gcc-%{GCC_VERSION}-root
Url: http://gcc.gnu.org/
Requires: cpp = %{GCC_VERSION}
%ifarch ppc
Requires: binutils >= 2.9.4.0.8
%else
Requires: binutils >= 2.9.1.0.23
%endif
Obsoletes: egcs
Prereq: /sbin/install-info

%description
GCC, the GNU Compiler Collection, is a free software project that intends to
further the development of GNU compilers using an open development
environment. The gcc package contains the GCC C compiler, a compiler aimed
at integrating all the optimizations and features necessary for a
high-performance and stable development environment.

Install gcc if you'd like to use the GNU Compiler Collection C compiler, you
will also need to install the cpp package.

%package -n cpp
Summary: GNU Compiler Collection - The C Preprocessor.
Group: Development/Languages
Prereq: /sbin/install-info

%description -n cpp
The C preprocessor is a 'macro processor' which is used automatically
by the C compiler to transform your program before actual
compilation. It is called a macro processor because it allows
you to define 'macros', which are abbreviations for longer
constructs.

The C preprocessor provides four separate facilities that you can use as
you see fit:

* Inclusion of header files. These are files of declarations that can be
  substituted into your program.
* Macro expansion. You can define 'macros', which are abbreviations for
  arbitrary fragments of C code, and then the C preprocessor will replace
  the macros with their definitions throughout the program.
* Conditional compilation. Using special preprocessing directives,
  you can include or exclude parts of the program according to various
  conditions.
* Line control. If you use a program to combine or rearrange source files
  into an intermediate file which is then compiled, you can use line
  control to inform the compiler about where each source line originated.

You should install this package if you are a programmer who is searching for
such a macro processor.

%package c++
Summary: C++ support for the GNU Compiler Collection.
Group: Development/Languages
Requires: cpp = %{GCC_VERSION}
Requires: gcc = %{GCC_VERSION}
Requires: libstdc++ = %{STDC_VERSION}
Obsoletes: egcs-c++
Obsoletes: libstdc++-devel
Obsoletes: libg++-devel

%description c++
This package adds C++ support to the GNU compiler collection. It includes
support for most of the current C++ specification, including templates and
exception handling. It does include the static standard C++ library and C++
header files; the library for dynamically linking programs is available
separately.

%package objc
Summary: Objective C support for the GNU Compiler Collection.
Group: Development/Languages
Requires: cpp = %{GCC_VERSION}
Requires: gcc = %{GCC_VERSION}
Requires: gcc-c++ = %{GCC_VERSION}
Obsoletes: egcs-objc

%description objc
Objective C is an object-oriented derivative of the C language, much like
C++ but with more dynamic capabilities than this. This package adds
Objective-C support to the GNU Compiler Collection. It includes the
Objective-C compiler and runtime that is needed for running Objective-C
programs.

Install gcc-objc if you are going to do Objective C development and you
would like to use the GNU Compiler Collection.  You will also need to
install the gcc package.

%package g77
Summary: Fortran 77 support for the GNU Compiler Collection.
Group: Development/Languages
Requires: cpp = %{GCC_VERSION}
Requires: gcc = %{GCC_VERSION}
Obsoletes: egcs-g77
Prereq: /sbin/install-info

%description g77
The gcc-g77 package provides support for compiling Fortran 77 programs with
the GNU Compiler Collection.

You should install gcc-g77 if you are going to do Fortran development and
you would like to use the GNU Compiler Collection.  You will also need to
install the gcc package.

%package java
Summary: Java support for the GNU Compiler Collection.
Group: Development/Languages
Requires: cpp = %{GCC_VERSION}
Requires: gcc = %{GCC_VERSION}
Requires: libgcj
Prereq: /sbin/install-info

%description java
The gcc-java package provides support for compiling Java programs
with the GNU Compiler Collection.

You should install gcc-java if you are going to do Java development and you
would like to use the GNU Compiler Collection.  You will also need to
install the gcc package and the libgcj package.

%package chill
Summary: Chill support for the GNU Compiler Collection.
Group: Development/Languages
Requires: cpp = %{GCC_VERSION}
Requires: gcc = %{GCC_VERSION}
Prereq: /sbin/install-info

%description chill
The gcc-chill package provides support for compiling Chill programs with the
GNU Compiler Collection. Chill is the "CCITT High-Level Language", where
CCITT is the old name for what is now ITU, the International
Telecommunications Union. It is is language in the Modula2 family, and
targets many of the same applications as Ada (especially large embedded
systems). Chill was never used much in the United States, but is still being
used in Europe, Brazil, Korea, and other places.

You will also need to install the gcc package.

%package -n libstdc++
Summary: c++ library for the GNU Compiler Collection.
Group: System Environment/Libraries
Obsoletes: libg++
Version: %{STDC_VERSION}

%description -n libstdc++
GNU C++ runtime libraries

%prep
%setup -q
# we don't need to build texinfo on a current Linux installation
rm -rf texinfo

%build
SRCDIR="$PWD"
rm -rf %{OBJDIR}
mkdir %{OBJDIR}
cd %{OBJDIR}

$SRCDIR/configure \
	--prefix=/usr \
	--enable-shared \
	--enable-threads \
	--with-cpp-install-dir=../lib \
	%{target_alias} 2>&1 | tee $SRCDIR/build.log

export PATH=$PATH:/sbin:/usr/sbin

make bootstrap-lean 2>&1 | tee -a $SRCDIR/build.log

# workaround a bug in the handling of MAKEINFO in gcc-2.95
find -name "*.info"|xargs rm -f
find -name "*.info-[1-9]*"|xargs rm -f
make info MAKEINFO="makeinfo --no-split" | tee -a $SRCDIR/build.log

if [ -x /usr/bin/runtest ]; then
	make -k check 2>&1 | tee -a $SRCDIR/build.log
else
	echo "Dejagnu not installed, no selftests have been run." >$SRCDIR/build.log
fi
$SRCDIR/contrib/warn_summary <$SRCDIR/build.log >$SRCDIR/warn.summary
$SRCDIR/contrib/test_summary -i $SRCDIR/warn.summary \
	> $SRCDIR/check.summary

%install
SRCDIR="$PWD"
rm -rf $RPM_BUILD_ROOT
cd %{OBJDIR}

export PATH=$PATH:/sbin:/usr/sbin

make install \
	prefix=$RPM_BUILD_ROOT/usr \
	MAKEINFO="makeinfo --no-split"

ln -sf gcc $RPM_BUILD_ROOT/usr/bin/cc
ln -sf g77 $RPM_BUILD_ROOT/usr/bin/f77

ln -sf g77.1 $RPM_BUILD_ROOT/usr/man/man1/f77.1
ln -sf cccp.1 $RPM_BUILD_ROOT/usr/man/man1/cpp.1

gzip -n -9f $RPM_BUILD_ROOT/usr/info/*.info* 

%clean
rm -rf $RPM_BUILD_ROOT

%post
/sbin/install-info --info-dir=/usr/info /usr/info/gcc.info.gz

%post -n cpp
/sbin/install-info --info-dir=/usr/info /usr/info/cpp.info.gz

%post g77
/sbin/install-info --info-dir=/usr/info /usr/info/g77.info.gz

%preun
if [ $1 = 0 ]; then
   /sbin/install-info --delete --info-dir=/usr/info /usr/info/gcc.info.gz
fi

%preun -n cpp
if [ $1 = 0 ]; then
   /sbin/install-info --delete --info-dir=/usr/info /usr/info/cpp.info.gz
fi

%preun g77
if [ $1 = 0 ]; then
   /sbin/install-info --delete --info-dir=/usr/info /usr/info/g77.info.gz
fi

%post -n libstdc++ -p /sbin/ldconfig

%postun -n libstdc++ -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc README* COPYING COPYING.LIB check.summary warn.summary build.log
%dir /usr/lib/gcc-lib
%dir /usr/lib/gcc-lib/%{target_alias}
%dir /usr/lib/gcc-lib/%{target_alias}/*
%dir /usr/lib/gcc-lib/%{target_alias}/*/include
%ifarch alpha
%dir /usr/lib/gcc-lib/%{target_alias}/*/ieee
%endif
%ifarch ppc
%dir /usr/lib/gcc-lib/%{target_alias}/*/nof
%endif

/usr/bin/%{target_alias}-gcc
/usr/bin/gcov
/usr/bin/protoize
/usr/bin/unprotoize
/usr/bin/gcc
/usr/bin/cc
/usr/info/gcc*
/usr/man/man1/gcc.1
/usr/%{target_alias}
/usr/lib/gcc-lib/%{target_alias}/*/SYSCALLS.c.X
/usr/lib/gcc-lib/%{target_alias}/*/cc1
/usr/lib/gcc-lib/%{target_alias}/*/collect2
/usr/lib/gcc-lib/%{target_alias}/*/libgcc.a
%ifarch alpha ppc
/usr/lib/gcc-lib/%{target_alias}/*/*/libgcc.a
%endif
%ifnarch alpha
/usr/lib/gcc-lib/%{target_alias}/*/*crt*.o
%endif
/usr/lib/gcc-lib/%{target_alias}/*/include/README
/usr/lib/gcc-lib/%{target_alias}/*/include/float.h
/usr/lib/gcc-lib/%{target_alias}/*/include/iso646.h
/usr/lib/gcc-lib/%{target_alias}/*/include/limits.h
/usr/lib/gcc-lib/%{target_alias}/*/include/proto.h
/usr/lib/gcc-lib/%{target_alias}/*/include/stdarg.h
/usr/lib/gcc-lib/%{target_alias}/*/include/stdbool.h
/usr/lib/gcc-lib/%{target_alias}/*/include/stddef.h
/usr/lib/gcc-lib/%{target_alias}/*/include/syslimits.h
/usr/lib/gcc-lib/%{target_alias}/*/include/va-*.h
/usr/lib/gcc-lib/%{target_alias}/*/include/varargs.h
%ifarch ppc
/usr/lib/gcc-lib/%{target_alias}/*/include/*-asm.h
%endif


%files -n cpp
%defattr(-,root,root)
%dir /usr/lib/gcc-lib
%dir /usr/lib/gcc-lib/%{target_alias}
%dir /usr/lib/gcc-lib/%{target_alias}/*
%dir /usr/lib/gcc-lib/%{target_alias}/*/include
%ifarch alpha
%dir /usr/lib/gcc-lib/%{target_alias}/*/ieee
%endif
%ifarch ppc
%dir /usr/lib/gcc-lib/%{target_alias}/*/nof
%endif

/lib/cpp
/usr/bin/cpp
/usr/info/cpp*
/usr/man/man1/cpp.1
/usr/man/man1/cccp.1
/usr/lib/gcc-lib/%{target_alias}/*/cpp
/usr/lib/gcc-lib/%{target_alias}/*/specs


%files c++
%defattr(-,root,root)
%dir /usr/lib/gcc-lib
%dir /usr/lib/gcc-lib/%{target_alias}
%dir /usr/lib/gcc-lib/%{target_alias}/*
%dir /usr/lib/gcc-lib/%{target_alias}/*/include
%ifarch alpha
%dir /usr/lib/gcc-lib/%{target_alias}/*/ieee
%endif
%ifarch ppc
%dir /usr/lib/gcc-lib/%{target_alias}/*/nof
%endif

/usr/bin/g++
/usr/bin/c++
/usr/bin/c++filt
/usr/man/man1/g++.1
/usr/include/g++*
/usr/lib/libstdc++*.a
/usr/lib/libstdc++*.a.*
%ifarch alpha ppc
/usr/lib/*/libstdc++*.a
/usr/lib/*/libstdc++*.a.*
%endif
/usr/lib/gcc-lib/%{target_alias}/*/cc1plus
/usr/lib/gcc-lib/%{target_alias}/*/libstdc*
%ifarch alpha ppc
/usr/lib/gcc-lib/%{target_alias}/*/*/libstdc*
%endif
/usr/lib/gcc-lib/%{target_alias}/*/include/exception
/usr/lib/gcc-lib/%{target_alias}/*/include/new
/usr/lib/gcc-lib/%{target_alias}/*/include/typeinfo
/usr/lib/gcc-lib/%{target_alias}/*/include/new.h


%files objc
%defattr(-,root,root)
%dir /usr/lib/gcc-lib
%dir /usr/lib/gcc-lib/%{target_alias}
%dir /usr/lib/gcc-lib/%{target_alias}/*
%dir /usr/lib/gcc-lib/%{target_alias}/*/include
%ifarch alpha
%dir /usr/lib/gcc-lib/%{target_alias}/*/ieee
%endif
%ifarch ppc
%dir /usr/lib/gcc-lib/%{target_alias}/*/nof
%endif

/usr/lib/gcc-lib/%{target_alias}/*/cc1obj
/usr/lib/gcc-lib/%{target_alias}/*/libobjc.a
/usr/lib/gcc-lib/%{target_alias}/*/include/objc


%files g77
%defattr(-,root,root)
%dir /usr/lib/gcc-lib
%dir /usr/lib/gcc-lib/%{target_alias}
%dir /usr/lib/gcc-lib/%{target_alias}/*
%dir /usr/lib/gcc-lib/%{target_alias}/*/include
%ifarch alpha
%dir /usr/lib/gcc-lib/%{target_alias}/*/ieee
%endif
%ifarch ppc
%dir /usr/lib/gcc-lib/%{target_alias}/*/nof
%endif

/usr/bin/g77
/usr/bin/f77
/usr/info/g77*
/usr/man/man1/g77.1
/usr/man/man1/f77.1
/usr/lib/gcc-lib/%{target_alias}/*/f771
/usr/lib/gcc-lib/%{target_alias}/*/libg2c.a
%ifarch alpha ppc
/usr/lib/gcc-lib/%{target_alias}/*/*/libg2c.a
%endif
/usr/lib/gcc-lib/%{target_alias}/*/include/g2c.h


%files chill
%defattr(-,root,root)
%dir /usr/lib/gcc-lib
%dir /usr/lib/gcc-lib/%{target_alias}
%dir /usr/lib/gcc-lib/%{target_alias}/*
%dir /usr/lib/gcc-lib/%{target_alias}/*/include
%ifarch alpha
%dir /usr/lib/gcc-lib/%{target_alias}/*/ieee
%endif
%ifarch ppc
%dir /usr/lib/gcc-lib/%{target_alias}/*/nof
%endif

/usr/bin/chill
/usr/lib/gcc-lib/%{target_alias}/*/cc1chill
/usr/lib/gcc-lib/%{target_alias}/*/chillrt0.o
/usr/lib/gcc-lib/%{target_alias}/*/libchill.a
%ifarch alpha ppc
/usr/lib/gcc-lib/%{target_alias}/*/*/chillrt0.o
/usr/lib/gcc-lib/%{target_alias}/*/*/libchill.a
%endif


%files java
%defattr(-,root,root)
%dir /usr/lib/gcc-lib
%dir /usr/lib/gcc-lib/%{target_alias}
%dir /usr/lib/gcc-lib/%{target_alias}/*
%dir /usr/lib/gcc-lib/%{target_alias}/*/include
%ifarch alpha
%dir /usr/lib/gcc-lib/%{target_alias}/*/ieee
%endif
%ifarch ppc
%dir /usr/lib/gcc-lib/%{target_alias}/*/nof
%endif

/usr/bin/gcj
/usr/bin/gcjh
/usr/bin/jcf-dump
/usr/bin/jv-scan
/usr/lib/gcc-lib/%{target_alias}/*/jc1
/usr/lib/gcc-lib/%{target_alias}/*/jvgenmain


%files -n libstdc++
%defattr(-,root,root)
%ifarch alpha
%dir /usr/lib/ieee
%endif
%ifarch ppc
%dir /usr/lib/nof
%endif

/usr/lib/libstdc++*.so
/usr/lib/libstdc++*.so.*
%ifarch alpha ppc
/usr/lib/*/libstdc++*.so
/usr/lib/*/libstdc++*.so.*
%endif


%changelog
* Fri Jul 16 1999 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
  - overhauled the RH-6.0 spec (done by Cristian Gafton <gafton@redhat.com>)
    to fit gcc-2.95

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]