summaryrefslogtreecommitdiffstats
path: root/mkmodular
diff options
context:
space:
mode:
Diffstat (limited to 'mkmodular')
-rwxr-xr-xmkmodular57
1 files changed, 30 insertions, 27 deletions
diff --git a/mkmodular b/mkmodular
index fc92bbb1..1f54b017 100755
--- a/mkmodular
+++ b/mkmodular
@@ -69,15 +69,6 @@ data:
rpms:
@RPMS@
...
----
-document: modulemd-defaults
-version: 1
-data:
- module: php
- stream: remi-@VERSION@
- profiles:
- remi-@VERSION@: [common]
-...
EOT;
@@ -121,15 +112,6 @@ data:
rpms:
@RPMS@
...
----
-document: modulemd-defaults
-version: 1
-data:
- module: redis
- stream: remi-@VERSION@
- profiles:
- remi-@VERSION@: [common]
-...
EOT;
@@ -170,15 +152,6 @@ data:
rpms:
@RPMS@
...
----
-document: modulemd-defaults
-version: 1
-data:
- module: glpi
- stream: @VERSION@
- profiles:
- @VERSION@: [common]
-...
EOT;
@@ -209,6 +182,21 @@ function findPackages($from, $dest, $pat) {
return $rpms;
}
+function genDefaults($name, $def, Array $vers) {
+ $meta = "---\n" .
+ "document: modulemd-defaults\n" .
+ "version: 1\n" .
+ "data:\n" .
+ " module: $name\n";
+ if ($def)
+ $meta .= " stream: $def\n";
+ $meta .= " profiles:\n";
+ foreach ($vers as $ver)
+ $meta .= " $ver: [common]\n";
+ $meta .= "...\n";
+
+ return $meta;
+}
function genModule($srce, $dest, $pats, $ver, $arch, $deps, $template) {
$rpms = [];
@@ -264,9 +252,11 @@ if (count($_SERVER['argv']) < 2 || in_array('f29', $_SERVER['argv'])) {
$mod = genModule('fedora/29/remi/x86_64', $dest, ['unit-php*rpm', 'php-*7.2*.rpm'], '7.2', 'x86_64', $deps, $template_php);
$mod .= genModule('fedora/29/php73/x86_64', $dest, '*.rpm', '7.3', 'x86_64', $deps, $template_php);
$mod .= genModule('fedora/29/php74/x86_64', $dest, '*.rpm', '7.4', 'x86_64', $deps, $template_php);
+ $mod .= genDefaults('php', 'remi-7.2', ['remi-7.2', 'remi-7.3', 'remi-7.4']);
$mod .= genModule('fedora/29/glpi92/x86_64', $dest, '*.rpm', '9.2', 'x86_64', $deps, $template_glpi);
$mod .= genModule('fedora/29/glpi93/x86_64', $dest, '*.rpm', '9.3', 'x86_64', $deps, $template_glpi);
$mod .= genModule('fedora/29/glpi94/x86_64', $dest, '*.rpm', '9.4', 'x86_64', $deps, $template_glpi);
+ $mod .= genDefaults('glpi', '9.4', ['9.2', '9.3', '9.4']);
createRepo($dest, $mod);
$dest = 'fedora/29/modular-test/x86_64';
@@ -285,9 +275,11 @@ if (count($_SERVER['argv']) < 2 || in_array('f29', $_SERVER['argv'])) {
$mod = genModule('fedora/29/remi/i386', $dest, ['unit-php*rpm', 'php-*7.2*.rpm'], '7.2', 'i386', $deps, $template_php);
$mod .= genModule('fedora/29/php73/i386', $dest, '*.rpm', '7.3', 'i386', $deps, $template_php);
$mod .= genModule('fedora/29/php74/i386', $dest, '*.rpm', '7.4', 'i386', $deps, $template_php);
+ $mod .= genDefaults('php', 'remi-7.2', ['remi-7.2', 'remi-7.3', 'remi-7.4']);
$mod .= genModule('fedora/29/glpi92/i386', $dest, '*.rpm', '9.2', 'i386', $deps, $template_glpi);
$mod .= genModule('fedora/29/glpi93/i386', $dest, '*.rpm', '9.3', 'i386', $deps, $template_glpi);
$mod .= genModule('fedora/29/glpi94/i386', $dest, '*.rpm', '9.4', 'i386', $deps, $template_glpi);
+ $mod .= genDefaults('glpi', '9.4', ['9.2', '9.3', '9.4']);
createRepo($dest, $mod);
$dest = 'fedora/29/modular-test/i386';
@@ -307,8 +299,10 @@ if (count($_SERVER['argv']) < 2 || in_array('f30', $_SERVER['argv'])) {
$deps = ['platform' => 'f30'];
$mod = genModule('fedora/30/remi/x86_64', $dest, ['unit-php*rpm', 'php-*7.3*.rpm'], '7.3', 'x86_64', $deps, $template_php);
$mod .= genModule('fedora/30/php74/x86_64', $dest, '*.rpm', '7.4', 'x86_64', $deps, $template_php);
+ $mod .= genDefaults('php', 'remi-7.3', ['remi-7.3', 'remi-7.4']);
$mod .= genModule('fedora/30/glpi93/x86_64', $dest, '*.rpm', '9.3', 'x86_64', $deps, $template_glpi);
$mod .= genModule('fedora/30/glpi94/x86_64', $dest, '*.rpm', '9.4', 'x86_64', $deps, $template_glpi);
+ $mod .= genDefaults('glpi', '9.4', ['9.3', '9.4']);
createRepo($dest, $mod);
$dest = 'fedora/30/modular-test/x86_64';
@@ -325,8 +319,10 @@ if (count($_SERVER['argv']) < 2 || in_array('f30', $_SERVER['argv'])) {
$deps = ['platform' => 'f30'];
$mod = genModule('fedora/30/remi/i386', $dest, ['unit-php*rpm', 'php-*7.3*.rpm'], '7.3', 'i386', $deps, $template_php);
$mod .= genModule('fedora/30/php74/i386', $dest, '*.rpm', '7.4', 'i386', $deps, $template_php);
+ $mod .= genDefaults('php', 'remi-7.3', ['remi-7.3', 'remi-7.4']);
$mod .= genModule('fedora/30/glpi93/i386', $dest, '*.rpm', '9.3', 'i386', $deps, $template_glpi);
$mod .= genModule('fedora/30/glpi94/i386', $dest, '*.rpm', '9.4', 'i386', $deps, $template_glpi);
+ $mod .= genDefaults('glpi', '9.4', ['9.3', '9.4']);
createRepo($dest, $mod);
$dest = 'fedora/30/modular-test/i386';
@@ -345,8 +341,10 @@ if (count($_SERVER['argv']) < 2 || in_array('f31', $_SERVER['argv'])) {
$deps = ['platform' => 'f31'];
$mod = genModule('fedora/31/remi/x86_64', $dest, ['unit-php*rpm', 'php-*7.3*.rpm'], '7.3', 'x86_64', $deps, $template_php);
$mod .= genModule('fedora/31/php74/x86_64', $dest, '*.rpm', '7.4', 'x86_64', $deps, $template_php);
+ $mod .= genDefaults('php', 'remi-7.3', ['remi-7.3', 'remi-7.4']);
$mod .= genModule('fedora/31/glpi93/x86_64', $dest, '*.rpm', '9.3', 'x86_64', $deps, $template_glpi);
$mod .= genModule('fedora/31/glpi94/x86_64', $dest, '*.rpm', '9.4', 'x86_64', $deps, $template_glpi);
+ $mod .= genDefaults('glpi', '9.4', ['9.3', '9.4']);
createRepo($dest, $mod);
$dest = 'fedora/31/modular-test/x86_64';
@@ -375,11 +373,14 @@ if (count($_SERVER['argv']) < 2 || in_array('el8', $_SERVER['argv'])) {
$mod = genModule('enterprise/8/php72/x86_64', $dest, '*.rpm', '7.2', 'x86_64', $deps, $template_php);
$mod .= genModule('enterprise/8/php73/x86_64', $dest, '*.rpm', '7.3', 'x86_64', $deps, $template_php);
$mod .= genModule('enterprise/8/php74/x86_64', $dest, '*.rpm', '7.4', 'x86_64', $deps, $template_php);
+ $mod .= genDefaults('php', '7.2', ['remi-7.2', 'remi-7.3', 'remi-7.4']);
$deps = ['platform' => 'el8'];
$mod .= genModule('enterprise/8/remi/x86_64', $dest, 'redis*.rpm', '5.0', 'x86_64', $deps, $template_redis);
+ $mod .= genDefaults('redis', '5', ['remi-5.0']);
$deps = ['platform' => 'el8', 'php' => ''];
$mod .= genModule('enterprise/8/glpi93/x86_64', $dest, '*.rpm', '9.3', 'x86_64', $deps, $template_glpi);
$mod .= genModule('enterprise/8/glpi94/x86_64', $dest, '*.rpm', '9.4', 'x86_64', $deps, $template_glpi);
+ $mod .= genDefaults('glpi', '9.4', ['9.3', '9.4']);
createRepo($dest, $mod);
}
@@ -403,10 +404,12 @@ if (count($_SERVER['argv']) < 2 || in_array('el7', $_SERVER['argv'])) {
$mod .= genModule('enterprise/7/php73/x86_64', $dest, '*.rpm', '7.3', 'x86_64', $deps, $template_php);
$mod .= genModule('enterprise/7/php74/x86_64', $dest, '*.rpm', '7.4', 'x86_64', $deps, $template_php);
$mod .= genModule('enterprise/7/remi/x86_64', $dest, 'redis*.rpm', '5.0', 'x86_64', $deps, $template_redis);
+ $mod .= genDefaults('php', '7.2', ['remi-7.1', 'remi-7.2', 'remi-7.3', 'remi-7.4']);
$deps = ['platform' => 'el7', 'php' => ''];
$mod .= genModule('enterprise/7/glpi92/x86_64', $dest, '*.rpm', '9.2', 'x86_64', $deps, $template_glpi);
$mod .= genModule('enterprise/7/glpi93/x86_64', $dest, '*.rpm', '9.3', 'x86_64', $deps, $template_glpi);
$mod .= genModule('enterprise/7/glpi94/x86_64', $dest, '*.rpm', '9.4', 'x86_64', $deps, $template_glpi);
+ $mod .= genDefaults('glpi', '9.4', ['9.2', '9.3', '9.4']);
createRepo($dest, $mod);
}
echo "Done\n";