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 SUNW_Copyright: %{name}.copyright 27 # Use the copyright-extractor script to create a copyright file. 28 BuildRoot: %{_tmppath}/%{name}-%{version}-build 29 %include default-depend.inc 30 # add build and runtime dependencies here: 31 BuildRequires: SUNWbar-devel 32 Requires: SUNWbar 33 # the base pkg should depend on the -root subpkg, if there is one: 34 Requires: %{name}-root 35 36 %package root 37 Summary: %{summary} - / filesystem 38 SUNW_BaseDir: / 39 %include default-depend.inc 40 41 #Please DON'T create share pkgs, we stopped using them in JDS4 42 #%package share (delete me) 43 44 %package devel 45 Summary: %{summary} - development files 46 SUNW_BaseDir: %{_basedir} 47 Requires: %{name} = %{version} 48 %include default-depend.inc 49 50 %if %build_l10n 51 %package l10n 52 Summary: foo - l10n files 53 SUNW_BaseDir: %{_basedir} 54 %include default-depend.inc 55 Requires: %{name} 56 %endif 57 58 # 59 ## runtime pkgs: 60 # 61 # SUNWpackage-name: the main package, binaries, libs, 62 # file in %{_datadir} needed at runtime 63 # SUNWpackage-name-root: /etc, /var stuff 64 # 65 ## development pkgs: 66 # 67 # SUNWpackage-name-devel: include files, pkgconfig files, 68 # files in %{_datadir}, like aclocal 69 # macros and gtk-docs and 70 # binaries only needed for development 71 # SUNWpackage-name-devel-root: any root files that are only needed 72 # for development 73 74 75 %prep 76 %setup -q -n foo-%version 77 %patch1 -p1 78 79 %build 80 CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '` 81 if test "x$CPUS" = "x" -o $CPUS = 0; then 82 CPUS=1 83 fi 84 85 export CFLAGS="%optflags" 86 export RPM_OPT_FLAGS="$CFLAGS" 87 export LDFLAGS="%{_ldflags}" 88 export MSGFMT="/usr/bin/msgfmt" 89 90 ./configure --prefix=%{_prefix} \ 91 --bindir=%{_bindir} \ 92 --sysconfdir=%{_sysconfdir} \ 93 --includedir=%{_includedir} \ 94 --mandir=%{_mandir} \ 95 --libdir=%{_libdir} 96 97 make -j$CPUS 98 99 %install 100 make install DESTDIR=$RPM_BUILD_ROOT 101 rm $RPM_BUILD_ROOT%{_libdir}/*.la 102 103 # 104 # when not building -l10n packages, remove anything l10n related from 105 # $RPM_BUILD_ROOT 106 # 107 %if %build_l10n 108 %else 109 # REMOVE l10n FILES 110 rm -rf $RPM_BUILD_ROOT%{_datadir}/locale 111 rm -rf $RPM_BUILD_ROOT%{_datadir}/gnome/help/*/[a-z]* 112 rm -rf $RPM_BUILD_ROOT%{_datadir}/omf/*/*-[a-z]*.omf 113 %endif 114 115 %clean 116 rm -rf $RPM_BUILD_ROOT 117 118 %files 119 %defattr (-, root, bin) 120 %dir %attr (0755, root, bin) %{_bindir} 121 %{_bindir}/* 122 %dir %attr (0755, root, bin) %{_libdir} 123 %{_libdir}/* 124 %dir %attr(0755, root, sys) %{_datadir} 125 %dir %attr (0755, root, other) %{_datadir}/pixmaps 126 %{_datadir}/pixmaps/* 127 %{_datadir}/foo 128 %dir %attr(0755, root, bin) %{_mandir} 129 %dir %attr(0755, root, bin) %{_mandir}/* 130 %{_mandir}/*/* 131 132 %files root 133 %defattr (0755, root, sys) 134 %attr (0755, root, sys) %dir %{_sysconfdir} 135 %{_sysconfdir}/* 136 137 %files devel 138 %defattr (-, root, bin) 139 %dir %attr (0755, root, bin) %{_includedir} 140 %{_includedir}/* 141 %dir %attr (0755, root, other) %{_libdir}/pkgconfig 142 %{_libdir}/pkgconfig/* 143 144 # 145 # The files included here should match the ones removed in %install 146 # 147 %if %build_l10n 148 %files l10n 149 %defattr (-, root, other) 150 %dir %attr (0755, root, sys) %{_datadir} 151 %{_datadir}/locale 152 %{_datadir}/gnome/help/*/[a-z]* 153 %{_datadir}/omf/*/*-[a-z]*.omf 154 %endif 155 156 %changelog 157 * Fri Jun 2 2006 - laca@sun.com 158 - Initial spec 159