From f585bea3c1291030ddd9656877b782deb6e966f9 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sun, 05 May 2013 22:58:17 -0400 Subject: Make man/ non-recursive. --- diff --git a/Makefile.in b/Makefile.in index aa7eb45..eafdf97 100644 --- a/Makefile.in +++ b/Makefile.in @@ -52,9 +52,11 @@ MACROS = \ include $(srcdir)/src/local.mk include $(srcdir)/lib/local.mk +include $(srcdir)/man/local.mk bin = $(src_bin) pkglib = $(lib_pkglib) +man1 = $(man_man1) distdir = $(package_name)-$(package_version) distfiles = \ @@ -68,20 +70,18 @@ distfiles = \ TODO \ $(src_distfiles) -all: all-exec +all: all-exec all-data @printf 'Making locales...\n' @cd locale && $(MAKE) $(MACROS) all - @printf 'Making manual pages...\n' - @cd man && $(MAKE) $(MACROS) all all-exec: all-bin all-pkglib all-bin: $(bin) all-pkglib: $(pkglib) +all-data: all-man1 +all-man1: $(man1) -clean: clean-exec +clean: clean-exec clean-data @printf 'Cleaning locales...\n' @cd locale && $(MAKE) $(MACROS) clean - @printf 'Cleaning manual pages...\n' - @cd man && $(MAKE) $(MACROS) clean clean-exec: clean-bin clean-pkglib clean-bin: @for f in $(bin); do \ @@ -93,12 +93,16 @@ clean-pkglib: printf ' RM %s\n' "$${f}"; \ rm -f "$${f}"; \ done +clean-data: clean-man1 +clean-man1: + @for f in $(man1); do \ + printf ' RM %s\n' "$${f}"; \ + rm -f "$${f}"; \ + done -install: all install-exec +install: all install-exec install-data @printf 'Installing locales...\n' @cd locale && $(MAKE) $(MACROS) install - @printf 'Installing manual pages...\n' - @cd man && $(MAKE) $(MACROS) install install-exec: install-bin install-pkglib install-bin: @mkdir -p '$(DESTDIR)/$(bindir)' @@ -120,12 +124,21 @@ install-pkglib: cp "$${f}" "$(DESTDIR)/$(pkglibdir)/$${ff}"; \ chmod 644 "$(DESTDIR)/$(pkglibdir)/$${ff}"; \ done +install-data: install-man1 +install-man1: + @mkdir -p '$(DESTDIR)/$(man1dir)' + @for f in $(man1); do \ + printf ' INSTALL %s\n' "$${f}"; \ + ff="$$(printf '%s' "$${f}" | sed 's|^[^/]*/||')"; \ + [ "x$${ff%/?*}" != "x$${ff}" ] && \ + mkdir -p "$(DESTDIR)/$(man1dir)/$${ff%/?*}"; \ + cp "$${f}" "$(DESTDIR)/$(man1dir)/$${ff}"; \ + chmod 644 "$(DESTDIR)/$(man1dir)/$${ff}"; \ + done -uninstall: uninstall-exec +uninstall: uninstall-exec uninstall-data @printf 'Uninstalling locales...\n' @cd locale && $(MAKE) $(MACROS) uninstall - @printf 'Uninstalling manual pages...\n' - @cd man && $(MAKE) $(MACROS) uninstall uninstall-exec: uninstall-bin uninstall-pkglib uninstall-bin: @for f in $(bin); do \ @@ -139,6 +152,13 @@ uninstall-pkglib: ff="$$(printf '%s' "$${f}" | sed 's|^[^/]*/||')"; \ rm -f "$(DESTDIR)/$(pkglibdir)/$${ff}"; \ done +uninstall-data: uninstall-man1 +uninstall-man1: + @for f in $(man1); do \ + printf ' RM %s\n' "$${f}"; \ + ff="$$(printf '%s' "$${f}" | sed 's|^[^/]*/||')"; \ + rm -f "$(DESTDIR)/$(man1dir)/$${ff}"; \ + done $(distdir): @mkdir -p '$(distdir)' diff --git a/man/local.mk b/man/local.mk new file mode 100644 index 0000000..936449e --- /dev/null +++ b/man/local.mk @@ -0,0 +1,52 @@ +# opkhelper +# lib/buildsystem/local.mk +# +# Copyright (C) 2012-2013 Patrick "P. J." McDermott +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +man_srcs1 = \ + man/oh-installfiles.1in \ + man/oh-strip.1in \ + man/oh-fixperms.1in \ + man/oh-autoconfigure.1in \ + man/oh-autobuild.1in \ + man/oh-autoclean.1in \ + man/oh-autotest.1in \ + man/oh-autoinstall.1in \ + man/oh-architecture.1in +man_man1 = $(man_srcs1:.1in=.1) +man_distfiles = man/local.mk $(man_srcs1) + +man_script = \ + s&@@PACKAGE_NAME@@&$(package_name)&;\ + s&@@PACKAGE_VERSION@@&$(package_version)&;\ + s&@@PACKAGE_DESCRIPTION@@&$(package_description)&; + +.SUFFIXES: .1in .1 + +.1in.1: + @printf ' SED %s\n' '$*.1' + @abmon='Nul Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec '; \ + date=$$(LC_TIME=POSIX ls -l '$(srcdir)/$*.1in' | sed 's/ / /g' | \ + cut -d ' ' -f 6-8); \ + md="$${date% *}"; \ + m="$$(echo $${abmon% $${md% *} *} | wc -w)"; \ + d="$${md#* }"; \ + [ $${m} -lt 10 ] && m="0$${m}"; \ + [ $${d} -lt 10 ] && d="0$${d}"; \ + y="$${date##* }"; \ + [ "$${y%:*}" != "$${y}" ] && y=$$(date '+%Y'); \ + sed "$(man_script) s&@@DATE@@&$${y}-$${m}-$${d}&;" \ + '$(srcdir)/$*.1in' >'$*.1' diff --git a/man/oh-architecture.1.in b/man/oh-architecture.1in index 6f0c6dd..6f0c6dd 100644 --- a/man/oh-architecture.1.in +++ b/man/oh-architecture.1in diff --git a/man/oh-autobuild.1.in b/man/oh-autobuild.1in index e64b98b..e64b98b 100644 --- a/man/oh-autobuild.1.in +++ b/man/oh-autobuild.1in diff --git a/man/oh-autoclean.1.in b/man/oh-autoclean.1in index 3e5dabb..3e5dabb 100644 --- a/man/oh-autoclean.1.in +++ b/man/oh-autoclean.1in diff --git a/man/oh-autoconfigure.1.in b/man/oh-autoconfigure.1in index d086f74..d086f74 100644 --- a/man/oh-autoconfigure.1.in +++ b/man/oh-autoconfigure.1in diff --git a/man/oh-autoinstall.1.in b/man/oh-autoinstall.1in index fbadf6a..fbadf6a 100644 --- a/man/oh-autoinstall.1.in +++ b/man/oh-autoinstall.1in diff --git a/man/oh-autotest.1.in b/man/oh-autotest.1in index 49a16ca..49a16ca 100644 --- a/man/oh-autotest.1.in +++ b/man/oh-autotest.1in diff --git a/man/oh-fixperms.1.in b/man/oh-fixperms.1in index aa51c64..aa51c64 100644 --- a/man/oh-fixperms.1.in +++ b/man/oh-fixperms.1in diff --git a/man/oh-installfiles.1.in b/man/oh-installfiles.1in index bbc3a21..bbc3a21 100644 --- a/man/oh-installfiles.1.in +++ b/man/oh-installfiles.1in diff --git a/man/oh-strip.1.in b/man/oh-strip.1in index fb0ca44..fb0ca44 100644 --- a/man/oh-strip.1.in +++ b/man/oh-strip.1in -- cgit v0.9.1