On Fri, Jun 25, 2010 at 02:56:39AM +0200, jonathan MERCIER wrote: > hello, i try create 2 package: ldc and tango. > I have a big question where i put *.d file ? > for C/C++ it's in /usr/include but D they are nothing attached my ancient gcc + D(v1.x) rpm specfile. Have not done this lately and especially with v2.x versions of D and tango things may have completely changed. Richard ##################### # experimental version? extra name suffix %define xxver %{nil} #%#define xxver xx # what do we build? %define _shared_libgcc 1 %define _build_cc 1 %define _build_d 1 %define _build_f 0 %define _build_java 1 %define _build_objc 0 %define _build_ada 0 # pascal, treelang # nver is the version we assign to executables and package names # (besides xx suffix) %define nver 402%{xxver} # bver is the version the compiler thinks it is, also used as # package version and source archive name %define bver 4.0.2 %define _use_xname 0 %define xname -cvs %if %{_use_xname} %define rsourcename gcc-%{bver}%{xname}.tar.bz2 %define rsourcedir gcc-%{bver}%{xname} %else %define rsourcename gcc-%{bver}.tar.bz2 %define rsourcedir gcc-%{bver} %endif # this is for snapshots.. %define rsourcename gcc-4.0-20050922.tar.bz2 %define rsourcedir gcc-4.0-20050922 %define build_manpages 1 # makeinfo too old %define build_info 1 Summary: GNU C Compiler Name: gcc%{nver} %define version %{bver} Version: %{version} Release: 2rel Copyright: GPL Group: Development/Languages #Source: gcc-%{bver}%{xname}.tar.gz Source: %{rsourcename} Source1: gdc-0.22-src.tar.bz2 ###Patch: gcc-3.4-rz.patch Patch1: gcc-3.4-rzpriv.patch Patch2: gcc-3.4-wcpu.patch Patch3: gcc-3.4-nll.patch ###Patch4: gcc-2.4-as.patch Patch5: gcc-3.4-libgccname.patch Patch6: gcc-3.4-libgcc-a.diff ####Patch7: gcc-3.4-rz-pseudo.patch Patch7: gcc-3.4-zippel.patch %if %{_shared_libgcc} Requires: binutils, libgcc%{nver} %else Requires: binutils, libgcc%{nver} %endif %if %{_build_cc} Requires: libstdc++%{nver}, libstdc++%{nver}-devel %endif %if %{_build_java} Requires: libgcj%{nver}, libgcj%{nver}-devel %endif %if %{_build_f} Requires: gcc%{nver}-fxx-libs, %endif %if %{_build_objc} Requires: gcc%{nver}-objc-libs %endif Prereq: /sbin/install-info Buildroot: /var/tmp/gcc-root%{nver} Summary(de): GNU-C-Compiler Summary(fr): Compilateur C de GNU Summary(tr): GNU C derleyicisi BuildArch: m68k i386 %description The GNU C, C++, Obj-C, f77, java, ADA and other compilers -- a full featured ANSI C compiler suite, with support for K&R C as well. GCC provides many levels of source code error checking tradionaly provided by other tools (such as lint), produces debugging information, and can perform many different optimizations to the resulting object code. The libgcc%{nver} package must also be installed and should *never* be deinstalled. To use c++, obj-c and other compilers install the other libs as well. To make the %nver compiler the system default compiler install gcc-default-%{nver} and libgcj-default-%{nver303} ################### %package -n gcc%{nver}-devel Summary: GCC %{nver} misc devel files Group: System Environment/Libraries %description -n gcc%{nver}-devel GCC %{nver} misc includes ## %package -n gcc%{nver}-d-libs Summary: GDC %{nver} misc libs Group: System Environment/Libraries %description -n gcc%{nver}-d-libs GDC %{nver} d related libs ## %package -n gcc%{nver}-d-devel Summary: GDC %{nver} misc includes Group: System Environment/Libraries %description -n gcc%{nver}-d-devel GDC %{nver} d related includes ## %package -n gcc%{nver}-fxx-libs Summary: GCC version %{nver} fortran related runtime libs Group: System Environment/Libraries %description -n gcc%{nver}-fxx-libs GCC version %{nver} fortran related runtime libs ## %package -n gcc%{nver}-fxx-devel Summary: GCC version %{nver} fortran related devel files Group: System Environment/Libraries %description -n gcc%{nver}-fxx-devel GCC version %{nver} fortran related devel files ## %package -n gcc%{nver}-objc-libs Summary: GCC version %{nver} objc runtime libs Group: System Environment/Libraries BuildArch: noarch %description -n gcc%{nver}-objc-libs GCC version %{nver} objc runtime libs ## %package -n gcc%{nver}-objc-devel Summary: GCC version %{nver} objc devel files Group: System Environment/Libraries BuildArch: noarch %description -n gcc%{nver}-objc-devel GCC version %{nver} objc devel files ################### %package -n gcc%{nver}-docs Summary: GCC version %{nver} documentation Group: System Environment/Libraries BuildArch: noarch %description -n gcc%{nver}-docs man and info pages for all parts of the gcc project %package -n libgcc%{nver} Summary: GCC version %{nver} shared support library. Group: System Environment/Libraries BuildArch: m68k i386 %description -n libgcc%{nver} shared version of libgcc, now required for most programs. %package -n libstdc++%{nver} Summary: GNU Standard C++ Library version 3. Group: System Environment/Libraries %description -n libstdc++%{nver} The libstdc++ package contains a rewritten standard compliant GCC Standard C++ Library version 3 %package -n libstdc++%{nver}-devel Summary: Header files and libraries for C++ development. Group: Development/Libraries Requires: libstdc++%{nver} = %{version}-%{release} %description -n libstdc++%{nver}-devel This is the GNU implementation of the standard C++ libraries. This package includes the header files and libraries needed for C++ development. This includes rewritten implementation of STL. %package -n libgcj%{nver} Summary: Java runtime library for gcc. Group: System Environment/Libraries Requires: zip >= 2.1 Prereq: /sbin/install-info %description -n libgcj%{nver} The Java runtime library. You will need this package to run your Java programs compiled using the gcc version Java compiler gcj. %package -n libgcj%{nver}-devel Summary: Libraries for Java development using gcc version 3. Group: Development/Languages Requires: zip >= 2.1 %description -n libgcj%{nver}-devel The Java static libraries and C header files. You will need this package to compile your Java programs using the gcc version 3 Java compiler. %prep #create fake dir, rpm expects name-ver to exist mkdir -p gcc%{nver}-%{version} case "${RPM_COMMAND:-all}" in all) # -D is needed, else setup would delete above created fake dir # use explicit rm -rf to cleanup appropriated dir if needed %setup -D -q cd ../%{rsourcedir} #%patch1 -p1 -b .rzpriv #%patch2 -p1 -b .wcpu #%patch3 -p1 -b .nll ####%patch4 -p0 -b .as #%patch5 -p1 -b .libgcc-name #%patch6 -p1 -b .libgcc-a cd gcc #%patch7 -p0 -b .rz-pseudo tar jxf %{SOURCE1} cd .. echo $PWD ./gcc/d/setup-gcc.sh ;; esac %build export DO_DEBUG="-g -gdwarf-2 -g3 -fno-omit-frame-pointer -O2" #export DISTCC="distcc" #export CC="$DISTCC m68k-linux-gcc" #export CC="gcc320xx" #export CC="gcc303" #export AR=ar #export CC="gcc320" #export CC="gcc340" export CFLAGS="$RPM_OPT_FLAGS $DO_DEBUG " export CXXFLAGS="$RPM_OPT_FLAGS $DO_DEBUG" export XCFLAGS="$RPM_OPT_FLAGS $DO_DEBUG" export TCFLAGS="$RPM_OPT_FLAGS $DO_DEBUG" #PARALLEL="3" PARALLEL="1" cd .. mkdir -p build-gcc-%{bver} cd build-gcc-%{bver} case "${RPM_COMMAND:-all}" in all|config*) CLNG="c" %if %{_shared_libgcc} LGCC="" %else LGCC="--disable-shared" %endif %if %{_build_cc} CLNG="$CLNG,c++" %endif %if %{_build_d} CLNG="$CLNG,d" %endif %if %{_build_f} CLNG="$CLNG,f77" %endif %if %{_build_java} CLNG="$CLNG,java" %endif %if %{_build_objc} CLNG="$CLNG,objc" %endif %if %{_build_ada} CLNG="$CLNG,ada" %endif ## HACK ## export _POSIX2_VERSION=199209 ## ARCH=`uname -m` case $ARCH in m68k) WCPU="--with-cpu=m68020-60" ;; i586) WCPU="--with-cpu=k6" ;; esac # may use target=m68k-rz%{xxver}-linux to distinguish from default installation # slibdir, ditto ../%{rsourcedir}/configure --prefix=/usr --mandir=%{_mandir} \ --infodir=%{_infodir} --disable-checking \ --target=$ARCH-rz%{xxver}-linux --build=$ARCH-rz%{xxver}-linux \ --host=$ARCH-rz%{xxver}-linux \ --enable-threads=posix --enable-shared --enable-__cxa_atexit \ --enable-languages=$CLNG --with-system-zlib \ $LGCC $WCPU ## xx-only: --enable-version-specific-runtime-libs ## --enable-version-specific-runtime-libs ## --build=m68k-rz-linux --host=m68k-rz-linux \ ## --with-slibdir=/usr/lib/gcc-lib/m68k-rz%{xxver}-linux/3.2/ ;; esac #make bootstrap CFLAGS="-O3 -m68020-60 -fomit-frame-pointer" ##find -name "*.o"| xargs touch ##find -name "*.lo"| xargs touch case "${RPM_COMMAND:-all}" in all|config|build) #make CFLAGS="$RPM_OPT_FLAGS $DO_DEBUG" CXXFLAGS="$RPM_OPT_FLAGS $DO_DEBUG" \ # XCFLAGS="$RPM_OPT_FLAGS $DO_DEBUG" TCFLAGS="$RPM_OPT_FLAGS $DO_DEBUG" #export STRICT2_WARN=" -pedantic -Wno-long-long -Wold-style-definition " #export MAKEFLAGS="-e" ## HACK ## export _POSIX2_VERSION=199209 #make -j "$PARALLEL" bootstrap make -j "$PARALLEL" %if %{build_info} make -C gcc info make info %endif %if %{build_manpages} make -C gcc generated-manpages make info %endif ;; esac %install ARCH=`uname -m` # use RPM_COMMAND=package to skip make install, useful to fix # file list case "${RPM_COMMAND:-all}" in all|config|build|install) cd ../build-gcc-%{bver} ##cd ../build-gcc-3.1 #rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/usr/{bin,lib} mkdir -p $RPM_BUILD_ROOT%{_mandir} mkdir -p $RPM_BUILD_ROOT%{_infodir} make prefix=$RPM_BUILD_ROOT/usr mandir=$RPM_BUILD_ROOT%{_mandir} \ infodir=$RPM_BUILD_ROOT%{_infodir} install ;; esac # maybe remove /usr/bin/c++filt (conflict: binutils) case "${RPM_COMMAND:-all}" in all|config|build|install|post-install) rm -f $RPM_BUILD_ROOT/usr/share/info/dir %if %{build_info} test -n "$RPM_BUILD_ROOT%{_infodir}/*info*.gz" || gzip -n -9f $RPM_BUILD_ROOT%{_infodir}/*info* %endif # do that in a separate default-gcc package instead ## ln -sf gcc $RPM_BUILD_ROOT/usr/bin/cc # both binutils and gcc want to install this # take binutils version rm -rf $RPM_BUILD_ROOT/usr/lib/libiberty.a ##mkdir -p $RPM_BUILD_ROOT/lib/ ## xx only: cp $RPM_BUILD_ROOT/usr/lib/libgcc* $RPM_BUILD_ROOT/usr/lib/gcc-lib/m68k-rz%{xxver}-linux/3.2/ %if %{_shared_libgcc} mkdir -p $RPM_BUILD_ROOT/lib cp $RPM_BUILD_ROOT/usr/lib/libgcc* $RPM_BUILD_ROOT/lib rm $RPM_BUILD_ROOT/lib/libgcc_s.so || echo "remove this hack" cd $RPM_BUILD_ROOT/usr/lib/gcc/$ARCH-rz-linux/%{bver}/ ln -sf /lib/libgcc_s_dw2eh.so.1 libgcc_s.so %endif # remove links to be provided by gcc-default package ##rm $RPM_BUILD_ROOT%{_prefix}/bin/cc ## ?? not built/installed?? rm -f $RPM_BUILD_ROOT%{_prefix}/bin/c++ || true rm -f $RPM_BUILD_ROOT%{_prefix}/bin/$ARCH-rz%{xxver}-linux-c++ || true ## make versioned prognames cp $RPM_BUILD_ROOT%{_prefix}/bin/gcc $RPM_BUILD_ROOT%{_prefix}/bin/gcc%{nver} cp $RPM_BUILD_ROOT%{_prefix}/bin/$ARCH-rz%{xxver}-linux-gcc $RPM_BUILD_ROOT%{_prefix}/bin/$ARCH-rz-linux-gcc%{nver} %if %{_build_cc} cp $RPM_BUILD_ROOT%{_prefix}/bin/g++ $RPM_BUILD_ROOT%{_prefix}/bin/g++%{nver} cp $RPM_BUILD_ROOT%{_prefix}/bin/c++filt $RPM_BUILD_ROOT%{_prefix}/bin/c++filt%{nver} || true cp $RPM_BUILD_ROOT%{_prefix}/bin/$ARCH-rz%{xxver}-linux-g++ $RPM_BUILD_ROOT%{_prefix}/bin/$ARCH-rz-linux-g++%{nver} %endif %if %{_build_d} cp $RPM_BUILD_ROOT%{_prefix}/bin/gdc $RPM_BUILD_ROOT%{_prefix}/bin/gdc%{nver} cp $RPM_BUILD_ROOT%{_prefix}/bin/gdc $RPM_BUILD_ROOT%{_prefix}/bin/gdmd%{nver} %endif %if %{_build_f} cp $RPM_BUILD_ROOT%{_prefix}/bin/g77 $RPM_BUILD_ROOT%{_prefix}/bin/g77-%{nver} %endif %if %{_build_java} cp $RPM_BUILD_ROOT%{_prefix}/bin/gcj $RPM_BUILD_ROOT%{_prefix}/bin/gcj%{nver} cp $RPM_BUILD_ROOT%{_prefix}/bin/gcjh $RPM_BUILD_ROOT%{_prefix}/bin/gcjh%{nver} cp $RPM_BUILD_ROOT%{_prefix}/bin/jcf-dump $RPM_BUILD_ROOT%{_prefix}/bin/jcf%{nver}-dump cp $RPM_BUILD_ROOT%{_prefix}/bin/jv-scan $RPM_BUILD_ROOT%{_prefix}/bin/jv%{nver}-scan cp $RPM_BUILD_ROOT%{_prefix}/bin/jv-convert $RPM_BUILD_ROOT%{_prefix}/bin/jv%{nver}-convert cp $RPM_BUILD_ROOT%{_prefix}/bin/gij $RPM_BUILD_ROOT%{_prefix}/bin/gij%{nver} #cp $RPM_BUILD_ROOT%{_prefix}/bin/jar $RPM_BUILD_ROOT%{_prefix}/bin/jar%{nver} cp $RPM_BUILD_ROOT%{_prefix}/bin/grepjar $RPM_BUILD_ROOT%{_prefix}/bin/grepjar%{nver} #cp $RPM_BUILD_ROOT%{_prefix}/bin/rmic $RPM_BUILD_ROOT%{_prefix}/bin/rmic%{nver} #cp $RPM_BUILD_ROOT%{_prefix}/bin/rmiregistry $RPM_BUILD_ROOT%{_prefix}/bin/rmiregistry%{nver} cp $RPM_BUILD_ROOT%{_prefix}/bin/gcj-dbtool $RPM_BUILD_ROOT%{_prefix}/bin/gcj-dbtool%{nver} %endif cp $RPM_BUILD_ROOT%{_prefix}/bin/gcov $RPM_BUILD_ROOT%{_prefix}/bin/gcov%{nver} cp $RPM_BUILD_ROOT%{_prefix}/bin/gccbug $RPM_BUILD_ROOT%{_prefix}/bin/gccbug%{nver} cp $RPM_BUILD_ROOT%{_prefix}/bin/cpp $RPM_BUILD_ROOT%{_prefix}/bin/cpp%{nver} ## get rid of fixed includes, they could get into our way later FULLPATH=$RPM_BUILD_ROOT%{_prefix}/lib/gcc/$ARCH-rz%{xxver}-linux/%{bver} for h in `find $FULLPATH/include -name \*.h`; do if grep -q 'It has been auto-edited by fixincludes from' $h; then rh=`grep -A2 'It has been auto-edited by fixincludes from' $h | sed -n -e '$ s|^.*"\(.*\)".*$|\1|p'` diff -up $rh $h || : rm -f $h fi done ;; esac %clean #echo '##FIXME## not cleaning yet, reenable !!' rm -rf $RPM_BUILD_ROOT %post %preun %post -n libgcc%{nver} -p /sbin/ldconfig %postun -n libgcc%{nver} -p /sbin/ldconfig %post -n gcc%{nver}-docs %if %{build_info} /sbin/install-info %{_infodir}/gcc.info.gz %{_infodir}/dir --entry="* gcc: (gcc). The GNU C compiler V %{bver}" %endif %preun -n gcc%{nver}-docs if [ $1 = 0 ]; then %if %{build_info} /sbin/install-info --delete %{_infodir}/gcc.info.gz %{_infodir}/dir --entry="* gcc: (gcc). The GNU C compiler V %{bver}" %else # bash doesn't accept empty if then fi echo "no docs" %endif fi %post -n libstdc++%{nver} -p /sbin/ldconfig %postun -n libstdc++%{nver} -p /sbin/ldconfig %post -n libstdc++%{nver}-devel -p /sbin/ldconfig %postun -n libstdc++%{nver}-devel -p /sbin/ldconfig %post -n libgcj%{nver} -p /sbin/ldconfig %postun -n libgcj%{nver} -p /sbin/ldconfig %post -n libgcj%{nver}-devel -p /sbin/ldconfig %postun -n libgcj%{nver}-devel -p /sbin/ldconfig ######################################################################## %files %defattr(-,root,root) /usr/lib/gcc/ /usr/libexec/gcc/*-rz-linux/%{bver}/* /usr/bin/gcov%{nver} /usr/bin/gccbug%{nver} /usr/bin/cpp%{nver} /usr/bin/gcc%{nver} /usr/bin/*-rz-linux-gcc%{nver} /usr/share/locale/* ## simply ignore that file.. #/usr/bin/*-rz-linux-gcc-%{bver} %if %{_build_cc} /usr/bin/g++%{nver} ##/usr/bin/c++filt%{nver} /usr/bin/*-rz-linux-g++%{nver} %endif %if %{_build_d} /usr/bin/gdc%{nver} /usr/bin/gdmd%{nver} %endif %if %{_build_f} /usr/bin/g77-%{nver} %endif %if %{_build_java} /usr/bin/gcj%{nver} /usr/bin/gcjh%{nver} /usr/bin/jcf%{nver}-dump /usr/bin/jv%{nver}-scan /usr/bin/gcj-dbtool%{nver} /usr/bin/grepjar%{nver} #/usr/bin/rmic%{nver} #/usr/bin/rmiregistry%{nver} %endif %files -n gcc%{nver}-docs %defattr(-,root,root) %if %{build_info} %{_infodir}/*info* %endif %if %{build_manpages} %{_mandir}/man*/* %endif %if %{_shared_libgcc} %files -n libgcc%{nver} %defattr(-,root,root) /lib/libgcc* # use if xxver set #/usr/lib/gcc-lib/*-rz%{xxver}-linux/3.2/libgcc_s* %endif %if %{_build_objc} %files -n gcc%{nver}-objc-libs /usr/lib/libobjc.so* %files -n gcc%{nver}-objc-devel /usr/lib/libobjc.a /usr/lib/libobjc.la %endif %if %{_build_f} %files -n gcc%{nver}-fxx-libs /usr/lib/libg2c.so* %files -n gcc%{nver}-fxx-devel /usr/lib/libfrtbegin.a /usr/lib/libg2c.a /usr/lib/libg2c.la %endif %if %{_build_d} %files -n gcc%{nver}-d-libs %defattr(-,root,root) /usr/lib/libgphobos.a /usr/lib/libgphobos.spec %files -n gcc%{nver}-d-devel %defattr(-,root,root) /usr/include/d/* %endif %if %{_build_cc} %files -n libstdc++%{nver} %defattr(-,root,root) /usr/lib/libstdc++.so.* %endif %if %{_build_cc} %files -n libstdc++%{nver}-devel %defattr(-,root,root) /usr/include/c++ /usr/lib/libstdc++.so /usr/lib/libstdc++.*a /usr/lib/libsupc++.*a ##%doc libstdc++-v3/ChangeLog* libstdc++-v3/README* %endif %if %{_build_java} %files -n gcc%{nver}-devel #/usr/include/gc.h #/usr/include/gc_backptr.h #/usr/include/gc_cpp.h #/usr/include/gc_local_alloc.h #/usr/include/gc_pthread_redirects.h /usr/include/ffi.h #/usr/lib/lib-org-w3c-dom.a #/usr/lib/lib-org-w3c-dom.la #/usr/lib/lib-org-xml-sax.a #/usr/lib/lib-org-xml-sax.la /usr/lib/libffi.a /usr/lib/libffi.la /usr/lib/pkgconfig/libgcj.pc %endif %if %{_build_java} %files -n libgcj%{nver} %defattr(-,root,root) /usr/bin/jv%{nver}-convert /usr/bin/gij%{nver} #/usr/bin/jar%{nver} /usr/lib/libgcj.so.* /usr/lib/libgij.so.* #/usr/lib/libzgcj.so.* #/usr/lib/libgcjgc.so.* /usr/lib/security /usr/share/java/libgcj-%{bver}.jar #/usr/lib/lib-org-w3c-dom.so.* #/usr/lib/lib-org-xml-sax.so.* #/usr/lib/libffi-*-beta.so /usr/lib/logging.properties %endif %if %{_build_java} %files -n libgcj%{nver}-devel %defattr(-,root,root) /usr/bin/addr2name.awk /usr/lib/libgcj.*a /usr/lib/libgcj.so /usr/lib/libgij.*a /usr/lib/libgcj.spec /usr/lib/gcj-4.0.2/classmap.db #/usr/include/j*.h #/usr/include/java #/usr/include/gnu #/usr/include/gcj #/usr/include/javax #/usr/include/org %endif # ? %doc boehm-gc/* fastjar/* rpm.doc/libffi/* # ? %doc rpm.doc/libjava/* %changelog * Wed Apr 24 2002 RZ - adapted for gcc-3.1 prerelease * Wed Feb 28 2001 RZ - created from old 2.7.2.3 spec -- devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mailman/listinfo/devel