]>
Commit | Line | Data |
---|---|---|
d4085243 | 1 | # TODO: |
d4085243 MK |
2 | # Move man dir to proper place ? |
3 | ||
4 | # NOTE: | |
ab906c73 MK |
5 | # Not sure if should be build as separate packages for py 3.x / 2.x with different binaries? Same conflicting binaries? |
6 | # Are modules used by other soft? If not, just switch to py 3.x ? | |
d4085243 MK |
7 | |
8 | # Conditional build: | |
d4085243 MK |
9 | %bcond_without tests # do not perform "make test" |
10 | %bcond_without python2 # CPython 2.x module | |
ab906c73 | 11 | %bcond_without python3 # CPython 3.x module |
d4085243 | 12 | |
a1c7cd73 | 13 | %define module pgactivity |
c48ae21a | 14 | Summary: A top like application for PostgreSQL server activity monitoring |
d4085243 | 15 | Name: pg_activity |
ab906c73 | 16 | Version: 1.3.0 |
a1c7cd73 | 17 | Release: 3 |
d4085243 MK |
18 | License: distributable |
19 | Group: Libraries/Python | |
20 | Source0: https://github.com/julmon/pg_activity/archive/v%{version}.tar.gz | |
ab906c73 | 21 | # Source0-md5: 88096354973c38761f056d04e550f58b |
d4085243 MK |
22 | URL: https://github.com/julmon/pg_activity |
23 | BuildRequires: rpm-pythonprov | |
ba3901fe | 24 | BuildRequires: rpmbuild(macros) >= 1.710 |
d4085243 MK |
25 | # when using /usr/bin/env or other in-place substitutions |
26 | #BuildRequires: sed >= 4.0 | |
27 | # when python3 present | |
28 | %if %{with python2} | |
29 | BuildRequires: python-psutil | |
30 | BuildRequires: python-psycopg2 >= 2.2.1 | |
31 | BuildRequires: python-setuptools | |
32 | %endif | |
33 | %if %{with python3} | |
34 | BuildRequires: python3-modules | |
35 | BuildRequires: python3-psutil | |
36 | BuildRequires: python3-psycopg2 >= 2.2.1 | |
37 | BuildRequires: python3-setuptools | |
38 | %endif | |
39 | # Below Rs only work for main package (python2) | |
d4085243 | 40 | Requires: python-modules |
ab906c73 MK |
41 | Requires: python-psutil |
42 | Requires: python-psycopg2 | |
d4085243 MK |
43 | BuildArch: noarch |
44 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
45 | ||
46 | %description | |
47 | htop like application for PostgreSQL server activity monitoring | |
48 | ||
49 | %description -l pl.UTF-8 | |
50 | Podobna do htop aplikacja monitorująca aktywność PostgresSQL | |
51 | ||
52 | %package -n python3-%{module} | |
53 | Summary: - | |
54 | Summary(pl.UTF-8): - | |
55 | Group: Libraries/Python | |
56 | Requires: python3-modules | |
ab906c73 MK |
57 | Requires: python3-psutil |
58 | Requires: python3-psycopg2 | |
d4085243 MK |
59 | |
60 | %description -n python3-%{module} | |
61 | ||
62 | %description -n python3-%{module} -l pl.UTF-8 | |
63 | ||
64 | %package apidocs | |
65 | Summary: %{module} API documentation | |
66 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
67 | Group: Documentation | |
68 | ||
69 | %description apidocs | |
70 | API documentation for %{module}. | |
71 | ||
72 | %description apidocs -l pl.UTF-8 | |
73 | Dokumentacja API %{module}. | |
74 | ||
75 | %prep | |
d4085243 MK |
76 | %setup -q |
77 | ||
d4085243 MK |
78 | %build |
79 | %if %{with python2} | |
ba3901fe | 80 | %py_build |
d4085243 MK |
81 | %endif |
82 | ||
83 | %if %{with python3} | |
ba3901fe | 84 | %py3_build |
d4085243 MK |
85 | %endif |
86 | ||
87 | %if %{with doc} | |
88 | cd docs | |
89 | %{__make} -j1 html | |
90 | rm -rf _build/html/_sources | |
91 | %endif | |
92 | ||
93 | %install | |
94 | rm -rf $RPM_BUILD_ROOT | |
a1c7cd73 JR |
95 | %if %{with python3} |
96 | %py3_install | |
97 | %endif | |
98 | ||
d4085243 | 99 | %if %{with python2} |
a1c7cd73 | 100 | rm -r $RPM_BUILD_ROOT%{_bindir} |
ba3901fe | 101 | %py_install |
d4085243 MK |
102 | %py_postclean |
103 | %endif | |
d4085243 | 104 | |
d4085243 MK |
105 | %clean |
106 | rm -rf $RPM_BUILD_ROOT | |
107 | ||
108 | %if %{with python2} | |
109 | %files | |
110 | %defattr(644,root,root,755) | |
c48ae21a ER |
111 | %doc README.md |
112 | %attr(755,root,root) %{_bindir}/pg_activity | |
d4085243 MK |
113 | %dir %{py_sitescriptdir}/%{module} |
114 | %{py_sitescriptdir}//%{module}/*.py[co] | |
d4085243 MK |
115 | %{py_sitescriptdir}/%{name}-%{version}-py*.egg-info |
116 | %endif | |
d4085243 MK |
117 | |
118 | %if %{with python3} | |
119 | %files -n python3-%{module} | |
120 | %defattr(644,root,root,755) | |
121 | %doc README.md docs | |
122 | %{py3_sitescriptdir}/%{module} | |
ab906c73 | 123 | %{py3_sitescriptdir}/%{name}-%{version}-py*.egg-info |
d4085243 MK |
124 | %endif |
125 | ||
126 | %if %{with doc} | |
127 | %files apidocs | |
128 | %defattr(644,root,root,755) | |
129 | %doc docs/_build/html/* | |
130 | %endif |