summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2013-05-09 13:04:08 (EDT)
committer P. J. McDermott <pjm@nac.net>2013-05-09 13:04:08 (EDT)
commit06c0c9b068bbc94eb82dc317ffc811d1c58d3e38 (patch)
tree00897fb9c05965a5290e0eb3575cafde1e288f1b
parente214ce9fa75a77436bbca77ffc9b78de31962277 (diff)
parent2dc3f08dc7219fb292f1c72ad2b1b05b0ce8a439 (diff)
Merge branch 'feature/build-system-improvements'.
-rw-r--r--Makefile.in230
-rwxr-xr-xconfigure30
-rw-r--r--lib/Makefile.in78
-rw-r--r--lib/buildsystem/Makefile.in71
-rw-r--r--lib/buildsystem/local.mk22
-rw-r--r--lib/local.mk23
-rw-r--r--locale/Makefile.in72
-rw-r--r--locale/local.mk20
-rw-r--r--man/Makefile.in85
-rw-r--r--man/local.mk28
-rw-r--r--man/oh-architecture.1in (renamed from man/oh-architecture.1.in)0
-rw-r--r--man/oh-autobuild.1in (renamed from man/oh-autobuild.1.in)0
-rw-r--r--man/oh-autoclean.1in (renamed from man/oh-autoclean.1.in)0
-rw-r--r--man/oh-autoconfigure.1in (renamed from man/oh-autoconfigure.1.in)0
-rw-r--r--man/oh-autoinstall.1in (renamed from man/oh-autoinstall.1.in)0
-rw-r--r--man/oh-autotest.1in (renamed from man/oh-autotest.1.in)0
-rw-r--r--man/oh-fixperms.1in (renamed from man/oh-fixperms.1.in)0
-rw-r--r--man/oh-installfiles.1in (renamed from man/oh-installfiles.1.in)0
-rw-r--r--man/oh-strip.1in (renamed from man/oh-strip.1.in)0
-rw-r--r--src/Makefile.in85
-rw-r--r--src/local.mk28
21 files changed, 311 insertions, 461 deletions
diff --git a/Makefile.in b/Makefile.in
index c699c11..3c9f2f7 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -19,14 +19,19 @@
package_name = @package_name@
package_version= @package_version@
+package_library = @package_library@
srcdir = @srcdir@
prefix = @prefix@
bindir = @bindir@
libdir = @libdir@
+pkglibdir = @pkglibdir@
+# FIXME: libopkhelper is deprecated. Migrate code and remove this variable.
+libopkhelper = @libopkhelper@
datadir = @datadir@
mandir = @mandir@
-libopkhelper = @libopkhelper@
+man1dir = @man1dir@
+localedir = @localedir@
libopkbuild_1 = @libopkbuild_1@
DESTDIR = /
@@ -34,75 +39,176 @@ DESTDIR = /
sh = @sh@
archtab = @archtab@
-MACROS = \
- 'DESTDIR=$(DESTDIR)' \
- 'prefix=$(prefix)' \
- 'bindir=$(bindir)' \
- 'libdir=$(libdir)' \
- 'datadir=$(datadir)' \
- 'mandir=$(mandir)' \
- 'libopkhelper=$(libopkhelper)' \
- 'libopkbuild_1=$(libopkbuild_1)' \
- 'archtab=$(archtab)'
+pkglibbuildsystemdir = $(pkglibdir)/buildsystem
+
+include $(srcdir)/src/local.mk
+include $(srcdir)/lib/local.mk
+include $(srcdir)/lib/buildsystem/local.mk
+include $(srcdir)/man/local.mk
+include $(srcdir)/locale/local.mk
+
+bin = $(bin_srcs:.sh=)
+pkglib = $(pkglib_srcs:.sh=.sm)
+pkglibbuildsystem = $(pkglibbuildsystem_srcs:.sh=.sm)
+man1 = $(man1_srcs:.1in=.1)
+locale = $(locale_srcs:.sh=.ms)
distdir = $(package_name)-$(package_version)
-distfiles = configure Makefile.in COPYING.2 COPYING.3 \
- README INSTALL ChangeLog TODO
+distfiles = \
+ configure \
+ Makefile.in \
+ COPYING.2 \
+ COPYING.3 \
+ README \
+ INSTALL \
+ ChangeLog \
+ TODO \
+ src/local.mk \
+ lib/local.mk \
+ man/local.mk \
+ locale/local.mk \
+ $(bin_srcs) \
+ $(pkglib_srcs) \
+ $(pkglibbuildsystem_srcs) \
+ $(man1_srcs) \
+ $(locale_srcs)
+
+# FIXME: libopkhelper is deprecated. Migrate code and remove this variable.
+script = \
+ s&@@PACKAGE_NAME@@&$(package_name)&;\
+ s&@@PACKAGE_VERSION@@&$(package_version)&;\
+ s&@@PACKAGE_DESCRIPTION@@&$(package_description)&;\
+ s&@@PKGLIBDIR@@&$(pkglibdir)&;\
+ s&@@LIBOPKHELPER@@&$(libopkhelper)&;\
+ s&@@LOCALEDIR@@&$(localedir)&;\
+ s&@@SH@@&$(sh)&;
.SUFFIXES:
+.SUFFIXES: .sh .sm .1in .1 .ms
+
+.sh:
+ @printf ' SED %s\n' '$*'
+ @sed '$(script)' '$(srcdir)/$*.sh' >'$*'
+
+.sh.sm:
+ @printf ' SED %s\n' '$*.sm'
+ @sed '$(script)' '$(srcdir)/$*.sh' >'$*.sm'
+
+.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 "$(script) s&@@DATE@@&$${y}-$${m}-$${d}&;" \
+ '$(srcdir)/$*.1in' >'$*.1'
+
+.sh.ms:
+ @printf ' CP %s\n' '$*.ms'
+ @obj='$*'; mkdir -p "$${obj%/*}"
+ @cp '$(srcdir)/$*.sh' '$*.ms'
+
+all: all-exec all-data
+all-exec: all-bin all-pkglib all-pkglibbuildsystem
+all-bin: $(bin)
+all-pkglib: $(pkglib)
+all-pkglibbuildsystem: $(pkglibbuildsystem)
+all-data: all-man1 all-locale
+all-man1: $(man1)
+all-locale: $(locale)
+
+clean_cmds = \
+ set -e; \
+ for f in $${files}; do \
+ printf ' RM %s\n' "$${f}"; \
+ rm -f "$${f}"; \
+ done
+clean: clean-exec clean-data
+clean-exec: clean-bin clean-pkglib clean-pkglibbuildsystem
+clean-bin:
+ @files='$(bin)'; $(clean_cmds)
+clean-pkglib:
+ @files='$(pkglib)'; $(clean_cmds)
+clean-pkglibbuildsystem:
+ @files='$(pkglibbuildsystem)'; $(clean_cmds)
+clean-data: clean-man1 clean-locale
+clean-man1:
+ @files='$(man1)'; $(clean_cmds)
+clean-locale:
+ @files='$(locale)'; $(clean_cmds)
+
+install_cmds = \
+ set -e; \
+ mkdir -p "$(DESTDIR)/$${dir}"; \
+ for f in $${files}; do \
+ printf ' INSTALL %s\n' "$${f}"; \
+ ff="$$(basename "$${f}")"; \
+ cp "$${f}" "$(DESTDIR)/$${dir}/$${ff}"; \
+ chmod "$${mode}" "$(DESTDIR)/$${dir}/$${ff}"; \
+ done
+install: all install-exec install-data
+install-exec: all-exec install-bin install-pkglib install-pkglibbuildsystem
+install-bin:
+ @files='$(bin)'; dir='$(bindir)'; mode='755'; $(install_cmds)
+install-pkglib:
+ @files='$(pkglib)'; dir='$(pkglibdir)'; mode='644'; $(install_cmds)
+install-pkglibbuildsystem:
+ @files='$(pkglibbuildsystem)'; dir='$(pkglibbuildsystemdir)'; \
+ mode='644'; $(install_cmds)
+install-data: all-data install-man1 install-locale
+install-man1:
+ @files='$(man1)'; dir='$(man1dir)'; mode='644'; $(install_cmds)
+install-locale:
+ @mkdir -p '$(DESTDIR)/$(localedir)'
+ @set -e; for f in $(locale); do \
+ printf ' INSTALL %s\n' "$${f}"; \
+ ff="$$(printf '%s' "$${f}" | sed 's|^[^/]*/||')"; \
+ [ "x$${ff%/?*}" != "x$${ff}" ] && \
+ mkdir -p "$(DESTDIR)/$(localedir)/$${ff%/?*}"; \
+ cp "$${f}" "$(DESTDIR)/$(localedir)/$${ff}"; \
+ chmod 644 "$(DESTDIR)/$(localedir)/$${ff}"; \
+ done
-all:
- @printf 'Making executable files...\n'
- @cd src && $(MAKE) $(MACROS) all
- @printf 'Making library files...\n'
- @cd lib && $(MAKE) $(MACROS) all
- @cd lib/buildsystem && $(MAKE) $(MACROS) all
- @printf 'Making locales...\n'
- @cd locale && $(MAKE) $(MACROS) all
- @printf 'Making manual pages...\n'
- @cd man && $(MAKE) $(MACROS) all
-
-clean:
- @printf 'Cleaning executable files...\n'
- @cd src && $(MAKE) $(MACROS) clean
- @printf 'Cleaning library files...\n'
- @cd lib && $(MAKE) $(MACROS) clean
- @cd lib/buildsystem && $(MAKE) $(MACROS) clean
- @printf 'Cleaning locales...\n'
- @cd locale && $(MAKE) $(MACROS) clean
- @printf 'Cleaning manual pages...\n'
- @cd man && $(MAKE) $(MACROS) clean
-
-install: all
- @printf 'Installing executable files...\n'
- @cd src && $(MAKE) $(MACROS) install
- @printf 'Installing library files...\n'
- @cd lib && $(MAKE) $(MACROS) install
- @cd lib/buildsystem && $(MAKE) $(MACROS) install
- @printf 'Installing locales...\n'
- @cd locale && $(MAKE) $(MACROS) install
- @printf 'Installing manual pages...\n'
- @cd man && $(MAKE) $(MACROS) install
-
-uninstall:
- @printf 'Uninstalling executable files...\n'
- @cd src && $(MAKE) $(MACROS) uninstall
- @printf 'Uninstalling library files...\n'
- @cd lib/buildsystem && $(MAKE) $(MACROS) uninstall
- @cd lib && $(MAKE) $(MACROS) uninstall
- @printf 'Uninstalling locales...\n'
- @cd locale && $(MAKE) $(MACROS) uninstall
- @printf 'Uninstalling manual pages...\n'
- @cd man && $(MAKE) $(MACROS) uninstall
+uninstall_cmds = \
+ set -e; \
+ for f in $${files}; do \
+ printf ' RM %s\n' "$${f}"; \
+ ff="$$(basename "$${f}")"; \
+ rm -f "$(DESTDIR)/$${dir}/$${ff}"; \
+ done
+uninstall: uninstall-exec uninstall-data
+uninstall-exec: uninstall-bin uninstall-pkglibbuildsystem uninstall-pkglib
+uninstall-bin:
+ @files='$(bin)'; dir='$(bindir)'; $(uninstall_cmds)
+uninstall-pkglib:
+ @files='$(pkglib)'; dir='$(pkglibdir)'; $(uninstall_cmds)
+ @rmdir '$(DESTDIR)/$(pkglibdir)'
+uninstall-pkglibbuildsystem:
+ @files='$(pkglibbuildsystem)'; dir='$(pkglibbuildsystemdir)'; \
+ $(uninstall_cmds)
+ @rmdir '$(DESTDIR)/$(pkglibbuildsystemdir)'
+uninstall-data: uninstall-man1 uninstall-locale
+uninstall-man1:
+ @files='$(man1)'; dir='$(man1dir)'; $(uninstall_cmds)
+uninstall-locale:
+ @set -e; for f in $(locale); do \
+ printf ' RM %s\n' "$${f}"; \
+ ff="$$(printf '%s' "$${f}" | sed 's|^[^/]*/||')"; \
+ rm -f "$(DESTDIR)/$(localedir)/$${ff}"; \
+ done
$(distdir):
@mkdir -p '$(distdir)'
- @cp -pR $(distfiles) '$(distdir)'
- @cd src && $(MAKE) '../$(distdir)/src'
- @cd lib && $(MAKE) '../$(distdir)/lib'
- @cd lib/buildsystem && $(MAKE) '../../$(distdir)/lib/buildsystem'
- @cd locale && $(MAKE) '../$(distdir)/locale'
- @cd man && $(MAKE) '../$(distdir)/man'
+ @set -e; for f in $(distfiles); do \
+ mkdir -p "$(distdir)/$$(dirname $${f})"; \
+ cp -p "$${f}" "$(distdir)/$${f}"; \
+ done
dist dist-gzip: $(distdir)
@tar -cf - '$(distdir)' | gzip -9c > '$(distdir).tar.gz'
diff --git a/configure b/configure
index fdce6b7..e895089 100755
--- a/configure
+++ b/configure
@@ -22,15 +22,19 @@
package_name='opkhelper'
package_version='3.0.0-beta1'
package_description='OPK Build Helper Tools'
+package_library='libopkhelper.3.0'
srcdir="$(cd "${0%/*}" && pwd)"
prefix='/usr/local'
bindir='${prefix}/bin'
libdir='${prefix}/share'
+pkglibdir='${libdir}/${package_library}'
+# FIXME: libopkhelper is deprecated. Migrate code and remove this variable.
+libopkhelper='${pkglibdir}'
datadir='${prefix}/share'
mandir='${datadir}/man'
+man1dir='${mandir}/man1'
localedir='${datadir}/locale'
-libopkhelper='${libdir}/libopkhelper.3.0'
multiarch_libdir='false'
quiet='false'
@@ -49,8 +53,10 @@ srcdir
prefix
bindir
libdir
+pkglibdir
datadir
mandir
+man1dir
localedir
'
@@ -62,10 +68,12 @@ ${opt_dep_libs}
multiarch-libdir
"
+# FIXME: libopkhelper is deprecated. Migrate code and remove this variable.
subst_vars="
package_name
package_version
package_description
+package_library
${long_opts_with_args}
libopkhelper
${features}
@@ -151,10 +159,14 @@ Installation directories:
default: PREFIX/bin
--libdir=LIBDIR install library scripts in LIBDIR
default: PREFIX/share
+ --pkglibdir=PKGLIBDIR install package library scripts in PKGLIBDIR
+ default: LIBDIR/${package_library}
--datadir=DATADIR expect to find data in DATADIR
default: PREFIX/share
--mandir=MANDIR install manual pages in MANDIR
default: DATADIR/man
+ --man1dir=MAN1DIR install section 1 manual pages in MAN1DIR
+ default: MANDIR/man1
--localedir=LOCALEDIR install locales in LOCALEDIR
default: DATADIR/locale
@@ -278,7 +290,8 @@ find_dep_cmd()
: ${_element=-.}
if [ -f "${_element}/${_dep}" -a -x "${_element}/${_dep}" ]; then
${quiet} || printf '%s/%s\n' "${_element}" "${_dep}"
- eval "${_dep}"=\"${_element}/${_dep}\"
+ _var="$(printf '%s' "${_dep}" | tr -c '[a-z0-9]' '_')"
+ eval "${_var}"=\"${_element}/${_dep}\"
return 0
fi
done
@@ -302,7 +315,8 @@ find_dep_lib()
: ${_element=-.}
if [ -d "${_element}/${_dep}" ]; then
${quiet} || printf '%s/%s\n' "${_element}" "${_dep}"
- eval "${_dep}"=\"${_element}/${_dep}\"
+ _var="$(printf '%s' "${_dep}" | tr -c '[a-z0-9]' '_')"
+ eval "${_var}"=\"${_element}/${_dep}\"
return 0
fi
done
@@ -315,17 +329,17 @@ find_dep_lib()
write_makefiles()
{
+ for _dir in src lib lib/buildsystem locale man; do
+ [ -d "${_dir}" ] || mkdir "${_dir}"
+ done
+
# Make a script to edit input makefiles.
_sed_script=''
for _var in ${subst_vars}; do
_var="$(printf '%s' "${_var}" | tr -c '[a-z0-9]' '_')"
_sed_script="${_sed_script}s&@${_var}@&$(eval echo \$\{"${_var}"\})&g;"
done
-
- for _dir in . src lib lib/buildsystem locale man; do
- mkdir -p "${_dir}"
- sed "${_sed_script}" "${srcdir}/${_dir}/Makefile.in" >"${_dir}/Makefile"
- done
+ sed "${_sed_script}" "${srcdir}/Makefile.in" >'Makefile'
# New and improved kludge to generate an architecture table for testing.
# TODO: Remove when no longer used.
diff --git a/lib/Makefile.in b/lib/Makefile.in
deleted file mode 100644
index f52a0b3..0000000
--- a/lib/Makefile.in
+++ /dev/null
@@ -1,78 +0,0 @@
-# opkhelper
-# Makefile.in
-# Input Makefile for configure.
-#
-# Copyright (C) 2012 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 <http://www.gnu.org/licenses/>.
-
-package_name = @package_name@
-package_version= @package_version@
-
-srcdir = @srcdir@
-prefix = @prefix@
-libdir = @libdir@
-datadir = @datadir@
-localedir = @localedir@
-libopkhelper = @libopkhelper@
-libopkbuild_1 = @libopkbuild_1@
-archtab = @archtab@
-
-sed_script = s&@@PACKAGE_NAME@@&$(package_name)&;\
- s&@@PACKAGE_VERSION@@&$(package_version)&;\
- s&@@LOCALEDIR@@&$(localedir)&;\
- s&@@LIBOPKHELPER@@&$(libopkhelper)&;\
- s&@@LIBOPKBUILD_1@@&$(libopkbuild_1)&;\
- s&@@ARCHTAB@@&$(archtab)&;
-
-.SUFFIXES:
-.SUFFIXES: .sh .sm
-
-SRCS = load.sh common.sh \
- buildsystem.sh
-OBJS = $(SRCS:.sh=.sm)
-
-distdir = ../$(package_name)-$(package_version)/lib
-distfiles = Makefile.in $(SRCS)
-
-all: $(OBJS)
-
-$(OBJS):
- @printf ' SED lib/%s\n' '$@'
- @sed '$(sed_script)' '$(srcdir)/lib/$*.sh' >'$@'
-
-clean:
- @for obj in $(OBJS); do \
- printf ' RM lib/%s\n' "$${obj}"; \
- rm -f "$${obj}"; \
- done
-
-install: all
- @mkdir -p '$(DESTDIR)/$(libopkhelper)'
- @for obj in $(OBJS); do \
- printf ' INSTALL lib/%s\n' "$${obj}"; \
- cp "$${obj}" "$(DESTDIR)/$(libopkhelper)/$${obj}"; \
- chmod 644 "$(DESTDIR)/$(libopkhelper)/$${obj}"; \
- done
-
-uninstall:
- @for obj in $(OBJS); do \
- printf ' RM %s\n' "$${obj}"; \
- rm -f "$(DESTDIR)/$(libopkhelper)/$${obj}"; \
- done
- @rmdir '$(DESTDIR)/$(libopkhelper)' 2>/dev/null || true
-
-$(distdir):
- @mkdir -p '$(distdir)'
- @cp -pR $(distfiles) '$(distdir)'
diff --git a/lib/buildsystem/Makefile.in b/lib/buildsystem/Makefile.in
deleted file mode 100644
index a7b3c59..0000000
--- a/lib/buildsystem/Makefile.in
+++ /dev/null
@@ -1,71 +0,0 @@
-# opkhelper
-# Makefile.in
-# Input Makefile for configure.
-#
-# Copyright (C) 2012 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 <http://www.gnu.org/licenses/>.
-
-package_name = @package_name@
-package_version= @package_version@
-
-srcdir = @srcdir@
-prefix = @prefix@
-libdir = @libdir@
-libopkhelper = @libopkhelper@
-multiarch_libdir = @multiarch_libdir@
-
-sed_script = s&@@PACKAGE_NAME@@&$(package_name)&;\
- s&@@PACKAGE_VERSION@@&$(package_version)&;\
- s&@@MULTIARCH_LIBDIR@@&$(multiarch_libdir)&;
-
-.SUFFIXES:
-.SUFFIXES: .sh .sm
-
-SRCS = autoconf.sh make.sh kbuild.sh
-OBJS = $(SRCS:.sh=.sm)
-
-distdir = ../../$(package_name)-$(package_version)/lib/buildsystem
-distfiles = Makefile.in $(SRCS)
-
-all: $(OBJS)
-
-$(OBJS):
- @printf ' SED lib/buildsystem/%s\n' '$@'
- @sed '$(sed_script)' '$(srcdir)/lib/buildsystem/$*.sh' >'$@'
-
-clean:
- @for obj in $(OBJS); do \
- printf ' RM lib/buildsystem/%s\n' "$${obj}"; \
- rm -f "$${obj}"; \
- done
-
-install: all
- @mkdir -p '$(DESTDIR)/$(libopkhelper)/buildsystem'
- @for obj in $(OBJS); do \
- printf ' INSTALL lib/buildsystem/%s\n' "$${obj}"; \
- cp "$${obj}" "$(DESTDIR)/$(libopkhelper)/buildsystem/$${obj}"; \
- chmod 644 "$(DESTDIR)/$(libopkhelper)/buildsystem/$${obj}"; \
- done
-
-uninstall:
- @for obj in $(OBJS); do \
- printf ' RM %s\n' "$${obj}"; \
- rm -f "$(DESTDIR)/$(libopkhelper)/buildsystem/$${obj}"; \
- done
- @rmdir '$(DESTDIR)/$(libopkhelper)/buildsystem' 2>/dev/null || true
-
-$(distdir):
- @mkdir -p '$(distdir)'
- @cp -pR $(distfiles) '$(distdir)'
diff --git a/lib/buildsystem/local.mk b/lib/buildsystem/local.mk
new file mode 100644
index 0000000..76cf972
--- /dev/null
+++ b/lib/buildsystem/local.mk
@@ -0,0 +1,22 @@
+# 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 <http://www.gnu.org/licenses/>.
+
+pkglibbuildsystem_srcs = \
+ lib/buildsystem/autoconf.sh \
+ lib/buildsystem/kbuild.sh \
+ lib/buildsystem/make.sh
diff --git a/lib/local.mk b/lib/local.mk
new file mode 100644
index 0000000..e249963
--- /dev/null
+++ b/lib/local.mk
@@ -0,0 +1,23 @@
+# opkhelper
+# lib/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 <http://www.gnu.org/licenses/>.
+
+pkglib_srcs = \
+ lib/load.sh \
+ lib/common.sh \
+ lib/buildsystem.sh \
+ $(lib_buildsystem_srcs)
diff --git a/locale/Makefile.in b/locale/Makefile.in
deleted file mode 100644
index d7a3b4f..0000000
--- a/locale/Makefile.in
+++ /dev/null
@@ -1,72 +0,0 @@
-# opkhelper
-# Makefile.in
-# Input Makefile for configure.
-#
-# Copyright (C) 2012 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 <http://www.gnu.org/licenses/>.
-
-package_name = @package_name@
-package_version= @package_version@
-
-srcdir = @srcdir@
-prefix = @prefix@
-datadir = @datadir@
-localedir = @localedir@
-
-.SUFFIXES:
-.SUFFIXES: .sh .ms
-
-SRCS = en_US/opkhelper.sh
-OBJS = $(SRCS:.sh=.ms)
-
-distdir = ../$(package_name)-$(package_version)/locale
-distfiles = Makefile.in $(SRCS)
-
-all: $(OBJS)
-
-$(OBJS):
- @printf ' CP locale/%s\n' '$@'
- @obj='$@'; mkdir -p "$${obj%/*}"
- @cp '$(srcdir)/locale/$*.sh' '$@'
-
-clean:
- @for obj in $(OBJS); do \
- printf ' RM locale/%s\n' "$${obj}"; \
- rm -f "$${obj}"; \
- done
-
-install: all
- @for obj in $(OBJS); do \
- printf ' INSTALL locale/%s\n' "$${obj}"; \
- mkdir -p "$(DESTDIR)/$(localedir)/$${obj%/*}/LC_MESSAGES"; \
- dest="$(DESTDIR)/$(localedir)/$${obj%/*}/LC_MESSAGES/$${obj##*/}"; \
- cp "$${obj}" "$${dest}"; \
- chmod 644 "$${dest}"; \
- done
-
-uninstall:
- @for obj in $(OBJS); do \
- printf ' RM %s\n' "$${obj}"; \
- dest="$(DESTDIR)/$(localedir)/$${obj%/*}/LC_MESSAGES/$${obj##*/}"; \
- rm -f "$${dest}"; \
- done
-
-$(distdir):
- @mkdir -p '$(distdir)'
- @for file in $(distfiles); do \
- file="./$${file}"; \
- mkdir -p "$(distdir)/$${file%/*}"; \
- cp -p "$${file}" "$(distdir)/$${file%/*}"; \
- done
diff --git a/locale/local.mk b/locale/local.mk
new file mode 100644
index 0000000..888b71b
--- /dev/null
+++ b/locale/local.mk
@@ -0,0 +1,20 @@
+# opkhelper
+# locale/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 <http://www.gnu.org/licenses/>.
+
+locale_srcs = \
+ locale/en_US/opkhelper.sh
diff --git a/man/Makefile.in b/man/Makefile.in
deleted file mode 100644
index 4866e7c..0000000
--- a/man/Makefile.in
+++ /dev/null
@@ -1,85 +0,0 @@
-# opkhelper
-# Makefile.in
-# Input Makefile for configure.
-#
-# Copyright (C) 2012 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 <http://www.gnu.org/licenses/>.
-
-package_name = @package_name@
-package_version= @package_version@
-package_description = @package_description@
-
-srcdir = @srcdir@
-prefix = @prefix@
-datadir = @datadir@
-mandir = @mandir@
-
-sh = @sh@
-
-sed_script = s&@@PACKAGE_NAME@@&$(package_name)&;\
- s&@@PACKAGE_VERSION@@&$(package_version)&;\
- s&@@PACKAGE_DESCRIPTION@@&$(package_description)&;
-
-.SUFFIXES:
-.SUFFIXES: .in
-
-SRCS = oh-installfiles.1.in oh-strip.1.in oh-fixperms.1.in \
- oh-autoconfigure.1.in oh-autobuild.1.in \
- oh-autoclean.1.in oh-autotest.1.in oh-autoinstall.1.in \
- oh-architecture.1.in
-OBJS = $(SRCS:.in=)
-
-distdir = ../$(package_name)-$(package_version)/man
-distfiles = Makefile.in $(SRCS)
-
-all: $(OBJS)
-
-$(OBJS):
- @printf ' SED man/%s\n' '$@'
- @abmon='Nul Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec '; \
- date=$$(LC_TIME=POSIX ls -l $(srcdir)/man/$@.in | 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 "$(sed_script) s&@@DATE@@&$${y}-$${m}-$${d}&;" '$(srcdir)/man/$@.in' >'$@'
-
-clean:
- @for obj in $(OBJS); do \
- printf ' RM man/%s\n' "$${obj}"; \
- rm -f $${obj}; \
- done
-
-install: all
- @for obj in $(OBJS); do \
- printf ' INSTALL man/%s\n' "$${obj}"; \
- mkdir -p "$(DESTDIR)/$(mandir)/man$${obj##*.}"; \
- cp "$${obj}" "$(DESTDIR)/$(mandir)/man$${obj##*.}/$${obj}"; \
- chmod 644 "$(DESTDIR)/$(mandir)/man$${obj##*.}/$${obj}"; \
- done
-
-uninstall:
- @for obj in $(OBJS); do \
- printf ' RM %s\n' "$${obj}"; \
- rm -f "$(DESTDIR)/$(mandir)/man$${obj##*.}/$${obj}"; \
- done
-
-$(distdir):
- @mkdir -p '$(distdir)'
- @cp -pR $(distfiles) '$(distdir)'
diff --git a/man/local.mk b/man/local.mk
new file mode 100644
index 0000000..808e325
--- /dev/null
+++ b/man/local.mk
@@ -0,0 +1,28 @@
+# opkhelper
+# man/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 <http://www.gnu.org/licenses/>.
+
+man1_srcs = \
+ 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
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
diff --git a/src/Makefile.in b/src/Makefile.in
deleted file mode 100644
index fe9e8ee..0000000
--- a/src/Makefile.in
+++ /dev/null
@@ -1,85 +0,0 @@
-# opkhelper
-# Makefile.in
-# Input Makefile for configure.
-#
-# Copyright (C) 2012 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 <http://www.gnu.org/licenses/>.
-
-package_name = @package_name@
-package_version= @package_version@
-
-srcdir = @srcdir@
-prefix = @prefix@
-bindir = @bindir@
-libdir = @libdir@
-datadir = @datadir@
-localedir = @localedir@
-libopkhelper = @libopkhelper@
-
-sh = @sh@
-
-sed_script = s&@@PACKAGE_NAME@@&$(package_name)&;\
- s&@@PACKAGE_VERSION@@&$(package_version)&;\
- s&@@LOCALEDIR@@&$(localedir)&;\
- s&@@LIBOPKHELPER@@&$(libopkhelper)&;\
- s&@@SH@@&$(sh)&;
-
-.SUFFIXES:
-.SUFFIXES: .sh
-
-SRCS = \
- oh-installfiles.sh \
- oh-strip.sh \
- oh-fixperms.sh \
- oh-autoconfigure.sh \
- oh-autobuild.sh \
- oh-autoclean.sh \
- oh-autotest.sh \
- oh-autoinstall.sh \
- oh-architecture.sh
-OBJS = $(SRCS:.sh=)
-
-distdir = ../$(package_name)-$(package_version)/src
-distfiles = Makefile.in $(SRCS)
-
-all: $(OBJS)
-
-$(OBJS):
- @printf ' SED src/%s\n' '$@'
- @sed '$(sed_script)' '$(srcdir)/src/$@.sh' >'$@'
-
-clean:
- @for obj in $(OBJS); do \
- printf ' RM src/%s\n' "$${obj}"; \
- rm -f "$${obj}"; \
- done
-
-install: all
- @for obj in $(OBJS); do \
- printf ' INSTALL src/%s\n' "$${obj}"; \
- mkdir -p '$(DESTDIR)/$(bindir)'; \
- cp "$${obj}" "$(DESTDIR)/$(bindir)/$${obj}"; \
- chmod 755 "$(DESTDIR)/$(bindir)/$${obj}"; \
- done
-
-uninstall:
- @for obj in $(OBJS); do \
- printf ' RM %s\n' "$${obj}"; \
- rm -f "$(DESTDIR)/$(bindir)/$${obj}"; \
- done
-
-$(distdir):
- @mkdir -p '$(distdir)'
- @cp -pR $(distfiles) '$(distdir)'
diff --git a/src/local.mk b/src/local.mk
new file mode 100644
index 0000000..84c8f4d
--- /dev/null
+++ b/src/local.mk
@@ -0,0 +1,28 @@
+# opkhelper
+# src/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 <http://www.gnu.org/licenses/>.
+
+bin_srcs = \
+ src/oh-installfiles.sh \
+ src/oh-strip.sh \
+ src/oh-fixperms.sh \
+ src/oh-autoconfigure.sh \
+ src/oh-autobuild.sh \
+ src/oh-autoclean.sh \
+ src/oh-autotest.sh \
+ src/oh-autoinstall.sh \
+ src/oh-architecture.sh