center of tech

OpenSolaris is a very, very robust operating system and now that /contrib is open for putting
open source applications into its balliwick, I want to show how easy it is to get those highly
productive open source application into it.
GLPK 4.38 (or the latest version)
OpenSolaris 2008.11, shortly to be a later version
SUNWbinutils
Studio compilers (the version which can be downloaded from the repository)
I currently have 2 test development environments, the first contains the latest version of
OpenSolaris. The other is the same as the /contrib environment, which is 2008.11. I have 2008.11
because I know that when I push something to /contrib, it will need to be built in the environment,
which /contrib gets updated, I will recheck all my work and re-submit if necessary.
# gzip -d glpk-4.38.tar.gz
# tar xvf glpk-4.38.tar
# ./configure –prefix=/usr/share/glpk CC=/opt/SunStudioExpress/bin/cc CFLAGS=-xO4 –with-gnu-ld –enable-shared
# gmake
# gmake install
A 32bit version of GLPK should be installed in /usr/share/glpk, this allowed me to test to
make sure my build of GLPK was good, there are a bunch of examples files to run with the source
# ./configure –prefix=/usr/share/glpk64 CC=/opt/SunStudioExpress/bin/cc CFLAGS=”-xO4 -xtarget=opteron
-xarch=amd64″ –with-gnu-ld –enable-shared
# gmake
# gmake install
A 64bit version of GLPK should be installed in /usr/share/glpk64, this allowed me to test to
make sure my build of GLPK was good, there are a bunch of examples files to run with the source
All done with testing, GLPK looks good both 64bit and 32bit, now to get ready to put into the repository
This is the spec file that I have created for building on OpenSolaris.org for submission to /contrib.
the file is named, glpk.spec
#
# spec file for package: glpk
#
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
%include Solaris.inc
%define glpk_dir /usr/share/%{name}
Name: glpk
Summary: GNU Linear Programming Kit
Version: 4.38
License: GPLv3
Source: ftp://ftp.gnu.org/gnu/glpk/%{name}-%{version}.tar.gz
URL: http://www.gnu.org/software/glpk/
Group: HPC
Distribution: OpenSolaris
Vendor: GNU Community
%include default-depend.inc
BuildRoot: %{_tmppath}/%{name}-%{version}-build
SUNW_Basedir: %{_basedir}
SUNW_Copyright: %{name}.copyright
# OpenSolaris IPS Manifest Fields
Meta(info.maintainer): jim.langston@sun.com
Meta(info.repository_url): http://www.gnu.org/software/glpk
%description
The GLPK (GNU Linear Programming Kit) package is intended for solving
large-scale linear programming (LP), mixed integer programming (MIP),
and other related problems. It is a set of routines written in ANSI C
and organized in the form of a callable library.
%prep
%setup -c -q -T -b 0 -n %{name}
%build
#
# Build GLPK
#
#
cd %{name}-%{version}
./configure –prefix=%{glpk_dir} CFLAGS=”-xO4″ –enable-shared
gmake
gmake install DESTDIR=$RPM_BUILD_ROOT
#
# 32bit version installed, clean up, preparing to build 64bit
#
gmake distclean
#
# Make 64bit version
#
./configure –prefix=%{glpk_dir}64 CFLAGS=”-xO4 -xtarget=opteron -xarch=amd64″ –enable-shared
gmake
%install
#
# This will install 64bit version
#
cd %{name}-%{version}
gmake install DESTDIR=$RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr (-, root, other)
%dir %attr (0755, root, sys) %{_basedir}/share
%{_basedir}/share/*
%changelog
* Wed Jun 24 2009 - jim.langston@sun.com
* Thur Jun 25 2009 Jim Langston
Will install 64bit and 32bit versions
* Thur Jun 26 2009 Jim Langston
Changed CFLAGS to compile 64bit on Studio 11
There are now two steps left to get GLPK into the repository, From the submission screen,
I needed to included the glpk.spec file, and also, I needed to include the copyright file
that is included with the source named, COPYING. I copied this file to one called glpk.copyright,
which is what I am looking for in the glpk.spec file via the variable SUNW_copyright.
With these two pieces in place, the submission is then in the hands of opensolaris.org to
validate. Once the validation is complete, then the source is built, and any errors, of
which I had a few initially, are logged, or if the build passes, a log is generated and
also the ability to download and check the IPS is created in /pending.
Once others have had a chance to check out GLPK, it will be voted on to move to /contrib.
Source/Kaynak : http://blogs.sun.com/langston/entry/getting_glpk_into_opensolaris_repository