craigwblake / redline

Pure Java Rpm Library
http://redline-rpm.org
MIT License
128 stars 97 forks source link

.spec missing #87

Open ronanquillevere opened 9 years ago

ronanquillevere commented 9 years ago

Hello,

I am trying to use redline to create a rpm. I am still trying to do a basic rpm doing nothing.

I have the following code

File directory = new File(Constants.RPM_OUTPUT_DIRECTORY);
builder.setType(RpmType.BINARY);
builder.setPlatform(Architecture.X86_64, Os.MACOSX);
builder.setPackage(Constants.RPM_NAME, Constants.RPM_VERSION, Constants.RPM_RELEASE);
builder.build(directory);

I am able to create my rpm.

When I run

rpm -Uvh myrpm.rpm

Then I get the following error : error: source package contains no .spec file

Any idea what I am doing wrong ?

ronanquillevere commented 9 years ago

Here is what I get when I run redline scanner

Lead ended at '96'.
Signature ended at '184' and contained '5' headers (expected '5').
Header ended at '893 and contained '39' headers (expected '39').
Version: 3.0
Type: BINARY
Arch: X86_64
Name: commons.os-1-1
OS: MACOSX
Sig type: 5
Start Header ( class org.redline_rpm.header.Signature)
0: signatures[tag=62,type=7,count=16,size=16,offset=68]
       0:  0  0  0 3e  0  0  0  7 ff ff ff b0  0  0  0 10
1: sha1header[tag=269,type=6,count=1,size=41,offset=0]
    aa596df7e4da82b2ce873f070e2ed2b4d7cfd21c
2: sigsize[tag=1000,type=4,count=1,size=4,offset=44]
    949, 
3: md5[tag=1004,type=7,count=16,size=16,offset=48]
       0: 95 e9 7a ce 6b e4 77 b1 fc 53 cf 85 fe ec 3f a1
4: payloadsize[tag=1007,type=4,count=1,size=4,offset=64]
    124, 
Start Header ( class org.redline_rpm.header.Header)
0: headerimmutable[tag=63,type=7,count=16,size=16,offset=237]
       0:  0  0  0 3f  0  0  0  7 ff ff fd 90  0  0  0 10
1: headeri18ntable[tag=100,type=8,count=1,size=2,offset=0]
    C
2: name[tag=1000,type=6,count=1,size=11,offset=2]
    commons.os
3: version[tag=1001,type=6,count=1,size=2,offset=13]
    1
4: release[tag=1002,type=6,count=1,size=2,offset=15]
    1
5: epoch[tag=1003,type=4,count=1,size=4,offset=20]
    0, 
6: buildtime[tag=1006,type=4,count=1,size=4,offset=24]
    1434640395, 
7: size[tag=1009,type=4,count=1,size=4,offset=28]
    0, 
8: os[tag=1021,type=6,count=1,size=7,offset=32]
    macosx
9: arch[tag=1022,type=6,count=1,size=7,offset=39]
    x86_64
10: filesizes[tag=1028,type=4,count=0,size=0,offset=48]

11: filemodes[tag=1030,type=3,count=0,size=0,offset=48]

12: filerdevs[tag=1033,type=3,count=0,size=0,offset=48]

13: filemtimes[tag=1034,type=4,count=0,size=0,offset=48]

14: filemd5s[tag=1035,type=8,count=0,size=0,offset=48]
15: filelinktos[tag=1036,type=8,count=0,size=0,offset=48]
16: fileflags[tag=1037,type=4,count=0,size=0,offset=48]

17: fileusername[tag=1039,type=8,count=0,size=0,offset=48]
18: filegroupname[tag=1040,type=8,count=0,size=0,offset=48]
19: fileverifyflags[tag=1045,type=4,count=0,size=0,offset=48]

20: providename[tag=1047,type=8,count=1,size=11,offset=48]
    commons.os
21: requireflags[tag=1048,type=4,count=3,size=12,offset=60]
    16777290, 16777290, 16777290, 
22: requirename[tag=1049,type=8,count=3,size=89,offset=72]
    rpmlib(VersionedDependencies)
    rpmlib(CompressedFileNames)
    rpmlib(PayloadFilesHavePrefix)
23: requireversion[tag=1050,type=8,count=3,size=22,offset=161]
    3.0.3-1
    3.0.4-1
    4.0-1
24: rpmversion[tag=1064,type=6,count=1,size=6,offset=183]
    4.4.2
25: filedevices[tag=1095,type=4,count=0,size=0,offset=192]

26: fileinodes[tag=1096,type=4,count=0,size=0,offset=192]

27: filelangs[tag=1097,type=8,count=0,size=0,offset=192]
28: provideflags[tag=1112,type=4,count=1,size=4,offset=192]
    8, 
29: provideversion[tag=1113,type=8,count=1,size=6,offset=196]
    0:1-1
30: dirindexes[tag=1116,type=4,count=0,size=0,offset=204]

31: basenames[tag=1117,type=8,count=0,size=0,offset=204]
32: dirnames[tag=1118,type=8,count=0,size=0,offset=204]
33: payloadformat[tag=1124,type=6,count=1,size=5,offset=204]
    cpio
34: payloadcompressor[tag=1125,type=6,count=1,size=5,offset=209]
    gzip
35: payloadflags[tag=1126,type=6,count=1,size=2,offset=214]
    9
36: rhnplatform[tag=1131,type=6,count=1,size=7,offset=216]
    x86_64
37: platform[tag=1132,type=6,count=1,size=14,offset=223]
    x86_64-macosx
38: filecontexts[tag=1147,type=8,count=0,size=0,offset=237]

Payload compression: payloadcompressor[tag=1125,type=6,count=1,size=5,offset=209]
    gzip
Inode: 0
Permission: 644
Type: 0
UID: 0
GID: 0
UserName: null
GroupName: null
Nlink: 1
MTime: Thu Jan 01 01:00:00 GMT 1970
FileSize: 0
DevMinor: 1
DevMajor: 9
RDevMinor: 0
RDevMajor: 0
NameSize: 11
Name: TRAILER!!!
ronanquillevere commented 9 years ago

Seems that the pb is specific to Mac OS. I have generated the same rpm for linux and it works fine ?!

I installed rpm using macports on my OS X 10.9.5