]> git.pld-linux.org Git - packages/pg_activity.git/blame - pg_activity.spec
Version 1.3.0-1. Enabled py3 build.
[packages/pg_activity.git] / pg_activity.spec
CommitLineData
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:
9%bcond_with doc # don't build doc
10%bcond_without tests # do not perform "make test"
11%bcond_without python2 # CPython 2.x module
ab906c73 12%bcond_without python3 # CPython 3.x module
d4085243
MK
13
14%define module pgactivity
15Summary: -
16Summary(pl.UTF-8): -
17# Name must match the python module/package name (as in 'import' statement)
18Name: pg_activity
ab906c73
MK
19Version: 1.3.0
20Release: 1
d4085243
MK
21License: distributable
22Group: Libraries/Python
23Source0: https://github.com/julmon/pg_activity/archive/v%{version}.tar.gz
ab906c73 24# Source0-md5: 88096354973c38761f056d04e550f58b
d4085243
MK
25URL: https://github.com/julmon/pg_activity
26BuildRequires: rpm-pythonprov
27# remove BR: python-devel for 'noarch' packages.
28# if py_postclean is used
29BuildRequires: rpmbuild(macros) >= 1.219
30# if py3* macros are used
31BuildRequires: rpmbuild(macros) >= 1.612
32# when using /usr/bin/env or other in-place substitutions
33#BuildRequires: sed >= 4.0
34# when python3 present
35%if %{with python2}
36BuildRequires: python-psutil
37BuildRequires: python-psycopg2 >= 2.2.1
38BuildRequires: python-setuptools
39%endif
40%if %{with python3}
41BuildRequires: python3-modules
42BuildRequires: python3-psutil
43BuildRequires: python3-psycopg2 >= 2.2.1
44BuildRequires: python3-setuptools
45%endif
46# Below Rs only work for main package (python2)
47#Requires: python-libs
48Requires: python-modules
ab906c73
MK
49Requires: python-psutil
50Requires: python-psycopg2
d4085243
MK
51BuildArch: noarch
52BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
53
54%description
55htop like application for PostgreSQL server activity monitoring
56
57%description -l pl.UTF-8
58Podobna do htop aplikacja monitorująca aktywność PostgresSQL
59
60%package -n python3-%{module}
61Summary: -
62Summary(pl.UTF-8): -
63Group: Libraries/Python
64Requires: python3-modules
ab906c73
MK
65Requires: python3-psutil
66Requires: python3-psycopg2
d4085243
MK
67
68%description -n python3-%{module}
69
70%description -n python3-%{module} -l pl.UTF-8
71
72%package apidocs
73Summary: %{module} API documentation
74Summary(pl.UTF-8): Dokumentacja API %{module}
75Group: Documentation
76
77%description apidocs
78API documentation for %{module}.
79
80%description apidocs -l pl.UTF-8
81Dokumentacja API %{module}.
82
83%prep
84# %setup -q -n %{module}-%{version}
85%setup -q
86
87# setup copy of source in py3 dir
88set -- *
89install -d py3
90cp -a "$@" py3
91
92%build
93%if %{with python2}
94%{__python} setup.py build --build-base build-2 %{?with_tests:test} --with-man
95%endif
96
97%if %{with python3}
98%{__python3} setup.py build --build-base build-3 %{?with_tests:test} --with-man
99%endif
100
101%if %{with doc}
102cd docs
103%{__make} -j1 html
104rm -rf _build/html/_sources
105%endif
106
107%install
108rm -rf $RPM_BUILD_ROOT
109
110%if %{with python2}
111%{__python} setup.py \
112 build --build-base build-2 \
113 install --skip-build \
114 --optimize=2 \
115 --root=$RPM_BUILD_ROOT
116
117%py_postclean
118%endif
119
120%if %{with python3}
121%{__python3} setup.py \
122 build --build-base build-3 \
123 install --skip-build \
124 --optimize=2 \
125 --root=$RPM_BUILD_ROOT
126%endif
127
128
129%clean
130rm -rf $RPM_BUILD_ROOT
131
132%if %{with python2}
133%files
134%defattr(644,root,root,755)
135%doc README.md docs
136%dir %{py_sitescriptdir}/%{module}
137%{py_sitescriptdir}//%{module}/*.py[co]
138%attr(755,root,root) %{_bindir}/pg_activity
139%if "%{py_ver}" > "2.4"
140%{py_sitescriptdir}/%{name}-%{version}-py*.egg-info
141%endif
142%endif
143
144%if %{with python3}
145%files -n python3-%{module}
146%defattr(644,root,root,755)
147%doc README.md docs
148%{py3_sitescriptdir}/%{module}
ab906c73 149%{py3_sitescriptdir}/%{name}-%{version}-py*.egg-info
d4085243
MK
150%endif
151
152%if %{with doc}
153%files apidocs
154%defattr(644,root,root,755)
155%doc docs/_build/html/*
156%endif
This page took 1.735656 seconds and 4 git commands to generate.