Description: Devolving to Makefile.in the task of mangling and renaming the manual page and avoiding unwanted files
 Mangling manual sessions session id as per Debian Tcl/Tk policy and correcting unexpected
 behavior of the freshly copied install-sh that let's files created by the build process
 slip into the binary package. Also remove useless creation of /usr/bin and /usr/lib/include
 directories within the target installation tree
Author: Massimo Manghi
Last-Update: 2026-05-08
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/Makefile.in
+++ b/Makefile.in
@@ -215,6 +215,11 @@
 #========================================================================
 
 doc: doc/tclcurl.n doc/tclcurl.html
+	@targets='$(srcdir)/doc/*.n'; for i in $$targets; do \
+	    echo "mangling $$i manual pages" ; \
+	    target=$${i%.n}.3tcl; \
+	    sed -e 's/(n)/(3tcl)/g' < "$$i" > "$$target"; \
+	done
 
 doc/tclcurl.n: doc/tclcurl.n.md
 	@if test -z "$(TCLCURL_DOC_GEN)"; then \
@@ -240,12 +245,6 @@
 #========================================================================
 
 install-libraries: libraries
-	@$(INSTALL_DATA_DIR) "$(DESTDIR)$(includedir)"
-	@echo "Installing header files in $(DESTDIR)$(includedir)"
-	@list='$(PKG_HEADERS)'; for i in $$list; do \
-	    echo "Installing $(srcdir)/$$i" ; \
-	    $(INSTALL_DATA) $(srcdir)/$$i "$(DESTDIR)$(includedir)" ; \
-	done;
 
 #========================================================================
 # Install documentation.  Unix manpages should go in the $(mandir)
@@ -253,11 +252,12 @@
 #========================================================================
 
 install-doc: doc
-	@$(INSTALL_DATA_DIR) "$(DESTDIR)$(mandir)/mann"
-	@echo "Installing documentation in $(DESTDIR)$(mandir)"
-	@list='$(srcdir)/doc/*.n'; for i in $$list; do \
+	@$(INSTALL_DATA_DIR) "$(DESTDIR)$(mandir)/man3"
+	@echo "Installing documentation in $(DESTDIR)$(mandir)/man3"
+	@list='$(srcdir)/doc/*.3tcl'; for i in $$list; do \
 	    echo "Installing $$i"; \
-	    $(INSTALL_DATA) $$i "$(DESTDIR)$(mandir)/mann" ; \
+	    rm -f $(DESTDIR)$(mandir)/man3/`basename $$i`; \
+	    $(INSTALL_DATA) $$i "$(DESTDIR)$(mandir)/man3" ; \
 	done
 
 test: binaries libraries
@@ -459,13 +459,6 @@
 #========================================================================
 
 install-bin-binaries: binaries
-	@$(INSTALL_DATA_DIR) "$(DESTDIR)$(bindir)"
-	@list='$(bin_BINARIES)'; for p in $$list; do \
-	  if test -f $$p; then \
-	    echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p"; \
-	    $(INSTALL_PROGRAM) $$p "$(DESTDIR)$(bindir)/$$p"; \
-	  fi; \
-	done
 
 #========================================================================
 # This rule installs the scripts that are part of TclCurl.
@@ -474,7 +467,7 @@
 install-scripts: scripts
 	@for i in generic/$(TCLCURL_SCRIPTS) ; do    \
 		echo "Installing $$i" ;              \
-		$(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(pkglibdir) ; \
+		$(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(pkglibdir)/`basename $$i` ; \
 	done;
 
 Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
