diff --git a/.gitignore b/.gitignore index fbf951d..6d83807 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ /tracer-0.6.9.tar.gz /tracer-0.6.10.tar.gz /tracer-0.6.11.tar.gz +/tracer-0.6.12.tar.gz diff --git a/sources b/sources index e3c3a3a..6618fd4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c0e1b2293e1539b92835118a04608a96 tracer-0.6.11.tar.gz +cc7b2f5667a940c07401d8da9f8b0dcf tracer-0.6.12.tar.gz diff --git a/tracer.spec b/tracer.spec index acb3129..225408f 100644 --- a/tracer.spec +++ b/tracer.spec @@ -1,11 +1,16 @@ +%if 0%{?rhel} && 0%{?rhel} <= 7 +%bcond_with python3 +%else +%bcond_without python3 +%endif + Name: tracer -Version: 0.6.11 +Version: 0.6.12 Release: 1%{?dist} Summary: Finds outdated running applications in your system BuildArch: noarch -Group: Applications/System -License: GPLv2 +License: GPLv2+ URL: http://tracer-package.com/ # Sources can be obtained by # git clone git@github.com:FrostyX/tracer.git @@ -13,119 +18,126 @@ URL: http://tracer-package.com/ # tito build --tgz Source0: %{name}-%{version}.tar.gz -BuildRequires: python2-devel -BuildRequires: python3-devel BuildRequires: asciidoc BuildRequires: gettext +%global _description \ +Tracer determines which applications use outdated files and prints them. For\ +special kind of applications such as services or daemons, it suggests a standard\ +command to restart it. Detecting whether file is outdated or not is based on a\ +simple idea. If application has loaded in memory any version of a file\ +which is provided by any package updated since system was booted up, tracer\ +consider this application as outdated. + +%description %{_description} + +%package common +Summary: Common files for %{name} + +%description common +%{summary}. + %package -n python2-%{name} Summary: %{summary} +%if ! %{with python3} Provides: %{name} = %{version}-%{release} -Obsoletes: %{name} <= %{version}-%{release} +Obsoletes: %{name} <= 0.6.11 +%endif +BuildRequires: python2-devel BuildRequires: python-sphinx BuildRequires: python-beautifulsoup4 BuildRequires: python-psutil BuildRequires: python-pygments BuildRequires: python-lxml Requires: rpm-python -Requires: python Requires: python-beautifulsoup4 Requires: python-psutil %{?python_provide:%python_provide python2-%{name}} +%description -n python2-%{name} %{_description} + +Python 2 version. + +%if %{with python3} %package -n python3-%{name} Summary: %{summary} +BuildRequires: python3-devel BuildRequires: python3-sphinx BuildRequires: python3-beautifulsoup4 BuildRequires: python3-psutil BuildRequires: python3-pygments BuildRequires: python3-lxml Requires: rpm-python3 -Requires: python3 Requires: python3-beautifulsoup4 Requires: python3-psutil %{?python_provide:%python_provide python3-%{name}} +Provides: %{name} = %{version}-%{release} +Obsoletes: %{name} <= 0.6.11 +%description -n python3-%{name} %{_description} -%description -Tracer determines which applications use outdated files and prints them. For -special kind of applications such as services or daemons, it suggests a standard -command to restart it. Detecting whether file is outdated or not is based on a -simple idea. If application has loaded in memory any version of a file -which is provided by any package updated since system was booted up, tracer -consider this application as outdated. - -%description -n python2-%{name} -Tracer determines which applications use outdated files and prints them. For -special kind of applications such as services or daemons, it suggests a standard -command to restart it. Detecting whether file is outdated or not is based on a -simple idea. If application has loaded in memory any version of a file -which is provided by any package updated since system was booted up, tracer -consider this application as outdated. - -%description -n python3-%{name} -Tracer determines which applications use outdated files and prints them. For -special kind of applications such as services or daemons, it suggests a standard -command to restart it. Detecting whether file is outdated or not is based on a -simple idea. If application has loaded in memory any version of a file -which is provided by any package updated since system was booted up, tracer -consider this application as outdated. - +Python 3 version. +%endif %prep %setup -q - +%if %{with python3} +sed -i -e '1s|^#!.*$|#!%{__python3}|' bin/%{name}.py +%else +sed -i -e '1s|^#!.*$|#!%{__python2}|' bin/%{name}.py +%endif %build %py2_build +%if %{with python3} %py3_build +%endif make %{?_smp_mflags} man -sed "s/\/usr\/bin\/python/\/usr\/bin\/python2/" bin/tracer.py > bin/tracer-2 -sed "s/\/usr\/bin\/python/\/usr\/bin\/python3/" bin/tracer.py > bin/tracer-3 -chmod +x bin/tracer-2 bin/tracer-3 - %install # @TODO use following macros # %%py2_install # %%py3_install -mkdir -p %{buildroot}/%{_bindir} -mkdir -p %{buildroot}/%{_datadir}/tracer -mkdir -p %{buildroot}/%{_mandir}/man8 -mkdir -p %{buildroot}/%{python2_sitelib}/tracer -mkdir -p %{buildroot}/%{python3_sitelib}/tracer -cp -a bin/tracer-2 %{buildroot}/%{_bindir}/ -cp -a bin/tracer-3 %{buildroot}/%{_bindir}/ -ln -s %{_bindir}/tracer-2 %{buildroot}/%{_bindir}/tracer +mkdir -p %{buildroot}%{_datadir}/%{name}/ +cp -a data/* %{buildroot}%{_datadir}/%{name}/ -cp -a data/* %{buildroot}/%{_datadir}/tracer/ -cp -ar tracer/* tests %{buildroot}/%{python2_sitelib}/tracer/ -cp -ar tracer/* tests %{buildroot}/%{python3_sitelib}/tracer/ -install -m644 doc/build/man/tracer.8 %{buildroot}/%{_mandir}/man8/ -make DESTDIR=%{buildroot}/usr/share/ mo +mkdir -p %{buildroot}%{python2_sitelib}/%{name}/ +cp -ar %{name}/* tests %{buildroot}%{python2_sitelib}/%{name}/ +%if %{with python3} +mkdir -p %{buildroot}%{python3_sitelib}/%{name}/ +cp -ar %{name}/* tests %{buildroot}%{python3_sitelib}/%{name}/ +%endif + +install -Dpm0755 bin/%{name}.py %{buildroot}%{_bindir}/%{name} +install -Dpm0644 doc/build/man/%{name}.8 %{buildroot}%{_mandir}/man8/%{name}.8 + +make DESTDIR=%{buildroot}%{_datadir} mo %find_lang %{name} - -%files -n python2-%{name} -f %{name}.lang +%files common -f %{name}.lang %license LICENSE %doc README.md -%{python2_sitelib}/tracer -%{_bindir}/tracer-2 -%{_bindir}/tracer -%{_datadir}/tracer/ -%doc %{_mandir}/man8/tracer.8* +%{_datadir}/%{name}/ -%files -n python3-%{name} -f %{name}.lang -%license LICENSE -%doc README.md -%{python3_sitelib}/tracer -%{_bindir}/tracer-3 -%{_datadir}/tracer/ -%doc %{_mandir}/man8/tracer.8* +%files -n python2-%{name} +%{python2_sitelib}/%{name}/ + +%if %{with python3} +%files -n python3-%{name} +%{python3_sitelib}/%{name}/ +%endif + +%{_bindir}/%{name} +%{_mandir}/man8/%{name}.8* %changelog +* Sun Nov 06 2016 Jakub Kadlčík 0.6.12-1 +- Add Vagrantfile for more convenient testing (frostyx@email.cz) +- Recommend systemctl instead of service on systemd machines (seanokeeffe797@gmail.com) +- Implement --now and --packages as API Query methods (frostyx@email.cz) +- Improve support for python applications (Fix #64) (frostyx@email.cz) * Sat Aug 06 2016 Jakub Kadlčík 0.6.11-1 - Release even for F25 (frostyx@email.cz) - Obsolete old tracer version (frostyx@email.cz)