-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathydcmd.spec
99 lines (69 loc) · 2.13 KB
/
ydcmd.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
Name: ydcmd
Version: 2.12.2
Release: 1
BuildArch: noarch
Summary: Command line Yandex.Disk client
Group: Applications/Internet
License: BSD-2-Clause
URL: https://github.com/abbat/ydcmd
Source0: https://build.opensuse.org/source/home:antonbatenev:ydcmd/ydcmd/ydcmd_%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} > 1000 || 0%{?fedora} > 20
Suggests: python-progressbar
Recommends: ca-certificates
%endif
%if 0%{?rhel}
Requires: python >= 2.6, python-dateutil
BuildRequires: python-devel >= 2.6
%else
Requires: python3, python3-dateutil
BuildRequires: python3-devel
%endif
%if 0%{?suse_version}
BuildRequires: fdupes
%endif
%define __python /usr/bin/python3
%description
Command-line tool to upload, retrieve and manage data in Yandex.Disk service
(https://disk.yandex.com), designed for use in scripts.
%prep
%setup -q -n ydcmd
%build
%install
install -d %{buildroot}%{_bindir}
install -d %{buildroot}%{python_sitelib}
%if 0%{?rhel}
sed -i -e 's|env python3|env python|g' ydcmd.py
%endif
install -m755 ydcmd.py %{buildroot}%{python_sitelib}/ydcmd.py
ln -s %{python_sitelib}/ydcmd.py %{buildroot}%{_bindir}/ydcmd
install -d %{buildroot}%{_mandir}/man1
install -d %{buildroot}%{_mandir}/ru/man1
install -d %{buildroot}%{_mandir}/tr/man1
install -m644 man/ydcmd.1 %{buildroot}%{_mandir}/man1/ydcmd.1
install -m644 man/ydcmd.ru.1 %{buildroot}%{_mandir}/ru/man1/ydcmd.1
install -m644 man/ydcmd.tr.1 %{buildroot}%{_mandir}/tr/man1/ydcmd.1
%if 0%{?suse_version}
%py3_compile -O %{buildroot}%{python_sitelib}
%fdupes %{buildroot}%{python_sitelib}
%endif
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%if 0%{?suse_version}
%dir %{_mandir}/tr
%dir %{_mandir}/tr/man1
%endif
%{_bindir}/ydcmd
%{python_sitelib}/ydcmd.py*
%if ! 0%{?rhel}
%{python_sitelib}/__pycache__/ydcmd.*
%endif
%doc %{_mandir}/man1/ydcmd.1*
%doc %{_mandir}/ru/man1/ydcmd.1*
%doc %{_mandir}/tr/man1/ydcmd.1*
%doc README.md README.en.md README.tr.md ydcmd.cfg
%changelog
* Mon Sep 23 2024 Anton Batenev <[email protected]> 2.12.2-1
- Initial RPM release