Home | History | Annotate | Download | only in docs
      1 #
      2 # spec file for package SUNWfoo
      3 #
      4 # Copyright 2006 Sun Microsystems, Inc.
      5 # This file and all modifications and additions to the pristine
      6 # package are under the same license as the package itself.
      7 
      8 ####################################################################
      9 # This is a simple example where we don't use Linux spec files
     10 # For a template of a typical JDS package, where we can build
     11 # the same stuff on Linux and Solaris, see SUNWtemplate.spec
     12 ####################################################################
     13 
     14 %include Solaris.inc
     15 
     16 Name:                    SUNWfoo
     17 Summary:                 foo libraries - This program does foo
     18 # use the version number of the community package if possible, but
     19 # don't include non-numerics, like 6.2b or 1.5.1alpha
     20 Version:                 0.0.0
     21 # make sure the Source is a url that actually works
     22 Source:			 
     23 # Use -p1 unified diffs (see man patch)
     24 Patch1:			 
     25 SUNW_BaseDir:            %{_basedir}
     26 BuildRoot:               %{_tmppath}/%{name}-%{version}-build
     27 %include default-depend.inc
     28 # add build and runtime dependencies here:
     29 BuildRequires: SUNWbar-devel
     30 Requires: SUNWbar
     31 # the base pkg should depend on the -root subpkg, if there is one:
     32 Requires: %{name}-root
     33 
     34 %package root
     35 Summary:                 %{summary} - / filesystem
     36 SUNW_BaseDir:            /
     37 %include default-depend.inc
     38 
     39 #Please DON'T create share pkgs, we stopped using them in JDS4
     40 #%package share   (delete me)
     41 
     42 %package devel
     43 Summary:		 %{summary} - development files
     44 SUNW_BaseDir:            %{_basedir}
     45 Requires:                %{name} = %{version}
     46 %include default-depend.inc
     47 
     48 %if %build_l10n
     49 %package l10n
     50 Summary:                 foo - l10n files
     51 SUNW_BaseDir:            %{_basedir}
     52 %include default-depend.inc
     53 Requires:                %{name}
     54 %endif
     55 
     56 #
     57 ## runtime pkgs:
     58 #
     59 # SUNWpackage-name:                    the main package, binaries, libs,
     60 #                                      file in %{_datadir} needed at runtime
     61 # SUNWpackage-name-root:               /etc, /var stuff
     62 #
     63 ## development pkgs:
     64 #
     65 # SUNWpackage-name-devel:              include files, pkgconfig files,
     66 #                                      files in %{_datadir}, like aclocal
     67 #                                      macros and gtk-docs and
     68 #                                      binaries only needed for development
     69 # SUNWpackage-name-devel-root:         any root files that are only needed
     70 #                                      for development
     71 
     72 
     73 %prep
     74 %setup -q -n foo-%version
     75 %patch1 -p1
     76 
     77 %build
     78 CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
     79 if test "x$CPUS" = "x" -o $CPUS = 0; then
     80     CPUS=1
     81 fi
     82 
     83 export CFLAGS="%optflags"
     84 export RPM_OPT_FLAGS="$CFLAGS"
     85 export LDFLAGS="%{_ldflags}"
     86 export MSGFMT="/usr/bin/msgfmt"
     87 
     88 ./configure --prefix=%{_prefix}			\
     89 	    --bindir=%{_bindir}			\
     90 	    --sysconfdir=%{_sysconfdir}		\
     91 	    --includedir=%{_includedir}		\
     92 	    --mandir=%{_mandir}			\
     93             --libdir=%{_libdir}
     94 
     95 make -j$CPUS
     96 
     97 %install
     98 make install DESTDIR=$RPM_BUILD_ROOT
     99 rm $RPM_BUILD_ROOT%{_libdir}/*.la
    100 
    101 #
    102 # when not building -l10n packages, remove anything l10n related from
    103 # $RPM_BUILD_ROOT
    104 #
    105 %if %build_l10n
    106 %else
    107 # REMOVE l10n FILES
    108 rm -rf $RPM_BUILD_ROOT%{_datadir}/locale
    109 rm -rf $RPM_BUILD_ROOT%{_datadir}/gnome/help/*/[a-z]*
    110 rm -rf $RPM_BUILD_ROOT%{_datadir}/omf/*/*-[a-z]*.omf
    111 %endif
    112 
    113 %clean
    114 rm -rf $RPM_BUILD_ROOT
    115 
    116 %files
    117 %defattr (-, root, bin)
    118 %dir %attr (0755, root, bin) %{_bindir}
    119 %{_bindir}/*
    120 %dir %attr (0755, root, bin) %{_libdir}
    121 %{_libdir}/*
    122 %dir %attr(0755, root, sys) %{_datadir}
    123 %dir %attr (0755, root, other) %{_datadir}/pixmaps
    124 %{_datadir}/pixmaps/*
    125 %{_datadir}/foo
    126 %dir %attr(0755, root, bin) %{_mandir}
    127 %dir %attr(0755, root, bin) %{_mandir}/*
    128 %{_mandir}/*/*
    129 
    130 %files root
    131 %defattr (0755, root, sys)
    132 %attr (0755, root, sys) %dir %{_sysconfdir}
    133 %{_sysconfdir}/*
    134 
    135 %files devel
    136 %defattr (-, root, bin)
    137 %dir %attr (0755, root, bin) %{_includedir}
    138 %{_includedir}/*
    139 %dir %attr (0755, root, other) %{_libdir}/pkgconfig
    140 %{_libdir}/pkgconfig/*
    141 
    142 #
    143 # The files included here should match the ones removed in %install
    144 #
    145 %if %build_l10n
    146 %files l10n
    147 %defattr (-, root, other)
    148 %dir %attr (0755, root, sys) %{_datadir}
    149 %{_datadir}/locale
    150 %{_datadir}/gnome/help/*/[a-z]*
    151 %{_datadir}/omf/*/*-[a-z]*.omf
    152 %endif
    153 
    154 %changelog
    155 * Fri Jun  2 2006 - laca@sun.com
    156 - Initial spec
    157