From 7f08ad06eaabf401be0aa989597ece4eff5044e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Sat, 5 Mar 2011 12:26:35 +0100 Subject: [PATCH] First attempt to make a Debian package --- Makefile | 12 ++++++- debian/Makefile | 64 ++++++++++++++++++++++++++++++++++++++ debian/changelog | 5 +++ debian/compat | 1 + debian/control | 17 ++++++++++ debian/copyright | 29 +++++++++++++++++ debian/dirs | 1 + debian/docs | 2 ++ debian/files | 1 + debian/kisscount-install | 1 + debian/menu | 2 ++ debian/rules | 28 +++++++++++++++++ debian/source/format | 1 + src/controller/KissCount.h | 2 +- tools/package.sh | 23 +++++++++++++- 15 files changed, 186 insertions(+), 3 deletions(-) create mode 100644 debian/Makefile create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/dirs create mode 100644 debian/docs create mode 100644 debian/files create mode 100644 debian/kisscount-install create mode 100644 debian/menu create mode 100755 debian/rules create mode 100644 debian/source/format diff --git a/Makefile b/Makefile index 092e224..d845dc0 100644 --- a/Makefile +++ b/Makefile @@ -48,4 +48,14 @@ package: else package: ./tools/package.sh -endif \ No newline at end of file +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 diff --git a/debian/Makefile b/debian/Makefile new file mode 100644 index 0000000..f1aedfa --- /dev/null +++ b/debian/Makefile @@ -0,0 +1,64 @@ +CXXFLAGS+=`wx-config --cxxflags` -Wall -Isrc -ggdb +CXXFLAGS+=-I./lib/wxsqlite3-1.9.9/include +CXXFLAGS+=-I./lib/freechart/include + +LDFLAGS+=`wx-config --libs` +ifdef WIN32 +LDFLAGS+=-L./lib/wxsqlite3-1.9.9/lib/ -lwxcode_msw_wxsqlite3-2.8 +LDFLAGS+=-L./lib/freechart/lib -lwxcode_msw_freechart-2.8 +else +LDFLAGS+=-L./lib/wxsqlite3-1.9.9/lib/ -lwxcode_gtk2u_wxsqlite3-2.8 +LDFLAGS+=-L./lib/freechart/lib -lwxcode_gtk2u_freechart-2.8 +endif + +CXX=$(PREFIX)g++ + +SOURCES=$(wildcard src/model/*.cpp) +SOURCES+=$(wildcard src/view/*.cpp) +SOURCES+=$(wildcard src/view/grid/*.cpp) +SOURCES+=$(wildcard src/controller/*.cpp) +SOURCES+=src/main.cpp src/sha1.cpp src/ParseExp.cpp +HEADERS=$(wildcard src/model/*.h) +HEADERS+=$(wildcard src/view/*.h) +HEADERS+=$(wildcard src/view/grid/*.h) +HEADERS+=$(wildcard src/controller/*.h) +HEADERS+=src/main.h src/sha1.h +OBJS=$(SOURCES:.cpp=.o) + +all: check kc + +clean: + rm -f *~ src/*~ src/*.o src/model/*.o src/model/*~ src/view/*.o src/view/grid/*.o src/view/grid/*~ src/view/*~ src/controller/*.o src/controller/*~ kc + +# %.o : src/model/%.cpp src/view/%.cpp src/view/grid/%.cpp src/controller/%.cpp src/%.cpp +# $(CXX) $(CXXFLAGS) $< -c + +check: +# if ! test -d lib ; then echo lib directory not found, please see INSTALL ; return 1 ; fi + +#kc: $(OBJS) +# $(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) + +kc: + cp ../kc . + +generate_locales: + ./tools/generate_locales.sh + +ifdef WIN32 +package: + ./tools/package_win32.sh +else +package: + ./tools/package.sh +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 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..bc81166 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +kisscount (0.2-1) unstable; urgency=low + + * Initial release + + -- Grégory Soutadé Sat, 26 Feb 2011 13:13:52 +0100 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +7 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..7e56d22 --- /dev/null +++ b/debian/control @@ -0,0 +1,17 @@ +Source: kisscount +Section: misc +Priority: extra +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 + +Package: kisscount +Architecture: amd64 +Depends: ${misc:Depends} +Description: Personal accounting software + KissCount is a personal accounting software. + It focuses on simplicity and everyday + users requirements. \ No newline at end of file diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..22a3eb9 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,29 @@ +Format: http://dep.debian.net/deps/dep5 +Upstream-Name: kisscount +Source: http://indefero.soutade.fr/p/kisscount/ + +Files: * +Copyright: 2010-2011 Grégory Soutadé + +License: GPL-3.0+ + +Files: debian/* +Copyright: 2011 Grégory Soutadé +License: GPL-3.0+ + +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the complete text of the GNU General + Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". diff --git a/debian/dirs b/debian/dirs new file mode 100644 index 0000000..f03a978 --- /dev/null +++ b/debian/dirs @@ -0,0 +1 @@ +/usr/lib/kisscount \ No newline at end of file diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..dccc5d8 --- /dev/null +++ b/debian/docs @@ -0,0 +1,2 @@ +README +README.fr diff --git a/debian/files b/debian/files new file mode 100644 index 0000000..78c876a --- /dev/null +++ b/debian/files @@ -0,0 +1 @@ +kisscount_0.2-1_amd64.deb misc extra diff --git a/debian/kisscount-install b/debian/kisscount-install new file mode 100644 index 0000000..064631e --- /dev/null +++ b/debian/kisscount-install @@ -0,0 +1 @@ +usr/bin/kc diff --git a/debian/menu b/debian/menu new file mode 100644 index 0000000..ed7c806 --- /dev/null +++ b/debian/menu @@ -0,0 +1,2 @@ +?package(kisscount):needs="X11" section="Applications/Office"\ + title="kisscount" command="/usr/bin/kc" diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..d9e62e5 --- /dev/null +++ b/debian/rules @@ -0,0 +1,28 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +export DH_VERBOSE=1 + +%: + dh $@ + +# clean: + +# build: +# $(MAKE) + +# binary: + +# binary-arch: + +# binary-indep: + +# install: +# $(MAKE) install DESTDIR=$(CURDIR)/debian/kisscount/ +override_dh_shlibdeps: \ No newline at end of file diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/src/controller/KissCount.h b/src/controller/KissCount.h index 229af3f..9614bd7 100644 --- a/src/controller/KissCount.h +++ b/src/controller/KissCount.h @@ -29,7 +29,7 @@ #include -#define APP_VERSION "v0.2_dev" +#define APP_VERSION "0.2" class wxUI; class Database; diff --git a/tools/package.sh b/tools/package.sh index 3649c25..49ad2f1 100755 --- a/tools/package.sh +++ b/tools/package.sh @@ -5,6 +5,11 @@ DATE=`date +%d.%m.%Y` VERSION=`cat src/controller/KissCount.h | grep APP_VERSION | cut -d\" -f2` DIR="KissCount_build_${VERSION}_${DATE}_${ARCH}" FILE="$DIR.tar.bz2" +DEB_DIR="kisscount-${VERSION}" +DEB_FILE="$DEB_DIR.tar.gz" +DEBEMAIL=soutade@gmail.com +DEBFULLNAME="Grégory Soutadé" +export DEBEMAIL DEBFULLNAME rm -f "$FILE" rm -rf "$DIR" @@ -18,4 +23,20 @@ cp -r kc init.sql ressources tools/launch_kc.sh TODO CONTRIBUTORS COPYING README find "$DIR" -type f -executable -exec ${PREFIX}strip \{\} \; tar -jcf "$FILE" "$DIR" rm -rf "$DIR" -echo "Packaged into $FILE !" \ No newline at end of file + +# Debian packaging +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" +#tar -zcf "$DEB_FILE" "$DEB_DIR" +cd "$DEB_DIR" +mv debian/Makefile . +ln -s ../../src +#sed -i s/i686/$ARCH/g debian/control +#dh_make -f "../$DEB_FILE" --copyright gpl3 --email $DEBEMAIL -s +[ "${ARCH}" == "x86_64" ] && ARCH="amd64" +debuild -us -uc -b -i -a${ARCH} +cd - + +echo "Packaged into $FILE and kisscount_${VERSION}-1_${ARCH}.deb !" \ No newline at end of file