OSDN Git Service

build system: some changes that simplify things for packaging tools
authorjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Mon, 24 Aug 2009 17:32:22 +0000 (17:32 +0000)
committerjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Mon, 24 Aug 2009 17:32:22 +0000 (17:32 +0000)
- Add DESTDIR to install path for HandBrakeCLI
- Modify linux packaging rules for deb and rpm packages to use DESTDIR
- lingui: only update icon cache during install if DESTDIR is not set
- patch out the hardcoded install path for m4 macros in libdvdread and libdvdnav
  when uid==0

git-svn-id: svn://localhost/HandBrake/trunk@2774 b64f7644-9d1e-0410-96f1-a4d463321fa5

contrib/libdvdnav/A04-m4-uid0.patch [new file with mode: 0644]
contrib/libdvdread/A03-m4-uid0.patch [new file with mode: 0644]
gtk/ghb.spec
gtk/src/Makefile.am
pkg/linux/debian/rules
pkg/linux/module.rules
test/module.defs

diff --git a/contrib/libdvdnav/A04-m4-uid0.patch b/contrib/libdvdnav/A04-m4-uid0.patch
new file mode 100644 (file)
index 0000000..4963827
--- /dev/null
@@ -0,0 +1,28 @@
+diff -Naur libdvdnav.orig/configure.ac libdvdnav/configure.ac
+--- libdvdnav.orig/configure.ac        2009-01-08 14:57:11.000000000 -0800
++++ libdvdnav/configure.ac     2009-08-24 10:20:16.560743586 -0700
+@@ -206,24 +206,6 @@
+ AC_SUBST(DEBUG_CFLAGS)
+-dnl ---------------------------------------------
+-dnl Get where .m4 should be installed.
+-dnl ---------------------------------------------
+-case "`id`" in
+-  uid=0\(* )
+-    AC_MSG_CHECKING(for aclocal directory)
+-    if (aclocal --version) < /dev/null > /dev/null 2>&1; then
+-      ACLOCAL_DIR="`eval $ACLOCAL --print-ac-dir`"
+-      AC_MSG_RESULT($ACLOCAL_DIR)
+-    else
+-      ACLOCAL_DIR="/usr/local/share/aclocal"
+-      AC_MSG_RESULT(none - will be installed in $ACLOCAL_DIR)
+-    fi
+-    escapedprefix="`echo $prefix | sed -e 's/\\//\\\\\//g'`"
+-    ACLOCAL_DIR="`echo $ACLOCAL_DIR|sed -e 's/^'$escapedprefix/'\${prefix}'/`"
+-    AC_SUBST(ACLOCAL_DIR)
+-    ;;
+-esac
+ AM_CONDITIONAL(INSTALL_M4, test x"$ACLOCAL_DIR" != "x")
+ dnl ---------------------------------------------
diff --git a/contrib/libdvdread/A03-m4-uid0.patch b/contrib/libdvdread/A03-m4-uid0.patch
new file mode 100644 (file)
index 0000000..eab2617
--- /dev/null
@@ -0,0 +1,28 @@
+diff -Naur libdvdread.orig/configure.ac libdvdread/configure.ac
+--- libdvdread.orig/configure.ac       2009-01-08 14:57:10.000000000 -0800
++++ libdvdread/configure.ac    2009-08-24 10:17:47.036747814 -0700
+@@ -167,24 +167,6 @@
+ AC_SUBST(DEBUG_CFLAGS)
+-dnl ---------------------------------------------
+-dnl Get where .m4 should be installed.
+-dnl ---------------------------------------------
+-case "`id`" in
+-  uid=0\(* )
+-    AC_MSG_CHECKING(for aclocal directory)
+-    if (aclocal --version) < /dev/null > /dev/null 2>&1; then
+-      ACLOCAL_DIR="`eval $ACLOCAL --print-ac-dir`"
+-      AC_MSG_RESULT($ACLOCAL_DIR)
+-    else
+-      ACLOCAL_DIR="/usr/local/share/aclocal"
+-      AC_MSG_RESULT(none - will be installed in $ACLOCAL_DIR)
+-    fi
+-    escapedprefix="`echo $prefix | sed -e 's/\\//\\\\\//g'`"
+-    ACLOCAL_DIR="`echo $ACLOCAL_DIR|sed -e 's/^'$escapedprefix/'\${prefix}'/`"
+-    AC_SUBST(ACLOCAL_DIR)
+-    ;;
+-esac
+ AM_CONDITIONAL(INSTALL_M4, test x"$ACLOCAL_DIR" != "x")
+ dnl ---------------------------------------------
index f39d4fc..5b83853 100644 (file)
@@ -50,7 +50,7 @@ transcoder, available for MacOS X, Linux and Windows.
 %install
 #rm -rf $RPM_BUILD_ROOT
 # I don't want to rebuild the world, so just install what I've prebuilt
-make -C $RPM_BUILD_ROOT/../.. PREFIX=$RPM_BUILD_ROOT/usr PREFIX/=$RPM_BUILD_ROOT/usr/ install
+make -C $RPM_BUILD_ROOT/../.. DESTDIR=$RPM_BUILD_ROOT install
 
 ## blow away stuff we don't want
 /bin/rm -f $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/icon-theme.cache
index 5dbecd5..52be4d1 100644 (file)
@@ -149,7 +149,7 @@ uninstall-local:
                fi; \
                rm -f $(DESTDIR)/$(datadir)/icons/hicolor/$$SIZE/apps/$$FILE; \
        done
-       @-if test -d "$(DESTDIR)/$(datadir)"; then \
+       @-if test -z "$(DESTDIR)"; then \
                echo "Updating Gtk icon cache."; \
                $(gtk_update_icon_cache); \
        else \
@@ -171,7 +171,7 @@ install-data-local:
                mkdir -p $(DESTDIR)/$(datadir)/icons/hicolor/$$SIZE/apps/; \
                $(INSTALL_DATA) $(srcdir)/$$icon $(DESTDIR)/$(datadir)/icons/hicolor/$$SIZE/apps/$$FILE; \
        done
-       @-if test -d "$(DESTDIR)/$(datadir)"; then \
+       @-if test -z "$(DESTDIR)"; then \
                echo "Updating Gtk icon cache."; \
                $(gtk_update_icon_cache); \
        else \
index a30f4fb..4ce0ec0 100755 (executable)
@@ -43,7 +43,7 @@ install: build
        dh_testdir
        dh_testroot
        dh_installdirs
-       $(MAKE) -C $(BUILDDIR) PREFIX=$(CURDIR)/debian/tmp/usr PREFIX/=$(CURDIR)/debian/tmp/usr/ install
+       $(MAKE) -C $(BUILDDIR) DESTDIR=$(CURDIR)/debian/tmp install
 
 # Build architecture-independent files here.
 binary-indep: build install
index 2d5b1a2..c3346be 100644 (file)
@@ -12,7 +12,6 @@ $(PKG.gui.rpm) $(PKG.cli.rpm):
        $(CP.exe) $(GTK.src/)ghb.spec $(RPM.out/)SPECS
        $(CP.exe) $(PKG.src.tar.bz2) $(RPM.out/)SOURCES
        $(TAR.exe) -xf $(PKG.src.tar.bz2) -C $(RPM.out/)BUILD
-#      fakeroot $(MAKE) PREFIX=$(RPMROOT.out/)usr PREFIX/=$(RPMROOT.out/)usr/ install
        rpmbuild --define="version $(HB.version)" --define="_topdir $(PWD)/$(RPM.out)" --buildroot $(RPMROOT.out) -ba $(GTK.src/)ghb.spec
        $(CP.exe) $(RPM.out/)RPMS/$(PKG.rpm.machine)/$(HB.name)-cli-$(HB.version)*.rpm $(PKG.cli.rpm)
        $(CP.exe) $(RPM.out/)RPMS/$(PKG.rpm.machine)/$(HB.name)-gui-$(HB.version)*.rpm $(PKG.gui.rpm)
index 48f0c57..947bc15 100644 (file)
@@ -14,7 +14,7 @@ TEST.libs = $(LIBHB.a) $(foreach n, \
         ogg samplerate swscale theora vorbis vorbisenc x264, \
         $(CONTRIB.build/)lib/lib$(n).a )
 
-TEST.install.exe = $(PREFIX/)bin/$(notdir $(TEST.exe))
+TEST.install.exe = $(DESTDIR)$(PREFIX/)bin/$(notdir $(TEST.exe))
 
 ifeq (1,$(LIBICONV.enabled))
     TEST.libs += $(CONTRIB.build/)lib/libiconv.a