-
Notifications
You must be signed in to change notification settings - Fork 0
/
auto-patch.spec
77 lines (58 loc) · 1.4 KB
/
auto-patch.spec
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
%bcond_without tests
Name: auto-patch
Version: $version
Release: 0
Url: $url
Summary: $description
License: Apache-2.0
Group: System/Management
Source: %{name}-%{version}.tar.gz
BuildRequires: python3-base >= 3.6
BuildRequires: python3-setuptools
BuildRequires: systemd-rpm-macros
%if %{with tests}
BuildRequires: python3-distutils-pytest
BuildRequires: python3-pytest >= 3.0
BuildRequires: python3-systemd
%endif
Requires: lsof
Requires: python3-systemd
Requires: systemd
Requires: zypper
%systemd_requires
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
$long_description
%prep
%setup -q
%build
python3 setup.py build
%install
python3 setup.py install --prefix=%{_prefix} --root=%{buildroot} --install-scripts=%{_sbindir}
mv %{buildroot}%{_sbindir}/auto-patch.py %{buildroot}%{_sbindir}/auto-patch
install -d -m 755 %{buildroot}%{_sysconfdir}
cp -p etc/auto-patch.cfg %{buildroot}%{_sysconfdir}
install -d -m 755 %{buildroot}%{_unitdir}
cp -p systemd/* %{buildroot}%{_unitdir}
%if %{with tests}
%check
python3 setup.py test
%endif
%pre
%service_add_pre %{name}.timer
%post
%service_add_post %{name}.timer
%preun
%service_del_preun %{name}.timer
%postun
%service_del_postun %{name}.timer
%files
%defattr(-,root,root)
%doc README.rst CHANGES.rst
%license LICENSE.txt
%config %{_sysconfdir}/auto-patch.cfg
%exclude %{python3_sitelib}/*
%{_sbindir}/auto-patch
%{_unitdir}/*
%changelog