ソースを参照

* use standard macros, patch by Soos Peter

peter 23 年 前
コミット
c304e3ba52
2 ファイル変更43 行追加28 行削除
  1. 12 7
      install/fpc-docs.spec
  2. 31 21
      install/fpc.spec

+ 12 - 7
install/fpc-docs.spec

@@ -1,17 +1,16 @@
 Name: fpc-docs
 Version: 1.1
-Release: 1
+Release: 0
 Copyright: GPL
 Group: Development/Languages
-Source: fpc-docs-1.1-src.tar.gz
+Source: %{name}-%{version}-src.tar.gz
 Summary: Free Pascal Compiler Documentation
 Packager: Peter Vreman ([email protected])
 URL: http://www.freepascal.org/
-BuildRoot: /tmp/fpc-docs-build
+BuildRoot: %{_tmppath}/fpc-build
 
-%define fpcversion 1.1
-%define fpcdir /usr/lib/fpc/%{fpcversion}
-%define docdir /usr/doc/fpc-%{fpcversion}
+%define fpcdir %{_libdir}/fpc/%{version}
+%define docdir %{_docdir}/fpc-%{version}
 
 %define builddocdir %{buildroot}%{docdir}
 
@@ -30,12 +29,18 @@ This package contains the documentation in PDF format
 	make -C docs pdf
 
 %install
+if [ %{buildroot} != "/" ]; then
 	rm -rf %{buildroot}
+fi
+
 	make -C docs pdfinstall DOCINSTALLDIR=%{builddocdir}
 
 %clean
 	make -C docs clean
+if [ %{buildroot} != "/" ]; then
 	rm -rf %{buildroot}
+fi
 
 %files
-/usr
+%defattr(-, root, root)
+%doc %{docdir}/*

+ 31 - 21
install/fpc.spec

@@ -1,23 +1,25 @@
 Name: fpc
 Version: 1.1
-Release: 1
+Release: 0
 ExclusiveArch: i386 i586 i686
 Copyright: GPL
 Group: Development/Languages
-Source: fpc-1.1-src.tar.gz
+Source: %{name}-%{version}-src.tar.gz
 Summary: Free Pascal Compiler
 Packager: Peter Vreman ([email protected])
 URL: http://www.freepascal.org/
-BuildRoot: /tmp/fpc-build
+BuildRoot: %{_tmppath}/fpc-build
 BuildRequires: fpc
 
-%define fpcversion 1.1
-%define fpcdir /usr/lib/fpc/%{fpcversion}
-%define docdir /usr/doc/fpc-%{fpcversion}
+%define fpcdir %{_libdir}/fpc/%{version}
+%define docdir %{_docdir}/fpc-%{version}
 
 %define builddocdir %{buildroot}%{docdir}
+%define buildmandir %{buildroot}%{_mandir}
+%define buildbindir %{buildroot}%{_bindir}
+%define buildlibdir %{buildroot}%{_libdir}
 
-%description	
+%description
 The Free Pascal Compiler is a Turbo Pascal 7.0 and Delphi compatible 32bit
 Pascal Compiler. It comes with fully TP 7.0 compatible run-time library.
 Some extensions are added to the language, like function overloading. Shared
@@ -33,15 +35,19 @@ utils. Provided units are the runtime library (RTL), free component library
 NEWPP=`pwd`/compiler/ppc386
 	make compiler_cycle FPC_VERSION=`ppc386 -iV`
 	make rtl_clean rtl_smart FPC=${NEWPP}
-	make packages_smart FPC=${NEWPP}
+	make packages_base_smart FPC=${NEWPP}
 	make fcl_smart FPC=${NEWPP}
+	make packages_extra_smart FPC=${NEWPP}
 	make utils_all FPC=${NEWPP}
 
 %install
+if [ %{buildroot} != "/" ]; then
 	rm -rf %{buildroot}
-	
+fi
+
 NEWPP=`pwd`/compiler/ppc386
-INSTALLOPTS="FPC=${NEWPP} INSTALL_PREFIX=%{buildroot}/usr INSTALL_DOCDIR=%{builddocdir}"
+INSTALLOPTS="FPC=${NEWPP} INSTALL_PREFIX=%{buildroot}/usr INSTALL_LIBDIR=%{buildlibdir} \
+		INSTALL_DOCDIR=%{builddocdir} INSTALL_BINDIR=%{buildbindir}"
 	make compiler_distinstall ${INSTALLOPTS}
 	make rtl_distinstall ${INSTALLOPTS}
 	make packages_distinstall ${INSTALLOPTS}
@@ -50,8 +56,12 @@ INSTALLOPTS="FPC=${NEWPP} INSTALL_PREFIX=%{buildroot}/usr INSTALL_DOCDIR=%{build
 
 	make demo_install ${INSTALLOPTS} INSTALL_SOURCEDIR=%{builddocdir}
 	make doc_install ${INSTALLOPTS}
-	make man_install ${INSTALLOPTS}
-	
+	make man_install ${INSTALLOPTS} INSTALL_PREFIX=%{buildmandir}
+
+	# create link
+	ln -sf %{fpcdir}/ppc386 %{buildroot}%{_bindir}/ppc386
+
+
 %clean
 	make compiler_clean
 	make rtl_clean
@@ -59,20 +69,20 @@ INSTALLOPTS="FPC=${NEWPP} INSTALL_PREFIX=%{buildroot}/usr INSTALL_DOCDIR=%{build
 	make fcl_clean
 	make utils_clean
 
+if [ %{buildroot} != "/" ]; then
 	rm -rf %{buildroot}
-	
-%post
-FPCDIR=%{fpcdir}
-
-# create link
-ln -sf $FPCDIR/ppc386 /usr/bin/ppc386
+fi
 
+%post
 # Create config
-$FPCDIR/samplecfg $FPCDIR
+%{fpcdir}/samplecfg %{fpcdir}
 
 # update ld.so cache
 #ldconfig
 
-
 %files
-/usr
+%defattr(-, root, root)
+%{_bindir}/*
+%{fpcdir}
+%doc %{docdir}/*
+%{_mandir}/*/*