summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/createrepo
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2015-10-09 22:59:03 +0200
committerTudor Florea <tudor.florea@enea.com>2015-10-09 22:59:03 +0200
commit972dcfcdbfe75dcfeb777150c136576cf1a71e99 (patch)
tree97a61cd7e293d7ae9d56ef7ed0f81253365bb026 /meta/recipes-support/createrepo
downloadpoky-972dcfcdbfe75dcfeb777150c136576cf1a71e99.tar.gz
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-support/createrepo')
-rw-r--r--meta/recipes-support/createrepo/createrepo/createrepo-rpm549.patch22
-rw-r--r--meta/recipes-support/createrepo/createrepo/fix-native-install.patch163
-rw-r--r--meta/recipes-support/createrepo/createrepo/python-scripts-should-use-interpreter-from-env.patch47
-rw-r--r--meta/recipes-support/createrepo/createrepo/recommends.patch71
-rwxr-xr-xmeta/recipes-support/createrepo/createrepo/rpm-createsolvedb.py64
-rw-r--r--meta/recipes-support/createrepo/createrepo_0.4.11.bb46
6 files changed, 413 insertions, 0 deletions
diff --git a/meta/recipes-support/createrepo/createrepo/createrepo-rpm549.patch b/meta/recipes-support/createrepo/createrepo/createrepo-rpm549.patch
new file mode 100644
index 0000000000..bc7200d072
--- /dev/null
+++ b/meta/recipes-support/createrepo/createrepo/createrepo-rpm549.patch
@@ -0,0 +1,22 @@
1dumpMetadata.py: Fix for RPM5 - 5.4.9 integration
2
3RPM5 no longer has a switch to disable signature validation. (Due to security
4validation concerns.)
5
6Upstream-Status: Inappropriate [other]
7 createrepo does not support RPM5 upstream
8
9Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
10
11diff -u createrepo-0.4.11.orig/dumpMetadata.py createrepo-0.4.11/dumpMetadata.py
12--- createrepo-0.4.11.orig/dumpMetadata.py 2012-06-05 10:12:55.687964222 -0500
13+++ createrepo-0.4.11/dumpMetadata.py 2012-06-05 10:40:08.154060600 -0500
14@@ -92,7 +92,7 @@
15 fdno = package # let's assume this is an fdno and go with it :)
16 except OSError:
17 raise MDError, "Error opening file"
18- ts.setVSFlags((rpm._RPMVSF_NOSIGNATURES|rpm.RPMVSF_NOMD5|rpm.RPMVSF_NEEDPAYLOAD))
19+ ts.setVSFlags((rpm.RPMVSF_NOMD5|rpm.RPMVSF_NEEDPAYLOAD))
20 try:
21 hdr = ts.hdrFromFdno(fdno)
22 except rpm.error:
diff --git a/meta/recipes-support/createrepo/createrepo/fix-native-install.patch b/meta/recipes-support/createrepo/createrepo/fix-native-install.patch
new file mode 100644
index 0000000000..d8202a4f7c
--- /dev/null
+++ b/meta/recipes-support/createrepo/createrepo/fix-native-install.patch
@@ -0,0 +1,163 @@
1Upstream-Status: Inappropriate [configuration]
2
3Date: Jan 31, 2011
4
5There are two fixes:
6 1. -native needs to customize prefix
7 2. needs to change python reference in binaries
8
9Signed-off-by: Qing He <qing.he@intel.com>
10
11diff --git a/Makefile b/Makefile
12index b2d1a32..3c3639f 100644
13--- a/Makefile
14+++ b/Makefile
15@@ -3,22 +3,22 @@ VERSION = 0.4.11
16 SHELL = /bin/sh
17 top_srcdir = .
18 srcdir = .
19-prefix = /usr
20-exec_prefix = ${prefix}
21-
22-bindir = ${exec_prefix}/bin
23-sbindir = ${exec_prefix}/sbin
24-libexecdir = ${exec_prefix}/libexec
25-datadir = ${prefix}/share
26-sysconfdir = ${prefix}/etc
27-sharedstatedir = ${prefix}/com
28-localstatedir = ${prefix}/var
29-libdir = ${exec_prefix}/lib
30-infodir = ${prefix}/info
31+prefix ?= /usr
32+exec_prefix ?= ${prefix}
33+
34+bindir ?= ${exec_prefix}/bin
35+sbindir ?= ${exec_prefix}/sbin
36+libexecdir ?= ${exec_prefix}/libexec
37+datadir ?= ${prefix}/share
38+sysconfdir ?= ${prefix}/etc
39+sharedstatedir ?= ${prefix}/com
40+localstatedir ?= ${prefix}/var
41+libdir ?= ${exec_prefix}/lib
42+infodir ?= ${prefix}/info
43 docdir =
44-includedir = ${prefix}/include
45+includedir ?= ${prefix}/include
46 oldincludedir = /usr/include
47-mandir = ${prefix}/share/man
48+mandir ?= ${prefix}/share/man
49
50 pkgdatadir = $(datadir)/$(PACKAGE)
51 pkglibdir = $(libdir)/$(PACKAGE)
52diff --git a/bin/Makefile b/bin/Makefile
53index 52c1f50..e30610e 100644
54--- a/bin/Makefile
55+++ b/bin/Makefile
56@@ -1,22 +1,22 @@
57 SHELL = /bin/sh
58 top_srcdir = ..
59 srcdir = ../bin
60-prefix = /usr
61-exec_prefix = ${prefix}
62-
63-bindir = ${exec_prefix}/bin
64-sbindir = ${exec_prefix}/sbin
65-libexecdir = ${exec_prefix}/libexec
66-datadir = ${prefix}/share
67-sysconfdir = ${prefix}/etc
68-sharedstatedir = ${prefix}/com
69-localstatedir = ${prefix}/var
70-libdir = ${exec_prefix}/lib
71-infodir = ${prefix}/info
72+prefix ?= /usr
73+exec_prefix ?= ${prefix}
74+
75+bindir ?= ${exec_prefix}/bin
76+sbindir ?= ${exec_prefix}/sbin
77+libexecdir ?= ${exec_prefix}/libexec
78+datadir ?= ${prefix}/share
79+sysconfdir ?= ${prefix}/etc
80+sharedstatedir ?= ${prefix}/com
81+localstatedir ?= ${prefix}/var
82+libdir ?= ${exec_prefix}/lib
83+infodir ?= ${prefix}/info
84 docdir =
85-includedir = ${prefix}/include
86+includedir ?= ${prefix}/include
87 oldincludedir = /usr/include
88-mandir = ${prefix}/man
89+mandir ?= ${prefix}/man
90
91 pkgdatadir = $(datadir)/$(PACKAGE)
92 pkglibdir = $(libdir)/$(PACKAGE)
93@@ -40,8 +40,11 @@ all: $(srcdir)/$(PACKAGE)
94
95
96 install: all installdirs
97- $(INSTALL_BIN) $(srcdir)/$(PACKAGE) $(DESTDIR)$(bindir)/$(PACKAGE)
98- $(INSTALL_BIN) $(srcdir)/modifyrepo $(DESTDIR)$(bindir)/modifyrepo
99+ sed -e "s|@DATADIR@|$(datadir)|" $(srcdir)/$(PACKAGE) > $(srcdir)/$(PACKAGE).tmp
100+ sed -e "s|@DATADIR@|$(datadir)|" $(srcdir)/modifyrepo > $(srcdir)/modifyrepo.tmp
101+ $(INSTALL_BIN) $(srcdir)/$(PACKAGE).tmp $(DESTDIR)$(bindir)/$(PACKAGE)
102+ $(INSTALL_BIN) $(srcdir)/modifyrepo.tmp $(DESTDIR)$(bindir)/modifyrepo
103+ rm -f $(srcdir)/$(PACKAGE).tmp $(srcdir)/modifyrepo.tmp
104
105
106 uninstall:
107diff --git a/bin/createrepo b/bin/createrepo
108index b0de515..eaacb39 100755
109--- a/bin/createrepo
110+++ b/bin/createrepo
111@@ -1,2 +1,2 @@
112 #!/bin/sh
113-exec /usr/share/createrepo/genpkgmetadata.py "$@"
114+exec @DATADIR@/createrepo/genpkgmetadata.py "$@"
115diff --git a/bin/modifyrepo b/bin/modifyrepo
116index c9732d8..6f7c1d4 100755
117--- a/bin/modifyrepo
118+++ b/bin/modifyrepo
119@@ -1,2 +1,2 @@
120 #!/bin/sh
121-exec /usr/share/createrepo/modifyrepo.py "$@"
122+exec @DATADIR@/createrepo/modifyrepo.py "$@"
123diff --git a/docs/Makefile b/docs/Makefile
124index 0a41179..e128c85 100644
125--- a/docs/Makefile
126+++ b/docs/Makefile
127@@ -1,22 +1,22 @@
128 SHELL = /bin/sh
129 top_srcdir = ..
130 srcdir = ../docs
131-prefix = /usr
132-exec_prefix = ${prefix}
133-
134-bindir = ${exec_prefix}/bin
135-sbindir = ${exec_prefix}/sbin
136-libexecdir = ${exec_prefix}/libexec
137-datadir = ${prefix}/share
138-sysconfdir = ${prefix}/etc
139-sharedstatedir = ${prefix}/com
140-localstatedir = ${prefix}/var
141-libdir = ${exec_prefix}/lib
142-infodir = ${prefix}/info
143+prefix ?= /usr
144+exec_prefix ?= ${prefix}
145+
146+bindir ?= ${exec_prefix}/bin
147+sbindir ?= ${exec_prefix}/sbin
148+libexecdir ?= ${exec_prefix}/libexec
149+datadir ?= ${prefix}/share
150+sysconfdir ?= ${prefix}/etc
151+sharedstatedir ?= ${prefix}/com
152+localstatedir ?= ${prefix}/var
153+libdir ?= ${exec_prefix}/lib
154+infodir ?= ${prefix}/info
155 docdir =
156-includedir = ${prefix}/include
157+includedir ?= ${prefix}/include
158 oldincludedir = /usr/include
159-mandir = ${datadir}/man
160+mandir ?= ${datadir}/man
161
162 pkgdatadir = $(datadir)/$(PACKAGE)
163 pkglibdir = $(libdir)/$(PACKAGE)
diff --git a/meta/recipes-support/createrepo/createrepo/python-scripts-should-use-interpreter-from-env.patch b/meta/recipes-support/createrepo/createrepo/python-scripts-should-use-interpreter-from-env.patch
new file mode 100644
index 0000000000..80205a1507
--- /dev/null
+++ b/meta/recipes-support/createrepo/createrepo/python-scripts-should-use-interpreter-from-env.patch
@@ -0,0 +1,47 @@
1Author: Andrei Gherzan <andrei@gherzan.ro>
2
3Python interpreter should be use from PATH - native python - and not the one from
4host.
5
6Upstream-Status: Inappropriate [configuration]
7
8Index: createrepo-0.4.11/genpkgmetadata.py
9===================================================================
10--- createrepo-0.4.11.orig/genpkgmetadata.py 2012-04-10 17:14:05.278649384 +0300
11+++ createrepo-0.4.11/genpkgmetadata.py 2012-04-10 17:14:22.290648886 +0300
12@@ -1,4 +1,4 @@
13-#!/usr/bin/python -t
14+#! /usr/bin/env python
15 # primary functions and glue for generating the repository metadata
16 #
17
18Index: createrepo-0.4.11/modifyrepo.py
19===================================================================
20--- createrepo-0.4.11.orig/modifyrepo.py 2012-04-10 17:14:09.106649272 +0300
21+++ createrepo-0.4.11/modifyrepo.py 2012-04-10 17:14:27.818648725 +0300
22@@ -1,4 +1,4 @@
23-#!/usr/bin/env python
24+#! /usr/bin/env python
25 # $Id$
26 #
27 # This tools is used to insert arbitrary metadata into an RPM repository.
28Index: createrepo-0.4.11/dumpMetadata.py
29===================================================================
30--- createrepo-0.4.11.orig/dumpMetadata.py 2012-04-10 17:19:23.874640068 +0300
31+++ createrepo-0.4.11/dumpMetadata.py 2012-04-10 17:19:34.502639756 +0300
32@@ -1,4 +1,4 @@
33-#!/usr/bin/python -t
34+#! /usr/bin/env python
35 # base classes and functions for dumping out package Metadata
36 #
37 # This program is free software; you can redistribute it and/or modify
38Index: createrepo-0.4.11/readMetadata.py
39===================================================================
40--- createrepo-0.4.11.orig/readMetadata.py 2012-04-10 17:19:19.626640193 +0300
41+++ createrepo-0.4.11/readMetadata.py 2012-04-10 17:19:40.198639590 +0300
42@@ -1,4 +1,4 @@
43-#!/usr/bin/python -t
44+#! /usr/bin/env python
45
46 # This program is free software; you can redistribute it and/or modify
47 # it under the terms of the GNU General Public License as published by
diff --git a/meta/recipes-support/createrepo/createrepo/recommends.patch b/meta/recipes-support/createrepo/createrepo/recommends.patch
new file mode 100644
index 0000000000..dc5de2b5b0
--- /dev/null
+++ b/meta/recipes-support/createrepo/createrepo/recommends.patch
@@ -0,0 +1,71 @@
1createrepo: implement recommends support
2
3Record against the corresponding requires entry in the output metadata
4if a dependency relationship is marked with the RPMSENSE_MISSINGOK flag
5(indicating it is a recommendation, rather than a hard dependency).
6
7Upstream-Status: Pending
8
9Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
10
11diff --git a/dumpMetadata.py b/dumpMetadata.py
12index 70bb2d8..e40e8ac 100644
13--- a/dumpMetadata.py
14+++ b/dumpMetadata.py
15@@ -319,6 +319,23 @@ class RpmMetaData:
16 reqs.append(0)
17 return reqs
18
19+ def _checkMissingOk(self, flags):
20+ reqs=[]
21+ if flags is None:
22+ return reqs
23+
24+ if type(flags) is not types.ListType:
25+ flags = [flags]
26+ for flag in flags:
27+ newflag = flag
28+ if flag is not None:
29+ newflag = flag & rpm.RPMSENSE_MISSINGOK
30+ if newflag:
31+ reqs.append(1)
32+ else:
33+ reqs.append(0)
34+ return reqs
35+
36
37 def _correctVersion(self, vers):
38 returnvers = []
39@@ -537,9 +554,10 @@ class RpmMetaData:
40 tmpflags = self.hdr[rpm.RPMTAG_REQUIREFLAGS]
41 flags = self._correctFlags(tmpflags)
42 prereq = self._checkPreReq(tmpflags)
43+ missingok = self._checkMissingOk(tmpflags)
44 ver = self._correctVersion(self.hdr[rpm.RPMTAG_REQUIREVERSION])
45 if names is not None:
46- lst = zip(names, flags, ver, prereq)
47+ lst = zip(names, flags, ver, prereq, missingok)
48 return self._uniq(lst)
49
50 def obsoletesList(self):
51@@ -692,7 +710,7 @@ def generateXML(doc, node, formatns, rpmObj, sumtype):
52 depsList = rpmObj.depsList()
53 if len(depsList) > 0:
54 rpconode = format.newChild(formatns, 'requires', None)
55- for (name, flags, (e,v,r), prereq) in depsList:
56+ for (name, flags, (e,v,r), prereq, missingok) in depsList:
57 entry = rpconode.newChild(formatns, 'entry', None)
58 entry.newProp('name', name)
59 if flags != 0:
60@@ -711,6 +729,8 @@ def generateXML(doc, node, formatns, rpmObj, sumtype):
61 entry.newProp('rel', str(r))
62 if prereq == 1:
63 entry.newProp('pre', str(prereq))
64+ if missingok:
65+ entry.newProp('missingok', '1')
66
67 for file in rpmObj.usefulFiles():
68 files = format.newChild(None, 'file', None)
69--
701.7.9.5
71
diff --git a/meta/recipes-support/createrepo/createrepo/rpm-createsolvedb.py b/meta/recipes-support/createrepo/createrepo/rpm-createsolvedb.py
new file mode 100755
index 0000000000..a5b61bade7
--- /dev/null
+++ b/meta/recipes-support/createrepo/createrepo/rpm-createsolvedb.py
@@ -0,0 +1,64 @@
1#!/usr/bin/env python
2#
3# This script generates a solution database for a directory containing rpm packages
4# but tries to be efficient about this, only doing so when the packages have changed
5# in some way.
6#
7# It is assumed something already went through and removed all the solvedb.done stamp files
8# in advance.
9#
10# First argument - the rpm binary to use
11# Subsequent arguments - paths to process solution databases for
12#
13
14import sys, os
15import hashlib
16import stat
17import subprocess
18
19if len(sys.argv) < 1:
20 print("Error, rpm command not specified")
21 sys.exit(1)
22
23if len(sys.argv) < 2:
24 print("Error, no paths specified")
25 sys.exit(1)
26
27paths = sys.argv[2:]
28
29for path in paths:
30 if os.path.exists(path + "/solvedb.done"):
31 continue
32 data = ""
33 manifest = []
34 for root, dirs, files in os.walk(path):
35 for file in files:
36 f = os.path.join(root, file)
37 if f.startswith(path + "/" + "solvedb"):
38 continue
39 data = data + str(os.stat(f)[stat.ST_MTIME])
40 manifest.append(f)
41 checksum = hashlib.md5(data).hexdigest()
42
43 if os.path.exists(path + "/solvedb.checksum") and open(path + "/solvedb.checksum", "r").read() == checksum:
44 open(path + "/solvedb.done", "w")
45 continue
46
47 if os.path.exists(path + "/solvedb"):
48 subprocess.call("rm -rf %s" % (path + "/solvedb"), shell=True)
49 os.mkdir(path + "/solvedb")
50 m = open(path + "/solvedb/manifest", "w")
51 m.write("# Dynamically generated solve manifest\n")
52 for f in manifest:
53 m.write(f + "\n")
54 m.close()
55
56 cmd = sys.argv[1] + ' -i --replacepkgs --replacefiles --oldpackage -D "_dbpath ' + path + '/solvedb" --justdb \
57 --noaid --nodeps --noorder --noscripts --notriggers --noparentdirs --nolinktos --stats \
58 --ignoresize --nosignature --nodigest -D "__dbi_txn create nofsync" \
59 ' + path + '/solvedb/manifest'
60 subprocess.call(cmd, shell=True)
61
62 open(path + "/solvedb.checksum", "w").write(checksum)
63 open(path + "/solvedb.done", "w")
64
diff --git a/meta/recipes-support/createrepo/createrepo_0.4.11.bb b/meta/recipes-support/createrepo/createrepo_0.4.11.bb
new file mode 100644
index 0000000000..49b45fc3b8
--- /dev/null
+++ b/meta/recipes-support/createrepo/createrepo_0.4.11.bb
@@ -0,0 +1,46 @@
1SUMMARY = "Creates metadata indexes for RPM package repositories"
2HOMEPAGE = "http://createrepo.baseurl.org/"
3
4LICENSE = "GPLv2+"
5LIC_FILES_CHKSUM = "file://COPYING;md5=18810669f13b87348459e611d31ab760"
6
7DEPENDS_class-native += "libxml2-native rpm-native"
8RDEPENDS_${PN}_class-target = "libxml2-python"
9
10PR = "r9"
11
12SRC_URI= "http://createrepo.baseurl.org/download/${BP}.tar.gz \
13 file://fix-native-install.patch \
14 file://python-scripts-should-use-interpreter-from-env.patch \
15 file://createrepo-rpm549.patch \
16 file://recommends.patch \
17 file://rpm-createsolvedb.py \
18 "
19
20SRC_URI[md5sum] = "3e9ccf4abcffe3f49af078c83611eda2"
21SRC_URI[sha256sum] = "a73ae11a0dcde8bde36d900bc3f7f8f1083ba752c70a5c61b72d1e1e7608f21b"
22
23BBCLASSEXTEND = "native"
24
25do_install () {
26 oe_runmake -e 'DESTDIR=${D}' install
27 install -m 0755 ${WORKDIR}/rpm-createsolvedb.py ${D}${bindir}/
28}
29
30# Wrap the python script since the native python is
31# ${bindir}/python-native/python, and the "#! /usr/bin/env python" can't
32# find it since it is not in PATH.
33do_install_append_class-native () {
34 # Not all the python scripts should be wrapped since some of
35 # them are modules (be imported).
36 for i in ${D}${datadir}/createrepo/genpkgmetadata.py \
37 ${D}${datadir}/createrepo/modifyrepo.py \
38 ${D}${bindir}/rpm-createsolvedb.py ; do
39 sed -i -e 's|^#!.*/usr/bin/env python|#! /usr/bin/env nativepython|' $i
40 done
41
42 create_wrapper ${D}/${bindir}/createrepo \
43 RPM_USRLIBRPM=${STAGING_LIBDIR_NATIVE}/rpm \
44 RPM_ETCRPM=${STAGING_ETCDIR_NATIVE}/rpm \
45 RPM_LOCALEDIRRPM=${STAGING_DATADIR_NATIVE}/locale
46}