-
Notifications
You must be signed in to change notification settings - Fork 1
/
rpm2swidtag.spec.in
101 lines (85 loc) · 2.73 KB
/
rpm2swidtag.spec.in
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
Name: rpm2swidtag
Version: %{version}
Release: 1%%{?dist}
Summary: Tools for producing SWID tags from rpm package headers and inspecting the SWID tags
License: ASL 2.0
URL: https://github.com/swidtags/rpm2swidtag
Source: %%{name}-%%{version}.tar.gz
Requires: python3-rpm
Requires: python3-lxml
Requires: python3-zstandard
Requires: dnf-plugins-core
Requires: xmlsec1-openssl
Obsoletes: dnf-plugin-swidtags
Obsoletes: swid-tools
BuildArch: noarch
BuildRequires: make
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-wheel
BuildRequires: python3-rpm
BuildRequires: python3-lxml
BuildRequires: python3-zstandard
BuildRequires: openssl
BuildRequires: xmlsec1-openssl
BuildRequires: createrepo_c
BuildRequires: fakechroot
BuildRequires: fakeroot
BuildRequires: dnf
BuildRequires: dnf-plugins-core
BuildRequires: gzip
BuildRequires: gnupg2
BuildRequires: python3-pylint
%%description
Tools for producing SWID tags from rpm package headers and inspecting the SWID tags.
%%prep
%%autosetup -p1
%%generate_buildrequires
%%pyproject_buildrequires
%%build
%%pyproject_wheel
%%install
%%pyproject_install
%%pyproject_save_files '*' +auto
install -D -t %%{buildroot}%%{_sysconfdir}/%%{name} \
rpm2swidtag.conf \
swidtag-template.xml \
swidtag.xslt \
rpm2swidtag.xslt \
rpm2swidtag-tagid.xslt
install -D -t %%{buildroot}%%{_sysconfdir}/%%{name}/rpm2swidtag.conf.d \
rpm2swidtag.conf.d/fedora-37.conf \
rpm2swidtag.conf.d/fedora-38.conf \
rpm2swidtag.conf.d/fedora-39.conf \
rpm2swidtag.conf.d/fedora-40.conf \
rpm2swidtag.conf.d/fedora-rawhide.conf
install -D -t %%{buildroot}%%{_sysconfdir}/swid swidq.conf
install -d %%{buildroot}%%{_sysconfdir}/swid/swidtags.d
install -D -t %%{buildroot}%%{_datarootdir}/swidq/stylesheets \
swidq-info.xslt \
swidq-dump.xslt \
swidq-files.xslt \
swidq-xml.xslt
install -D -t %%{buildroot}%%{_sysconfdir}/dnf/plugins dnf/plugins/swidtags.conf
%%check
%%pyproject_check_import
make test-pylint test
%%files -f %%{pyproject_files}
%%{_sysconfdir}/%%{name}
%%{_sysconfdir}/swid/swidq.conf
%%{_sysconfdir}/swid/swidtags.d
%%{_datarootdir}/swidq
%%{_sysconfdir}/dnf/plugins/swidtags.conf
%%post
if rpm -q rpm2swidtag dnf-plugin-swidtags 2> /dev/null | grep -E -q '(rpm2swidtag|dnf-plugin-swidtags)-0\.[1-7]\.[0-9]-' ; then
echo
echo "Please run dnf-plugin-swidtags-update-from-0.7 to update the filename format."
if echo "88d7506a4769d9402548cd9f0d242913cd46616f4fa755c52013094af33f5c1b /etc/dnf/plugins/swidtags.conf" | sha256sum -c > /dev/null 2>&1 ; then
sed -i 's/^# rpm2swidtag_command = /rpm2swidtag_command = /' /etc/dnf/plugins/swidtags.conf
echo
echo "The rpm2swidtag_command in /etc/dnf/plugins/swidtags.conf enabled"
echo "to keep the pre-0.8 behaviour."
fi
fi
%%changelog
%%autochangelog