使用redline(java)no .spec文件生成rpm

时间:2015-06-18 15:56:35

标签: java rpm

我正在尝试使用redline来创建rpm。我仍在努力做一个基本的rpm什么都不做。

我有以下代码

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);

我可以创建我的rpm。

当我跑步时

rpm -Uvh myrpm.rpm

然后我收到以下错误:

error: source package contains no .spec file

知道我做错了吗?

以下是我运行红线扫描仪时的结果

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!!!

当我跑步时

rpm -qpi commons.os-1-1.x86_64.rpm 

返回

Name        : commons.os                   Relocations: (not relocatable)
Version     : 1                                 Vendor: (none)
Release     : 1                             Build Date: Thu Jun 18 16:13:15 2015
Install Date: (not installed)               Build Host: (none)
Group       : (none)                        Source RPM: (none)
Size        : 0                          
Signature   : (none)
Summary     : (none)
Description :
(none)

当我跑步时

rpm -Uvvvvh commons.os-1-1.x86_64.rpm

返回

D: ============== commons.os-1-1.x86_64.rpm
D: Expected size:         1229 = lead(96)+sigs(180)+pad(4)+data(949)
D:   Actual size:         1229
D: commons.os-1-1.x86_64.rpm: Header SHA1 digest: OK (aa596df7e4da82b2ce873f070e2ed2b4d7cfd21c)
D:  added source package [0]
D: found 1 source and 0 binary packages
D: Expected size:         1229 = lead(96)+sigs(180)+pad(4)+data(949)
D:   Actual size:         1229
D: InstallSourcePackage: Header SHA1 digest: OK (aa596df7e4da82b2ce873f070e2ed2b4d7cfd21c)
error: source package contains no .spec file 

修改

似乎问题是特定于mac os。我为linux平台生成了相同的rpm,它工作正常吗?!

我在OS X 10.9.5

上使用macports安装了rpm

0 个答案:

没有答案