diff options
Diffstat (limited to 'mkmodular')
-rwxr-xr-x | mkmodular | 97 |
1 files changed, 56 insertions, 41 deletions
@@ -7,14 +7,16 @@ $template_php = <<< EOT document: modulemd version: 2 data: - name: remi-php - stream: @VERSION@ + name: php + stream: remi-@VERSION@ version: @DATE@ context: 00000000 arch: @ARCH@ summary: PHP scripting language description: >- - php @VERSION@ module + Alternative php @VERSION@ module. + The remi-@VERSION@ stream provides more recent versions + and more packages than default @VERSION@ stream. license: module: - GPLv2+ @@ -30,7 +32,7 @@ data: - buildrequires: platform: [@DIST@] requires: - platform: [@DIST@] +@DEPS@ references: documentation: http://php.net/ tracker: https://bugs.php.net/ @@ -63,12 +65,6 @@ data: api: rpms: - php-fpm - components: - rpms: - php: - rationale: Module API. - php-pecl-zip: - rationale: ZIP extension artifacts: rpms: @@ -79,7 +75,7 @@ $template_glpi = <<< EOT document: modulemd version: 2 data: - name: remi-glpi + name: glpi stream: @VERSION@ version: @DATE@ context: 00000000 @@ -96,7 +92,7 @@ data: - buildrequires: platform: [@DIST@] requires: - platform: [@DIST@] +@DEPS@ references: documentation: https://glpi-project.org/ tracker: https://github.com/glpi-project/glpi/issues @@ -107,10 +103,6 @@ data: api: rpms: - glpi - components: - rpms: - glpi: - rationale: Module API. artifacts: rpms: @@ -121,16 +113,16 @@ $defaults = <<< EOT document: modulemd-defaults version: 1 data: - module: remi-php + module: php profiles: - 7.2: [default] - 7.3: [default] + remi-7.2: [default] + remi-7.3: [default] ... --- document: modulemd-defaults version: 1 data: - module: remi-glpi + module: glpi profiles: 9.2: [default] 9.3: [default] @@ -159,10 +151,18 @@ function findPackages($from, $dest, $pat) { return $rpms; } -function genModule($srce, $dest, $pat, $ver, $arch, $dist, $template) { +function genModule($srce, $dest, $pat, $ver, $arch, $deps, $template) { $rpms = findPackages($srce, $dest, $pat); - $mod = str_replace(['@VERSION@', '@ARCH@', "@DATE@", "@DIST@"], [$ver, $arch, date("YmdHis"), $dist], $template); + $deptxt = ''; + foreach($deps as $n => $v) { + $deptxt .= ($deptxt ? "\n" : '') . " $n: [$v]"; + } + $mod = str_replace( + ['@VERSION@', '@ARCH@', "@DATE@", "@DIST@", "@DEPS@"], + [$ver, $arch, date("YmdHis"), $deps['platform'], $deptxt], + $template + ); foreach($rpms as $rpm) { $mod .= " - $rpm\n"; } @@ -191,23 +191,38 @@ echo " in $data.$arch\n"; chdir(__DIR__); } -$dest = 'fedora/29/modular/x86_64'; -echo "Populate $dest\n"; -cleanup($dest); -$mod = genModule('fedora/29/remi/x86_64', $dest, 'php-*7.2*.rpm', '7.2', 'x86_64', 'f29', $template_php); -$mod .= genModule('fedora/29/php73/x86_64', $dest, '*.rpm', '7.3', 'x86_64', 'f29', $template_php); -$mod .= genModule('fedora/29/glpi92/x86_64', $dest, '*.rpm', '9.2', 'x86_64', 'f29', $template_glpi); -$mod .= genModule('fedora/29/glpi93/x86_64', $dest, '*.rpm', '9.3', 'x86_64', 'f29', $template_glpi); -$mod .= $defaults; -createRepo($dest, $mod); - -$dest = 'fedora/29/modular/i386'; -echo "Populate $dest\n"; -cleanup($dest); -$mod = genModule('fedora/29/remi/i386', $dest, 'php-*7.2*.rpm', '7.2', 'i386', 'f29', $template_php); -$mod .= genModule('fedora/29/php73/i386', $dest, '*.rpm', '7.3', 'i386', 'f29', $template_php); -$mod .= genModule('fedora/29/glpi92/i386', $dest, '*.rpm', '9.2', 'i386', 'f29', $template_glpi); -$mod .= genModule('fedora/29/glpi93/i386', $dest, '*.rpm', '9.3', 'i386', 'f29', $template_glpi); -$mod .= $defaults; -createRepo($dest, $mod); +if (count($_SERVER['argv'])<2 || in_array('f29', $_SERVER['argv'])) { + $dest = 'fedora/29/modular/x86_64'; + echo "Populate $dest\n"; + cleanup($dest); + $deps = ['platform' => 'f29']; + $mod = genModule('fedora/29/remi/x86_64', $dest, '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/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 .= $defaults; + createRepo($dest, $mod); + + $dest = 'fedora/29/modular/i386'; + echo "Populate $dest\n"; + cleanup($dest); + $deps = ['platform' => 'f29']; + $mod = genModule('fedora/29/remi/i386', $dest, '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/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 .= $defaults; + createRepo($dest, $mod); +} + +if (count($_SERVER['argv'])<2 || in_array('el8', $_SERVER['argv'])) { + $dest = 'enterprise/8/modular/x86_64'; + echo "Populate $dest\n"; + cleanup($dest); + $deps = ['platform' => 'el8', 'nginx' => '1.14', 'httpd' => '2.4']; + $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 .= $defaults; + createRepo($dest, $mod); +} |