Fix checking for SVN revision, checking for configure options to use, and installatio...
authorceros7 <ceros7@svn>
Wed, 2 Dec 2009 04:29:43 +0000 (04:29 +0000)
committerceros7 <ceros7@svn>
Wed, 2 Dec 2009 04:29:43 +0000 (04:29 +0000)
Also remove empty directories from xbmc-data package in usr/share/xbmc.

git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@25211 568bbfeb-2a22-0410-94d2-cc84cf5bfa90

tools/Linux/packaging/debian/rules

index 4c031e1..dea7cf1 100755 (executable)
@@ -6,30 +6,32 @@ DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
 # Get the SVN revision from the changelog
-SVNVERSION ?= $(shell dpkg-parsechangelog | grep '^Version:' | grep 'svn' | sed 's/.*svn\([[:digit:]]*\).*/\1/')
+SVNVERSION ?= $(shell dpkg-parsechangelog | grep '^Version:' | sed 's/.*svn\([[:digit:]]*\).*/\1/')
 
-ifeq "$(SVNVERSION)" ""
-       SVNVERSION = $(shell cat debian/svnrevision)
+# If not set already, try to set from debian/svnrevision
+ifeq (,$(SVNVERSION))
+       SVNVERSION = $(shell cat debian/svnrevision 2>/dev/null)
 endif
 
 # List of options to pass to configure. Can be overridden.
 XBMC_CONFIG_OPTIONS ?= --host=$(DEB_HOST_GNU_TYPE) \
        --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --disable-ccache \
-       --enable-goom --enable-avahi --enable-external-libraries \
-        CFLAGS="$(DEB_CFLAGS)" CXXFLAGS="$(DEB_CXXFLAGS)"
+       --enable-goom --enable-avahi --enable-vdpau \
+       --enable-external-libraries --disable-dvdcss
 
-# Add the SVN revision if it exists in the changelog
-ifeq (,$(findstring Version,$(SVNVERSION)))
-  XBMC_CONFIG_OPTIONS += SVN_REV="$(SVNVERSION)"
+# Ubuntu or Debian specific options
+ifeq (Ubuntu,$(shell lsb_release -is))
+  XBMC_CONFIG_OPTIONS += --enable-faac
 endif
 
-# Ubuntu or Debian specific options
-ifneq (Ubuntu,$(shell lsb_release -is))
-  XBMC_CONFIG_OPTIONS += --disable-dvdcss
-else
-  XBMC_CONFIG_OPTIONS += --enable-vdpau
+# Add the SVN revision if we could determine the svn revision
+ifneq (,$(SVNVERSION))
+  XBMC_CONFIG_OPTIONS += SVN_REV="$(SVNVERSION)"
 endif
 
+# Various environment variables to set
+XBMC_CONFIG_OPTIONS += CFLAGS="$(DEB_CFLAGS)" CXXFLAGS="$(DEB_CXXFLAGS)"
+
 # Input files used for generating other files
 INPUT_FILES = debian/control.in \
 
@@ -47,14 +49,13 @@ override_dh_clean:
        dh_clean
        debian/rules $(INPUT_FILES)
 
-override_dh_auto_configure:
-       ./bootstrap
+override_dh_auto_configure: configure
        ./configure $(XBMC_CONFIG_OPTIONS)
 
 override_dh_auto_install:
        $(MAKE) install install-livedatas prefix=$(CURDIR)/debian/tmp/usr
-       mkdir -p $(CURDIR)/debian/tmp/etc/init/
-       cp $(CURDIR)/tools/XBMCLive/xbmc-live.conf $(CURDIR)/debian/tmp/etc/init/
+       install -D -m 0644 $(CURDIR)/tools/XBMCLive/xbmc-live.conf \
+           $(CURDIR)/debian/tmp/etc/init/xbmc-live.conf
        find "debian/tmp/usr/share/xbmc" -regextype posix-extended \
                -type f -iregex \
                ".*\.so|.*\.vis|.*\.xbs|.*xbmc\.bin|.*xbmc-xrandr" | \
@@ -93,6 +94,7 @@ override_dh_link:
                LINK_DESTINATION="$$(echo "$$FILE" | sed -e 's|debian/xbmc-bin/usr/lib|usr/share|')"; \
                dh_link -pxbmc-bin "$$LINK_TARGET" "$$LINK_DESTINATION"; \
                done
+       find debian/xbmc-data/usr/share/xbmc -type d -empty -delete
 
 override_dh_strip:
        dh_strip --dbg-package=xbmc-dbg