2014-10-06 21:26:53

by Jan Engelhardt

[permalink] [raw]
Subject: libnfsidmap: build system updates


The following changes since commit f139de79d91e7773b5b98fe5aca5570f77c7aee9:

libnfsidmap: respect Nobody-User/Nobody-Group (2014-08-13 12:42:14 -0400)

are available in the git repository at:

git://git.inai.de/libnfsidmap HEAD

for you to fetch changes up to 14dc1869cb96c4bd4945bbd08e3b88e7df0c6442:

build: use a symbol version map (2014-10-06 22:59:09 +0200)

----------------------------------------------------------------
Jan Engelhardt (5):
build: rename configure.in -> .ac
build: regenerate .pc file when .pc.in changed
build: use a separate tool directory and update .gitignore
build: kill autogenerated/empty files from the SCM
build: use a symbol version map

.gitignore | 13 +++----------
Makefile.am | 4 +++-
NEWS | 1 -
configure.in => configure.ac | 3 ++-
m4/.gitignore | 2 ++
nfsidmap.map | 27 +++++++++++++++++++++++++++
6 files changed, 37 insertions(+), 13 deletions(-)
delete mode 100644 NEWS
rename configure.in => configure.ac (97%)
create mode 100644 m4/.gitignore
create mode 100644 nfsidmap.map


2014-10-06 21:26:53

by Jan Engelhardt

[permalink] [raw]
Subject: [PATCH 4/5] build: kill autogenerated/empty files from the SCM

Not using "foreign" mode caused two things:
- INSTALL is always overwritten with a copy of the GNU boilerplate
- existence of NEWS file is enforced
Switch to foreign to fix both, and nuke the quite-empty NEWS file.

Signed-off-by: Jan Engelhardt <[email protected]>
---
NEWS | 1 -
configure.ac | 2 +-
2 files changed, 1 insertion(+), 2 deletions(-)
delete mode 100644 NEWS

diff --git a/NEWS b/NEWS
deleted file mode 100644
index 5cf3e06..0000000
--- a/NEWS
+++ /dev/null
@@ -1 +0,0 @@
-There is currently no news.
diff --git a/configure.ac b/configure.ac
index 84a2ab0..78a05a6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,7 +6,7 @@ AC_INIT([libnfsidmap],[0.25],[[email protected]])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_SRCDIR([nfsidmap.h])
AC_CONFIG_MACRO_DIR([m4])
-AM_INIT_AUTOMAKE
+AM_INIT_AUTOMAKE([foreign])
LT_INIT

# Checks for programs.
--
2.0.0


2014-10-15 15:42:11

by Steve Dickson

[permalink] [raw]
Subject: Re: libnfsidmap: build system updates



On 10/06/2014 05:19 PM, Jan Engelhardt wrote:
> The following changes since commit f139de79d91e7773b5b98fe5aca5570f77c7aee9:
>
> libnfsidmap: respect Nobody-User/Nobody-Group (2014-08-13 12:42:14 -0400)
>
> are available in the git repository at:
>
> git://git.inai.de/libnfsidmap HEAD
>
> for you to fetch changes up to 14dc1869cb96c4bd4945bbd08e3b88e7df0c6442:
>
> build: use a symbol version map (2014-10-06 22:59:09 +0200)
>
> ----------------------------------------------------------------
> Jan Engelhardt (5):
> build: rename configure.in -> .ac
> build: regenerate .pc file when .pc.in changed
> build: use a separate tool directory and update .gitignore
> build: kill autogenerated/empty files from the SCM
> build: use a symbol version map
>
> .gitignore | 13 +++----------
> Makefile.am | 4 +++-
> NEWS | 1 -
> configure.in => configure.ac | 3 ++-
> m4/.gitignore | 2 ++
> nfsidmap.map | 27 +++++++++++++++++++++++++++
> 6 files changed, 37 insertions(+), 13 deletions(-)
> delete mode 100644 NEWS
> rename configure.in => configure.ac (97%)
> create mode 100644 m4/.gitignore
> create mode 100644 nfsidmap.map
>
All these were committed... a while ago...

steved.

2014-10-06 21:26:53

by Jan Engelhardt

[permalink] [raw]
Subject: [PATCH 2/5] build: regenerate .pc file when .pc.in changed

Signed-off-by: Jan Engelhardt <[email protected]>
---
Makefile.am | 1 +
1 file changed, 1 insertion(+)

diff --git a/Makefile.am b/Makefile.am
index 0832c1c..85f19c8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -59,3 +59,4 @@ dist-hook:
pkgconfigdir=$(libdir)/pkgconfig
pkgconfig_DATA = libnfsidmap.pc

+$(pkgconfig_DATA): $(top_builddir)/config.status
--
2.0.0


2014-10-06 21:26:54

by Jan Engelhardt

[permalink] [raw]
Subject: [PATCH 3/5] build: use a separate tool directory and update .gitignore

With m4/.gitignore, we ensure that the m4 directory exists in any
git checkout such that aclocal/libtoolize won't complain about
its absence during `autoreconf`.

Signed-off-by: Jan Engelhardt <[email protected]>
---
.gitignore | 13 +++----------
configure.ac | 1 +
m4/.gitignore | 2 ++
3 files changed, 6 insertions(+), 10 deletions(-)
create mode 100644 m4/.gitignore

diff --git a/.gitignore b/.gitignore
index d24d727..fd87695 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,15 +1,9 @@
Makefile.in
-aclocal.m4
-autom4te.cache/
-config.guess
-config.sub
+/aclocal.m4
+/autom4te.cache/
+/build-aux/
configure
-depcomp
-ltmain.sh
-missing
-install-sh
Makefile
-install-sh
.deps/
config.log
config.status
@@ -21,7 +15,6 @@ nsswitch.la
static.la
umich_ldap.la
configure.in~
-m4/
*.o
*.lo
cscope.*
diff --git a/configure.ac b/configure.ac
index cb5740b..84a2ab0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,6 +3,7 @@

AC_PREREQ([2.66])
AC_INIT([libnfsidmap],[0.25],[[email protected]])
+AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_SRCDIR([nfsidmap.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE
diff --git a/m4/.gitignore b/m4/.gitignore
new file mode 100644
index 0000000..64d9bbc
--- /dev/null
+++ b/m4/.gitignore
@@ -0,0 +1,2 @@
+/libtool.m4
+/lt*.m4
--
2.0.0


2014-10-06 21:26:53

by Jan Engelhardt

[permalink] [raw]
Subject: [PATCH 1/5] build: rename configure.in -> .ac

The .in suffix is long obsolete and newer autotools versions
rightfully start nagging about it.

$ autoreconf -fi
aclocal: warning: autoconf input should be named 'configure.ac',
not 'configure.in'
automake: warning: autoconf input should be named 'configure.ac',
not 'configure.in'

Signed-off-by: Jan Engelhardt <[email protected]>
---
configure.ac | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
configure.in | 67 ------------------------------------------------------------
2 files changed, 67 insertions(+), 67 deletions(-)
create mode 100644 configure.ac
delete mode 100644 configure.in

diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..cb5740b
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,67 @@
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.66])
+AC_INIT([libnfsidmap],[0.25],[[email protected]])
+AC_CONFIG_SRCDIR([nfsidmap.h])
+AC_CONFIG_MACRO_DIR([m4])
+AM_INIT_AUTOMAKE
+LT_INIT
+
+# Checks for programs.
+AC_PROG_CC
+
+# Checks for libraries.
+
+AC_ARG_ENABLE([ldap],
+ [AS_HELP_STRING([--disable-ldap],[Disable support for LDAP @<:@default=detect@:>@])])
+if test "x$enable_ldap" != "xno" ; then
+ AC_CHECK_HEADER([ldap.h],
+ [AC_CHECK_LIB([ldap], [ldap_initialize],
+ [have_ldap="yes"],[have_ldap="no"])],
+ [have_ldap="no"])
+ if test "x$have_ldap" = "xyes" ; then
+ AC_DEFINE([ENABLE_LDAP], 1, [Enable LDAP Support])
+ elif test "x$enable_ldap$have_ldap" = "xyesno" ; then
+ AC_MSG_ERROR(LDAP support not found!)
+ fi
+fi
+AM_CONDITIONAL(ENABLE_LDAP, test "x$have_ldap" = "xyes")
+
+# Should we build gums mapping library?
+AC_ARG_ENABLE([gums],
+ [AS_HELP_STRING([--enable-gums],[Enable support for the GUMS mapping library @<:@default=false@:>@])])
+if test "x$enable_gums" = "xyes" ; then
+ AC_DEFINE([ENABLE_GUMS], 1, [Enable GUMS mapping library support])
+fi
+AM_CONDITIONAL(ENABLE_GUMS, test "x$enable_gums" = "xyes")
+
+#Where do the Plugins live
+AC_ARG_WITH(pluginpath,
+ [AS_HELP_STRING([--with-pluginpath=/foo],[Causes the library to look in /foo instead of /usr/lib/libnfsidmap for plugins
+ ])],
+ path_plugins=$withval,
+ path_plugins=""
+ )
+if test -n "$path_plugins" ; then
+ AC_DEFINE_UNQUOTED(PATH_PLUGINS, "$path_plugins",
+ [Define this to change the plugins path])
+fi
+AM_CONDITIONAL(PATH_PLUGINS, test -n "$path_plugins")
+
+AC_CONFIG_HEADERS([./config.h])
+# Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS([stdlib.h string.h unistd.h errno.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_TYPE_UID_T
+AC_TYPE_SIZE_T
+
+# Checks for library functions.
+AC_FUNC_MALLOC
+AC_CHECK_FUNCS([strchr strdup])
+
+AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([libnfsidmap.pc])
+AC_OUTPUT
diff --git a/configure.in b/configure.in
deleted file mode 100644
index cb5740b..0000000
--- a/configure.in
+++ /dev/null
@@ -1,67 +0,0 @@
-# -*- Autoconf -*-
-# Process this file with autoconf to produce a configure script.
-
-AC_PREREQ([2.66])
-AC_INIT([libnfsidmap],[0.25],[[email protected]])
-AC_CONFIG_SRCDIR([nfsidmap.h])
-AC_CONFIG_MACRO_DIR([m4])
-AM_INIT_AUTOMAKE
-LT_INIT
-
-# Checks for programs.
-AC_PROG_CC
-
-# Checks for libraries.
-
-AC_ARG_ENABLE([ldap],
- [AS_HELP_STRING([--disable-ldap],[Disable support for LDAP @<:@default=detect@:>@])])
-if test "x$enable_ldap" != "xno" ; then
- AC_CHECK_HEADER([ldap.h],
- [AC_CHECK_LIB([ldap], [ldap_initialize],
- [have_ldap="yes"],[have_ldap="no"])],
- [have_ldap="no"])
- if test "x$have_ldap" = "xyes" ; then
- AC_DEFINE([ENABLE_LDAP], 1, [Enable LDAP Support])
- elif test "x$enable_ldap$have_ldap" = "xyesno" ; then
- AC_MSG_ERROR(LDAP support not found!)
- fi
-fi
-AM_CONDITIONAL(ENABLE_LDAP, test "x$have_ldap" = "xyes")
-
-# Should we build gums mapping library?
-AC_ARG_ENABLE([gums],
- [AS_HELP_STRING([--enable-gums],[Enable support for the GUMS mapping library @<:@default=false@:>@])])
-if test "x$enable_gums" = "xyes" ; then
- AC_DEFINE([ENABLE_GUMS], 1, [Enable GUMS mapping library support])
-fi
-AM_CONDITIONAL(ENABLE_GUMS, test "x$enable_gums" = "xyes")
-
-#Where do the Plugins live
-AC_ARG_WITH(pluginpath,
- [AS_HELP_STRING([--with-pluginpath=/foo],[Causes the library to look in /foo instead of /usr/lib/libnfsidmap for plugins
- ])],
- path_plugins=$withval,
- path_plugins=""
- )
-if test -n "$path_plugins" ; then
- AC_DEFINE_UNQUOTED(PATH_PLUGINS, "$path_plugins",
- [Define this to change the plugins path])
-fi
-AM_CONDITIONAL(PATH_PLUGINS, test -n "$path_plugins")
-
-AC_CONFIG_HEADERS([./config.h])
-# Checks for header files.
-AC_HEADER_STDC
-AC_CHECK_HEADERS([stdlib.h string.h unistd.h errno.h])
-
-# Checks for typedefs, structures, and compiler characteristics.
-AC_TYPE_UID_T
-AC_TYPE_SIZE_T
-
-# Checks for library functions.
-AC_FUNC_MALLOC
-AC_CHECK_FUNCS([strchr strdup])
-
-AC_CONFIG_FILES([Makefile])
-AC_CONFIG_FILES([libnfsidmap.pc])
-AC_OUTPUT
--
2.0.0


2014-10-06 21:26:53

by Jan Engelhardt

[permalink] [raw]
Subject: [PATCH 5/5] build: use a symbol version map

The symbol versions are used by the dynamic linker (and other things,
like rpm) to ensure that a program does not run with an outdated
library that still has the same SONAME.

Signed-off-by: Jan Engelhardt <[email protected]>
---
Makefile.am | 3 ++-
nfsidmap.map | 27 +++++++++++++++++++++++++++
2 files changed, 29 insertions(+), 1 deletion(-)
create mode 100644 nfsidmap.map

diff --git a/Makefile.am b/Makefile.am
index 85f19c8..69bbcbc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -26,8 +26,9 @@ pkglib_LTLIBRARIES = nsswitch.la static.la $(UMICH_LDAP_LIB) $(GUMS_MAPPING_LIB)
# by this library.

libnfsidmap_la_SOURCES = libnfsidmap.c cfg.c strlcpy.c cfg.h nfsidmap_internal.h queue.h
-libnfsidmap_la_LDFLAGS = -version-info 3:0:3
+libnfsidmap_la_LDFLAGS = -version-info 3:0:3 -Wl,--version-script=$(srcdir)/nfsidmap.map
libnfsidmap_la_LIBADD = -ldl
+libnfsidmap_la_DEPENDENCIES = nfsidmap.map

nsswitch_la_SOURCES = nss.c
nsswitch_la_LDFLAGS = -module -avoid-version
diff --git a/nfsidmap.map b/nfsidmap.map
new file mode 100644
index 0000000..540835c
--- /dev/null
+++ b/nfsidmap.map
@@ -0,0 +1,27 @@
+V_0.26 {
+global:
+ nfs4_init_name_mapping;
+ nfs4_get_default_domain;
+ nfs4_uid_to_name;
+ nfs4_gid_to_name;
+ nfs4_uid_to_owner;
+ nfs4_gid_to_group_owner;
+ nfs4_name_to_uid;
+ nfs4_name_to_gid;
+ nfs4_owner_to_uid;
+ nfs4_owner_to_gid;
+ nfs4_group_owner_to_gid;
+ nfs4_gss_princ_to_ids;
+ nfs4_gss_princ_to_grouplist;
+ nfs4_gss_princ_to_ids_ex;
+ nfs4_gss_princ_to_grouplist_ex;
+ nfs4_set_debug;
+local:
+ *;
+};
+/*
+V_0.27 {
+global:
+ ...
+} V_0.26;
+*/
--
2.0.0


2014-10-09 21:35:30

by Steve Dickson

[permalink] [raw]
Subject: Re: libnfsidmap: build system updates



On 10/06/2014 05:19 PM, Jan Engelhardt wrote:
> The following changes since commit f139de79d91e7773b5b98fe5aca5570f77c7aee9:
>
> libnfsidmap: respect Nobody-User/Nobody-Group (2014-08-13 12:42:14 -0400)
>
> are available in the git repository at:
>
> git://git.inai.de/libnfsidmap HEAD
>
> for you to fetch changes up to 14dc1869cb96c4bd4945bbd08e3b88e7df0c6442:
>
> build: use a symbol version map (2014-10-06 22:59:09 +0200)
>
> ----------------------------------------------------------------
> Jan Engelhardt (5):
> build: rename configure.in -> .ac
> build: regenerate .pc file when .pc.in changed
> build: use a separate tool directory and update .gitignore
> build: kill autogenerated/empty files from the SCM
> build: use a symbol version map
>
> .gitignore | 13 +++----------
> Makefile.am | 4 +++-
> NEWS | 1 -
> configure.in => configure.ac | 3 ++-
> m4/.gitignore | 2 ++
> nfsidmap.map | 27 +++++++++++++++++++++++++++
> 6 files changed, 37 insertions(+), 13 deletions(-)
> delete mode 100644 NEWS
> rename configure.in => configure.ac (97%)
> create mode 100644 m4/.gitignore
> create mode 100644 nfsidmap.map
>
All 5 patches committed...

steved.