Laca, this helps a lot!
I'm pretty close to putting my first spec together, aside from taking
into account building 32bit and 64bit binaries, but I've seen some
other posts and info that should help when I get there.
Unfortunately, I'm getting stuck on the %files section. I looked up
some rpmbuild docs and found a way to use find and sed to construct an
external files list. %install and %files are listed:
%install
rm -rf $RPM_BUILD_ROOT
gmake install DESTDIR=$RPM_BUILD_ROOT
gmake install-info DESTDIR=$RPM_BUILD_ROOT
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
rm -f $RPM_BUILD_DIR/file.list.%{name}
#find %{_tmppath}/%{name}-%{version}-build -type f | sed -e
's|%{_tmppath}/%{name}-%{version}-build||'| sed -e
's,^,\%attr(-\,root\,root) ,' > $RPM_BUILD_DIR/file.list.%{name}
find %{_tmppath}/%{name}-%{version}-build -type f | sed -e
's,^,\%attr(-\,root\,root) ,' > $RPM_BUILD_DIR/file.list.%{name}
find %{_tmppath}/%{name}-%{version}-build -type l | sed -e
's,^,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/file.list.%{name}
%clean
rm -rf $RPM_BUILD_ROOT
%files -f ../file.list.%{name}
The error I get is as follows:
kgbuild: + find /var/tmp/pkgbuild-brandon/R-2.9.1-build -type f
pkgbuild: + sed -e 's,^,\%attr(-\,root\,root) ,'
pkgbuild: + find /var/tmp/pkgbuild-brandon/R-2.9.1-build -type l
pkgbuild: + sed -e 's,^,\%attr(-\,root\,root) ,'
pkgbuild: + exit 0
pkgbuild: Creating packages...
pkgbuild: pkgbuild: File not found by glob:
/var/tmp/pkgbuild-brandon/R-2.9.1-build/var/tmp/pkgbuild-brandon/R-2.9.1-build/usr/share/man/man1/R.1
pkgbuild: pkgbuild: file
var/tmp/pkgbuild-brandon/R-2.9.1-build/usr/share/man/man1 is not under
basedir %{_basedir}
--- command output ends --- finished at Wed Jul 29 02:12:27 EDT 2009
INFO: pkgbuild -ba finished at Wed Jul 29 02:12:27 EDT 2009
ERROR: R FAILED
INFO: Check the build log in /tmp/R.log for details
A similar error:
pkgbuild: Creating packages...
pkgbuild: pkgbuild: File not found by glob:
/var/tmp/pkgbuild-brandon/R-2.9.1-build/var/tmp/pkgbuild-brandon/R-2.9.1-build/usr/bin/Rscript
pkgbuild: pkgbuild: file
var/tmp/pkgbuild-brandon/R-2.9.1-build/usr/bin is not under basedir
%{_basedir}
--- command output ends --- finished at Wed Jul 29 13:31:41 EDT 2009
INFO: pkgbuild -ba finished at Wed Jul 29 13:31:41 EDT 2009
ERROR: R FAILED
It seems to be complaining that the files aren't in the basedir; I
suppose I could move them from the package install directory to a
subdirectory of basedir but there is probably a better way.
Brandon Barker
Phone: (607) 262-6009
brandon.barker at gmail.com
http://brandon.barker.googlepages.com/home
On Tue, Jul 28, 2009 at 1:22 AM, Laszlo (Laca)
Peter<Laszlo.Peter at sun.com> wrote:
> Hi,
>
> On Mon, 2009-07-27 at 05:08 -0400, Brandon Barker wrote:
>> I tried that also, since I saw that on the juicer documentation, but I
>> still received the same error:
>>
>> bash-3.2$ ls *
>> R-2.9.1.tar.gz ? ? ? ?R.spec
>>
>> copyright:
>> R.copyright
>
> You need to tell pkgtool where to find the sources and other files.
> In this case, you have your source tarball in the current dir and
> the copyright file (considered a source file) in the copyright
> subdir. ?You can use the --tarballdirs (or --tar for short) option
> to specify the tarball directory and the --sourcedirs (or --src)
> for the copyright file, e.g.
>
> pkgtool build-only --tar . --src copyright R.spec
>
> To avoid having to type this in every time, you can create a
> .pkgtoolrc in the current dir that does the same:
>
> cat > .pkgtoolrc << EOF
> tarballdirs: ? ?${MYDIR}:${tarballdirs}
> sourcedirs: ? ? ${MYDIR}/copyright
> EOF
>
> pkgtool --help gives you a fair bit of information about the
> various command line options and the --dumprc option helps you
> convert those options into a config file.
>
> Hope this helps
> Laca
>
>> bash-3.2$ pkgtool build-only ?R.spec
>> INFO: Copying %use'd or %include'd spec files to SPECS directory
>> INFO: Processing spec files
>> INFO: Finding sources
>> INFO: Hint: you need to use the --download option to enable automatic
>> downloads
>> ERROR: R: Source file R.copyright not found
>>
>> Summary:
>>
>> ? ? ? ? ? ? ? ? ? ? ? ? ?package | ? ? ?status | details
>> ---------------------------------+-------------+-------------------------------
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?R | ? ? ?FAILED | Source R.copyright not found
>>
>> Brandon Barker
>> Phone: (607) 262-6009
>> brandon.barker at gmail.com
>> http://brandon.barker.googlepages.com/home
>>
>>
>>
>> On Mon, Jul 27, 2009 at 4:48 AM, Gilles Dauphin<Gilles.Dauphin at enst.fr>
>> wrote:
>> >
>> >
>> >> From: Brandon Barker <brandon.barker at gmail.com>
>> >>
>> >> I'm not very familiar with pkgtool or its cousin rpmbuild, so I have some
>> >> pretty basic
>> > questions (and will probably have more). I didn't see any opensolaris
>> > documentation or
>> > howtos that described things in-depth, but maybe I missed them.
>> >>
>> >> First, when trying to do a local package build, I have a directory with
>> >> the following
>> > contents:
>> >>
>> >> bash-3.2$ ls
>> >> R-2.9.1.tar.gz R.copyright R.spec
>> >>
>> >> The relevant part of R.spec:
>> >>
>> >> Name: R
>> >> Summary: R Statistical Language
>> >> Version: 2.9.1
>> >> License: GPLv2
>> >> #Source: http://cran.r-project.org/src/base/R-2/%{name}-%{version}.tar.gz
>> >> Source: %{name}-%{version}.tar.gz
>> >> URL: http://www.r-project.org/
>> >> Group: __________
>> >> Distribution: OpenSolaris
>> >> Vendor: OpenSolaris Community
>> >> %include default-depend.inc
>> >> #BuildRequires:______________
>> >> #Requires: ___________________
>> >>
>> >> BuildRoot: %{_tmppath}/%{name}-%{version}-build
>> >> SUNW_Basedir: %{_basedir}
>> >> SUNW_Copyright: %{name}.copyright
>> >>
>> >> # OpenSolaris IPS Manifest Fields
>> >> Meta(info.upstream): Robert Gentleman, Ross Ihaka
>> >> Meta(info.repository_url):
>> >> https://svn.r-project.org/R-dev-web/trunk/R-dev-web
>> >> Meta(info.maintainer): Brandon Barker brandon dot barker at gmail dot com
>> >>
>> >>
>> >> %description
>> >> R is a free software environment for statistical computing and graphics.
>> >>
>> >> %prep
>> >> rm -rf %name-%version
>> >> %setup -q -n %{name}-%{version}
>> >>
>> >>
>> >>
>> >> When I try to build I get an error that suggest the copyright file and
>> >> maybe the source
>> > is not found:
>> >> ( /opt/dtbld/bin/env.sh has been run)
>> >> bash-3.2$ pkgtool build-only R.spec
>> >> INFO: Copying %use'd or %include'd spec files to SPECS directory
>> >> INFO: Processing spec files
>> >> INFO: Finding sources
>> >> INFO: Hint: you need to use the --download option to enable automatic
>> >> downloads
>> >> ERROR: R: Source file R.copyright not found
>> >
>> > I think you must put the file "R.copyright" in the "copyright" directory.
>> >
>> > Cheers Gilles
>> >
>> >
>> >>
>> >> Summary:
>> >>
>> >> package | status | details
>> >> ---------------------------------+-------------+-----------------------------
>> >> --
>> >> R | FAILED | Source R.copyright not found
>> >>
>> >>
>> >> Any suggestions?
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> Also I'm wondering about the %files section - what is the preferred
>> >> method for
>> > constructing it? ?Installing the package in a temporary location and
>> > listing all files and
>> > directories that are installed? ?e.g.:
>> >>
>> >> /configure --prefix=/my/temp/directory; make; make install;
>> >> cd /my/temp/directory
>> >> find ./ -type d
>> >>
>> >> substitute each directory with directory/* and change permissions as
>> >> appropriate? ?I
>> > suppose one could be more precise but this seems like it would do the
>> > trick - haven't
>> > tried yet though.
>> >>
>> >> Thanks,
>> >> Brandon
>> >> --
>> >> This message posted from opensolaris.org
>> >> _______________________________________________
>> >> desktop-discuss mailing list
>> >> desktop-discuss at opensolaris.org
>> >
>> >
>> _______________________________________________
>> desktop-discuss mailing list
>> desktop-discuss at opensolaris.org
>
>