From 6a20953757e1f8aca34234b09d9d36836c8f96f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Sun, 6 Mar 2011 17:20:42 +0100 Subject: [PATCH] Add Debian packaging --- ChangeLog | 3 ++- INSTALL | 6 +++--- Makefile | 24 ++++++++++++++-------- README | 2 +- README.fr | 2 +- TODO | 2 +- debian/Makefile | 24 ++++++++++++++-------- debian/control | 8 ++++---- debian/dirs | 1 - debian/docs | 3 +++ debian/files | 1 - debian/kisscount-install | 1 - debian/kisscount.manpages | 1 + debian/rules | 1 - kc.1 | 35 +++++++++++++++++++++++++++++++++ init.sql => ressources/init.sql | 0 src/model/Database.h | 2 +- src/view/SupportedLanguages.h | 2 +- src/view/view.h | 20 ++++++++++--------- src/view/wxUI.cpp | 4 ++-- tools/launch_kc.sh | 4 ---- tools/package.sh | 4 ++-- 22 files changed, 100 insertions(+), 50 deletions(-) delete mode 100644 debian/dirs delete mode 100644 debian/files delete mode 100644 debian/kisscount-install create mode 100644 debian/kisscount.manpages create mode 100644 kc.1 rename init.sql => ressources/init.sql (100%) mode change 100755 => 100644 delete mode 100755 tools/launch_kc.sh diff --git a/ChangeLog b/ChangeLog index 842186c..b36a622 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -v0.2_dev (19/02/2011) +v0.2 (06/03/2011) ** User ** Better use of sizers (so better interface!) @@ -13,6 +13,7 @@ v0.2_dev (19/02/2011) Default categories in native language (even if switching language at runtime) Add Real mode Database is now at ~/.kisscount/kc.bdd + Add Debian's packages !! ** Dev ** Use a factory to create panels (prepare for plug-in) diff --git a/INSTALL b/INSTALL index 794d553..aa12c3d 100644 --- a/INSTALL +++ b/INSTALL @@ -26,9 +26,9 @@ cd - ** Compilation of KissCount ** +make clean make - +sudo make install ** Execution ** -export LD_LIBRARY_PATH=$PWD/lib/freechart/lib:$PWD/lib/wxsqlite3-1.9.9/lib/ -./kc +kc diff --git a/Makefile b/Makefile index d845dc0..314290c 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,14 @@ +LIB_DIR=$(DESTDIR)"/usr/lib/kisscount/" +SHARE_DIR=$(DESTDIR)"/usr/share/kisscount/" +DOC_DIR=$(DESTDIR)"/usr/share/doc/kisscount/" +BIN_DIR=$(DESTDIR)"/usr/bin/" + CXXFLAGS+=`wx-config --cxxflags` -Wall -Isrc -ggdb CXXFLAGS+=-I./lib/wxsqlite3-1.9.9/include CXXFLAGS+=-I./lib/freechart/include +CXXFLAGS+=-Wl,--rpath,"$(LIB_DIR)" +CXXFLAGS+=-DRESSOURCES_ROOT="\"$(SHARE_DIR)\"" +#CXXFLAGS+=-DRESSOURCES_ROOT="\"./ressources/\"" LDFLAGS+=`wx-config --libs` ifdef WIN32 @@ -51,11 +59,11 @@ package: endif install: - mkdir -p $(DESTDIR)/usr/lib/kisscount/ - mkdir -p $(DESTDIR)/usr/bin - cp kc $(DESTDIR)/usr/lib/kisscount/ - cp -r lib/freechart/lib/*.so* lib/wxsqlite3-1.9.9/lib/*.so* $(DESTDIR)/usr/lib/kisscount/ - cp tools/launch_kc.sh $(DESTDIR)/usr/lib/kisscount/ - cp -r ressources $(DESTDIR)/usr/lib/kisscount/ - cp init.sql $(DESTDIR)/usr/lib/kisscount/ - ln -s $(DESTDIR)/usr/lib/kisscount/launch_kc.sh $(DESTDIR)/usr/bin/kc + mkdir -p $(LIB_DIR) $(BIN_DIR) $(SHARE_DIR) $(DOC_DIR) + cp kc $(BIN_DIR) + cp -rf lib/*.so* $(LIB_DIR) + cp -rf ressources/* $(SHARE_DIR) + cp -rf README* ChangeLog CONTRIBUTORS COPYING TODO $(DOC_DIR) + +remove: + rm -rf $(LIB_DIR) $(SHARE_DIR) $(DOC_DIR) $(BIN_DIR)/kc diff --git a/README b/README index de07df8..816937c 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ KissCount is personnal account software delivered under GPL v3 licence terms. -Current version is 0.1 +Current version is 0.2 wxWidgets 2.8 and sqlite3 are needed diff --git a/README.fr b/README.fr index d352efa..9c2b61c 100644 --- a/README.fr +++ b/README.fr @@ -1,6 +1,6 @@ KissCount est un logiciel de gestion de comptes personnels délivré sous licence GPL v3 -La version actuelle est 0.1 +La version actuelle est 0.2 wxWidgets 2.8 et sqlite3 sont nécessaires diff --git a/TODO b/TODO index 3561de6..a3e3a44 100644 --- a/TODO +++ b/TODO @@ -5,7 +5,6 @@ Auto completion (already up into wxwidgets 2.9) Using tabulation to navigate throw interface (Search Panel) Can type a letter with a comboboxes Windows version -Need packaging (.deb) Real mode Choosing accounts & categories position @@ -14,6 +13,7 @@ Database auto saving at startup Use caches for created panels (avoid destroying/creating panels for nothing) Add search function to web view Need optimizations by caching operations and categories (using hastables) +Packaging for more distributions =============================================================== Next version diff --git a/debian/Makefile b/debian/Makefile index f1aedfa..76a2bc2 100644 --- a/debian/Makefile +++ b/debian/Makefile @@ -1,6 +1,14 @@ +LIB_DIR=$(DESTDIR)"/usr/lib/kisscount/" +SHARE_DIR=$(DESTDIR)"/usr/share/kisscount/" +DOC_DIR=$(DESTDIR)"/usr/share/doc/kisscount/" +BIN_DIR=$(DESTDIR)"/usr/bin/" + CXXFLAGS+=`wx-config --cxxflags` -Wall -Isrc -ggdb CXXFLAGS+=-I./lib/wxsqlite3-1.9.9/include CXXFLAGS+=-I./lib/freechart/include +CXXFLAGS+=-Wl,--rpath,"$(LIB_DIR)" +CXXFLAGS+=-DRESSOURCES_ROOT="\"$(SHARE_DIR)\"" +#CXXFLAGS+=-DRESSOURCES_ROOT="\"./ressources/\"" LDFLAGS+=`wx-config --libs` ifdef WIN32 @@ -54,11 +62,11 @@ package: endif install: - mkdir -p $(DESTDIR)/usr/lib/kisscount/ - mkdir -p $(DESTDIR)/usr/bin - cp kc $(DESTDIR)/usr/lib/kisscount/ - cp -r ressources $(DESTDIR)/usr/lib/kisscount/ - cp -r lib/*.so* $(DESTDIR)/usr/lib/kisscount/ - cp tools/launch_kc.sh $(DESTDIR)/usr/lib/kisscount/ - cp init.sql $(DESTDIR)/usr/lib/kisscount/ - ln -s $(DESTDIR)/usr/lib/kisscount/launch_kc.sh $(DESTDIR)/usr/bin/kc + mkdir -p $(LIB_DIR) $(BIN_DIR) $(SHARE_DIR) $(DOC_DIR) + cp kc $(BIN_DIR) + cp -rf lib/*.so* $(LIB_DIR) + cp -rf ressources/* $(SHARE_DIR) + cp -rf README* ChangeLog CONTRIBUTORS TODO $(DOC_DIR) + +remove: + rm -rf $(LIB_DIR) $(SHARE_DIR) $(DOC_DIR) $(BIN_DIR)/kc diff --git a/debian/control b/debian/control index 7e56d22..ed6d6f2 100644 --- a/debian/control +++ b/debian/control @@ -5,12 +5,12 @@ Maintainer: Grégory Soutadé Build-Depends: debhelper (>= 7.0.50~), libsqlite3-dev, libwxgtk2.8-dev (>= 2.8.10) Standards-Version: 3.9.1 Homepage: http://indefero.soutade.fr/p/kisscount/ -#Vcs-Git: git://git.debian.org/collab-maint/kisscount.git -#Vcs-Browser: http://git.debian.org/?p=collab-maint/kisscount.git;a=summary +Vcs-Git: git://soutade.fr/kisscount.git +Vcs-Browser: http://indefero.soutade.fr/p/kisscount/source/tree/master/ Package: kisscount -Architecture: amd64 -Depends: ${misc:Depends} +Architecture: any +Depends: ${shlibs:Depends} ${misc:Depends} Description: Personal accounting software KissCount is a personal accounting software. It focuses on simplicity and everyday diff --git a/debian/dirs b/debian/dirs deleted file mode 100644 index f03a978..0000000 --- a/debian/dirs +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/kisscount \ No newline at end of file diff --git a/debian/docs b/debian/docs index dccc5d8..c2788bf 100644 --- a/debian/docs +++ b/debian/docs @@ -1,2 +1,5 @@ README README.fr +ChangeLog +TODO +CONTRIBUTORS diff --git a/debian/files b/debian/files deleted file mode 100644 index 78c876a..0000000 --- a/debian/files +++ /dev/null @@ -1 +0,0 @@ -kisscount_0.2-1_amd64.deb misc extra diff --git a/debian/kisscount-install b/debian/kisscount-install deleted file mode 100644 index 064631e..0000000 --- a/debian/kisscount-install +++ /dev/null @@ -1 +0,0 @@ -usr/bin/kc diff --git a/debian/kisscount.manpages b/debian/kisscount.manpages new file mode 100644 index 0000000..3a00e83 --- /dev/null +++ b/debian/kisscount.manpages @@ -0,0 +1 @@ +kc.1 \ No newline at end of file diff --git a/debian/rules b/debian/rules index d9e62e5..bb5c21c 100755 --- a/debian/rules +++ b/debian/rules @@ -25,4 +25,3 @@ export DH_VERBOSE=1 # install: # $(MAKE) install DESTDIR=$(CURDIR)/debian/kisscount/ -override_dh_shlibdeps: \ No newline at end of file diff --git a/kc.1 b/kc.1 new file mode 100644 index 0000000..b37925d --- /dev/null +++ b/kc.1 @@ -0,0 +1,35 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH KC 1 "February 26, 2011" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +KissCount \- Personal Accounting Software +.SH SYNOPSIS +.B kc +.RI [ bdd_file ] +.SH DESCRIPTION +KissCount is a personal accounting software. Its goal is to be as simple as possible (matching KISS philosophy). +.br +It focuses on PERSONAL accounting (not companies/associations). You only have to enter operations and see what you have (or not). +.TP +.B bdd_file +Choose another database file than ~/.kisscount/kc.bdd +.SH FILES +Default database is ~/.kisscount/kc.bdd +.SH AUTHOR +KissCount was written by . +.PP +This manual page was written by Grégory Soutadé , diff --git a/init.sql b/ressources/init.sql old mode 100755 new mode 100644 similarity index 100% rename from init.sql rename to ressources/init.sql diff --git a/src/model/Database.h b/src/model/Database.h index 88d5c16..2126190 100644 --- a/src/model/Database.h +++ b/src/model/Database.h @@ -36,7 +36,7 @@ #define DATABASE_VERSION 2 #define BDD_FILE "/.kisscount/kc.bdd" -#define INIT_SCRIPT "init.sql" +#define INIT_SCRIPT RESSOURCES_ROOT "init.sql" #define FIX_OP (1 << 0) #define NON_FIX_OP (1 << 1) diff --git a/src/view/SupportedLanguages.h b/src/view/SupportedLanguages.h index c6e70a1..2df9936 100644 --- a/src/view/SupportedLanguages.h +++ b/src/view/SupportedLanguages.h @@ -29,7 +29,7 @@ typedef struct { } language ; #define NB_SUPPORTED_LANGUAGES 2 -#define ICONS_PATH "./ressources/icons" +#define ICONS_PATH RESSOURCES_ROOT "icons/" extern language languages[NB_SUPPORTED_LANGUAGES]; diff --git a/src/view/view.h b/src/view/view.h index d253acd..7e64524 100644 --- a/src/view/view.h +++ b/src/view/view.h @@ -28,15 +28,17 @@ #define DEFAULT_FONT_SIZE 12 #define DEFAULT_FONT(font_name) wxFont font_name(DEFAULT_FONT_SIZE, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, DEFAULT_FONT_NAME); -#define DELETE_ICON "./ressources/icons/process-stop.png" -#define CHECKED_ICON "./ressources/icons/tick-icon.png" -#define ACCOUNT_ICON "./ressources/icons/administrator-icon.png" -#define STATS_ICON "./ressources/icons/chart-icon.png" -#define SEARCH_ICON "./ressources/icons/Search-icon.png" -#define PREFS_ICON "./ressources/icons/options-icon.png" -#define CHANGE_USER_ICON "./ressources/icons/Clients-icon.png" -#define ABOUT_ICON "./ressources/icons/windows-users-icon.png" -#define QUIT_ICON "./ressources/icons/system-log-out.png" +#define DELETE_ICON RESSOURCES_ROOT "icons/process-stop.png" +#define CHECKED_ICON RESSOURCES_ROOT "icons/tick-icon.png" +#define ACCOUNT_ICON RESSOURCES_ROOT "icons/administrator-icon.png" +#define STATS_ICON RESSOURCES_ROOT "icons/chart-icon.png" +#define SEARCH_ICON RESSOURCES_ROOT "icons/Search-icon.png" +#define PREFS_ICON RESSOURCES_ROOT "icons/options-icon.png" +#define CHANGE_USER_ICON RESSOURCES_ROOT "icons/Clients-icon.png" +#define ABOUT_ICON RESSOURCES_ROOT "icons/windows-users-icon.png" +#define QUIT_ICON RESSOURCES_ROOT "icons/system-log-out.png" + +#define LANG_ROOT RESSOURCES_ROOT "po/" #include "KissPanel.h" diff --git a/src/view/wxUI.cpp b/src/view/wxUI.cpp index 0eedd29..59c78ee 100644 --- a/src/view/wxUI.cpp +++ b/src/view/wxUI.cpp @@ -95,7 +95,7 @@ bool wxUI::SetLanguage(long language) _locale = new wxLocale( language, wxLOCALE_CONV_ENCODING ); #ifdef __WXGTK__ - _locale->AddCatalogLookupPathPrefix(wxT("./ressources/po")); + _locale->AddCatalogLookupPathPrefix(wxT(LANG_ROOT)); #endif _locale->AddCatalog(wxT("french")); @@ -110,7 +110,7 @@ bool wxUI::SetLanguage(long language) _locale = new wxLocale(); #ifdef __WXGTK__ - _locale->AddCatalogLookupPathPrefix(wxT("./ressources/po")); + _locale->AddCatalogLookupPathPrefix(wxT(LANG_ROOT)); #endif _locale->AddCatalog(wxT("kisscount")); diff --git a/tools/launch_kc.sh b/tools/launch_kc.sh deleted file mode 100755 index 854f4aa..0000000 --- a/tools/launch_kc.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -export LD_LIBRARY_PATH=./lib:$LD_LIBRARY_PATH -./kc $* diff --git a/tools/package.sh b/tools/package.sh index 49ad2f1..3329985 100755 --- a/tools/package.sh +++ b/tools/package.sh @@ -19,7 +19,7 @@ fi make || (echo "Compilation failed" ; exit 1) mkdir -p "$DIR"/lib cp -r lib/freechart/lib/*.so* lib/wxsqlite3-1.9.9/lib/*.so* "$DIR"/lib -cp -r kc init.sql ressources tools/launch_kc.sh TODO CONTRIBUTORS COPYING README README.fr www "$DIR" +cp -r kc ressources tools/launch_kc.sh TODO CONTRIBUTORS COPYING README* www "$DIR" find "$DIR" -type f -executable -exec ${PREFIX}strip \{\} \; tar -jcf "$FILE" "$DIR" rm -rf "$DIR" @@ -28,7 +28,7 @@ rm -rf "$DIR" rm -rf "$DEB_DIR" "$DEB_FILE" mkdir -p "$DEB_DIR/lib" cp -r lib/freechart/lib/*.so* lib/wxsqlite3-1.9.9/lib/*.so* "$DEB_DIR/lib" -cp -r kc debian init.sql README* ressources tools "$DEB_DIR" +cp -r kc.1 kc debian README* ChangeLog TODO CONTRIBUTORS ressources "$DEB_DIR" #tar -zcf "$DEB_FILE" "$DEB_DIR" cd "$DEB_DIR" mv debian/Makefile .