From: Ralph Ronnquist Date: Mon, 24 Oct 2022 00:59:33 +0000 (+1100) Subject: updates X-Git-Url: https://git.rrq.au/?a=commitdiff_plain;h=8572228e54a6216fd38a14c2d4847188116a6ce5;p=rrq%2Fpathmap.git updates --- diff --git a/Makefile b/Makefile index a1f3982..52d522a 100644 --- a/Makefile +++ b/Makefile @@ -6,21 +6,22 @@ SBINFILES = tarmap LIBFILES = libtarmap.so libpathmap.so MAN8FILES = $(addsuffix .8,$(LIBFILES) $(SBINFILES)) HTMLDOC = $(addsuffix .html,$(MAN8FILES)) -GENFILES = $(LIBFILES) $(SBINFILES) -default: $(GENFILES) +GENFILES = $(LIBFILES) $(SBINFILES) $(MAN8FILES) -# Generic rule to compile an html file from an adoc file -%.html: %.adoc - asciidoc -bhtml $^ +default: $(GENFILES) # Generic rule to compile a man page from an adoc file %: %.adoc a2x -d manpage -f manpage $^ +# Generic rule to compile an html file from an adoc file +%.html: %.adoc + asciidoc -bhtml $^ + # Generic rule for making a dynamic library form a same named .c file %.so: %.c - gcc -Wall -fPIC -Wl,-init,so_init -shared -o $$@ $$^ -ldl + gcc -Wall -fPIC -Wl,-init,so_init -shared -o $@ $^ -ldl # Generic rule for making a binary from a same named .c file %: %.c @@ -42,6 +43,10 @@ $(LIBDIR)/% $(SBINDIR)/% $(MAN8DIR)/%: % install: $(INSTALLTARGETS) # Target for development building of the deb package -deb: - PREFIX= INCLUDE_PREFIX=/usr dpkg-buildpackage -us -uc --build=full +pool: + mkdir -p pool +deb: pool + PREFIX= INCLUDE_PREFIX=/usr XDH_OPTIONS=--destdir=pool \ + dpkg-buildpackage -us -uc --build=full + mv ../pathmap_* ../libpathmap[-_]* pool diff --git a/debian/changelog b/debian/changelog index 5a99af3..5964214 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,3 @@ pathmap (0.1) experimental; urgency=medium - - * creation + * creation -- Ralph Ronnquist Mon, 29 Mar 2021 12:51:07 +1100 diff --git a/debian/rules b/debian/rules old mode 100644 new mode 100755 index 9354bd2..942ae72 --- a/debian/rules +++ b/debian/rules @@ -3,6 +3,6 @@ %: dh $@ -# -#override_dh_usrlocal: -# true + +override_dh_usrlocal: + true diff --git a/libpathmap.8.adoc b/libpathmap.8.adoc deleted file mode 100644 index 0430292..0000000 --- a/libpathmap.8.adoc +++ /dev/null @@ -1,62 +0,0 @@ -libpathmap.so(8) -================ -:doctype: manpage -:revdate: {sys:date "+%Y-%m-%d %H:%M:%S"} -:COLON: : -:EQUALS: = - -NAME ----- -libpathmap.so - preload utility to redirect pathnames - -SYNOPSYS --------- -+LD_PRELOAD=libpathmap.so+ _command_ - -DESCRIPTION ------------ - -This dynamic library, libpathmap.so, is intended to be used as a -"preload" library for programs for which pathnames are to be mapped to -a different common prefix. The effect is somewhat similar to +chroot+ -in that absolute pathnames, which normally are from the root of the -file system, get mapped to be relative to the choosen prefix point. - -+libpathmap.so+ is "configured" by setting environment variable -+PATHMAPNOT+ to be the path prefixes, given as a colon separated list, -that +libpathmap.so+ should be concerned with. The first of them is -then used as the prefix to add to the program's pathnames (when -opening files) except to those pathnames that start with any of the -prefixes in the list, including the first. - -For example, if the prefix +/elsewhere+ should be added to all -pathnames for a program +prgrm+ then the command line might be: - ----- -PATHMAPNOT=/elsewhere LD_PRELOAD=libpathmap.so prgrm ----- - -However, if +prgrm+ is a dynamically linked executable, then all -libraries - -ENVIRONMENT ------------ - -PATHMAPNOT:: - -This environment variable tells which path prefixes, given as a colon -separated list, +libpathmap.so+ should be concerned with. The first -prefix is the one to add to all pathnames except to those of any of -the prefixes in the list. - -EXAMPLES --------- - -Assume there is a directory +/home/test/extra+ - -> env PATHMAPNOT=/home/test:/proc:/dev:/lib:/usr:/bin \ - LD_PRELOAD=libpathmap.so \ - ls /extra - -SEE ALSO --------- diff --git a/libpathmap.so.8.adoc b/libpathmap.so.8.adoc new file mode 100644 index 0000000..20fe8e5 --- /dev/null +++ b/libpathmap.so.8.adoc @@ -0,0 +1,69 @@ +libpathmap.so(8) +================ +:doctype: manpage +:revdate: {sys:date "+%Y-%m-%d %H:%M:%S"} +:COLON: : +:EQUALS: = + +NAME +---- +libpathmap.so - preload utility to redirect pathnames + +SYNOPSYS +-------- ++LD_PRELOAD=libpathmap.so+ _command_ + +DESCRIPTION +----------- + +This dynamic library, libpathmap.so, is intended to be used as a +"preload" library for programs for which pathnames are to be mapped to +a different common prefix. The effect is somewhat similar to +chroot+ +in that absolute pathnames, which normally are from the root of the +file system, get mapped to be relative to the choosen prefix point. + ++libpathmap.so+ is "configured" by setting environment variable ++PATHMAPNOT+ to be the path prefixes, given as a colon separated list, +that +libpathmap.so+ should be concerned with. The first of them is +then used as the prefix to add to the program's pathnames (when +opening files) except to those pathnames that start with any of the +prefixes in the list, including the first. + +For example, if the prefix +/elsewhere+ should be added to all +pathnames for a program +prgrm+ then the command line might be: + +---- +PATHMAPNOT=/elsewhere LD_PRELOAD=libpathmap.so prgrm +---- + +However, if +prgrm+ is a dynamically linked executable, then all +libraries + +ENVIRONMENT +----------- + +PATHMAPNOT:: + +This environment variable tells which path prefixes, given as a colon +separated list, +libpathmap.so+ should be concerned with. The first +prefix is the one to add to all pathnames except to those of any of +the prefixes in the list. + +EXAMPLES +-------- + +Assume there is a directory +/home/test/extra+ + +---- +env PATHMAPNOT=/home/test:/proc:/dev:/lib:/usr:/bin \ + LD_PRELOAD=libpathmap.so \ + ls /extra +---- + +SEE ALSO +-------- + +libtarmap.so:: + +something + diff --git a/libtarmap.8.adoc b/libtarmap.8.adoc deleted file mode 100644 index 31f92bb..0000000 --- a/libtarmap.8.adoc +++ /dev/null @@ -1,62 +0,0 @@ -libtarmap.so(8) -=============== -:doctype: manpage -:revdate: {sys:date "+%Y-%m-%d %H:%M:%S"} -:COLON: : -:EQUALS: = - -NAME ----- -libtarmap.so - preload utility to map pathnames into a tar file - -SYNOPSYS --------- -+LD_PRELOAD=libtarmap.so+ +TARMAP=+_tarfile_ _command_ - -DESCRIPTION ------------ - -This dynamic library, libtarmap.so, is intended to be used as a -"preload" library for programs for which pathnames are to be mapped to -a different common prefix. The effect is somewhat similar to +chroot+ -in that absolute pathnames, which normally are from the root of the -file system, get mapped to be relative to the choosen prefix point. - -+libtarmap.so+ is "configured" by setting environment variable -+PATHMAPNOT+ to be the path prefixes, given as a colon separated list, -that +libtarmap.so+ should be concerned with. The first of them is -then used as the prefix to add to the program's pathnames (when -opening files) except to those pathnames that start with any of the -prefixes in the list, including the first. - -For example, if the prefix +/elsewhere+ should be added to all -pathnames for a program +prgrm+ then the command line might be: - ----- -PATHMAPNOT=/elsewhere LD_PRELOAD=libtarmap.so prgrm ----- - -However, if +prgrm+ is a dynamically linked executable, then all -libraries - -ENVIRONMENT ------------ - -PATHMAPNOT:: - -This environment variable tells which path prefixes, given as a colon -separated list, +libtarmap.so+ should be concerned with. The first -prefix is the one to add to all pathnames except to those of any of -the prefixes in the list. - -EXAMPLES --------- - -Assume there is a directory +/home/test/extra+ - -> env PATHMAPNOT=/home/test:/proc:/dev:/lib:/usr:/bin \ - LD_PRELOAD=libtarmap.so \ - ls /extra - -SEE ALSO --------- diff --git a/libtarmap.so.8.adoc b/libtarmap.so.8.adoc new file mode 100644 index 0000000..ca477bc --- /dev/null +++ b/libtarmap.so.8.adoc @@ -0,0 +1,71 @@ +libtarmap.so(8) +=============== +:doctype: manpage +:revdate: {sys:date "+%Y-%m-%d %H:%M:%S"} +:COLON: : +:EQUALS: = + +NAME +---- +libtarmap.so - preload utility to map pathnames into a tar file + +SYNOPSYS +-------- ++LD_PRELOAD=libtarmap.so+ +TARMAP=+_tarfile_ _command_ + +DESCRIPTION +----------- + +This dynamic library, libtarmap.so, is intended to be used as a +"preload" library for programs for which pathnames are to be mapped to +a different common prefix. The effect is somewhat similar to +chroot+ +in that absolute pathnames, which normally are from the root of the +file system, get mapped to be relative to the choosen prefix point. + ++libtarmap.so+ is "configured" by setting environment variable ++PATHMAPNOT+ to be the path prefixes, given as a colon separated list, +that +libtarmap.so+ should be concerned with. The first of them is +then used as the prefix to add to the program's pathnames (when +opening files) except to those pathnames that start with any of the +prefixes in the list, including the first. + +For example, if the prefix +/elsewhere+ should be added to all +pathnames for a program +prgrm+ then the command line might be: + +---- +PATHMAPNOT=/elsewhere LD_PRELOAD=libtarmap.so prgrm +---- + +However, if +prgrm+ is a dynamically linked executable, then all +libraries + +ENVIRONMENT +----------- + +PATHMAPNOT:: + +This environment variable tells which path prefixes, given as a colon +separated list, +libtarmap.so+ should be concerned with. The first +prefix is the one to add to all pathnames except to those of any of +the prefixes in the list. + +EXAMPLES +-------- + +Assume there is a directory +/home/test/extra+ + +---- +env PATHMAPNOT=/home/test:/proc:/dev:/lib:/usr:/bin \ + LD_PRELOAD=libtarmap.so \ + ls /extra +---- + +SEE ALSO +-------- + +tarmap:: + +aaa + +libpathmap.so:: +aaa diff --git a/tarmap.8.adoc b/tarmap.8.adoc new file mode 100644 index 0000000..86e7961 --- /dev/null +++ b/tarmap.8.adoc @@ -0,0 +1,69 @@ +tarmap(8) +========= +:doctype: manpage +:revdate: {sys:date "+%Y-%m-%d %H:%M:%S"} +:COLON: : +:EQUALS: = + +NAME +---- +tarmap - run command with libtarmap.so preloading + +SYNOPSYS +-------- ++tarmap+ _tarfile_ _command_ + +DESCRIPTION +----------- + +TBD + +This dynamic library, libtarmap.so, is intended to be used as a +"preload" library for programs for which pathnames are to be mapped to +a different common prefix. The effect is somewhat similar to +chroot+ +in that absolute pathnames, which normally are from the root of the +file system, get mapped to be relative to the choosen prefix point. + ++libtarmap.so+ is "configured" by setting environment variable ++PATHMAPNOT+ to be the path prefixes, given as a colon separated list, +that +libtarmap.so+ should be concerned with. The first of them is +then used as the prefix to add to the program's pathnames (when +opening files) except to those pathnames that start with any of the +prefixes in the list, including the first. + +For example, if the prefix +/elsewhere+ should be added to all +pathnames for a program +prgrm+ then the command line might be: + +---- +PATHMAPNOT=/elsewhere LD_PRELOAD=libtarmap.so prgrm +---- + +However, if +prgrm+ is a dynamically linked executable, then all +libraries + +ENVIRONMENT +----------- + +PATHMAPNOT:: + +This environment variable tells which path prefixes, given as a colon +separated list, +libtarmap.so+ should be concerned with. The first +prefix is the one to add to all pathnames except to those of any of +the prefixes in the list. + +EXAMPLES +-------- + +Assume there is a directory +/home/test/extra+ + +SEE ALSO +-------- + +libtarmap.so:: + +a + +libpathmap.so:: + +b +