summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena Reshetova <elena.reshetova@intel.com>2013-01-04 13:46:32 +0200
committerAnas Nashif <anas.nashif@intel.com>2013-02-02 16:44:44 -0800
commite5571e11ba2a08eda4c0d3917511d36eab9e2777 (patch)
tree6d3d63a8af64dd866415e1997a7e807eb6b49e8d
parent844ffebd91a71bf139b6339d0cf2ea57af70d2ce (diff)
downloadrpm-e5571e11ba2a08eda4c0d3917511d36eab9e2777.tar.gz
rpm-e5571e11ba2a08eda4c0d3917511d36eab9e2777.tar.bz2
rpm-e5571e11ba2a08eda4c0d3917511d36eab9e2777.zip
Adding manifest support for rpmbuild
-rw-r--r--build/files.c14
-rw-r--r--build/parsePreamble.c1
-rw-r--r--lib/rpmfi.h1
-rw-r--r--lib/rpmtag.h4
4 files changed, 17 insertions, 3 deletions
diff --git a/build/files.c b/build/files.c
index d12e3248f..63cac8bc3 100644
--- a/build/files.c
+++ b/build/files.c
@@ -826,6 +826,7 @@ static VFA_t const virtualAttrs[] = {
{ "%readme", RPMFILE_README },
{ "%license", RPMFILE_LICENSE },
{ "%pubkey", RPMFILE_PUBKEY },
+ { "%manifest", RPMFILE_SECMANIFEST },
{ NULL, 0 }
};
@@ -840,7 +841,7 @@ static rpmRC parseForSimple(char * buf, FileEntry cur, ARGV_t * fileNames)
{
char *s, *t;
rpmRC res = RPMRC_OK;
- int allow_relative = (RPMFILE_PUBKEY|RPMFILE_DOC|RPMFILE_LICENSE);
+ int allow_relative = (RPMFILE_PUBKEY|RPMFILE_DOC|RPMFILE_LICENSE|RPMFILE_SECMANIFEST);
t = buf;
while ((s = strtokWithQuotes(t, " \t\n")) != NULL) {
@@ -1554,6 +1555,15 @@ static rpmRC processMetadataFile(Package pkg, FileList fl,
apkt = pgpArmorWrap(PGPARMOR_PUBKEY, pkt, pktlen);
break;
}
+ case RPMTAG_SECMANIFEST: {
+ if ((xx = rpmioSlurp(fn, &pkt, &pktlen)) != 0 || pkt == NULL) {
+ rpmlog(RPMLOG_ERR, _("%s: Security manifest file read failed.\n"), fn);
+ goto exit;
+ }
+ apkt = rpmBase64Encode(pkt, pktlen, -1);
+ rpmlog(RPMLOG_INFO, _("Aptk: %s\n"), apkt);
+ break;
+ }
}
if (!apkt) {
@@ -1896,6 +1906,8 @@ static rpmRC processPackageFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags,
argvAdd(&(fl.docDirs), *fn);
} else if (fl.cur.attrFlags & RPMFILE_PUBKEY) {
(void) processMetadataFile(pkg, &fl, *fn, RPMTAG_PUBKEYS);
+ } else if (fl.cur.attrFlags & RPMFILE_SECMANIFEST) {
+ (void) processMetadataFile(pkg, &fl, *fn, RPMTAG_SECMANIFEST);
} else {
if (fl.cur.attrFlags & RPMFILE_DIR)
fl.cur.isDir = 1;
diff --git a/build/parsePreamble.c b/build/parsePreamble.c
index 78891dbdf..523e452e3 100644
--- a/build/parsePreamble.c
+++ b/build/parsePreamble.c
@@ -919,6 +919,7 @@ static struct PreambleRec_s const preambleList[] = {
{RPMTAG_BUILDSUGGESTS, 0, 0, LEN_AND_STR("buildsuggests")},
{RPMTAG_BUILDENHANCES, 0, 0, LEN_AND_STR("buildsupplements")},
{RPMTAG_BUILDENHANCES, 0, 0, LEN_AND_STR("buildenhances")},
+ {RPMTAG_SECMANIFEST, 0, 0, LEN_AND_STR("manifest")},
{0, 0, 0, 0}
};
diff --git a/lib/rpmfi.h b/lib/rpmfi.h
index c526c90ca..b77c82895 100644
--- a/lib/rpmfi.h
+++ b/lib/rpmfi.h
@@ -61,6 +61,7 @@ enum rpmfileAttrs_e {
RPMFILE_README = (1 << 8), /*!< from %%readme */
/* bits 9-10 unused */
RPMFILE_PUBKEY = (1 << 11), /*!< from %%pubkey */
+ RPMFILE_SECMANIFEST = (1 << 12), /*!< from %%manifest */
};
typedef rpmFlags rpmfileAttrs;
diff --git a/lib/rpmtag.h b/lib/rpmtag.h
index 1295a711a..025a0a415 100644
--- a/lib/rpmtag.h
+++ b/lib/rpmtag.h
@@ -299,8 +299,8 @@ typedef enum rpmTag_e {
RPMTAG_ORDERNAME = 5035, /* s[] */
RPMTAG_ORDERVERSION = 5036, /* s[] */
RPMTAG_ORDERFLAGS = 5037, /* i[] */
- RPMTAG_MSSFMANIFEST = 5038, /* s[] reservation (unimplemented) */
- RPMTAG_MSSFDOMAIN = 5039, /* s[] reservation (unimplemented) */
+ RPMTAG_SECMANIFEST = 5038, /* s[] security manifest file */
+ RPMTAG_SECSWSOURCE = 5039, /* s[] security software source */
RPMTAG_INSTFILENAMES = 5040, /* s[] extension */
RPMTAG_REQUIRENEVRS = 5041, /* s[] extension */
RPMTAG_PROVIDENEVRS = 5042, /* s[] extension */