Description: Fix FTBFS due to version numbering
Author: ronys <ronys@pwsafe.org>
Origin: upstream, https://github.com/pwsafe/pwsafe/commit/eea4ef611110f34f184b8d49d1832beb2e0f5cec
Last-Update: 2016-03-12
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/Makefile.linux
+++ b/Makefile.linux
@@ -2,7 +2,8 @@
 # Toplevel Makefile for Linux build of PasswordSafe
 
 export VER_MAJOR := 0
-export VER_MINOR := 98.1
+export VER_MINOR := 98
+export VER_REV := 1
 export VER_SPECIAL := BETA
 
 # Since we use wxWidgets 3.x, while many distros still provide 2.8
--- a/src/ui/wxWidgets/Makefile
+++ b/src/ui/wxWidgets/Makefile
@@ -240,9 +240,13 @@ $(DEPDIR)/%.d: %.cpp version.h
 	$(RM) $@.$$$$
 
 version.h: always
-	@../../../Misc/mkversion.pl MAJOR=$(VER_MAJOR) MINOR=$(VER_MINOR) SPECIAL=$(VER_SPECIAL) \
-     version.in $@
-
+ifdef VER_REV
+	@../../../Misc/mkversion.pl MAJOR=$(VER_MAJOR) MINOR=$(VER_MINOR) REV=$(VER_REV) \
+															SPECIAL=$(VER_SPECIAL) version.in $@
+else
+	@../../../Misc/mkversion.pl MAJOR=$(VER_MAJOR) MINOR=$(VER_MINOR) \
+															SPECIAL=$(VER_SPECIAL) version.in $@
+endif
 -include $(SOURCES:%.cpp=$(DEPDIR)/%.d)
 
 
--- a/src/ui/wxWidgets/about.cpp
+++ b/src/ui/wxWidgets/about.cpp
@@ -328,7 +328,7 @@ void CAbout::CheckNewVersion()
   }
   stringT latest;
   if (status == CheckVersion::UP2DATE) {
-    CheckVersion cv(MAJORVERSION, MINORVERSION, 0);
+    CheckVersion cv(MAJORVERSION, MINORVERSION, REVISION);
     status = cv.CheckLatestVersion(latest_xml, latest);
   }
   m_newVerStatus->Clear();
--- a/src/ui/wxWidgets/pwsafeapp.cpp
+++ b/src/ui/wxWidgets/pwsafeapp.cpp
@@ -274,8 +274,6 @@ bool PwsafeApp::OnInit()
   wxFileSystem::AddHandler(new wxArchiveFSHandler);
 
   SetAppName(pwsafeAppName);
-  m_core.SetApplicationNameAndVersion(tostdstring(pwsafeAppName),
-                                      DWORD((MINORVERSION << 16) | MAJORVERSION));
   PWSprefs::SetReporter(&aReporter);
   PWScore::SetReporter(&aReporter);
   PWScore::SetAsker(&anAsker);
--- a/src/ui/wxWidgets/version.cpp
+++ b/src/ui/wxWidgets/version.cpp
@@ -17,12 +17,18 @@
 #endif
 
 const wxString pwsafeAppName(APPNAME);
-#ifndef _DEBUG
-const wxString pwsafeVersionString = wxString::Format(wxString(_T("v%d.%d (%ls) %ls")),
-                                                      MAJORVERSION, MINORVERSION,
-                                                      _T(VCS_VERSION), SPECIALBUILD);
+#ifdef _DEBUG
+const wchar_t *debstr = L"[debug] ";
+#else
+const wchar_t *debstr = L"";
+#endif
+
+#if defined(REVISION) && (REVISION != 0)
+const wxString pwsafeVersionString = wxString::Format(wxString(_T("v%d.%d.%d (%ls) %ls%ls")),
+                                                      MAJORVERSION, MINORVERSION, REVISION,
+                                                      _T(VCS_VERSION), debstr, SPECIALBUILD);
 #else
-const wxString pwsafeVersionString = wxString::Format(wxString(_T("v%d.%d (%ls) [debug] %ls")),
+const wxString pwsafeVersionString = wxString::Format(wxString(_T("v%d.%d (%ls) %ls%ls")),
                                                       MAJORVERSION, MINORVERSION,
-                                                      _T(VCS_VERSION), SPECIALBUILD);
+                                                      _T(VCS_VERSION), debstr, SPECIALBUILD);
 #endif
