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