mirror of
https://github.com/clearlinux/autospec.git
synced 2026-06-16 02:45:56 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d73a1e70d8 | |||
| f07e061437 | |||
| d4144f5efd | |||
| 07a959cc83 | |||
| e36a856c50 | |||
| 2618dc3eb1 | |||
| 8b9384758b | |||
| 94c6be068b | |||
| f4a13a5a93 | |||
| 5424026110 |
@@ -212,6 +212,12 @@ ${custom}_provides_ban
|
||||
Controlling the build process
|
||||
------------------------------
|
||||
|
||||
invalid_release_sig
|
||||
This file contains the current version that will **not** have its package
|
||||
file be processed for signature verification (overriding the config_opt).
|
||||
This file will be automatically deleted after a new release and is intended
|
||||
to override a single bad signed release.
|
||||
|
||||
extra_sources
|
||||
This file contains a list of extra files to be added to the ``.spec`` and
|
||||
optionally installed as well. Each non-blank and non-comment line should start
|
||||
|
||||
@@ -763,7 +763,7 @@ class Requirements(object):
|
||||
for dirpath, _, files in os.walk(dirn):
|
||||
default_score = 2 if dirpath == dirn else 1
|
||||
|
||||
if "Cargo.toml" in files:
|
||||
if "Cargo.toml" in files and 'Makefile' not in files:
|
||||
config.set_build_pattern('cargo', default_score)
|
||||
|
||||
if "CMakeLists.txt" in files and "configure.ac" not in files:
|
||||
|
||||
+13
-1
@@ -347,7 +347,7 @@ class Config(object):
|
||||
def detect_build_from_url(self, url):
|
||||
"""Detect build patterns and build requirements from the patterns detected in the url."""
|
||||
# R package
|
||||
if "cran.r-project.org" in url or "cran.rstudio.com" in url:
|
||||
if "cran.r-project.org" in url or "cran.rstudio.com" in url or "/pub/cran/" in url:
|
||||
self.set_build_pattern("R", 10)
|
||||
|
||||
# python
|
||||
@@ -837,6 +837,18 @@ class Config(object):
|
||||
except Exception as e:
|
||||
print_warning(f"Unable to remove buildreq_cache file: {e}")
|
||||
|
||||
invalid_release_sig_file = os.path.join(self.download_path, "invalid_release_sig")
|
||||
content = self.read_conf_file(invalid_release_sig_file)
|
||||
if content and content[0] == version:
|
||||
self.config_opts['verify_required'] = False
|
||||
else:
|
||||
try:
|
||||
os.unlink(invalid_release_sig_file)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
except Exception as e:
|
||||
print_warning(f"Unable to remove invalid_release_sig file: {e}")
|
||||
|
||||
content = self.read_conf_file(os.path.join(self.download_path, "pkgconfig_add"))
|
||||
for extra in content:
|
||||
extra = pkgconfig_re.sub(r'\1', extra)
|
||||
|
||||
@@ -377,6 +377,7 @@ class FileManager(object):
|
||||
(r"^/lib/systemd/user/", "services"),
|
||||
(r"^/usr/lib/systemd/system/", "services"),
|
||||
(r"^/usr/lib/systemd/user/", "services"),
|
||||
(r"^/usr/lib/udev/hwdb.d", "config"),
|
||||
(r"^/usr/lib/udev/rules.d", "config"),
|
||||
(r"^/usr/lib/modules-load.d", "config"),
|
||||
(r"^/usr/lib/tmpfiles.d", "config"),
|
||||
|
||||
+10
-10
@@ -326,6 +326,9 @@ class Specfile(object):
|
||||
self._write("Group: Default\n")
|
||||
|
||||
for dep in deps.get(pkg, []):
|
||||
# honor requires_ban for manual overrides
|
||||
if f"{self.name}-{dep}" in self.requirements.banned_requires.get(pkg, []):
|
||||
continue
|
||||
if dep in self.packages:
|
||||
self._write("Requires: {}-{} = %{{version}}-%{{release}}\n".format(self.name, dep))
|
||||
|
||||
@@ -537,7 +540,7 @@ class Specfile(object):
|
||||
if not archive_prefix:
|
||||
# Make it up
|
||||
archive_prefix = os.path.splitext(os.path.basename(archive))[0]
|
||||
self._write_strip("cp -r %{{_builddir}}/{0}/* %{{_builddir}}/{1}/{2}"
|
||||
self._write_strip("cp -r %{{_builddir}}/{0}/. %{{_builddir}}/{1}/{2}"
|
||||
.format(archive_prefix,
|
||||
self.content.tarball_prefix,
|
||||
destination))
|
||||
@@ -548,7 +551,7 @@ class Specfile(object):
|
||||
if self.config.subdir:
|
||||
self._write_strip("pushd " + self.config.subdir)
|
||||
self._write_strip("mkdir -p .cargo")
|
||||
self._write_strip(f"echo '{self.config.cargo_vendors}' >> .cargo/config.toml")
|
||||
self._write_strip(f"echo '\n{self.config.cargo_vendors}' >> .cargo/config.toml")
|
||||
if self.config.subdir:
|
||||
self._write_strip("popd")
|
||||
|
||||
@@ -2067,14 +2070,11 @@ class Specfile(object):
|
||||
self.write_license_files()
|
||||
if self.config.subdir:
|
||||
self._write_strip("pushd " + self.config.subdir)
|
||||
if self.config.install_macro:
|
||||
self._write_strip(self.config.install_macro)
|
||||
else:
|
||||
self._write_strip("cargo install --path .")
|
||||
self._write_strip("mkdir -p %{buildroot}/usr/bin")
|
||||
self._write_strip('pushd "${HOME}/.cargo/bin/"')
|
||||
self._write_strip("mv * %{buildroot}/usr/bin/")
|
||||
self._write_strip("popd")
|
||||
self._write_strip("cargo install --path .")
|
||||
self._write_strip("mkdir -p %{buildroot}/usr/bin")
|
||||
self._write_strip('pushd "${HOME}/.cargo/bin/"')
|
||||
self._write_strip("mv * %{buildroot}/usr/bin/")
|
||||
self._write_strip("popd")
|
||||
if self.config.subdir:
|
||||
self._write_strip("popd")
|
||||
self.write_install_append()
|
||||
|
||||
+6
-3
@@ -120,7 +120,10 @@ class Source():
|
||||
extraction_path = base_path
|
||||
|
||||
extract_method = getattr(self, 'extract_{}'.format(self.type))
|
||||
extract_method(extraction_path)
|
||||
try:
|
||||
extract_method(extraction_path)
|
||||
except tarfile.AbsoluteLinkError:
|
||||
pass
|
||||
|
||||
def extract_tar(self, extraction_path):
|
||||
"""Extract tar in path."""
|
||||
@@ -153,7 +156,7 @@ def convert_version(ver_str, name):
|
||||
# them out with expensive regular expressions
|
||||
banned_subs = ["x86.64", "source", "src", "all", "bin", "release", "rh",
|
||||
"ga", ".ce", "lcms", "onig", "linux", "gc", "sdk", "orig",
|
||||
"jurko", "%2f", "%2F", "%20", "x265"]
|
||||
"jurko", "%2f", "%2F", "%20", "x265", "autotools"]
|
||||
|
||||
# package names may be modified in the version string by adding "lib" for
|
||||
# example. Remove these from the name before trying to remove the name from
|
||||
@@ -169,7 +172,7 @@ def convert_version(ver_str, name):
|
||||
ver_str = ver_str.replace(name.replace(mod, ""), "")
|
||||
|
||||
# replace illegal characters
|
||||
ver_str = ver_str.strip().replace('-', '.').replace('_', '.')
|
||||
ver_str = ver_str.strip().replace('-', '.').replace('_', '.').replace('+', '.')
|
||||
|
||||
# remove banned substrings
|
||||
for sub in banned_subs:
|
||||
|
||||
@@ -1613,3 +1613,4 @@ https://pigeonhole.dovecot.org/releases/2.3/dovecot-2.3.11-pigeonhole-0.5.11.tar
|
||||
https://pigeonhole.dovecot.org/releases/2.3/dovecot-2.3-pigeonhole-0.5.20.tar.gz,pigeonhole,0.5.20
|
||||
https://www.ezix.org/software/files/lshw-B.02.19.2.tar.gz,lshw,02.19.2
|
||||
https://github.com/VectorCamp/vectorscan/archive/refs/tags/vectorscan/5.4.11.tar.gz,vectorscan,5.4.11
|
||||
https://lib.openmpt.org/files/libopenmpt/src/libopenmpt-0.7.13+release.autotools.tar.gz,libopenmpt,0.7.13
|
||||
|
||||
@@ -6,6 +6,7 @@ import config
|
||||
# Structure: (url, build_pattern)
|
||||
BUILD_PAT_URL = [
|
||||
("https://cran.r-project.org/src/contrib/raster_3.0-12.tar.gz", "R"),
|
||||
("https://ftp.osuosl.org/pub/cran/src/contrib/hexbin_1.28.5.tar.gz", "R"),
|
||||
("http://pypi.debian.net/argparse/argparse-1.4.0.tar.gz", "distutils3"),
|
||||
("https://pypi.python.org/packages/source/T/Tempita/Tempita-0.5.2.tar.gz", "distutils3"),
|
||||
("https://cpan.metacpan.org/authors/id/T/TO/TODDR/IO-Tty-1.14.tar.gz", "cpan"),
|
||||
|
||||
Reference in New Issue
Block a user