[Unix Solaris11] RPM2PKG error about compilation.


 
Thread Tools Search this Thread
Operating Systems Solaris [Unix Solaris11] RPM2PKG error about compilation.
# 1  
Old 12-10-2011
[Unix Solaris11] RPM2PKG error about compilation.

Hi,
I'm new on this forum. I'm working on Solaris 11 (Express Edition) and I must install some programm created only for RedHat system (I don't want to buy or download RedHat). So I search for this tools and I find a working script for Solaris 9 and 10, but I need that for Solaris 11. So I search the difference between them and I modify the script, but it doesn't work.
I post here the code of the script:
Code:
#!/usr/bin/perl
#
# rpm2pkg - creating Solaris pkg files from Linux rpm's
#
# 2008 - Mike Golvach - eggi@comcast.net
#
# Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
#

$rpm=$ARGV[0];
$tmp_dir="dir.$$";
$orig_dir=`pwd`;

mkdir("$tmp_dir");
chdir("$tmp_dir");
system("rpm2cpio ../$rpm|cpio -dim");
$proto_list=`find . -print|/bin/pkgproto|grep -v prototype`;
open(TMP_FILE, ">>prototype");
print TMP_FILE "i pkg info\n";
print TMP_FILE $proto_list;
close(TMP_FILE);
@pkg_info=`strings ../$rpm`;
$count = 0;
foreach (@pkg_info)     {
        if ( $_ =~ /\# \@\(\#\)BegWS/ ) {
                push(@rpm_info, $_);
                $count++;
        }       elsif ( $_ =~ /\# \@\(\#\)EndWS/ )      {
                last;
        }       elsif ( $count > 0 )    {
                push(@rpm_info, $_);
        }
}
$uname_s = `uname -s`;
$uname_r = `uname -r`;
$uname_p = `uname -p`;
$pkg_name = $rpm;
$pkg_name =~ s/\.rpm//;
chomp $uname_s;
chomp $uname_r;
chomp $uname_p;
chomp $rpm_info[1];
chomp $rpm_info[2];
chomp $rpm_info[5];
chomp $rpm_info[12];
open(PKGINFO, ">>pkginfo");
print PKGINFO "SUNW_PRODNAME=\"$uname_s\"\n";
print PKGINFO "SUNW_PRODVERS=\"$uname_r\"\n";
print PKGINFO "SUNW_PKGTYPE=\"usr\"\n";
print PKGINFO "PKG=\"$pkg_name\"\n";
print PKGINFO "NAME=\"$rpm_info[2]\"\n";
print PKGINFO "VERSION=\"$rpm_info[5]\"\n";
print PKGINFO "VENDOR=\"$rpm_info[1]\"\n";
print PKGINFO "ARCH=\"$uname_p\"\n";
print PKGINFO "EMAIL=\"me@xyz.com\"\n";
print PKGINFO "CATEGORY=\"application\"\n";
print PKGINFO "BASEDIR=/\n";
print PKGINFO "DESC=\"$rpm_info[12]\"\n";
print PKGINFO "PSTAMP=\"Your Name Here\"\n";
print PKGINFO "CLASSES=\"none\"\n";
close(PKGINFO);
system("/bin/pkgmk -o -b `pwd` -d /tmp");
system("/bin/pkgtrans -o -s /tmp `pwd`/test01.pkg test01");
system("mv test01.pkg ../");
system("cd ../;pwd;rm -r $tmp_dir");

The error is this:
Code:
## Building pkgmap from package prototype file.
ERROR in prototype:
    garbled entry
    - pathname: pkg
    - problem: extra tokens on input line
pkgmk: ERROR: unable to build pkgmap from prototype file
## Packaging was not successful.
pkgtrans: ERROR: unable to complete package transfer
    - no packages were selected from </tmp>
mv: cannot access test01.pkg
/root

If I cut the program to "close(PKGINFO);" It will work.
If anyone can help me I will release this script on this topic =)

Thank's for all.

(sorry for my not perfect english)
# 2  
Old 12-10-2011
Can you paste the contents of the pkginfo file that the script generates?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Compilation error character is missing-UNIX shell script

Dear Friends, Regarding Compilation error character is missing-unix shell script I am new to unix shell script. My requirement is --I need to find out 3 files in my UBM unix directory,if any one(CMUSER) file is available means,then i need to exit from my unix script, Below is my unix... (2 Replies)
Discussion started by: Joseph2017
2 Replies

2. Solaris

Error: installing Nmap on Solaris11 Express

Hello, I am trying to install Nmap on my Solaris machine. I got errors at the very last of "make" command though. Could someone point me out what I am lacking? Thank you! Nmap version: 5.50 (nmap-5.50.tar.bz2) Solaris version (cat /etc/release): Error message ( run "./configure &&... (0 Replies)
Discussion started by: fragile_it
0 Replies

3. UNIX for Dummies Questions & Answers

proc program compilation in unix

hi, i need to compile a proc program, say prog.pc can we compile this program in the unix environment? does this need a make file? can anyone help me on this since i am new to this area. Thanks in advance. (1 Reply)
Discussion started by: csprog
1 Replies

4. Programming

Compilation Error

I am getting the below given errors for the following program though all the variables have been declared and used appropriately. Please Help. The environment is AIX. Error: ------ "gbsizeprofile.c", line 67.4: 1506-275 (S) Unexpected text 'void' encountered. "gbsizeprofile.c", line 67.10:... (2 Replies)
Discussion started by: yschd
2 Replies

5. Programming

Compilation error : Please help

state_field state_abvr = { "AL","ALABAMA", "AK","ALASKA", "AZ","ARIZONA", "AR","ARKANSAS", "CA","CALIFORNIA", "CO","COLORADO", "CT","CONNECTICUT", "DE","DELAWARE", "DC","DISTRICT-OF-COLUMBIA", "FL","FLORIDA", "GA","GEORGIA", "HI","HAWAII", "ID","IDAHO", "IL","ILLINOIS",... (1 Reply)
Discussion started by: jagan_kalluri
1 Replies

6. HP-UX

compilation error

hello everyone, here i am attempting to compile a c++ submodule.OS is HP-UX. here i am getting the following error. ====================================== "Make: Don't know how to make compile. Stop." =================================== could you pls somebody suggest why this error is... (2 Replies)
Discussion started by: mannam srinivas
2 Replies

7. Linux

c++ compilation error

Hello every one, here i am attempting to compile a c++ module using gcc.it is throwing a error . error: ==== > make -S dummyCHARGP /usr/local/bin/gcc -g -DDEBUG -DMAT -I. -I/swtemp/usbs/cc/unix-ce/root/subsys/lib/Linux/ -I/opt/dce/include -I/opt/dce/include/dce ... (12 Replies)
Discussion started by: mannam srinivas
12 Replies

8. Programming

Compilation error

I am compiling a software xchm on solaris 10. First i run './configure' There is no error. But when i start compiling using 'gmake' following error shown /usr/local/include/wx-2.6/wx/x11/brush.h: In copy constructor `wxBrush::wxBrush(const wxBrush&)':... (3 Replies)
Discussion started by: mansoorulhaq
3 Replies

9. Programming

compilation error

Hi, While trying compile a C++ file in UNIX with gcc whose make rule involves the usage of /usr/ccs/bin/as, I get the following error: /usr/ccs/bin/as: No such file or directory /usr/ccs/bin/as: error: write error on output file "<filename>.o" *** Error code 1 clearmake: Error: Build... (2 Replies)
Discussion started by: smanu
2 Replies

10. Programming

Regarding compilation error.

Hi All, I facing the following compilation error; when I implementing the following logic. ostrstream ostr; ostr << (( scAxsm.getRecord( i ).getField( 2 ).getShort())%12)!=0?(( scAxsm.getRecord( i ).getField( 2 ).getShort())/12+1) : (( scAxsm.getRecord( i ).getField( 2 ).getShort())/12) <<... (1 Reply)
Discussion started by: sweta
1 Replies
Login or Register to Ask a Question