Hi list,

I am trying to create a pacakge for OpenSolaris using the pkgbuild
tool. I just wanted to first build the pacakge but its failing.

I have performed the following steps:

1. Prepare the environment by installing the CBE (Common Build Environment)
2. Install the pkgbuild too

I have a sample source which is working on Linux machine. It consists
of 4 files:
add.c  complex.c multiply.c  subtract.c
Through Makefile, it generates a binary named complex

I have spec file which generates the Linux RPM. I have modified this
spec for pkgbuild to generate the pacakge on OpenSolaris. My spec file
and Makefile attach with this mail. Its very simple to understand.

Now when i try to use with pkgbuild, it gives following message:

a...@opensolaris:~$ /opt/pkgbuild/bin/pkgtool build-only
complex-2.0.spec --specdirs=/export/home/adil/packages/SPECS
--sourcedirs=/export/home/adil/packages/SOURCES
INFO: Copying %use'd or %include'd spec files to SPECS directory
INFO: Processing spec files
basename: missing operand
Try `basename --help' for more information.
basename: missing operand
Try `basename --help' for more information.
basename: missing operand
Try `basename --help' for more information.
INFO: Finding sources
INFO: Running pkgbuild -ba [...] complex-2.0.spec (complex)
ERROR: complex FAILED
INFO: Check the build log in /tmp/complex-2.0.log for details
libnotify-Message: Unable to get session bus: dbus-launch failed to
autolaunch D-Bus session: Autolaunch error: X11 initialization failed.


Summary:

                         package |      status | details
---------------------------------+-------------+-------------------------------
                         complex |      FAILED | pkgbuild build failed
a...@opensolaris:~$


Query:
1) From where "basename: missing operand" error is generated?
2) What does the following message means:
INFO: Copying %use'd or %include'd spec files to SPECS directory

When i check the  /tmp/complex-2.0.log , it is giving error in install section:

+ make DESTDIR=/var/tmp/pkgbuild-adil/complex-2.0-build complex_install
Installing...
install  complex
/var/tmp/pkgbuild-adil/complex-2.0-build/opt/complex/bin/complex

In Linux, install target creates the image in the RPM:
$(INSTALL) $(IFLAG) complex $(DESTDIR)/opt/complex/bin/complex

But it seems in case Solaris, it is actually installing on the machine.

Query:
3) What should we do in the install target? I tried to change the
install target as:

cp complex $(DESTDIR)/opt/complex/bin/complex

But this is also wrong and gives error:
pkgbuild: cp complex /opt/complex/bin/complex
pkgbuild: cp: cannot create regular file `/opt/complex/bin/complex':
No such file or directory

I tried to look at Makefiles for Solaris but of no help.

Other queries:
4) Is it necessary to define SUNW_BaseDir in the spec file? If yes
then do we need to modify the %files section which contains the
absolute path.
5) What should be the value of BuildRoot?

Can some one help me and correct the Makefile/spec file to run this example?

Thanks in advance.

Regards,
Adil

Attachment: Makefile
Description: Binary data

Attachment: complex-2.0.spec
Description: Binary data

_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to