From 46b44d5f433764fb7976da47f449b35d31b04098 Mon Sep 17 00:00:00 2001
From: Laurent Bercot
Date: Sun, 6 Dec 2020 21:07:44 +0000
Subject: Prepare for 0.1.0.0; don't install utmpx.h by default
New --enable-libc-includes configure option to overwrite the
system utmpx.h
---
Makefile | 6 +++---
NEWS | 5 ++++-
configure | 9 +++++++++
doc/index.html | 4 ++--
doc/libutmps/index.html | 25 ++++++++++++++++++++++---
doc/upgrade.html | 6 +++++-
package/info | 2 +-
package/targets.mak | 4 ++++
8 files changed, 50 insertions(+), 11 deletions(-)
diff --git a/Makefile b/Makefile
index 9cb6494..9dd4ab1 100644
--- a/Makefile
+++ b/Makefile
@@ -57,7 +57,7 @@ ALL_BINS := $(LIBEXEC_TARGETS) $(BIN_TARGETS)
ALL_LIBS := $(SHARED_LIBS) $(STATIC_LIBS) $(INTERNAL_LIBS)
ALL_INCLUDES := $(wildcard src/include/$(package)/*.h)
-all: $(ALL_LIBS) $(ALL_BINS) $(ALL_INCLUDES) src/include/utmpx.h
+all: $(ALL_LIBS) $(ALL_BINS) $(ALL_INCLUDES) $(EXTRA_INCLUDES)
clean:
@exec rm -f $(ALL_LIBS) $(ALL_BINS) $(wildcard src/*/*.o src/*/*.lo) $(EXTRA_TARGETS)
@@ -86,7 +86,7 @@ install-dynlib: $(SHARED_LIBS:lib%.so.xyzzy=$(DESTDIR)$(dynlibdir)/lib%.so)
install-libexec: $(LIBEXEC_TARGETS:%=$(DESTDIR)$(libexecdir)/%)
install-bin: $(BIN_TARGETS:%=$(DESTDIR)$(bindir)/%)
install-lib: $(STATIC_LIBS:lib%.a.xyzzy=$(DESTDIR)$(libdir)/lib%.a)
-install-include: $(ALL_INCLUDES:src/include/$(package)/%.h=$(DESTDIR)$(includedir)/$(package)/%.h) $(DESTDIR)$(includedir)/utmpx.h
+install-include: $(ALL_INCLUDES:src/include/$(package)/%.h=$(DESTDIR)$(includedir)/$(package)/%.h) $(EXTRA_INCLUDES:src/include/%.h=$(DESTDIR)$(includedir)/%.h)
install-data: $(ALL_DATA:src/etc/%=$(DESTDIR)$(datadir)/%)
ifneq ($(exthome),)
@@ -128,7 +128,7 @@ $(DESTDIR)$(libdir)/lib%.a: lib%.a.xyzzy
$(DESTDIR)$(includedir)/$(package)/%.h: src/include/$(package)/%.h
exec $(INSTALL) -D -m 644 $< $@
-$(DESTDIR)$(includedir)/utmpx.h: src/include/utmpx.h
+$(DESTDIR)$(includedir)/%.h: src/include/%.h
exec $(INSTALL) -D -m 644 $< $@
%.o: %.c
diff --git a/NEWS b/NEWS
index 131d82c..8a5f857 100644
--- a/NEWS
+++ b/NEWS
@@ -1,9 +1,12 @@
Changelog for utmps.
-In 0.0.3.3
+In 0.1.0.0
----------
- Bugfixes.
+ - utmpx.h is not installed by default anymore.
+You now need to explicitly give the --enable-libc-includes
+configure option.
In 0.0.3.2
diff --git a/configure b/configure
index 545c3c6..fcd5d2a 100755
--- a/configure
+++ b/configure
@@ -46,6 +46,7 @@ Optional features:
--enable-absolute-paths do not rely on PATH to access this package's binaries,
hardcode absolute BINDIR/foobar paths instead [disabled]
--enable-nsss use the nsss library for user information [disabled]
+ --enable-libc-includes overwrite utmpx.h in includedir [disabled]
--with-utmpd-socket=PATH assume the utmpd socket is at PATH [/run/utmps/.utmpd-socket]
--with-wtmpd-socket=PATH assume the wtmpd socket is at PATH [/run/utmps/.wtmpd-socket]
@@ -163,6 +164,7 @@ addlibdpath=''
vpaths=''
vpathd=''
build=
+libcincludes=false
utmpdpath=/run/utmps/.utmpd-socket
wtmpdpath=/run/utmps/.wtmpd-socket
@@ -195,6 +197,8 @@ for arg ; do
--disable-slashpackage) sproot= ; slashpackage=false ;;
--enable-absolute-paths|--enable-absolute-paths=yes) abspath=true ;;
--disable-absolute-paths|--enable-absolute-paths=no) abspath=false ;;
+ --enable-libc-includes|--enable-libc-includes=yes) libcincludes=true ;;
+ --disable-libc-includes|--enable-libc-includes=no) libcincludes=false ;;
--enable-nsss|--enable-nsss=yes) usensss=true ;;
--disable-nsss|--enable-nsss=no) usensss=false ;;
--enable-*|--disable-*|--with-*|--without-*|--*dir=*) ;;
@@ -448,6 +452,11 @@ if $allpic ; then
else
echo "STATIC_LIBS_ARE_PIC :="
fi
+if $libcincludes ; then
+ echo "DO_LIBC_INCLUDES := 1"
+else
+ echo "DO_LIBC_INCLUDES :="
+fi
if $usensss ; then
echo "LIBNSSS := -lnsss"
echo "MAYBEPTHREAD_LIB := -lpthread"
diff --git a/doc/index.html b/doc/index.html
index 247a9a0..a911019 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -70,13 +70,13 @@ suitable replacement for
utmps is free software. It is available under the
-ISC license.
+ISC license.
Download
- - The current released version of utmps is 0.0.3.3.
+ - The current released version of utmps is 0.1.0.0.
- Alternatively, you can checkout a copy of the
utmps
git repository:
diff --git a/doc/libutmps/index.html b/doc/libutmps/index.html
index f2fb86f..dc41fda 100644
--- a/doc/libutmps/index.html
+++ b/doc/libutmps/index.html
@@ -35,6 +35,17 @@ interface, which in utmps is implemented as a series of thin wrappers
around the utmps library.
+
+ A suitable utmpx.h header can be found in the utmps/
+subdirectory of
+the header installation directory; if the --enable-libc-includes
+option has been given to configure, it can also be found directly
+in that directory. (Example: /usr/include/utmps/utmpz.h is
+always installed, but if the option has been given at nsss build time,
+/usr/include/utmpx.h is also installed and replaces the
+version provided by the libc.)
+
+
Compiling
@@ -42,9 +53,17 @@ around the utmps library.
are visible in your header search path.
- Use #include <utmps/utmps.h>
- To use the standard utmpx.h interface, you can
-just #include <utmpx.h>, which will work as long
-as the utmps/utmpx.h header is accessible in your header
-search path.
+just #include <utmpx.h>, which will work:
+
+ - either if the --enable-libc-includes option
+has been given at utmps build time
+ - or if you give the -I/usr/include/utmps option
+to your compiler. (Depending on your standard header location,
+specify that the header search path should include the
+utmps subdirectory of that location.) This is useful when
+the administrator did not want to overwrite the libc-provided
+utmpx.h file when they installed utmps.
+
Linking
diff --git a/doc/upgrade.html b/doc/upgrade.html
index d700919..a01dfc3 100644
--- a/doc/upgrade.html
+++ b/doc/upgrade.html
@@ -18,13 +18,17 @@
What has changed in utmps
- in 0.0.3.3
+ in 0.1.0.0
- skalibs
dependency bumped to 2.10.0.0.
- s6 run-time
dependency bumped to 2.10.0.0.
+ - The utmpx.h header files is
+not installed by default anymore. You now need to explicitly give the
+--enable-libc-includes configure option in order to install it. The
+point of this change is to avoid overwriting libc headers accidentally.
in 0.0.3.2
diff --git a/package/info b/package/info
index d4afb81..ea11f8e 100644
--- a/package/info
+++ b/package/info
@@ -1,4 +1,4 @@
package=utmps
-version=0.0.3.3
+version=0.1.0.0
category=admin
package_macro_name=UTMPS
diff --git a/package/targets.mak b/package/targets.mak
index ff763be..3ff5217 100644
--- a/package/targets.mak
+++ b/package/targets.mak
@@ -5,3 +5,7 @@ utmps-wtmpd
LIBEXEC_TARGETS :=
LIB_DEFS := UTMPS=utmps
+
+ifneq ($(DO_LIBC_INCLUDES),)
+EXTRA_INCLUDES := src/include/utmpx.h
+endif
--
cgit 1.4.1