[xdrawchem] - rebuild for new openbabel - fix source URL - add `0' to unnumbered source and patch - fix some com
Dominik Mierzejewski
rathann at fedoraproject.org
Thu Nov 25 00:33:23 UTC 2010
commit 149ccd2b5b006690d534df4d7fc6f6c825dd0e3d
Author: Dominik Mierzejewski <dominik at greysector.net>
Date: Thu Nov 25 01:32:09 2010 +0100
- rebuild for new openbabel
- fix source URL
- add `0' to unnumbered source and patch
- fix some compiler warnings
- use a nicer icon included in the sources, put it into hicolor icons
directory and add appropriate scriptlets and Requires:
- fix desktop file
xdrawchem-ob22.patch | 18 ++++++++++++++----
xdrawchem-warn.patch | 30 ++++++++++++++++++++++++++++++
xdrawchem.desktop | 2 +-
xdrawchem.png | Bin 803 -> 0 bytes
xdrawchem.spec | 37 ++++++++++++++++++++++++++++++-------
5 files changed, 75 insertions(+), 12 deletions(-)
---
diff --git a/xdrawchem-ob22.patch b/xdrawchem-ob22.patch
index f7f8bda..8edcc04 100644
--- a/xdrawchem-ob22.patch
+++ b/xdrawchem-ob22.patch
@@ -1,6 +1,7 @@
---- xdrawchem-1.9.9/xdrawchem/application_ob.cpp.ob 2005-11-30 12:47:14.000000000 +0900
-+++ xdrawchem-1.9.9/xdrawchem/application_ob.cpp 2008-05-20 20:50:07.000000000 +0900
-@@ -45,23 +45,38 @@
+diff -up xdrawchem-1.9.9/xdrawchem/application_ob.cpp.ob xdrawchem-1.9.9/xdrawchem/application_ob.cpp
+--- xdrawchem-1.9.9/xdrawchem/application_ob.cpp.ob 2005-11-30 04:47:14.000000000 +0100
++++ xdrawchem-1.9.9/xdrawchem/application_ob.cpp 2010-11-25 01:10:06.532000767 +0100
+@@ -45,23 +45,38 @@ void ApplicationWindow::OBGetFilters() {
readFilters.append(str1);
writeFilters.append(str1);
@@ -18,7 +19,7 @@
+ pFormat=Conv.FindFormat(pFormats[i].c_str());
+ if(!pFormat) continue;
+ if(pFormat->Flags() & NOTREADABLE)
-+ continue;
++ continue;
+ str1 = pFormats[i];
+ myext = str1.left( str1.find(" -- ") );
+ str1.append("(*.");
@@ -48,3 +49,12 @@
}
filters.sort();
+@@ -87,7 +102,7 @@ void ApplicationWindow::OBNewLoad(QStrin
+ OBFormat *inFormat = NULL;
+
+ if (infilter.left(2) == "--") {
+- inFormat = Conv.FormatFromExt(infile);
++ inFormat = Conv.FormatFromExt((const char *)infile);
+ if (inFormat == NULL) {
+ QMessageBox::warning( 0, tr("Could not determine file type"),
+ tr("Please select a file type from the list.") );
diff --git a/xdrawchem-warn.patch b/xdrawchem-warn.patch
new file mode 100644
index 0000000..f35ce94
--- /dev/null
+++ b/xdrawchem-warn.patch
@@ -0,0 +1,30 @@
+diff -up xdrawchem-1.9.9/xdrawchem/bracket.cpp.warn xdrawchem-1.9.9/xdrawchem/bracket.cpp
+--- xdrawchem-1.9.9/xdrawchem/bracket.cpp.warn 2005-06-09 20:23:57.000000000 +0200
++++ xdrawchem-1.9.9/xdrawchem/bracket.cpp 2010-11-25 01:15:32.843249035 +0100
+@@ -253,7 +253,10 @@ Drawable * Bracket::FindNearestObject(DP
+ dist = dist1;
+ else
+ dist = dist2;
+- delete tl, tr, bl, br;
++ delete tl;
++ delete tr;
++ delete bl;
++ delete br;
+ return this;
+ }
+
+diff -up xdrawchem-1.9.9/xdrawchem/gobject.cpp.warn xdrawchem-1.9.9/xdrawchem/gobject.cpp
+--- xdrawchem-1.9.9/xdrawchem/gobject.cpp.warn 2005-06-13 15:02:09.000000000 +0200
++++ xdrawchem-1.9.9/xdrawchem/gobject.cpp 2010-11-25 01:14:58.399000590 +0100
+@@ -227,7 +227,10 @@ Drawable * GraphicObject::FindNearestObj
+ dist = dist1;
+ else
+ dist = dist2;
+- delete tl, tr, bl, br;
++ delete tl;
++ delete tr;
++ delete bl;
++ delete br;
+ return this;
+ }
+
diff --git a/xdrawchem.desktop b/xdrawchem.desktop
index 1ba0ba6..3066a09 100644
--- a/xdrawchem.desktop
+++ b/xdrawchem.desktop
@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
Exec=xdrawchem
-Icon=xdrawchem.png
+Icon=xdrawchem
Comment=Chemical drawing.
Comment[da]=Tegning af kemiske stoffer.
Terminal=false
diff --git a/xdrawchem.spec b/xdrawchem.spec
index c90c2e3..1d8df09 100644
--- a/xdrawchem.spec
+++ b/xdrawchem.spec
@@ -1,12 +1,12 @@
Name: xdrawchem
Version: 1.9.9
-Release: 13%{?dist}
+Release: 14%{?dist}
Summary: 2D chemical structures drawing tool
-Source: http://dl.sourceforge.net/sourceforge/xdrawchem/%{name}-%{version}.tar.gz
+Source0: http://downloads.sourceforge.net/sourceforge/xdrawchem/%{name}-%{version}.tar.gz
Source1: %{name}.desktop
-Source2: %{name}.png
-Patch: %{name}-gcc43.patch
+Patch0: %{name}-gcc43.patch
Patch1: %{name}-ob22.patch
+Patch2: %{name}-warn.patch
URL: http://xdrawchem.sourceforge.net/
License: GPLv2+
Group: Applications/Engineering
@@ -14,6 +14,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: qt3-devel
BuildRequires: desktop-file-utils
BuildRequires: openbabel-devel
+Requires: hicolor-icon-theme
%description
XDrawChem is a two-dimensional molecule drawing program for Unix
@@ -24,8 +25,9 @@ XDrawChem and other chemistry applications.
%prep
%setup -q
-%patch -p1 -b .gcc43
+%patch0 -p1 -b .gcc43
%patch1 -p1 -b .ob
+%patch2 -p1 -b .warn
%build
%configure \
@@ -40,7 +42,7 @@ XDrawChem and other chemistry applications.
# menu
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
-install -c -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/pixmaps
+install -Dpm 644 ring/xdrawchem-icon.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps/xdrawchem.png
desktop-file-install --vendor fedora \
--dir $RPM_BUILD_ROOT%{_datadir}/applications \
%{SOURCE1}
@@ -49,15 +51,36 @@ rm -f $RPM_BUILD_ROOT%{_datadir}/xdrawchem/caslist.txt
%clean
rm -rf $RPM_BUILD_ROOT
+%post
+touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
+
+%postun
+if [ $1 -eq 0 ] ; then
+ touch --no-create %{_datadir}/icons/hicolor &>/dev/null
+ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
+fi
+
+%posttrans
+gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
+
%files
%defattr(644,root,root,755)
%doc HISTORY.txt GPL.txt README.txt TODO.txt
%attr(755,root,root) %{_bindir}/xdrawchem
%{_datadir}/xdrawchem
%{_datadir}/applications/*xdrawchem.desktop
-%{_datadir}/pixmaps/xdrawchem.png
+%{_datadir}/icons/hicolor/*/apps/xdrawchem.png
%changelog
+* Thu Nov 25 2010 Dominik Mierzejewski <rpm at greysector.net> 1.9.9-14
+- rebuild for new openbabel
+- fix source URL
+- add `0' to unnumbered source and patch
+- fix some compiler warnings
+- use a nicer icon included in the sources, put it into hicolor icons
+ directory and add appropriate scriptlets and Requires:
+- fix desktop file
+
* Mon Jul 27 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.9.9-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
More information about the scm-commits
mailing list