summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am160
-rw-r--r--Makefile.in284
-rw-r--r--archtab/local.mk2
-rwxr-xr-xautogen.sh15
-rwxr-xr-xconfigure344
-rw-r--r--configure.ac74
-rw-r--r--lib/buildsystem/local.mk2
-rw-r--r--lib/local.mk2
-rw-r--r--locale/local.mk2
-rw-r--r--man/local.mk2
-rw-r--r--src/local.mk2
11 files changed, 255 insertions, 634 deletions
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..a5875d6
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,160 @@
+# Process this file with automake to produce an input makefile.
+#
+# Copyright (C) 2013, 2014 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 3 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/>.
+
+include $(top_srcdir)/src/local.mk
+include $(top_srcdir)/lib/local.mk
+include $(top_srcdir)/lib/buildsystem/local.mk
+include $(top_srcdir)/man/local.mk
+include $(top_srcdir)/locale/local.mk
+include $(top_srcdir)/archtab/local.mk
+include $(top_srcdir)/tests/local.mk
+
+bin_SCRIPTS = $(bin_sources:.sh=)
+pkgdata_SCRIPTS = $(pkgdata_sources:.sh=.sm)
+pkgdatabuildsystem_SCRIPTS = $(pkgdatabuildsystem_sources:.sh=.sm)
+man1_MANS = $(man1_sources:.1in=.1)
+locale_MESSAGES = $(locale_sources:.sh=.ms)
+CLEANFILES = \
+ $(bin_SCRIPTS) \
+ $(pkgdata_SCRIPTS) \
+ $(pkgdatabuildsystem_SCRIPTS) \
+ $(man1_MANS) \
+ $(locale_MESSAGES)
+pkgdatabuildsystemdir = $(pkgdatadir)/buildsystem
+archtabdir = $(pkgdatadir)/archtab
+EXTRA_DIST = \
+ COPYING.2 \
+ COPYING.3 \
+ autogen.sh \
+ $(bin_sources) \
+ $(pkgdata_sources) \
+ $(pkgdatabuildsystem_sources) \
+ $(man1_sources) \
+ $(locale_sources) \
+ $(archtab_sources) \
+ $(tests)
+
+SUFFIXES = .sh .sm .1in .1 .ms
+
+textdomain = $$(printf '%s\n' '$(PACKAGE)' | sed -e 's|-|_|g')
+do_subst = sed \
+ -e 's|[@]PACKAGE[@]|$(PACKAGE)|g' \
+ -e 's|[@]PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
+ -e 's|[@]PACKAGE_VERSION[@]|$(PACKAGE_VERSION)|g' \
+ -e 's|[@]SH[@]|$(SH)|g' \
+ -e 's|[@]multiarch_libdir[@]|$(multiarch_libdir)|g' \
+ -e 's|[@]pkgdatadir[@]|$(pkgdatadir)|g' \
+ -e 's|[@]localedir[@]|$(localedir)|g' \
+ -e 's|[@]archtabdir[@]|$(archtabdir)|g' \
+ -e 's|@[@]PACKAGE_NAME[@]@|$(PACKAGE)|g' \
+ -e 's|@[@]PACKAGE_VERSION[@]@|$(PACKAGE_VERSION)|g' \
+ -e 's|@[@]PACKAGE_DESCRIPTION[@]@|$(PACKAGE_NAME)|g' \
+ -e 's|@[@]PKGLIBDIR[@]@|$(pkgdatadir)|g' \
+ -e 's|@[@]LOCALEDIR[@]@|$(localedir)|g' \
+ -e 's|@[@]ARCHTABDIR[@]@|$(archtabdir)|g' \
+ -e 's|@[@]SH[@]@|$(SH)|g' \
+ -e 's|@[@]MULTIARCH_LIBDIR[@]@|$(multiarch_libdir)|g'
+
+all-local: $(locale_MESSAGES) $(archtab_sources)
+
+install-data-local: $(locale_MESSAGES) $(archtab_sources)
+ @$(NORMAL_INSTALL)
+ for f in $(locale_MESSAGES); do \
+ ff="$${f#*/}"; \
+ dir="$(DESTDIR)$(localedir)/$${ff%.ms}/LC_MESSAGES"; \
+ $(MKDIR_P) "$${dir}" || exit 1; \
+ $(INSTALL_DATA) "$${f}" "$${dir}/$(textdomain).ms" || \
+ exit $${?}; \
+ done
+ for f in $(archtab_sources); do \
+ ff="$${f#*/}"; \
+ dir="$(DESTDIR)$(archtabdir)/$${ff%/?*}"; \
+ $(MKDIR_P) "$${dir}" || exit 1; \
+ $(INSTALL_DATA) "$(top_srcdir)/$${f}" "$${dir}/$${ff#*/}" || \
+ exit $${?}; \
+ done
+
+uninstall-local:
+ @$(NORMAL_UNINSTALL)
+ for f in $(locale_MESSAGES); do \
+ ff="$${f#*/}"; \
+ dir="$(DESTDIR)$(localedir)/$${ff%.ms}/LC_MESSAGES"; \
+ rm -f "$${dir}/$(textdomain).ms"; \
+ done
+
+uninstall-hook:
+ for dir in \
+ '$(DESTDIR)$(pkgdatabuildsystemdir)' \
+ '$(DESTDIR)$(archtabdir)' \
+ '$(DESTDIR)$(pkgdatadir)'; do \
+ if [ -d "$${dir}" ]; then \
+ rmdir "$${dir}"; \
+ fi; \
+ done
+
+really-clean: distclean
+ rm -Rf $(srcdir)/aclocal.m4 $(srcdir)/autom4te.cache/ \
+ $(srcdir)/configure \
+ $(srcdir)/build-aux/ $(srcdir)/INSTALL $(srcdir)/Makefile.in
+
+test:
+ @set -e; \
+ mkdir -p tests; \
+ cd tests; \
+ . '$(abs_top_srcdir)/tests/testlib.sh'; \
+ PATH="$${PATH}:$(DESTDIR)$(bindir)"; \
+ t_all=0; t_failed=0; \
+ for t_test in $(tests); do \
+ t_fail='false'; \
+ . "$(abs_top_srcdir)/$${t_test}" >out 2>&1; \
+ if "$${t_fail}"; then \
+ printf 'FAIL: %s\n' "$${t_test#tests/}"; \
+ cat out | sed 's/^/ /'; \
+ t_failed=$$(($$t_failed + 1)); \
+ else \
+ printf 'PASS: %s\n' "$${t_test#tests/}"; \
+ fi; \
+ t_all=$$(($$t_all + 1)); \
+ rm out; \
+ done; \
+ t_banner="$$(printf '%d out of %d tests failed' \
+ $${t_failed} $${t_all})"; \
+ t_l=$$(printf '%s\n' "$${t_banner}" | wc -c); \
+ t_i=1; while [ "$${t_i}" -lt "$${t_l}" ]; do \
+ printf '='; \
+ t_i=$$(($$t_i + 1)); \
+ done; \
+ printf '\n%s\n' "$${t_banner}"; \
+ t_i=1; while [ "$${t_i}" -lt "$${t_l}" ]; do \
+ printf '='; \
+ t_i=$$(($$t_i + 1)); \
+ done; \
+ printf '\n'; \
+ [ $${t_failed} -eq 0 ]
+
+.sh:
+ $(MKDIR_P) "$$(dirname $@)"
+ $(do_subst) $< >$@
+ chmod a+x $@
+
+.sh.sm .1in.1:
+ $(MKDIR_P) "$$(dirname $@)"
+ $(do_subst) $< >$@
+
+.sh.ms:
+ $(MKDIR_P) "$$(dirname $@)"
+ cp $< $@
diff --git a/Makefile.in b/Makefile.in
deleted file mode 100644
index 1d57c5d..0000000
--- a/Makefile.in
+++ /dev/null
@@ -1,284 +0,0 @@
-# opkhelper
-# Makefile.in
-# Input Makefile for configure.
-#
-# 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/>.
-
-package_name = @package_name@
-package_version= @package_version@
-package_description = @package_description@
-package_library = @package_library@
-
-srcdir = @srcdir@
-prefix = @prefix@
-bindir = @bindir@
-libdir = @libdir@
-pkglibdir = @pkglibdir@
-datadir = @datadir@
-mandir = @mandir@
-man1dir = @man1dir@
-localedir = @localedir@
-pkgdatadir = @pkgdatadir@
-archtabdir = @archtabdir@
-
-DESTDIR = /
-
-sh = @sh@
-
-multiarch_libdir = @multiarch_libdir@
-
-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
-include $(srcdir)/archtab/local.mk
-include $(srcdir)/tests/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)
-archtab = $(archtab_srcs)
-
-distdir = $(package_name)-$(package_version)
-distfiles = \
- configure \
- Makefile.in \
- COPYING.2 \
- COPYING.3 \
- README \
- INSTALL \
- ChangeLog \
- TODO \
- src/local.mk \
- lib/local.mk \
- lib/buildsystem/local.mk \
- man/local.mk \
- locale/local.mk \
- archtab/local.mk \
- tests/local.mk \
- $(bin_srcs) \
- $(pkglib_srcs) \
- $(pkglibbuildsystem_srcs) \
- $(man1_srcs) \
- $(locale_srcs) \
- $(archtab_srcs) \
- $(tests)
-
-textdomain = $$(printf '%s\n' '$(package_name)' | sed -e 's|-|_|g')
-
-script = \
- s&@@PACKAGE_NAME@@&$(package_name)&;\
- s&@@PACKAGE_VERSION@@&$(package_version)&;\
- s&@@PACKAGE_DESCRIPTION@@&$(package_description)&;\
- s&@@PKGLIBDIR@@&$(pkglibdir)&;\
- s&@@LOCALEDIR@@&$(localedir)&;\
- s&@@ARCHTABDIR@@&$(archtabdir)&;\
- s&@@SH@@&$(sh)&;\
- s&@@MULTIARCH_LIBDIR@@&$(multiarch_libdir)&;
-
-.SUFFIXES:
-.SUFFIXES: .sh .sm .1in .1 .ms
-
-# XXX: Support for lists of multiple targets in inference rules doesn't appear
-# to be required by POSIX.1-2008 [1], but it exists in GNU Make and NetBSD
-# pmake. Expand this into separate rules if it is a problem with certain make
-# implementations.
-# [1]: Compare the inference and target rule definitions after fragments
-# <#tag_20_76_13_06> and <#tag_20_76_13_04> in
-# <http://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html>.
-.sh:
- @printf ' SED %s\n' '$@'
- @sed '$(script)' '$(srcdir)/$?' >'$@'
- @chmod 755 '$@'
-.sh.sm .1in.1:
- @printf ' SED %s\n' '$@'
- @sed '$(script)' '$(srcdir)/$?' >'$@'
- @chmod 644 '$@'
-.sh.ms:
- @printf ' CP %s\n' '$@'
- @obj='$@'; mkdir -p "$${obj%/*}"
- @cp '$(srcdir)/$?' '$@'
- @chmod 644 '$@'
-
-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-archtab
-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="$${f#*/}"; \
- dd="$(DESTDIR)/$(localedir)/$${ff%.ms}/LC_MESSAGES"; \
- mkdir -p "$${dd}"; \
- df="$${dd}/$(textdomain).ms"; \
- cp "$${f}" "$${df}"; \
- chmod 644 "$${df}"; \
- done
-install-archtab:
- @mkdir -p '$(DESTDIR)/$(archtabdir)'
- @set -e; for f in $(archtab); do \
- printf ' INSTALL %s\n' "$${f}"; \
- ff="$${f#*/}"; \
- mkdir -p "$(DESTDIR)/$(archtabdir)/$${ff%/?*}"; \
- cp "$(srcdir)/$${f}" "$(DESTDIR)/$(archtabdir)/$${ff}"; \
- chmod 644 "$(DESTDIR)/$(archtabdir)/$${ff}"; \
- done
-
-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-archtab
-uninstall-man1:
- @files='$(man1)'; dir='$(man1dir)'; $(uninstall_cmds)
-uninstall-locale:
- @set -e; for f in $(locale); do \
- printf ' RM %s\n' "$${f}"; \
- ff="$${f#*/}"; \
- dd="$(DESTDIR)/$(localedir)/$${ff%.ms}/LC_MESSAGES"; \
- df="$${dd}/$(textdomain).ms)"; \
- rm -f "$${df}"; \
- done
-uninstall-archtab:
- @set -e; for f in $(archtab); do \
- printf ' RM %s\n' "$${f}"; \
- ff="$${f#*/}"; \
- rm -f "$(DESTDIR)/$(archtabdir)/$${ff}"; \
- rmdir "$(DESTDIR)/$(archtabdir)/$${ff%/?*}" 2>/dev/null || \
- true; \
- done
- @rmdir '$(DESTDIR)/$(archtabdir)'
- @rmdir '$(DESTDIR)/$(pkgdatadir)'
-
-test:
- @set -e; \
- mkdir -p tests; \
- cd tests; \
- . ./testlib.sh; \
- PATH="$${PATH}:$(DESTDIR)/$(bindir)"; \
- t_all=0; t_failed=0; \
- for t_test in $(tests); do \
- t_fail='false'; \
- . "$(srcdir)/$${t_test}" >out 2>&1; \
- if "$${t_fail}"; then \
- printf 'FAIL: %s\n' "$${t_test#tests/}"; \
- cat out | sed 's/^/ /'; \
- t_failed=$$(($$t_failed + 1)); \
- else \
- printf 'PASS: %s\n' "$${t_test#tests/}"; \
- fi; \
- t_all=$$(($$t_all + 1)); \
- rm out; \
- done; \
- t_banner="$$(printf '%d out of %d tests failed' \
- $${t_failed} $${t_all})"; \
- t_l=$$(printf '%s\n' "$${t_banner}" | wc -c); \
- t_i=1; while [ "$${t_i}" -lt "$${t_l}" ]; do \
- printf '='; \
- t_i=$$(($$t_i + 1)); \
- done; \
- printf '\n%s\n' "$${t_banner}"; \
- t_i=1; while [ "$${t_i}" -lt "$${t_l}" ]; do \
- printf '='; \
- t_i=$$(($$t_i + 1)); \
- done; \
- printf '\n'; \
- [ $${t_failed} -eq 0 ]
-
-$(distdir):
- @mkdir -p '$(distdir)'
- @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'
- @rm -Rf '$(distdir)'
-
-dist-bzip2: $(distdir)
- @tar -cf - '$(distdir)' | bzip2 -9c > '$(distdir).tar.bz2'
- @rm -Rf '$(distdir)'
-
-dist-xz: $(distdir)
- @tar -cf - '$(distdir)' | xz -c > '$(distdir).tar.xz'
- @rm -Rf '$(distdir)'
diff --git a/archtab/local.mk b/archtab/local.mk
index 0841263..b773c33 100644
--- a/archtab/local.mk
+++ b/archtab/local.mk
@@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-archtab_srcs = \
+archtab_sources = \
archtab/amd64-linux-glibc/autoconf \
archtab/amd64-linux-glibc/kbuild \
archtab/i686-linux-glibc/autoconf \
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..c90bb39
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+
+srcdir="${0%/*}"
+
+{(
+ cd "${srcdir}"
+ [ -d build-aux ] || mkdir build-aux
+ aclocal
+ autoconf
+ automake --add-missing --copy
+)}
+
+"${srcdir}/configure" "${@}"
diff --git a/configure b/configure
deleted file mode 100755
index 5687863..0000000
--- a/configure
+++ /dev/null
@@ -1,344 +0,0 @@
-#! /bin/sh
-#
-# opkhelper
-# configure
-# Configuration script to generate Makefile.
-#
-# Copyright (C) 2011-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/>.
-
-package_name='opkhelper'
-package_version='3.0.0-beta4'
-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}'
-datadir='${prefix}/share'
-mandir='${datadir}/man'
-man1dir='${mandir}/man1'
-localedir='${datadir}/locale'
-pkgdatadir='${datadir}/${package_name}'
-archtabdir='${pkgdatadir}/archtab'
-multiarch_libdir='true'
-
-quiet='false'
-missing_deps='false'
-dep_cmds='
-sh
-make
-'
-dep_libs='
-'
-
-long_opts_with_args='
-srcdir
-prefix
-bindir
-libdir
-pkglibdir
-datadir
-mandir
-man1dir
-localedir
-pkgdatadir
-archtabdir
-'
-
-features="
-${dep_cmds}
-${dep_libs}
-${opt_dep_cmds}
-${opt_dep_libs}
-multiarch-libdir
-"
-
-subst_vars="
-package_name
-package_version
-package_description
-package_library
-${long_opts_with_args}
-${features}
-"
-
-main()
-{
- parse_options "${@}"
- shift ${optind}
- if [ ${#} -ne 0 ]; then
- print_usage
- exit
- fi
-
- for dep in ${dep_cmds}; do
- dep_name="$(printf '%s' "${dep}" | tr -c '[a-z0-9]' '_')"
- dep_val="$(eval echo \$\{"${dep_name}"\})"
- if [ -z "${dep_val}" ]; then
- find_dep_cmd "${dep}" || missing_deps='true'
- fi
- done
- for dep in ${dep_libs}; do
- dep_name="$(printf '%s' "${dep}" | tr -c '[a-z0-9]' '_')"
- dep_val="$(eval echo \$\{"${dep_name}"\})"
- if [ -z "${dep_val}" ]; then
- find_dep_lib "${dep}" || missing_deps='true'
- fi
- done
- for dep in ${opt_dep_cmds}; do
- dep_name="$(printf '%s' "${dep}" | tr -c '[a-z0-9]' '_')"
- dep_val="$(eval echo \$\{"${dep_name}"\})"
- if [ -z "${dep_val}" ]; then
- find_dep_cmd "${dep}"
- fi
- done
- for dep in ${opt_dep_libs}; do
- dep_name="$(printf '%s' "${dep}" | tr -c '[a-z0-9]' '_')"
- dep_val="$(eval echo \$\{"${dep_name}"\})"
- if [ -z "${dep_val}" ]; then
- find_dep_lib "${dep}"
- fi
- done
-
- if ${missing_deps}; then
- cat <<EOF
-
-Some dependencies could not be found.
-Please make sure all dependencies are installed and try again.
-
-EOF
- exit 1
- fi
-
- write_makefiles
-
- printf '\nConfiguration complete!\n\n'
-}
-
-print_usage()
-{
- printf 'Usage: %s [OPTION]...\n' "${0}"
-}
-
-print_help()
-{
- cat <<EOF
-\`configure' configures ${package_name} ${package_version} to adapt to many \
-kinds of systems.
-
-$(print_usage)
-
-Configuration:
- -h, --help display this help and exit
- -V, --version display version information and exit
- -q, --quiet do not print \`checking ...' messages
- --srcdir=SRCDIR find the scripts in SRCDIR
- default: configure dir
-
-Installation directories:
- --prefix=PREFIX install files under PREFIX
- default: /usr/local
- --bindir=BINDIR install scripts in BINDIR
- 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
- --pkgdatadir=PKGDATADIR install package data in PKGDATADIR
- default: DATADIR/${package_name}
- --archtabdir=ARCHTABDIR install architecture table entries in ARCHTABDIR
- default: PKGDATADIR/archtab
-
-Features:
- --with-multiarch-libdir=BOOL
- use multiarch library paths in packages
- default: true
-
-Dependencies:
- --with-sh=PATH use sh at PATH
-EOF
-}
-
-print_version()
-{
- cat <<EOF
-${package_name} ${package_version} configure
-Not generated by GNU Autoconf
-
-Copyright (C) 2011-2013 Patrick "P. J." McDermott
-License: GNU GPL version 2 or later <http://www.gnu.org/licenses/gpl.html>.
-This configure script is free software: you can redistribute and/or modify it.
-There is NO WARRANTY, to the extent permitted by law.
-EOF
-}
-
-parse_options()
-{
- optind=0
-
- for _opt; do
-
- # Handle arguments of "--opt arg" options.
- if [ -n "${_prev}" ]; then
- eval "${_prev}"=\"\$\{_opt\}\"
- _prev=''
- continue
- fi
-
- # Detect "--opt=arg" and "--opt arg" options.
- case "${_opt}" in
- *=*)
- _optarg="${_opt#*=}"
- _opt="${_opt%=*}"
- _optarg_set='true'
- ;;
- *)
- _optarg_set='false'
- ;;
- esac
-
- # Handle short and long options.
- case "${_opt}" in
- --)
- break
- ;;
- -h|--help)
- print_help
- exit 0
- ;;
- -V|--version)
- print_version
- exit 0
- ;;
- -q|--quiet)
- quiet='true'
- continue
- ;;
- esac
-
- # Anything beyond this point should be a long option.
- case "${_opt}" in
- --with-*)
- _opt="${_opt#--with-}"
- _opts="${features}"
- _type='package'
- ;;
- --*)
- _opt="${_opt#--}"
- _opts="${long_opts_with_args}"
- _type='option'
- ;;
- *)
- break
- ;;
- esac
-
- grep "^${_opt}\$" >/dev/null 2>&1 <<EOF
-"${_opts}"
-EOF
- if [ ${?} -ne 0 ]; then
- printf 'warning: unrecognized %s name: %s\n' \
- "${_type}" "${_opt}" >&2
- continue
- fi
- if ${_optarg_set}; then
- _opt="$(printf '%s' "${_opt}" | tr -c '[a-z0-9]' '_')"
- eval "${_opt}"=\"\$\{_optarg\}\"
- else
- _prev="${_opt}"
- fi
-
- optind=$(($optind + 1))
-
- done
-}
-
-find_dep_cmd()
-{
- _dep="${1}"
-
- ${quiet} || printf 'checking for %s... ' "${_dep}"
-
- IFS=':'
-
- for _element in ${PATH}; do
- unset IFS
- : ${_element=-.}
- if [ -f "${_element}/${_dep}" -a -x "${_element}/${_dep}" ]; then
- ${quiet} || printf '%s/%s\n' "${_element}" "${_dep}"
- _var="$(printf '%s' "${_dep}" | tr -c '[a-z0-9]' '_')"
- eval "${_var}"=\"${_element}/${_dep}\"
- return 0
- fi
- done
-
- unset IFS
-
- ${quiet} || printf 'not found\n'
- return 1
-}
-
-find_dep_lib()
-{
- _dep="${1}"
-
- ${quiet} || printf 'checking for %s... ' "${_dep}"
-
- IFS=':'
-
- for _element in $(eval echo "${libdir}") ${PATH}; do
- unset IFS
- : ${_element=-.}
- if [ -d "${_element}/${_dep}" ]; then
- ${quiet} || printf '%s/%s\n' "${_element}" "${_dep}"
- _var="$(printf '%s' "${_dep}" | tr -c '[a-z0-9]' '_')"
- eval "${_var}"=\"${_element}/${_dep}\"
- return 0
- fi
- done
-
- unset IFS
-
- ${quiet} || printf 'not found\n'
- return 1
-}
-
-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
- sed "${_sed_script}" "${srcdir}/Makefile.in" >'Makefile'
-}
-
-main "${@}"
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..a736956
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,74 @@
+# Process this file with autoconf to produce a configure script.
+#
+# Copyright (C) 2013, 2014 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 3 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/>.
+
+AC_INIT([OPK Build Helper Tools], [3.0.0-beta4],
+ [mailto:proteanos-dev@lists.proteanos.com], [opkhelper],
+ [http://www.proteanos.com/dev/opkhelper/])
+AC_CONFIG_AUX_DIR([build-aux])
+AC_CONFIG_SRCDIR([src/oh-installfiles.sh])
+
+AM_INIT_AUTOMAKE([foreign dist-bzip2 dist-xz subdir-objects])
+
+AC_ARG_WITH(
+ [sh],
+ [AS_HELP_STRING([--with-sh], [POSIX-conformant shell with `local'])],
+ dnl This `dnl' is needed to workaround Vim syntax highlighting.
+ [
+ case "${withval}" in
+ 'yes'|'')
+ AC_MSG_ERROR([--with-sh requires an argument])
+ ;;
+ 'no')
+ AC_MSG_ERROR([sh is required])
+ ;;
+ *)
+ SH="${withval}"
+ ;;
+ esac
+ ],
+ [
+ AC_PATH_PROG([SH], [sh])
+ if test -z "${SH}"; then
+ AC_MSG_ERROR([sh not found])
+ fi
+ ]
+)
+
+AC_ARG_ENABLE(
+ [multiarch-libdir],
+ [AS_HELP_STRING(
+ [--disable-multiarch-libdir],
+ [do not use multiarch library paths in packages]
+ )],
+ [
+ opt='multiarch-libdir'
+ case "${enableval}" in
+ 'yes'|'no') ;;
+ *) AC_MSG_ERROR(
+ [bad value ${enableval} for ${opt} option]) ;;
+ esac
+ multiarch_libdir="${enableval}"
+ ],
+ [
+ multiarch_libdir='yes'
+ ]
+)
+
+AC_SUBST([SH])
+AC_SUBST([multiarch_libdir])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT()
diff --git a/lib/buildsystem/local.mk b/lib/buildsystem/local.mk
index 76cf972..bacf27d 100644
--- a/lib/buildsystem/local.mk
+++ b/lib/buildsystem/local.mk
@@ -16,7 +16,7 @@
# 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 = \
+pkgdatabuildsystem_sources = \
lib/buildsystem/autoconf.sh \
lib/buildsystem/kbuild.sh \
lib/buildsystem/make.sh
diff --git a/lib/local.mk b/lib/local.mk
index 0f7c62d..53a3ff8 100644
--- a/lib/local.mk
+++ b/lib/local.mk
@@ -16,7 +16,7 @@
# 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 = \
+pkgdata_sources = \
lib/load.sh \
lib/common.sh \
lib/output.sh \
diff --git a/locale/local.mk b/locale/local.mk
index eeddd03..e490e60 100644
--- a/locale/local.mk
+++ b/locale/local.mk
@@ -16,5 +16,5 @@
# 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_sources = \
locale/en_US.sh
diff --git a/man/local.mk b/man/local.mk
index 808e325..0e88e68 100644
--- a/man/local.mk
+++ b/man/local.mk
@@ -16,7 +16,7 @@
# 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 = \
+man1_sources = \
man/oh-installfiles.1in \
man/oh-strip.1in \
man/oh-fixperms.1in \
diff --git a/src/local.mk b/src/local.mk
index 84c8f4d..970704f 100644
--- a/src/local.mk
+++ b/src/local.mk
@@ -16,7 +16,7 @@
# 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 = \
+bin_sources = \
src/oh-installfiles.sh \
src/oh-strip.sh \
src/oh-fixperms.sh \