From 2192bd4b897ae5b7c518d735e2b289396bd2300d Mon Sep 17 00:00:00 2001 From: fuanan <2385803914@qq.com> Date: Tue, 15 Feb 2022 18:47:22 +0800 Subject: [PATCH] Add build-conditions disabling Emacs --- libidn-emacsopt.patch | 61 +++++++++++++++++++++++++++++++++++++++++++ libidn.spec | 32 ++++++++++++++++++++--- 2 files changed, 89 insertions(+), 4 deletions(-) create mode 100644 libidn-emacsopt.patch diff --git a/libidn-emacsopt.patch b/libidn-emacsopt.patch new file mode 100644 index 0000000..823a730 --- /dev/null +++ b/libidn-emacsopt.patch @@ -0,0 +1,61 @@ +From d011a6ae00ce9abd445d6d01ce9131a7b97ef5bc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Tue, 3 Oct 2017 10:04:18 +0200 +Subject: [PATCH] Allow disabling Emacs support +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This patch adds --disable-emacs configure option to disable installing +LISP scripts for Emacs. + +Signed-off-by: Petr Písař +--- + configure.ac | 9 ++++++++- + src/Makefile.am | 2 ++ + 2 files changed, 10 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 649ddcd..a6dc9ff 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -51,7 +51,6 @@ LT_INIT([win32-dll]) + AM_GNU_GETTEXT(external) + AM_GNU_GETTEXT_VERSION(0.19.3) + AM_ICONV +-AM_PATH_LISPDIR + + if test "$am_cv_func_iconv" != "yes"; then + AC_MSG_NOTICE([ +@@ -100,6 +99,14 @@ AM_CONDITIONAL(JAVA, test "$enable_java" != "no") + AC_MSG_CHECKING([if implementation in Java should be built]) + AC_MSG_RESULT($enable_java) + ++# Check for Emacs ++AC_ARG_ENABLE(emacs, AC_HELP_STRING([--disable-emacs], [disable Emacs support]), ++ enable_emacs=$enableval, enable_emacs=yes) ++AM_CONDITIONAL(EMACS, test "$enable_emacs" != "no") ++if test "$enable_emacs" != "no"; then ++ AM_PATH_LISPDIR ++fi ++ + # Check for C# + if test -n "$HAVE_CSHARPCOMP"; then + gt_CSHARPEXEC +diff --git a/src/Makefile.am b/src/Makefile.am +index 6832c20..ec99560 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -20,7 +20,9 @@ AM_CFLAGS = $(WERROR_CFLAGS) $(WARN_CFLAGS) + AM_CPPFLAGS = -I$(top_srcdir)/lib -I../lib -I$(top_srcdir)/gl -I../gl + AM_CPPFLAGS += -DLOCALEDIR=\"$(localedir)\" + ++if EMACS + dist_lisp_DATA = punycode.el idna.el ++endif + + bin_PROGRAMS = idn + idn_SOURCES = idn.c +-- +2.13.6 + diff --git a/libidn.spec b/libidn.spec index 5a99015..d2b244a 100644 --- a/libidn.spec +++ b/libidn.spec @@ -1,19 +1,30 @@ -%bcond_with java +# Build with Emacs support +%bcond_without libidn_enables_emacs +%bcond_with java + Name: libidn Version: 1.36 -Release: 1 +Release: 2 Summary: GNU IDN Library - Libidn License: LGPLv2+ and GPLv3+ and GFDL URL: http://www.gnu.org/software/libidn/ Source0: http://ftp.gnu.org/gnu/libidn/libidn-%{version}.tar.gz +# Allow disabling Emacs support +Patch0: libidn-emacsopt.patch + BuildRequires: autoconf autoconf-archive automake libtool texinfo -BuildRequires: gcc gettext gettext-devel pkgconfig help2man emacs +BuildRequires: gcc gettext gettext-devel pkgconfig help2man +%if %{with libidn_enables_emacs} +BuildRequires: emacs +%endif Provides: bundled(gnulib) +%if %{with libidn_enables_emacs} Obsoletes: emacs-libidn < 1.30-4 Provides: emacs-libidn < 1.30-4 Requires: emacs-filesystem >= %{_emacs_version} +%endif %description GNU Libidn is a fully documented implementation of the Stringprep, Punycode and IDNA 2003 specifications. @@ -57,7 +68,13 @@ autoreconf -vif touch src/idn_cmd.c src/idn_cmd.h %build -%configure --disable-csharp --enable-emacs --with-lispdir=%{_emacs_sitelispdir}/%{name} \ +%configure --disable-csharp \ +%if %{with libidn_enables_emacs} + --enable-emacs \ + --with-lispdir=%{_emacs_sitelispdir}/%{name} \ +%else + --disable-emacs \ +%endif %if %{with java} --enable-java %else @@ -76,7 +93,9 @@ rm -rf %{buildroot}%{_datadir}/info/dir rm -rf %{buildroot}%{_libdir}/*.la \ %{buildroot}%{_datadir}/info/*.png +%if %{with libidn_enables_emacs} %{_emacs_bytecompile} $RPM_BUILD_ROOT%{_emacs_sitelispdir}/%{name}/*.el +%endif %if %{with java} rm -rf doc/java/* @@ -96,7 +115,9 @@ rm -rf $RPM_BUILD_ROOT%{_javadir}/libidn*.jar %doc AUTHORS NEWS FAQ THANKS README %{_bindir}/idn %{_libdir}/libidn.so.12* +%if %{with libidn_enables_emacs} %{_emacs_sitelispdir}/%{name} +%endif %files devel %{_libdir}/libidn.so @@ -118,6 +139,9 @@ rm -rf $RPM_BUILD_ROOT%{_javadir}/libidn*.jar %{_infodir}/%{name}.info.gz %changelog +* Tue Feb 15 2022 fuanan - 1.36-2 +- Add build-conditions disabling Emacs + * Thu Aug 6 2020 yangzhuangzhuang - 1.36-1 - Type:enhancement - ID:NA -- Gitee