harmattan version.
[monky] / debian / rules
old mode 100755 (executable)
new mode 100644 (file)
index fdac833..b12ba3a
@@ -1,21 +1,20 @@
 #!/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
-
+export DH_VERBOSE=1
 
 # These are used for cross-compiling and for saving the configure script
 # from having to guess our platform (since we know it already)
 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+DEB_HOST_ARCH_OS    ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
+DEB_HOST_ARCH_CPU   ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
 
 CFLAGS = -Wall -g
+LDFLAGS = -Wl,--as-needed -ldbus-1
+# CFLAGS += `pkg-config --cflags gtk+-2.0`
+# LDFLAGS += `pkg-config --libs gtk+-2.0`
 
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
        CFLAGS += -O0
@@ -23,29 +22,72 @@ else
        CFLAGS += -O2
 endif
 
-configure: configure-stamp
-configure-stamp:
+ifeq ($(DEB_HOST_ARCH_OS),linux)
+       LINUX_CONF_ARGS_STD=--enable-wlan
+       LINUX_CONF_ARGS_ALL=--enable-wlan --enable-ibm
+endif
+
+ifeq ($(DEB_HOST_ARCH_CPU),i386)
+       ENABLE_NVIDIA=--enable-nvidia
+endif
+
+ifeq ($(DEB_HOST_ARCH_CPU),amd64)
+       ENABLE_NVIDIA=--enable-nvidia
+endif
+
+COMMON_CONFIGURE_FLAGS = --host=$(DEB_HOST_GNU_TYPE) \
+                        --build=$(DEB_BUILD_GNU_TYPE) \
+                        --prefix=/usr --sysconfdir=/etc \
+                        --mandir=\$${prefix}/share/man \
+                        --infodir=\$${prefix}/share/info \
+                        --srcdir=..
+
+configure: config-stamp
+
+config-stamp:
        dh_testdir
-       ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --enable-double-buffer   --enable-own-window --enable-proc-uptime --enable-mpd --enable-xft --enable-seti
-       touch configure-stamp
+#DML#  chmod +x ./autogen.sh
+       AUTOMAKE=automake ./autogen.sh
 
+# copy these instead
+#      ln -sf /usr/share/misc/config.sub .
+#      ln -sf /usr/share/misc/config.guess .
+
+       mkdir build-all
+
+       cd build-all && CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
+       ../configure $(COMMON_CONFIGURE_FLAGS) \
+        --enable-rss --enable-weather-xoap LUA51_LIBS='-llua5.1 -lm' \
+       --enable-eve --enable-lua=yes --enable-lua-cairo --enable-lua-imlib2 \
+       --disable-static --enable-argb --enable-x11 --enable-imlib2 \
+       $(LINUX_CONF_ARGS_ALL) $(ENABLE_NVIDIA)
+
+       touch $@
 
 build: build-stamp
 
-build-stamp: configure-stamp 
+build-stamp: config-stamp
        dh_testdir
 
-       $(MAKE)
-#docbook-to-man debian/conky.sgml > conky.1
+       cd build-all && $(MAKE)
 
-       touch build-stamp
+       touch $@
 
 clean:
        dh_testdir
        dh_testroot
-       rm -f build-stamp configure-stamp
-       rm -f config.cache config.status config.log
-       -$(MAKE) clean
+
+       rm -f  build-stamp config-stamp
+
+       rm  -f configure.ac configure config.h.in src/config.h.in \
+              src/defconfig.h compile install-sh missing ltmain.sh depcomp \
+              Makefile.in doc/Makefile.in src/Makefile.in  src/dbus/Makefile.in \
+              data/Makefile.in lua/Makefile.in \
+              aclocal.m4 m4/libtool.m4 m4/ltversion.m4 \
+              m4/lt~obsolete.m4 m4/ltoptions.m4 m4/ltsugar.m4
+
+       rm -rf build-std build-cli build-all
+       rm -f config.guess config.sub
 
        dh_clean 
 
@@ -53,24 +95,32 @@ install: build
        dh_testdir
        dh_testroot
        dh_clean -k 
-       dh_installdirs
 
-       $(MAKE) install DESTDIR=$(CURDIR)/debian/conky
+       cd build-all && $(MAKE) install DESTDIR=$(CURDIR)/debian/conky-n950
+       mkdir -p debian/conky-n950/usr/share/icons/hicolor/scalable/apps/
+       cp -p debian/conkylogo64.png debian/conky-n950/usr/share/icons/hicolor/scalable/apps/conky.png
+       mkdir -p debian/conky-n950/usr/share/icons/hicolor/48x48/apps/
+       cp -p debian/conkylogo48.png debian/conky-n950/usr/share/icons/hicolor/48x48/apps/conky.png
+       mkdir -p debian/conky-n950/usr/share/applications/
+       cp -p debian/conky.desktop debian/conky-n950/usr/share/applications/conky.desktop
+       mkdir -p debian/conky-n950/usr/bin/
+       cp -p debian/conky.sh debian/conky-n950/usr/bin/
+
+       # Clean up cruft left upstream
+       rm -rf debian/conky-std/usr/lib debian/conky-cli/usr/lib \
+              debian/conky-n950/usr/lib/conky/*.la \
+              debian/conky-n950/usr/lib/conky/*.so.?
 
-
-# Build architecture-independent files here.
 binary-indep: build install
-# We have nothing to do by default.
 
-# Build architecture-dependent files here.
 binary-arch: build install
        dh_testdir
        dh_testroot
        dh_installchangelogs ChangeLog
-       dh_installdocs AUTHORS README TODO doc/docs.html doc/variables.html doc/config_settings.html
-       dh_installexamples doc/conkyrc.sample
+       dh_installdocs
        dh_installmenu
-       dh_installman doc/conky.1
+       dh_installman -a doc/conky.1
+       dh_install
        dh_link
        dh_strip
        dh_compress
@@ -81,5 +131,6 @@ binary-arch: build install
        dh_md5sums
        dh_builddeb
 
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
+binary: binary-arch binary-indep
+
+.PHONY: configure build clean install binary binary-indep binary-arch