Просмотр исходного кода

build: Add new --without-update-alternatives

Some distributions already ship their own reimplementation of
update-alternatives, so we allow them to disable our own.
Guillem Jover лет назад: 16
Родитель
Сommit
6985e4e0a8
4 измененных файлов с 24 добавлено и 4 удалено
  1. 9 0
      configure.ac
  2. 2 0
      debian/changelog
  3. 6 2
      man/Makefile.am
  4. 7 2
      scripts/Makefile.am

+ 9 - 0
configure.ac

@@ -40,6 +40,15 @@ else
    AC_DEFINE(WITH_START_STOP_DAEMON, 0)
 fi
 
+# Allow compilation without update-alternatives
+AC_ARG_WITH(update-alternatives,
+	AS_HELP_STRING([--without-update-alternatives],
+		       [do not build or use update-alternatives]),
+	[build_update_alternatives=$with_update_alternatives],
+	[build_update_alternatives=yes])
+AM_CONDITIONAL(WITH_UPDATE_ALTERNATIVES,
+	[test "x$build_update_alternatives" = "xyes"])
+
 # Allow alternate admin directory
 admindir="${localstatedir}/${PACKAGE_NAME}"
 AC_ARG_WITH(admindir,

+ 2 - 0
debian/changelog

@@ -101,6 +101,8 @@ dpkg (1.15.6) UNRELEASED; urgency=low
   * Set DPKG_SHELL_REASON, DPKG_CONFFILE_OLD and DPKG_CONFFILE_NEW environment
     variables when spawning a shell for conffile examination. Closes: #60329
     Thanks to Daniel Martin <Daniel.Martin@jhu.edu> for the idea.
+  * Add support for disabling update-alternatives at configure time using
+    --withouth-update-alternatives.
 
   [ Modestas Vainius ]
   * Implement symbol patterns (Closes: #563752). From now on, it is possible to

+ 6 - 2
man/Makefile.am

@@ -114,8 +114,7 @@ dist_man_MANS = \
 	dpkg-trigger.1 \
 	dpkg-vendor.1 \
 	dpkg.1 \
-	dpkg.cfg.5 \
-	update-alternatives.8
+	dpkg.cfg.5
 
 if WITH_DSELECT
 dist_man_MANS += \
@@ -128,6 +127,11 @@ dist_man_MANS += \
 	start-stop-daemon.8
 endif
 
+if WITH_UPDATE_ALTERNATIVES
+dist_man_MANS += \
+	update-alternatives.8
+endif
+
 EXTRA_DIST = \
 	po/ChangeLog.old \
 	po/po4a.cfg \

+ 7 - 2
scripts/Makefile.am

@@ -17,8 +17,11 @@ bin_SCRIPTS = \
 	dpkg-scansources \
 	dpkg-shlibdeps \
 	dpkg-source \
-	dpkg-vendor \
-	update-alternatives
+	dpkg-vendor
+
+if WITH_UPDATE_ALTERNATIVES
+bin_SCRIPTS += update-alternatives
+endif
 
 changelogdir = $(pkglibdir)/parsechangelog
 changelog_SCRIPTS = \
@@ -116,10 +119,12 @@ do_perl_subst = $(AM_V_GEN) \
 	$(do_perl_subst) <$< >$@
 	$(AM_V_at) chmod +x $@
 
+if WITH_UPDATE_ALTERNATIVES
 install-data-local:
 	$(mkdir_p) $(DESTDIR)$(sysconfdir)/alternatives
 	$(mkdir_p) $(DESTDIR)$(admindir)/alternatives
 	$(INSTALL_DATA) $(srcdir)/README.alternatives $(DESTDIR)$(sysconfdir)/alternatives/README
+endif
 
 # Ideally we'd use 'sed -i', but unfortunately that's not portable.
 install-data-hook: