2016-10-13 22:44:52 +10:00
|
|
|
diff -urN rpm-5.4.10-orig/configure.ac rpm-5.4.10-patched/configure.ac
|
|
|
|
--- rpm-5.4.10-orig/configure.ac 2016-10-13 19:51:48.630996187 +1000
|
|
|
|
+++ rpm-5.4.10-patched/configure.ac 2016-10-13 21:31:19.476242608 +1000
|
2016-10-12 19:40:22 +10:00
|
|
|
@@ -2572,7 +2572,7 @@
|
|
|
|
macros/macros macros/macros.rpmbuild
|
|
|
|
macros/cmake macros/gstreamer macros/java macros/kernel macros/libtool
|
|
|
|
macros/mandriva macros/suse macros/fedora macros/mono macros/perl macros/pkgconfig macros/php
|
|
|
|
- macros/python macros/ruby macros/selinux macros/tcl
|
|
|
|
+ macros/python macros/ruby macros/selinux macros/tcl macros/qml
|
|
|
|
doc/Makefile
|
|
|
|
doc/manual/Makefile doc/fr/Makefile doc/ja/Makefile doc/ko/Makefile
|
|
|
|
doc/pl/Makefile doc/ru/Makefile doc/sk/Makefile
|
2016-10-13 22:44:52 +10:00
|
|
|
diff -urN rpm-5.4.10-orig/lib/rpmfc.c rpm-5.4.10-patched/lib/rpmfc.c
|
|
|
|
--- rpm-5.4.10-orig/lib/rpmfc.c 2016-10-13 19:51:48.806996194 +1000
|
|
|
|
+++ rpm-5.4.10-patched/lib/rpmfc.c 2016-10-13 22:14:04.696348477 +1000
|
2016-10-12 19:40:22 +10:00
|
|
|
@@ -647,6 +647,7 @@
|
|
|
|
|
|
|
|
{ "libtool library ", RPMFC_LIBTOOL|RPMFC_INCLUDE },
|
|
|
|
{ "pkgconfig ", RPMFC_PKGCONFIG|RPMFC_INCLUDE },
|
|
|
|
+ { "qml ", RPMFC_QML|RPMFC_INCLUDE },
|
|
|
|
|
|
|
|
{ "Bourne ", RPMFC_BOURNE|RPMFC_INCLUDE },
|
|
|
|
{ "Bourne-Again ", RPMFC_BOURNE|RPMFC_INCLUDE },
|
|
|
|
@@ -953,6 +954,10 @@
|
|
|
|
#endif
|
|
|
|
xx = rpmfcHelper(fc, 'R', "pkgconfig");
|
|
|
|
} else
|
|
|
|
+ if (fc->fcolor->vals[fc->ix] & RPMFC_QML) {
|
|
|
|
+ xx = rpmfcHelper(fc, 'P', "qml");
|
2016-10-13 22:44:52 +10:00
|
|
|
+// xx = rpmfcHelper(fc, 'R', "qml");
|
2016-10-12 19:40:22 +10:00
|
|
|
+ } else
|
|
|
|
if (fc->fcolor->vals[fc->ix] & RPMFC_BOURNE) {
|
|
|
|
#ifdef NOTYET
|
|
|
|
xx = rpmfcHelper(fc, 'P', "executable");
|
|
|
|
@@ -1147,7 +1152,7 @@
|
|
|
|
/*@unchecked@*/
|
|
|
|
static struct rpmfcApplyTbl_s rpmfcApplyTable[] = {
|
|
|
|
{ rpmfcELF, RPMFC_ELF },
|
|
|
|
- { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_FONT|RPMFC_HASKELL|RPMFC_RUBY|RPMFC_PERL|RPMFC_PYTHON|RPMFC_LIBTOOL|RPMFC_PKGCONFIG|RPMFC_BOURNE|RPMFC_JAVA|RPMFC_PHP|RPMFC_MONO|RPMFC_TYPELIB|RPMFC_NODEJS) },
|
|
|
|
+ { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_FONT|RPMFC_HASKELL|RPMFC_RUBY|RPMFC_PERL|RPMFC_PYTHON|RPMFC_LIBTOOL|RPMFC_PKGCONFIG|RPMFC_QML|RPMFC_BOURNE|RPMFC_JAVA|RPMFC_PHP|RPMFC_MONO|RPMFC_TYPELIB|RPMFC_NODEJS) },
|
|
|
|
#if defined(RPM_VENDOR_MANDRIVA)
|
|
|
|
{ rpmfcSYMLINK, RPMFC_SYMLINK },
|
|
|
|
#endif
|
2016-10-13 22:44:52 +10:00
|
|
|
@@ -1455,6 +1460,14 @@
|
2016-10-12 19:40:22 +10:00
|
|
|
else if (_suffix(s, ".pc"))
|
|
|
|
ftype = "pkgconfig file";
|
|
|
|
|
|
|
|
+ /* XXX all files with extension ".qml" are qml for now. */
|
|
|
|
+ else if (_suffix(s, ".qml"))
|
|
|
|
+ ftype = "qml file";
|
2016-10-13 22:44:52 +10:00
|
|
|
+
|
|
|
|
+ /* XXX all files named "qmldir" are qml for now. */
|
|
|
|
+ else if (_suffix(s, "qmldir"))
|
|
|
|
+ ftype = "qml file";
|
2016-10-12 19:40:22 +10:00
|
|
|
+
|
|
|
|
/* XXX all files with extension ".php" are PHP for now. */
|
|
|
|
else if (_suffix(s, ".php"))
|
|
|
|
ftype = "PHP script text";
|
2016-10-13 22:44:52 +10:00
|
|
|
diff -urN rpm-5.4.10-orig/lib/rpmfc.h rpm-5.4.10-patched/lib/rpmfc.h
|
|
|
|
--- rpm-5.4.10-orig/lib/rpmfc.h 2016-10-13 19:51:48.806996194 +1000
|
|
|
|
+++ rpm-5.4.10-patched/lib/rpmfc.h 2016-10-13 21:31:19.498242609 +1000
|
2016-10-12 19:40:22 +10:00
|
|
|
@@ -24,7 +24,7 @@
|
|
|
|
#define RPMFC_ELF (RPMFC_ELF32|RPMFC_ELF64|RPMFC_ELFMIPSN32)
|
|
|
|
/* (1 << 3) leaks into package headers, reserved */
|
|
|
|
|
|
|
|
- /* bit 4 unused */
|
|
|
|
+ RPMFC_QML = (1 << 4),
|
|
|
|
RPMFC_TYPELIB = (1 << 5),
|
|
|
|
RPMFC_HASKELL = (1 << 6),
|
|
|
|
RPMFC_RUBY = (1 << 7),
|
2016-10-13 22:44:52 +10:00
|
|
|
diff -urN rpm-5.4.10-orig/macros/macros rpm-5.4.10-patched/macros/macros
|
|
|
|
--- rpm-5.4.10-orig/macros/macros 2016-10-13 19:51:48.798996194 +1000
|
|
|
|
+++ rpm-5.4.10-patched/macros/macros 2016-10-13 21:31:19.500242609 +1000
|
2016-10-12 19:40:22 +10:00
|
|
|
@@ -1061,6 +1061,10 @@
|
|
|
|
#%%{load:%{_usrlibrpm}/macros.d/pkgconfig}
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------
|
|
|
|
+# qml(...) configuration.
|
|
|
|
+#%%{load:%{_usrlibrpm}/macros.d/qml}
|
|
|
|
+
|
|
|
|
+#------------------------------------------------------------------------
|
|
|
|
# mono(...) configuration.
|
|
|
|
#%%{load:%{_usrlibrpm}/macros.d/mono}
|
|
|
|
|
2016-10-13 22:44:52 +10:00
|
|
|
diff -urN rpm-5.4.10-orig/macros/macros.in rpm-5.4.10-patched/macros/macros.in
|
|
|
|
--- rpm-5.4.10-orig/macros/macros.in 2016-10-13 19:51:48.647996188 +1000
|
|
|
|
+++ rpm-5.4.10-patched/macros/macros.in 2016-10-13 21:31:19.509242609 +1000
|
2016-10-12 19:40:22 +10:00
|
|
|
@@ -1065,6 +1065,10 @@
|
|
|
|
%{load:%{_usrlibrpm}/macros.d/pkgconfig}
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------
|
|
|
|
+# qml(...) configuration.
|
|
|
|
+%{load:%{_usrlibrpm}/macros.d/qml}
|
|
|
|
+
|
|
|
|
+#------------------------------------------------------------------------
|
|
|
|
# mono(...) configuration.
|
|
|
|
%{load:%{_usrlibrpm}/macros.d/mono}
|
|
|
|
|
2016-10-13 22:44:52 +10:00
|
|
|
diff -urN rpm-5.4.10-orig/macros/qml rpm-5.4.10-patched/macros/qml
|
|
|
|
--- rpm-5.4.10-orig/macros/qml 1970-01-01 10:00:00.000000000 +1000
|
|
|
|
+++ rpm-5.4.10-patched/macros/qml 2016-10-13 21:31:19.513242610 +1000
|
2016-10-12 19:40:22 +10:00
|
|
|
@@ -0,0 +1,11 @@
|
|
|
|
+# QML specific macro definitions.
|
|
|
|
+# To make use of these macros insert the following line into your spec file:
|
|
|
|
+# %{load:%{_usrlibrpm}/macros.d/qml}
|
|
|
|
+#
|
|
|
|
+
|
2016-10-13 19:42:16 +10:00
|
|
|
+# Path to scripts to autogenerate QML package dependencies,
|
2016-10-12 19:40:22 +10:00
|
|
|
+#
|
|
|
|
+# Note: Used iff _use_internal_dependency_generator is non-zero. The
|
|
|
|
+# helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
|
|
|
|
+%__qml_provides %{_rpmhome}/qmldeps.sh --provides
|
|
|
|
+%__qml_requires %{_rpmhome}/qmldeps.sh --requires
|
2016-10-13 22:44:52 +10:00
|
|
|
diff -urN rpm-5.4.10-orig/macros/qml.in rpm-5.4.10-patched/macros/qml.in
|
|
|
|
--- rpm-5.4.10-orig/macros/qml.in 1970-01-01 10:00:00.000000000 +1000
|
|
|
|
+++ rpm-5.4.10-patched/macros/qml.in 2016-10-13 21:31:19.515242610 +1000
|
2016-10-12 19:40:22 +10:00
|
|
|
@@ -0,0 +1,11 @@
|
|
|
|
+# QML specific macro definitions.
|
|
|
|
+# To make use of these macros insert the following line into your spec file:
|
|
|
|
+# %{load:%{_usrlibrpm}/macros.d/qml}
|
|
|
|
+#
|
|
|
|
+
|
2016-10-13 19:42:16 +10:00
|
|
|
+# Path to scripts to autogenerate QML package dependencies,
|
2016-10-12 19:40:22 +10:00
|
|
|
+#
|
|
|
|
+# Note: Used iff _use_internal_dependency_generator is non-zero. The
|
|
|
|
+# helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
|
|
|
|
+%__qml_provides %{_rpmhome}/qmldeps.sh --provides
|
|
|
|
+%__qml_requires %{_rpmhome}/qmldeps.sh --requires
|
2016-10-13 22:44:52 +10:00
|
|
|
diff -urN rpm-5.4.10-orig/Makefile.am rpm-5.4.10-patched/Makefile.am
|
|
|
|
--- rpm-5.4.10-orig/Makefile.am 2012-03-17 11:24:19.000000000 +1100
|
|
|
|
+++ rpm-5.4.10-patched/Makefile.am 2016-10-13 21:31:19.515242610 +1000
|
2016-10-12 19:40:22 +10:00
|
|
|
@@ -118,7 +118,7 @@
|
|
|
|
pkgcfg_DATA = \
|
|
|
|
macros/cmake macros/gstreamer macros/java macros/kernel macros/libtool \
|
|
|
|
macros/mandriva macros/mono macros/perl macros/pkgconfig macros/php \
|
|
|
|
- macros/python macros/ruby macros/selinux macros/tcl
|
|
|
|
+ macros/python macros/ruby macros/selinux macros/tcl macros/qml
|
|
|
|
|
|
|
|
noinst_HEADERS = build.h debug.h system.h
|
|
|
|
|
2016-10-13 22:44:52 +10:00
|
|
|
diff -urN rpm-5.4.10-orig/scripts/Makefile.am rpm-5.4.10-patched/scripts/Makefile.am
|
|
|
|
--- rpm-5.4.10-orig/scripts/Makefile.am 2016-10-13 19:51:47.745996150 +1000
|
|
|
|
+++ rpm-5.4.10-patched/scripts/Makefile.am 2016-10-13 21:31:19.519242610 +1000
|
2016-10-12 19:40:22 +10:00
|
|
|
@@ -67,7 +67,8 @@
|
|
|
|
rpm.daily rpm.log rpm.xinetd \
|
|
|
|
rubygems.rb \
|
|
|
|
tgpg u_pkg.sh \
|
|
|
|
- vcheck vpkg-provides.sh vpkg-provides2.sh
|
|
|
|
+ vcheck vpkg-provides.sh vpkg-provides2.sh \
|
|
|
|
+ qmldeps.sh
|
|
|
|
|
|
|
|
|
|
|
|
pkglibbindir = @USRLIBRPM@/bin
|
2016-10-13 22:44:52 +10:00
|
|
|
diff -urN rpm-5.4.10-orig/scripts/qmldeps.sh rpm-5.4.10-patched/scripts/qmldeps.sh
|
|
|
|
--- rpm-5.4.10-orig/scripts/qmldeps.sh 1970-01-01 10:00:00.000000000 +1000
|
|
|
|
+++ rpm-5.4.10-patched/scripts/qmldeps.sh 2016-10-13 22:13:24.485346817 +1000
|
|
|
|
@@ -0,0 +1,88 @@
|
2016-10-12 19:40:22 +10:00
|
|
|
+#!/bin/bash
|
|
|
|
+# Copyright (C) 2012 Jolla Oy
|
|
|
|
+# Contact: Bernd Wachter <bernd.wachter@jollamobile.com>
|
|
|
|
+# Modified by Andrey Bondrov <andrey.bondrov@rosalab.ru>
|
|
|
|
+#
|
|
|
|
+# Try to locate module information for automatic provide generation from
|
|
|
|
+# qmldir files as well as information about imported modules for automatic
|
|
|
|
+# require generation from qml files.
|
|
|
|
+#
|
|
|
|
+# TODO:
|
|
|
|
+# - figure out if type handling needs special attention in regard to versioning
|
|
|
|
+# - stuff like Sailfish.Silica.theme currently can't get autodetected
|
|
|
|
+# - implement requires generation
|
|
|
|
+# - check if the regex include all valid characters allowed in module definitions
|
|
|
|
+# - fine tune the regex -- they're currently not perfect, just "good enough"
|
|
|
|
+#
|
|
|
|
+# A note about versioning:
|
|
|
|
+# A module package should provide the module in the version of the highest file
|
|
|
|
+# included in the package. A package using a module should require the module
|
|
|
|
+# in a version >= the one used for the import.
|
|
|
|
+
|
2016-10-13 19:42:16 +10:00
|
|
|
+[ $# -ge 1 ] || {
|
2016-10-12 19:40:22 +10:00
|
|
|
+ cat > /dev/null
|
|
|
|
+ exit 0
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+# grep blows up with C/POSIX locale, so make sure we're using a working locale
|
|
|
|
+if [ -z "$LANG" ] || [ "$LANG" = "C" ] || [ "$LANG" = "POSIX" ] ; then
|
|
|
|
+ export LANG=en_US.UTF-8
|
|
|
|
+fi
|
|
|
|
+
|
|
|
|
+case $1 in
|
|
|
|
+-P|--provides)
|
|
|
|
+ while read file; do
|
|
|
|
+ case "$file" in
|
|
|
|
+ */qmldir)
|
|
|
|
+ if head -1 "$file" | grep -iq '^module\s*' 2>/dev/null; then
|
|
|
|
+ provides="`head -1 ${file} | sed -r 's/^module\s+//'`"
|
|
|
|
+ version="`grep -i -E -o '^[a-z]*\s+[0-9.]*\s+[a-z0-9]*.qml' ${file} | awk '{print $2}' | sort -r | uniq | head -1`"
|
|
|
|
+ if [ -z "$version" ]; then
|
2016-10-13 22:44:52 +10:00
|
|
|
+# echo "qmldeps: WARNING: no version number found, package version will be used." >&2
|
2016-10-12 19:40:22 +10:00
|
|
|
+ echo "qml($provides)"
|
|
|
|
+ else
|
|
|
|
+ echo "qml($provides) = $version"
|
|
|
|
+ fi
|
|
|
|
+ else
|
|
|
|
+ echo "qmldeps: no valid module definition found in $file" >&2
|
|
|
|
+ fi
|
|
|
|
+ ;;
|
|
|
|
+ esac
|
|
|
|
+ done
|
|
|
|
+ ;;
|
|
|
|
+-R|--requires)
|
|
|
|
+ while read file; do
|
|
|
|
+ case "$file" in
|
|
|
|
+ *.qml)
|
|
|
|
+ # this first part is some hack to avoid depending on own provides
|
|
|
|
+ # for modules
|
|
|
|
+ qmldir=`echo ${file}|sed 's,/[^/]*$,,'`
|
|
|
|
+ qmldir_noprivate=`echo ${file}|sed 's,private/[^/]*$,,'`
|
|
|
|
+ if [ -f $qmldir/qmldir ]; then
|
|
|
|
+ module=`head -1 $qmldir/qmldir | sed -r 's/^.*\s+//'`
|
|
|
|
+ elif [ -f $qmldir_noprivate/qmldir ]; then
|
|
|
|
+ module=`head -1 $qmldir_noprivate/qmldir | sed -r 's/^.*\s+//'`
|
|
|
|
+ fi
|
|
|
|
+ IFS=$'\n'
|
|
|
|
+ imports=`grep -i -E -o '^\s*import\s+[a-z0-9.]*\s+[0-9.]*' ${file} | sed -r -e 's/^\s*import\s*//' | sort | uniq`
|
|
|
|
+ if [ -z "$imports" ]; then
|
|
|
|
+ echo "qmldeps: no imports found in $file. Probably should not happen." >&2
|
|
|
|
+ fi
|
|
|
|
+ for i in $imports; do
|
|
|
|
+ import=`echo $i | awk '{ print $1 }'`
|
|
|
|
+ import_version=`echo $i | awk '{ print $2 }'`
|
|
|
|
+ if [ $import = "$module" ]; then
|
|
|
|
+ echo "qmldeps: skipping provide for own module '$module' in $file" >&2
|
|
|
|
+ elif echo $import | grep -q '\.private$'; then
|
|
|
|
+ echo "qmldeps: skipping private import '$import' in $file" >&2
|
|
|
|
+ else
|
2016-10-13 19:42:16 +10:00
|
|
|
+ # remove the >&2 to enable requires generation as well
|
|
|
|
+ echo "qml($import) >= $import_version"
|
2016-10-12 19:40:22 +10:00
|
|
|
+ fi
|
|
|
|
+ done
|
|
|
|
+ ;;
|
|
|
|
+ esac
|
|
|
|
+ done
|
|
|
|
+ ;;
|
|
|
|
+esac
|
|
|
|
+exit 0
|