On Fri, 2008-07-25 at 12:14 +0530, Harshal wrote: > Hi, > I am trying to port SWT: The Standard Widget Toolkit to OpenSolaris. > This will help us build and install SWT on OpenSolaris, which can be > helpful for porting applications like Azureus or Eclipse on OpenSolaris. > Since OpenSolaris doesn't support CDE, there are modifications I have > made to SWT spec files available at spec-files-extra (SFE). I have > attached the modified spec file with this mail. > > > > > This is my first adventure with SPEC files, so please let me know if > there are any goof ups. > > > --Harshal > plain text document attachment (SUNWswt.spec) > # > # Copyright (c) 2006 Sun Microsystems, Inc.
2008 > # This file and all modifications and additions to the pristine > # package are under the same license as the package itself. Our requirement (JDS) is that you need to add your opensolaris user name as owner in the spec file header. We use this for reporting purposes, e.g.: # Owner: laca > %include Solaris.inc > > Name: SUNWswt > Summary: Standard Widget Toolkit > Version: 3.3.2 > Source: > http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/eclipse/downloads/drops/R-3.3.2-200802211800/swt-3.3.2-gtk-solaris-sparc.zip Instead of repeating the version number in several places in the Source string, you can use the %{version} macro so that when you need to update to the next version, you only need to change in one place. > SUNW_BaseDir: %{_basedir} > BuildRoot: %{_tmppath}/%{name}-%{version}-build > %include default-depend.inc > > BuildRequires: SUNWcairomm > BuildRequires: SUNWpng > BuildRequires: SUNWxwinc I assume these are runtime requirements, so you should use Requires for them and add BuildRequires lines for the corresponding developer packages, e.g. Requires: SUNWpng BuildRequires: SUNWpng-devel > BuildRequires: SUNWgnome-common-devel > Requires: SUNWgnome-base-libs > Requires: SUNWgnome-libs > Requires: SUNWgnome-vfs > Requires: SUNWxwrtl > > > %prep > %setup -q -c -n swt-%version > > %build > > unzip -o src.zip unpacking the sources usually happens in %prep > CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '` > if test "x$CPUS" = "x" -o $CPUS = 0; then > CPUS=1 > fi > > export CFLAGS="%optflags" > export LDFLAGS="%{_ldflags}" Since it uses SUNWcairomm, does this include C++ code? If so, you probably need to set CXXFLAGS to %cxx_optflags > make -j$CPUS -f make_solaris.mak JAVA_HOME=/usr/java make_swt make_atk > make_awt make_cairo make_gnome > > %install > rm -rf $RPM_BUILD_ROOT > > mkdir -p $RPM_BUILD_ROOT/%{_libdir}/swt > mkdir -p $RPM_BUILD_ROOT/usr/share/lib/java > cp *.so $RPM_BUILD_ROOT/%{_libdir}/swt > cp *.jar $RPM_BUILD_ROOT/usr/share/lib/java > > %clean > rm -rf $RPM_BUILD_ROOT > > %files > %defattr (-, root, bin) > %dir %attr (0755, root, bin) %{_libdir} > %dir %attr (0755, root, bin) %{_libdir}/swt > %dir %attr (0755, root, bin) /usr/share This is wrong, should be 0755, root, sys and please use the %{_datadir} macro instead of hard coding /usr/share. > %dir %attr (0755, root, bin) /usr/share/lib > %dir %attr (0755, root, bin) /usr/share/lib/java > %{_libdir}/swt/* > /usr/share/lib/java/* ???Same comment for these. Since this is someone else's original work (river at wikimedia.org) you should probably contact them and tell them about your plan to move it to JDS. Thanks, Laca > %changelog > * Fri Jun 25 2008 - harshal.patil at sun.com > - rename SFEswt to SUNWswt > - add BuildRequires section > - removed Dt dependacy from make > - add Requires section > - add /usr/share/lib/java in %files > * Fri Jun 20 2008 - river at wikimedia.org > - Initial spec. > >
