]> git.pld-linux.org Git - packages/pg_activity.git/blob - pg_activity.spec
- make sure installs are consistent and macthing internal deps
[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? If not, just switch to py 3.x ?
7
8 # Conditional build:
9 %bcond_without  tests   # do not perform "make test"
10 %bcond_without  python2 # CPython 2.x module
11 %bcond_without  python3 # CPython 3.x module
12
13 %define         module  pgactivity
14 Summary:        A top like application for PostgreSQL server activity monitoring
15 Name:           pg_activity
16 Version:        1.3.0
17 Release:        3
18 License:        distributable
19 Group:          Libraries/Python
20 Source0:        https://github.com/julmon/pg_activity/archive/v%{version}.tar.gz
21 # Source0-md5:  88096354973c38761f056d04e550f58b
22 URL:            https://github.com/julmon/pg_activity
23 BuildRequires:  rpm-pythonprov
24 BuildRequires:  rpmbuild(macros) >= 1.710
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)
40 Requires:       python-modules
41 Requires:       python-psutil
42 Requires:       python-psycopg2
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
57 Requires:       python3-psutil
58 Requires:       python3-psycopg2
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
76 %setup -q
77
78 %build
79 %if %{with python2}
80 %py_build
81 %endif
82
83 %if %{with python3}
84 %py3_build
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
95 %if %{with python3}
96 %py3_install
97 %endif
98
99 %if %{with python2}
100 rm -r $RPM_BUILD_ROOT%{_bindir}
101 %py_install
102 %py_postclean
103 %endif
104
105 %clean
106 rm -rf $RPM_BUILD_ROOT
107
108 %if %{with python2}
109 %files
110 %defattr(644,root,root,755)
111 %doc README.md
112 %attr(755,root,root) %{_bindir}/pg_activity
113 %dir %{py_sitescriptdir}/%{module}
114 %{py_sitescriptdir}//%{module}/*.py[co]
115 %{py_sitescriptdir}/%{name}-%{version}-py*.egg-info
116 %endif
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}
123 %{py3_sitescriptdir}/%{name}-%{version}-py*.egg-info
124 %endif
125
126 %if %{with doc}
127 %files apidocs
128 %defattr(644,root,root,755)
129 %doc docs/_build/html/*
130 %endif
This page took 0.096288 seconds and 4 git commands to generate.