diff --git a/description-nwdiag.txt b/description-nwdiag.txt deleted file mode 100644 index 37fe818..0000000 --- a/description-nwdiag.txt +++ /dev/null @@ -1,15 +0,0 @@ -nwdiag and its family generate diagram images from simply text file. - -Features: -- Generates beautiful diagram images from simple text format (similar to - graphviz’s DOT format) -- Layouts diagram elements automatically -- Embeds to many documentations; Sphinx, Trac, Redmine and some wikis - -- Supports many types of diagrams - - logical network diagram (with this package) - - block diagram (with the blockdiag package) - - sequence diagram (with the seqdiag package) - - activity diagram (with the actdiag package) - -Enjoy documentation with nwdiag ! diff --git a/python-nwdiag.spec b/python-nwdiag.spec index cee026a..0bfefa9 100644 --- a/python-nwdiag.spec +++ b/python-nwdiag.spec @@ -1,124 +1,92 @@ -%global owner tk0miya -%global srcname nwdiag -%global tag %{version} -%global commit 8e6ff6bf2dd1279f863f19ca27d7e35ad0393f6a -%global shortcommit %(c=%{commit}; echo ${c:0:12}) +%global srcname nwdiag +%global srcdesc \ +nwdiag and its family generate diagram images from simply text file.\ +\ +Features:\ +- Generates beautiful diagram images from simple text format (similar to\ + graphviz’s DOT format)\ +- Layouts diagram elements automatically\ +- Embeds to many documentations; Sphinx, Trac, Redmine and some wikis\ +\ +- Supports many types of diagrams\ + - logical network diagram (with this package)\ + - block diagram (with the blockdiag package)\ + - sequence diagram (with the seqdiag package)\ + - activity diagram (with the actdiag package)\ +\ +Enjoy documentation with nwdiag ! Name: python-%{srcname} Version: 1.0.4 -Release: 12%{?dist} +Release: 13%{?dist} Summary: nwdiag generates network-diagram images from text License: ASL 2.0 URL: http://blockdiag.com/ -Source0: https://pypi.python.org/packages/source/a/%{srcname}/%{srcname}-%{version}.tar.gz -Source1: description-%{srcname}.txt +Source: %pypi_source BuildArch: noarch -BuildRequires: python2-devel -BuildRequires: python2-blockdiag-devel -BuildRequires: python2-docutils -BuildRequires: python2-nose -BuildRequires: python2-pep8 -BuildRequires: python2-pillow -BuildRequires: python2-reportlab -BuildRequires: python2-setuptools - -BuildRequires: python3-blockdiag-devel BuildRequires: python3-devel -BuildRequires: python3-docutils -BuildRequires: python3-nose -BuildRequires: python3-pep8 -BuildRequires: python3-pillow -BuildRequires: python3-reportlab -BuildRequires: python3-setuptools - - -%global _description\ -%(cat %{SOURCE1}) - +BuildRequires: python3-blockdiag-devel +BuildRequires: %{py3_dist docutils} +BuildRequires: %{py3_dist nose} +BuildRequires: %{py3_dist pep8} +BuildRequires: %{py3_dist pillow} +BuildRequires: %{py3_dist reportlab} +BuildRequires: %{py3_dist setuptools} -%description %_description -%package -n python2-%{srcname} -Summary: %summary -Requires: python2-blockdiag -%{?python_provide:%python_provide python2-%{srcname}} +%description %{srcdesc} -%description -n python2-%{srcname} %_description %package -n python3-%{srcname} Summary: %{summary} -Requires: python3-blockdiag %{?python_provide:%python_provide python3-%{srcname}} -%description -n python3-%{srcname} %_description + +%description -n python3-%{srcname} %{srcdesc} + %prep -%setup -qn %{srcname}-%{version} +%autosetup -n %{srcname}-%{version} # Upstream dropped pep8 tests, they are no longer maintained: # https://bitbucket.org/blockdiag/nwdiag/commits/54c1f2b3b8af58034aea21a2401822a59d44f9fc rm src/*/tests/test_pep8.py -rm -rf %{py3dir} -cp -a . %{py3dir} - -find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' -find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|' - %build -%{__python2} setup.py build - -pushd %{py3dir} -%{__python3} setup.py build -popd +%py3_build %install -pushd %{py3dir} -%{__python3} setup.py install -O1 --skip-build --root %{buildroot} -mv %{buildroot}%{_bindir}/%{srcname} %{buildroot}%{_bindir}/%{srcname}-%{python3_version} -mv %{buildroot}%{_bindir}/packetdiag %{buildroot}%{_bindir}/packetdiag-%{python3_version} -mv %{buildroot}%{_bindir}/rackdiag %{buildroot}%{_bindir}/rackdiag-%{python3_version} -install -m 0644 -D %{srcname}.1 %{buildroot}%{_mandir}/man1/%{srcname}-%{python3_version}.1 -install -m 0644 -D packetdiag.1 %{buildroot}%{_mandir}/man1/packetdiag-%{python3_version}.1 -install -m 0644 -D rackdiag.1 %{buildroot}%{_mandir}/man1/rackdiag-%{python3_version}.1 -popd - -%{__python2} setup.py install -O1 --skip-build --root %{buildroot} +%py3_install install -m 0644 -D %{srcname}.1 %{buildroot}%{_mandir}/man1/%{srcname}.1 install -m 0644 -D packetdiag.1 %{buildroot}%{_mandir}/man1/packetdiag.1 install -m 0644 -D rackdiag.1 %{buildroot}%{_mandir}/man1/rackdiag.1 %check -%{__python2} setup.py test - -pushd %{py3dir} %{__python3} setup.py test -popd - - -%files -n python2-%{srcname} -%doc LICENSE -%{_bindir}/*diag -%{_mandir}/man1/*diag.1* -%{python2_sitelib}/* -%exclude %{python2_sitelib}/*/tests %files -n python3-%{srcname} -%doc LICENSE -%{_bindir}/*-%{python3_version} -%{_mandir}/man1/*-%{python3_version}.1* +%license LICENSE +%doc PKG-INFO README.rst +%{_bindir}/* +%{_mandir}/man1/*.1* %{python3_sitelib}/__pycache__/* %{python3_sitelib}/*diag* %exclude %{python3_sitelib}/*/tests %changelog +* Tue Feb 05 2019 Dridi Boukelmoune - 1.0.4-13 +- Catch up with packaging guidelines +- In general, use recommended RPM macros +- Drop the Python 2 package +- Inline package description + * Sat Feb 02 2019 Fedora Release Engineering - 1.0.4-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild @@ -154,7 +122,7 @@ popd * Tue Jul 19 2016 Fedora Release Engineering - 1.0.4-2 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages -* Mon Feb 22 2016 Dridi Boukelmoune - 1.0.4-1 +* Mon Feb 22 2016 Dridi Boukelmoune - 1.0.4-1 - Bumped to 1.0.4 * Thu Feb 04 2016 Fedora Release Engineering - 1.0.0-7 @@ -172,11 +140,11 @@ popd * Mon May 19 2014 Bohuslav Kabrda - 1.0.0-3 - Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4 -* Tue Mar 04 2014 Dridi Boukelmoune - 1.0.0-2 +* Tue Mar 04 2014 Dridi Boukelmoune - 1.0.0-2 - Fixed changelog format. - Fixed man page permissions. - Added missing man pages. - Avoid co-ownership of %%{python3_sitelib}/__pycache__/. -* Sun Mar 02 2014 Dridi Boukelmoune - 1.0.0-1 +* Sun Mar 02 2014 Dridi Boukelmoune - 1.0.0-1 - Initial version.