2017-10-18 13:07:48 +02:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
2020-06-23 04:05:30 +02:00
|
|
|
from __future__ import (absolute_import, division, print_function)
|
|
|
|
__metaclass__ = type
|
2017-10-18 13:07:48 +02:00
|
|
|
|
|
|
|
import sys
|
|
|
|
from collections import namedtuple
|
|
|
|
import rpmfluff
|
|
|
|
|
|
|
|
|
2019-01-04 17:37:59 +01:00
|
|
|
RPM = namedtuple('RPM', ['name', 'version', 'release', 'epoch', 'recommends'])
|
2017-10-18 13:07:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
SPECS = [
|
2019-08-07 20:26:55 +02:00
|
|
|
RPM('dinginessentail', '1.0', '1', None, None),
|
|
|
|
RPM('dinginessentail', '1.0', '2', '1', None),
|
|
|
|
RPM('dinginessentail', '1.1', '1', '1', None),
|
|
|
|
RPM('dinginessentail-olive', '1.0', '1', None, None),
|
|
|
|
RPM('dinginessentail-olive', '1.1', '1', None, None),
|
|
|
|
RPM('landsidescalping', '1.0', '1', None, None),
|
|
|
|
RPM('landsidescalping', '1.1', '1', None, None),
|
|
|
|
RPM('dinginessentail-with-weak-dep', '1.0', '1', None, ['dinginessentail-weak-dep']),
|
|
|
|
RPM('dinginessentail-weak-dep', '1.0', '1', None, None),
|
2017-10-18 13:07:48 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
try:
|
|
|
|
arch = sys.argv[1]
|
|
|
|
except IndexError:
|
|
|
|
arch = 'x86_64'
|
|
|
|
|
|
|
|
pkgs = []
|
|
|
|
for spec in SPECS:
|
|
|
|
pkg = rpmfluff.SimpleRpmBuild(spec.name, spec.version, spec.release, [arch])
|
|
|
|
pkg.epoch = spec.epoch
|
2019-01-04 17:37:59 +01:00
|
|
|
|
|
|
|
if spec.recommends:
|
|
|
|
# Skip packages that require weak deps but an older version of RPM is being used
|
|
|
|
if not hasattr(rpmfluff, "can_use_rpm_weak_deps") or not rpmfluff.can_use_rpm_weak_deps():
|
|
|
|
continue
|
|
|
|
|
|
|
|
for recommend in spec.recommends:
|
|
|
|
pkg.add_recommends(recommend)
|
|
|
|
|
2017-10-18 13:07:48 +02:00
|
|
|
pkgs.append(pkg)
|
|
|
|
|
|
|
|
repo = rpmfluff.YumRepoBuild(pkgs)
|
|
|
|
repo.make(arch)
|
|
|
|
|
|
|
|
for pkg in pkgs:
|
|
|
|
pkg.clean()
|
|
|
|
|
|
|
|
print(repo.repoDir)
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|