summaryrefslogtreecommitdiff
path: root/prunerepo.spec
blob: 7a6669118ce43c8f785255dd3c8ffd3ee13a6a29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
Name:    prunerepo
Version: 1.21
Summary: Remove old packages from rpm-md repository
Release: 1
Url: https://pagure.io/prunerepo

Source0: %name-%version.tar.gz

License: GPLv2+
BuildArch: noarch
BuildRequires: bash
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-rpm
BuildRequires: createrepo_c
BuildRequires: asciidoc
BuildRequires: findutils
BuildRequires: dnf
BuildRequires: dnf-plugins-core
BuildRequires: coreutils
Requires: createrepo_c
Requires: dnf-plugins-core
Requires: python3-rpm
Requires: python3

%description
RPM packages that have newer version available in that same
repository are deleted from filesystem and the rpm-md metadata are
recreated afterwards. If there is a source rpm for a deleted rpm
(and they both share the same directory path), then the source rpm
will be deleted as well.

Support for specific repository structure (e.g. COPR) is also available
making it possible to additionally remove build logs and whole build
directories associated with a package.

After deletion of obsoleted packages, the command
"createrepo_c --database --update" is called
to recreate the repository metadata.

%prep
%setup -q

%check
tests/run.sh

%build
name="%{name}" version="%{version}" summary="%{summary}" %py3_build
a2x -d manpage -f manpage man/prunerepo.1.asciidoc

%install
name="%{name}" version="%{version}" summary="%{summary}" %py3_install

install -d %{buildroot}%{_mandir}/man1
install -p -m 644 man/prunerepo.1 %{buildroot}/%{_mandir}/man1/

%files
%license LICENSE

%{python3_sitelib}/*
%{_bindir}/prunerepo
%{_mandir}/man1/prunerepo.1*

%changelog
* Sun Jun 25 2023 lichaoran <pkwarcraft@hotmail.com> 1.21-1
- Initial package version