chore: Add spec files for rmlint 2.10.2

This commit is contained in:
Kyle Gospodnetich 2023-09-12 07:53:46 -07:00
parent 5df2dced44
commit 2f5dff5daf
4 changed files with 212 additions and 0 deletions

View File

@ -0,0 +1,57 @@
The header parameter disables the creation of fake prototypes, and
CheckFunc always calls the function with no arguments, so the check
fails. This presently works by accident because compilers ignore the
second #include in '#include <sys/types.h>#include <sys/xattr.h>' (so
no prototype gets declared) and supply an implicit function
declaration which allows calls with any number of arguments.
Submitted upstream: <https://github.com/sahib/rmlint/pull/609>
diff --git a/SConstruct b/SConstruct
index 4964f11f9deaa82a..5cb9a5bd15011f20 100755
--- a/SConstruct
+++ b/SConstruct
@@ -195,14 +195,7 @@ def check_bigfiles(context):
off_t_is_big_enough = False
have_stat64 = True
- if tests.CheckFunc(
- context, 'stat64',
- header=
- '#include <sys/types.h>'
- '#include <sys/stat.h>'
- '#include <unistd.h>'
-
- ):
+ if tests.CheckFunc(context, 'stat64'):
have_stat64 = False
rc = int(off_t_is_big_enough or have_stat64)
@@ -291,12 +284,7 @@ def check_xattr(context):
rc = 1
for func in ['getxattr', 'setxattr', 'removexattr', 'listxattr']:
- if tests.CheckFunc(
- context, func,
- header=
- '#include <sys/types.h>'
- '#include <sys/xattr.h>'
- ):
+ if tests.CheckFunc(context, func):
rc = 0
break
@@ -312,12 +300,7 @@ def check_lxattr(context):
rc = 1
for func in ['lgetxattr', 'lsetxattr', 'lremovexattr', 'llistxattr']:
- if tests.CheckFunc(
- context, func,
- header=
- '#include <sys/types.h>'
- '#include <sys/xattr.h>'
- ):
+ if tests.CheckFunc(context, func):
rc = 0
break

View File

@ -0,0 +1,25 @@
From fcf83b479620d5bea6b7c81bc1255ecc5b12daac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <zebob.m@gmail.com>
Date: Tue, 21 Jun 2022 17:28:40 +0200
Subject: [PATCH] Add RPM_BUILD_ROOT to env
---
SConstruct | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/SConstruct b/SConstruct
index 7e12d413..4a4f1497 100755
--- a/SConstruct
+++ b/SConstruct
@@ -538,7 +538,7 @@ options = dict(
PREFIX=GetOption('prefix'),
ENV = dict([ (key, os.environ[key])
for key in os.environ
- if key in ['PATH', 'TERM', 'HOME', 'PKG_CONFIG_PATH']
+ if key in ['PATH', 'TERM', 'HOME', 'PKG_CONFIG_PATH', 'RPM_BUILD_ROOT']
])
)
--
2.36.1

View File

@ -0,0 +1,57 @@
The header parameter disables the creation of fake prototypes, and
CheckFunc always calls the function with no arguments, so the check
fails. This presently works by accident because compilers ignore the
second #include in '#include <sys/types.h>#include <sys/xattr.h>' (so
no prototype gets declared) and supply an implicit function
declaration which allows calls with any number of arguments.
Submitted upstream: <https://github.com/sahib/rmlint/pull/609>
diff --git a/SConstruct b/SConstruct
index 4964f11f9deaa82a..5cb9a5bd15011f20 100755
--- a/SConstruct
+++ b/SConstruct
@@ -195,14 +195,7 @@ def check_bigfiles(context):
off_t_is_big_enough = False
have_stat64 = True
- if tests.CheckFunc(
- context, 'stat64',
- header=
- '#include <sys/types.h>'
- '#include <sys/stat.h>'
- '#include <unistd.h>'
-
- ):
+ if tests.CheckFunc(context, 'stat64'):
have_stat64 = False
rc = int(off_t_is_big_enough or have_stat64)
@@ -291,12 +284,7 @@ def check_xattr(context):
rc = 1
for func in ['getxattr', 'setxattr', 'removexattr', 'listxattr']:
- if tests.CheckFunc(
- context, func,
- header=
- '#include <sys/types.h>'
- '#include <sys/xattr.h>'
- ):
+ if tests.CheckFunc(context, func):
rc = 0
break
@@ -312,12 +300,7 @@ def check_lxattr(context):
rc = 1
for func in ['lgetxattr', 'lsetxattr', 'lremovexattr', 'llistxattr']:
- if tests.CheckFunc(
- context, func,
- header=
- '#include <sys/types.h>'
- '#include <sys/xattr.h>'
- ):
+ if tests.CheckFunc(context, func):
rc = 0
break

View File

@ -0,0 +1,73 @@
%undefine _package_note_file
Name: rmlint
Version: 2.10.2
Release: %autorelease
Summary: Finds space waste and other broken things on your filesystem
# GPLv3: main code
# MIT: metrohash
# BSD: xxHash Library
# CC0 or ASL 2.0 or OpenSSL: blake2
# Public code: MurmurHash3, sha3
License: GPLv3 and MIT and BSD and (CC0 or ASL 2.0 or OpenSSL) and Public Domain
URL: https://rmlint.rtfd.org
Source0: https://github.com/sahib/rmlint/archive/v%{version}/%{name}-%{version}.tar.gz
Patch0: 0001-Add-RPM_BUILD_ROOT-to-env.patch
Patch1: rmlint-scons-c99.patch
BuildRequires: scons
BuildRequires: gcc
BuildRequires: python3-sphinx
BuildRequires: python3-devel
BuildRequires: gettext
BuildRequires: libblkid-devel
BuildRequires: elfutils-libelf-devel
BuildRequires: glib2-devel
BuildRequires: sqlite-devel
BuildRequires: json-glib-devel
BuildRequires: desktop-file-utils
Requires: hicolor-icon-theme
Recommends: gtksourceview3
Provides: bundled(blake2)
Provides: bundled(sha3)
Provides: bundled(xxhash)
Provides: bundled(metrohash)
Provides: bundled(murmurhash3)
%description
Rmlint finds space waste and other broken things and offers to remove it. It is
especially an extremely fast tool to remove duplicates from your filesystem.
%prep
%autosetup -p1
for f in `find gui/shredder -name "*.py"`; do
sed '1{\@^#!/usr/bin/env python@d}' $f > $f.new &&
touch -r $f $f.new &&
mv $f.new $f
done
%build
%set_build_flags
scons config %{?_smp_mflags} --prefix="%{buildroot}%{_prefix}" --actual-prefix="%{_prefix}" --libdir="%{_lib}" DEBUG=1 SYMBOLS=1 VERBOSE=1
scons
%install
scons install --prefix="%{buildroot}%{_prefix}" --actual-prefix="%{_prefix}" --libdir="%{_lib}" DEBUG=1 SYMBOLS=1 VERBOSE=1
desktop-file-validate %{buildroot}/%{_datadir}/applications/shredder.desktop
%find_lang %{name}
%files -f %{name}.lang
%doc README.rst
%license COPYING
%{_bindir}/rmlint
%{_datadir}/applications/shredder.desktop
%{_datadir}/glib-2.0/schemas/org.gnome.Shredder.gschema.xml
%exclude %{_datadir}/glib-2.0/schemas/gschemas.compiled
%{_datadir}/icons/hicolor/scalable/apps/shredder.svg
%{_mandir}/man1/rmlint.1*
%{python3_sitelib}/shredder/
%{python3_sitelib}/Shredder-%{version}-py*.egg-info
%changelog
%autochangelog