summaryrefslogtreecommitdiff
path: root/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules104
1 files changed, 104 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..f16dec6
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,104 @@
+#!/usr/bin/make -f
+
+## DO NOT MODIFY THIS AREA : BEGIN
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# $(PKGDIR) is a package build directory to create a final .deb package .
+include debian/control.slp
+
+PKGDIR = debian/PKG
+ifneq (,$(filter ide,$(DEB_BUILD_OPTIONS)))
+DESTDIR = .
+else
+DESTDIR = ..
+endif
+CONTROLFILE = debian/control.slp
+CONTROLFILE_SRC = debian/control
+
+BUILD_TYPE=Debug
+# BUILD_TYPE=Release
+
+# UNIT_TEST_ENABLE=TRUE
+ UNIT_TEST_ENABLE=FALSE
+
+CFLAGS = -Wall -g
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+ CFLAGS += -O0
+else
+ CFLAGS += -O2
+endif
+
+build: pre-build configure
+ # Add here commands to compile the package.
+ $(MAKE)
+
+
+configure:
+ cmake . -DCMAKE_INSTALL_PREFIX=${AppInstallPath} -DCMAKE_PROJECT=${Source} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DUNIT_TEST_ENABLE=${UNIT_TEST_ENABLE}
+ rm -rf CMakeFiles/CompilerIdC*
+# sed 's/^Package:.*$$/Package: $(Package)/' $(CONTROLFILE_SRC) > $(CONTROLFILE_SRC).tmp ; mv -f $(CONTROLFILE_SRC).tmp $(CONTROLFILE_SRC)
+
+clean:
+ # Add here commands to clean up before the build process.
+ # debian clean
+ -$(MAKE) clean
+
+ -find . -name "CMakeFiles" -exec rm -rf {} \;
+ -find . -name "CMakeCache.txt" -exec rm -rf {} \;
+ -find . -name "Makefile" -exec rm -rf {} \;
+ -find . -name "cmake_install.cmake" -exec rm -rf {} \;
+ -find . -name "install_manifest.txt" -exec rm -rf {} \;
+ -find . -name "*.pc" -exec rm -rf {} \;
+ -find . -name "*.so" -exec rm -rf {} \;
+
+ -rm -rf $(PKGDIR)
+
+ dh_clean
+
+install: build pre-install
+ rm -rf $(PKGDIR)
+ mkdir $(PKGDIR)
+
+ # Add here commands to install the package into $(PKGDIR).
+ $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
+
+ #execute unit test
+ debian/unit_test.sh ./debian/tmp/usr/bin/fw-test
+
+# Build architecture-dependent files here.
+binary: install pre-binary
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installexamples
+ dh_install --sourcedir=debian/tmp
+ dh_link
+ dh_strip --dbg-package=libsync-agent-framework-dbg
+ dh_compress
+ dh_fixperms
+ dh_makeshlibs
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+
+
+.PHONY: build clean install binary
+## DO NOT MODIFY THIS AREA : END
+
+## DO NOT MODIFY OR DELETE TARGET.
+pre-build:
+ # Add here commands to execute before the build process.
+
+pre-install:
+ # Add here commands to execute before installing the binaries into $(PKGDIR).
+
+pre-binary:
+ # Add here commands to execute before creating a package.
+