%define DATE 20050520 %define gcc_version 4.0.0 %define gcc_release 8 %define gdc_version 0.17 %define gdc_release 1 Summary: D compiler Name: gdc Version: %{gdc_version} Release: %{gdc_release} License: GPL Group: Development/Languages Source0: gcc-%{gcc_version}-%{DATE}.tar.bz2 Source1: gdc-%{gdc_version}-%{gdc_release}.tar.gz URL: http://home.earthlink.net/~dvdfrdmn/d/ BuildRoot: /var/tmp/gdc-root BuildRequires: binutils >= 2.15.91.0.2-4 BuildRequires: zlib-devel, gettext, dejagnu, bison, flex, texinfo, libgcc, gcc, libstdc++-devel, gcc-c++ BuildRequires: glibc-devel >= 2.2.90-12 Requires: binutils >= 2.15.94.0.2-2 Requires: glibc-devel >= 2.2.90-12 Requires: libgcc >= %{gcc_version}-%{gcc_release} Provides: gdc = %{gdc_version}-%{gdc_release} Prereq: /sbin/install-info AutoReq: true %define gdc_target_platform %{_target_platform} %description The gdc package contains the D Compiler frontend for gcc version 0.17. You'll need this package in order to compile D code. %package gdc Summary: D support for GCC Group: Development/Languages Requires: gcc = %{gcc_version}-%{gcc_release} Requires: libgcc >= %{gcc_version}-%{gcc_release} Provides: gdc = %{gdc_version}-%{gdc_release} Autoreq: true %description gdc This package adds D support to the GNU Compiler Collection. %package -n libgphobos Summary: D Library Group: System Environment/Libraries Provides: libgphobos Autoreq: true %description -n libgphobos The libgphobos package %package -n libgphobos-devel Summary: Libraries and modules for D development Group: Development/Libraries Requires: libgphobos = %{gdc_version}-%{gdc_release} Provides: libgphobos-devel Autoreq: true %description -n libgphobos-devel This is the implementation of the standard D libraries. %prep %setup -q -n gcc-%{gcc_version}-%{DATE} cd gcc rm -rf d gzip -dc /usr/src/redhat/SOURCES/gdc-%{gdc_version}-%{gdc_release}.tar.gz | tar -xvvf - if [ $? -ne 0 ]; then exit $? fi cd d chown -R root.root . chmod -R a+rX,g-w,o-w . cd .. cd .. ./gcc/d/setup-gcc.sh %build rm -fr obj-%{gdc_target_platform} mkdir obj-%{gdc_target_platform} cd obj-%{gdc_target_platform} CC=gcc OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g'` OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/\(-Wp,\)\?-D_FORTIFY_SOURCE=[12]//g'` OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-m64//g;s/-m32//g;s/-m31//g'` OPT_FLAGS=`echo "$OPT_FLAGS" | sed -e 's/[[:blank:]]\+/ /g'` CC="$CC" CFLAGS="$OPT_FLAGS" CXXFLAGS="$OPT_FLAGS" XCFLAGS="$OPT_FLAGS" TCFLAGS="$OPT_FLAGS" \ GCJFLAGS="$OPT_FLAGS" \ ../configure --prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} \ --enable-shared --enable-threads=posix --enable-checking=release \ --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions \ --enable-languages=d \ --host=%{gdc_target_platform} make %{?_smp_mflags} BOOT_CFLAGS="$OPT_FLAGS" bootstrap-lean %install rm -fr $RPM_BUILD_ROOT cd obj-%{gdc_target_platform} make prefix=$RPM_BUILD_ROOT%{_prefix} mandir=$RPM_BUILD_ROOT%{_mandir} infodir=$RPM_BUILD_ROOT%{_infodir} install FULLPATH=$RPM_BUILD_ROOT%{_prefix}/lib/gcc/%{gdc_target_platform}/%{gcc_version} FULLEPATH=$RPM_BUILD_ROOT%{_prefix}/libexec/gcc/%{gdc_target_platform}/%{gcc_version} mkdir -p $RPM_BUILD_ROOT/%{_lib} mv -f $RPM_BUILD_ROOT%{_prefix}/%{_lib}/libgphobos.* $FULLLPATH/ mkdir -p $RPM_BUILD_ROOT%{_prefix}/sbin cd .. %find_lang %{name} %clean rm -rf $RPM_BUILD_ROOT %post %preun %postun -n libgphobos -p /sbin/ldconfig %files -f %{name}.lang %defattr(-,root,root) %{_prefix}/bin/gdc %{_prefix}/bin/gdmd %{_prefix}/bin/%{gdc_target_platform}-gdc %{_mandir}/man1/gdc.1* %{_mandir}/man1/gdmd.1* %files -n libgphobos %defattr(-,root,root) %{_prefix}/%{_lib}/libgphobos.* %files -n libgphobos-devel %defattr(-,root,root) %dir %{_prefix}/include/d %dir %{_prefix}/include/d/%{gcc_version} %{_prefix}/include/d/%{gcc_version}/[^gj]*