From 9217f3869f76d6936e77cec0a1a4d5efd1e97727 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sat, 22 Jul 2017 18:06:12 -0400 Subject: Merge branch 'feature/use-autoconf-automake-shpp-and-shld' --- diff --git a/.gitignore b/.gitignore index 3be0820..8938392 100644 --- a/.gitignore +++ b/.gitignore @@ -4,11 +4,29 @@ *~ Session.vim -# Generated files +# Files generated by aclocal, autoconf, and automake +aclocal.m4 +autom4te.cache/ +configure +build-aux/ +ChangeLog +INSTALL +Makefile.in + +# Files generated by configure +config.log +config.status Makefile -src/*[^.]?? -lib/*.sm -lib/*/*.sm -man/*.? -locale/*/*.ms -pro-archman-*.tar.* +config.sh + +# Files generated by Makefile +*.sho +pro-archman +locale/*.ms +man/*.1 +*-*/ +*-*.tar* +tests/*[^.]?? +tests/*.log +tests/*.trs +test-suite.log diff --git a/INSTALL b/INSTALL deleted file mode 100644 index a648c82..0000000 --- a/INSTALL +++ /dev/null @@ -1,51 +0,0 @@ -Basic Installation ------------------- - -This software package uses a build system similar to one generated by GNU -Autoconf and Automake. - -The `configure` shell script attempts to find certain system dependencies (e.g. -a shell interpreter) and configure the package to be built and installed on the -system. Upon successful dependency resolution and configuration, the script -generates a `Makefile` in your current working directory. - -The simplest way to configure, build, and install this package is: - - 1. Run the `configure` script from the source directory or any other directory. - For example, from the source directory you can run `./configure`. - 2. Run `make` to build the package. - 3. Run `make install` to install the package. You will probably need superuser - privileges to install files into your system. - -To uninstall the package, you can run `make uninstall`. - -Configuration Options ---------------------- - -The `configure` script accepts certain command-line options to control package -building and installation. Run the script with the `--help` option for more -information. - -Macros ------- - -The macro `DESTDIR` affects the root directory into which the `Makefile` -installs the package. For example, you can install the package into a -filesystem hierarchy under a directory named `dest` in the current directory by -running `make DESTDIR=dest install`. - -Separate Build Directory ------------------------- - -Building this package from outside the source directory is currently -unsupported. - -Copyright Information ---------------------- - -Copyright (C) 2012-2013 Patrick "P. J." McDermott - -Copying and distribution of this file, with or without modification, -are permitted in any medium without royalty provided the copyright -notice and this notice are preserved. This file is offered as-is, -without any warranty. diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..c49df54 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,142 @@ +# Process this file with automake to produce an input makefile. +# +# Copyright (C) 2013-2016 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 . + +if IN_GIT +PACKAGE_VERSION_GIT = $$(git describe --tags --dirty | sed 's|^.*/||') +else +PACKAGE_VERSION_GIT = $(PACKAGE_VERSION) +endif + +MANUAL = ProteanOS Archive Manager Manual +TEXTDOMAIN = $$(printf '%s\n' '$(PACKAGE)' | sed -e 's|-|_|g') + +SUFFIXES = .sh .sho .ms .1in .1 +OBJEXT = sho + +# This PACKAGE_VERSION stuff is a rather gross hack, but it's the only reliable +# way to put Git commit information in the prokit executable. Setting +# PACKAGE_VERSION in configure causes it to become outdated until the next +# configure run. Adding it to the preprocessor command line can cause multiple +# values of it to exist in the linked executable. +LINK = printf "PACKAGE_VERSION='%s'\n" "$(PACKAGE_VERSION_GIT)" | \ + '$(srcdir)/tools/shld.sh' -I '$(SH)' -o $@ config.sh - + +bin_PROGRAMS = pro-archman + +pro_archman_SOURCES = +pro_archman_SHPPFLAGS = \ + -DLOCALEDIR="$(localedir)" \ + -DTEXTDOMAIN="$(TEXTDOMAIN)" +pro_archman_LDADD = $(pro_archman_SOURCES:.sh=.sho) +EXTRA_pro_archman_DEPENDENCIES = config.sh + +locale_MESSAGES = $(locale_sources:.sh=.ms) +noinst_DATA = $(locale_MESSAGES) + +man1_MANS = $(man1_sources:.1in=.1) +do_subst = sed \ + -e 's|[@]PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \ + -e "s|[@]PACKAGE_VERSION[@]|$(PACKAGE_VERSION_GIT)|g" \ + -e 's|[@]MANUAL[@]|$(MANUAL)|g' + +CLEANFILES = \ + $(pro_archman_LDADD) \ + $(locale_MESSAGES) \ + $(man1_MANS) +EXTRA_DIST = \ + COPYING.2 \ + COPYING.3 \ + autogen.sh \ + $(locale_sources) \ + $(man1_sources) \ + $(tests) \ + tools/shpp.sh \ + tools/shld.sh + +install-data-local: $(locale_MESSAGES) + @$(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 + +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 + +really-clean: distclean + rm -Rf $(srcdir)/aclocal.m4 $(srcdir)/autom4te.cache/ \ + $(srcdir)/configure \ + $(srcdir)/build-aux/ $(srcdir)/INSTALL $(srcdir)/Makefile.in \ + $(srcdir)/ChangeLog + +dist-hook: + if [ -d '$(srcdir)/.git' ]; then \ + printf 'Generated file. Do not edit.\n\n' \ + >'$(distdir)/ChangeLog~'; \ + GIT_DIR='$(srcdir)/.git' git log --stat --color=never \ + >>'$(distdir)/ChangeLog~'; \ + mv '$(distdir)/ChangeLog~' '$(distdir)/ChangeLog'; \ + fi + +release: + sed "s/^Released: ????-??-??\$$/Released: $$(date '+%Y-%m-%d')/" \ + '$(srcdir)/NEWS' >'$(srcdir)/NEWS~' + mv '$(srcdir)/NEWS~' '$(srcdir)/NEWS' + $(MAKE) distcheck + set -e; \ + export GIT_DIR='$(srcdir)/.git'; \ + export GIT_WORK_TREE='$(srcdir)'; \ + git commit -m 'NEWS: Release $(PACKAGE) $(VERSION)' -- NEWS; \ + git tag '$(PACKAGE)/$(VERSION)' HEAD; \ + git push --tags origin master:master + md5sum $(DIST_ARCHIVES) >MD5SUMS + sha256sum $(DIST_ARCHIVES) >SHA256SUMS + set -e; \ + for f in $(DIST_ARCHIVES); do \ + gpg --armor --sign $${f}; \ + done + ssh files@files.proteanos.com mkdir -p files/pub/$(PACKAGE) + rsync -az --progress --stats $(DIST_ARCHIVES) MD5SUMS SHA256SUMS \ + files@files.proteanos.com:files/pub/$(PACKAGE)/$(VERSION)/ + '$(srcdir)/scripts/announce-release.sh' \ + $(PACKAGE) $(VERSION) '$(PACKAGE_NAME)' + +.sh.sho: + $(AM_V_GEN)$(MKDIR_P) "$$(dirname $@)" + $(AM_V_at)$(SH) -n $< + $(AM_V_at)'$(srcdir)/tools/shpp.sh' $(pro_archman_SHPPFLAGS) $< $@ + +.sh.ms: + $(AM_V_GEN)$(MKDIR_P) "$$(dirname $@)" + $(AM_V_at)cp $< $@ + +.1in.1: + $(AM_V_GEN)$(MKDIR_P) "$$(dirname $@)" + $(AM_V_at)$(do_subst) $< >$@ + +include $(top_srcdir)/src/local.mk +include $(top_srcdir)/locale/local.mk +include $(top_srcdir)/man/local.mk +include $(top_srcdir)/tests/local.mk diff --git a/Makefile.in b/Makefile.in deleted file mode 100644 index fad6921..0000000 --- a/Makefile.in +++ /dev/null @@ -1,255 +0,0 @@ -# pro-archman -# 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 . - -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@ - -DESTDIR = / - -sh = @sh@ - -pkglibcmddir = $(pkglibdir)/cmd - -include $(srcdir)/src/local.mk -include $(srcdir)/lib/local.mk -include $(srcdir)/lib/cmd/local.mk -include $(srcdir)/man/local.mk -include $(srcdir)/locale/local.mk -include $(srcdir)/tests/local.mk - -bin = $(bin_srcs:.sh=) -pkglib = $(pkglib_srcs:.sh=.sm) -pkglibcmd = $(pkglibcmd_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 \ - HACKING \ - NEWS \ - examples/conf.default \ - src/local.mk \ - lib/local.mk \ - lib/cmd/local.mk \ - man/local.mk \ - locale/local.mk \ - tests/local.mk \ - $(bin_srcs) \ - $(pkglib_srcs) \ - $(pkglibcmd_srcs) \ - $(man1_srcs) \ - $(locale_srcs) \ - $(tests) - -script = \ - s&@@PACKAGE_NAME@@&$(package_name)&;\ - s&@@PACKAGE_VERSION@@&$(package_version)&;\ - s&@@PACKAGE_DESCRIPTION@@&$(package_description)&;\ - s&@@BINDIR@@&$(bindir)&;\ - s&@@PKGLIBDIR@@&$(pkglibdir)&;\ - s&@@PKGLIBCMDDIR@@&$(pkglibcmddir)&;\ - s&@@DATADIR@@&$(datadir)&;\ - s&@@LOCALEDIR@@&$(localedir)&;\ - s&@@SH@@&$(sh)&;\ - s&@@PKGLIBCMD@@&$(pkglibcmd)&; - -.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 -# . -.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-pkglibcmd -all-bin: $(bin) -all-pkglib: $(pkglib) -all-pkglibcmd: $(pkglibcmd) -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-pkglibcmd -clean-bin: - @files='$(bin)'; $(clean_cmds) -clean-pkglib: - @files='$(pkglib)'; $(clean_cmds) -clean-pkglibcmd: - @files='$(pkglibcmd)'; $(clean_cmds) -clean-data: clean-man1 clean-locale -clean-man1: - @files='$(man1)'; $(clean_cmds) -clean-locale: - @files='$(locale)'; $(clean_cmds) - -distclean: clean - @printf ' RM Makefile\n'; \ - rm -f Makefile - -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-pkglibcmd -install-bin: - @files='$(bin)'; dir='$(bindir)'; mode='755'; $(install_cmds) -install-pkglib: - @files='$(pkglib)'; dir='$(pkglibdir)'; mode='644'; $(install_cmds) -install-pkglibcmd: - @files='$(pkglibcmd)'; dir='$(pkglibcmddir)'; \ - 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="$${f#*/}"; \ - dd="$(DESTDIR)/$(localedir)/$${ff%/?*}/LC_MESSAGES"; \ - mkdir -p "$${dd}"; \ - df="$${dd}/$${ff##*/}"; \ - cp "$${f}" "$${df}"; \ - chmod 644 "$${df}"; \ - 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-pkglibcmd uninstall-pkglib -uninstall-bin: - @files='$(bin)'; dir='$(bindir)'; $(uninstall_cmds) -uninstall-pkglib: - @files='$(pkglib)'; dir='$(pkglibdir)'; $(uninstall_cmds) - @rmdir '$(DESTDIR)/$(pkglibdir)' -uninstall-pkglibcmd: - @files='$(pkglibcmd)'; dir='$(pkglibcmddir)'; \ - $(uninstall_cmds) - @rmdir '$(DESTDIR)/$(pkglibcmddir)' -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="$${f#*/}"; \ - dd="$(DESTDIR)/$(localedir)/$${ff%/?*}/LC_MESSAGES"; \ - df="$${dd}/$${ff##*/}"; \ - rm -f "$${df}"; \ - done - -test: all - @cd '$(srcdir)/tests'; \ - all=0; failed=0; \ - for test in $(tests); do \ - out="$$($(sh) "$(srcdir)/$${test}" 2>&1)"; \ - if [ $${?} -eq 0 ]; then \ - printf 'PASS: %s\n' "$${test}"; \ - else \ - printf 'FAIL: %s\n' "$${test}"; \ - echo "$${out}" | sed 's/^/ /'; \ - failed=$$(($$failed + 1)); \ - fi; \ - all=$$(($$all + 1)); \ - done; \ - banner="$$(printf '%d out of %d tests failed' $${failed} $${all})"; \ - l=$$(echo "$${banner}" | wc -c); \ - i=1; while [ "$${i}" -lt "$${l}" ]; do \ - printf '='; \ - i=$$(($$i + 1)); \ - done; \ - printf '\n%s\n' "$${banner}"; \ - i=1; while [ $${i} -lt $${l} ]; do \ - printf '='; \ - i=$$(($$i + 1)); \ - done; \ - printf '\n'; \ - exit $${failed} - -$(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/autogen.sh b/autogen.sh new file mode 100755 index 0000000..969dc3a --- /dev/null +++ b/autogen.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# +# Script to generate the build system. +# +# Copyright (C) 2013 Patrick "P. J." McDermott +# +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. This file is offered as-is, +# without any warranty. + +set -e + +srcdir="${0%/*}" + +{( + cd "${srcdir}" + [ -d build-aux ] || mkdir build-aux + cat >ChangeLog <<-EOF +This file is generated upon release. Run \`git log\` for a list of changes. +EOF + aclocal + autoconf + automake --add-missing --copy +)} + +"${srcdir}/configure" "${@}" diff --git a/config.sh.in b/config.sh.in new file mode 100644 index 0000000..e882179 --- /dev/null +++ b/config.sh.in @@ -0,0 +1,2 @@ +PACKAGE='@PACKAGE@' +PACKAGE_NAME='@PACKAGE_NAME@' diff --git a/configure b/configure deleted file mode 100755 index 2e18e91..0000000 --- a/configure +++ /dev/null @@ -1,320 +0,0 @@ -#! /bin/sh -# -# pro-archman -# 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 . - -package_name='pro-archman' -package_version='1.4.0' -package_description='ProteanOS Archive Manager' -package_library='pro-archman' - -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' - -quiet='false' -missing_deps='false' -dep_cmds=' -sh -make -' - -long_opts_with_args=' -srcdir -prefix -bindir -libdir -pkglibdir -datadir -mandir -man1dir -localedir -' - -features=" -${dep_cmds} -${dep_libs} -${opt_dep_cmds} -${opt_dep_libs} -" - -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 printf \'%s\' \"\$\{"${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 printf \'%s\' \"\$\{"${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 printf \'%s\' \"\$\{"${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 printf \'%s\' \"\$\{"${dep_name}"\}\")" - if [ -z "${dep_val}" ]; then - find_dep_lib "${dep}" - fi - done - - if ${missing_deps}; then - cat <. -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 <&2 - elif ${_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}" - - for _element in $(eval printf \'%s\' \""${libdir}"\") ${PATH}; do - : ${_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 - - ${quiet} || printf 'not found\n' - return 1 -} - -write_makefiles() -{ - mkdir -p src lib lib/cmd locale man tests - - # Make a script to edit input makefiles. - _sed_script='' - for _var in ${subst_vars}; do - _var="$(printf '%s' "${_var}" | tr -c '[a-z0-9]' '_')" - _val="$(eval printf \'%s\' \"\$\{"${_var}"\}\")" - _sed_script="${_sed_script}s&@${_var}@&${_val}&g;" - done - - sed "${_sed_script}" "${srcdir}/Makefile.in" >'Makefile' -} - -main "${@}" diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..6d6b874 --- /dev/null +++ b/configure.ac @@ -0,0 +1,59 @@ +# Process this file with autoconf to produce a configure script. +# +# Copyright (C) 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 . + +AC_INIT([ProteanOS Archive Manager], [1.4.0], + [mailto:proteanos-dev@lists.proteanos.com], [pro-archman], + [http://www.proteanos.com/dev/pro-archman/]) +AC_CONFIG_AUX_DIR([build-aux]) +AC_CONFIG_SRCDIR([src/main.sh]) + +AM_INIT_AUTOMAKE([gnu check-news dist-bzip2 dist-xz subdir-objects]) +AM_SILENT_RULES([yes]) + +AM_CONDITIONAL([IN_GIT], + [test -d "${srcdir}/.git" && command -v git >/dev/null 2>&1]) + +AC_ARG_WITH( + [sh], + [AS_HELP_STRING([--with-sh=PATH], + [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_SUBST([SH]) +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([config.sh]) +AC_OUTPUT() diff --git a/lib/cmd/local.mk b/lib/cmd/local.mk deleted file mode 100644 index 5687a3e..0000000 --- a/lib/cmd/local.mk +++ /dev/null @@ -1,11 +0,0 @@ -# pro-archman -# lib/cmd/local.mk - -pkglibcmd_srcs = \ - lib/cmd/help.sh \ - lib/cmd/version.sh \ - lib/cmd/include.sh \ - lib/cmd/process-incoming.sh \ - lib/cmd/remove.sh \ - lib/cmd/copy-suite.sh \ - lib/cmd/remove-suite.sh diff --git a/lib/local.mk b/lib/local.mk deleted file mode 100644 index 0ad1925..0000000 --- a/lib/local.mk +++ /dev/null @@ -1,15 +0,0 @@ -# pro-archman -# lib/local.mk - -pkglib_srcs = \ - lib/output.sh \ - lib/locale.sh \ - lib/control.sh \ - lib/dir.sh \ - lib/db.sh \ - lib/index.sh \ - lib/garbage.sh \ - lib/include.sh \ - lib/remove.sh \ - lib/suite.sh \ - lib/cmd.sh diff --git a/locale/en_US/pro_archman.sh b/locale/en_US.sh index 76c5e58..920df73 100644 --- a/locale/en_US/pro_archman.sh +++ b/locale/en_US.sh @@ -27,18 +27,18 @@ msg_pro_archman_opt_v_summary='print verbose informational messages' msg_pro_archman_opt_b_summary='set archive base directory to ' msg_pro_archman_opt_b_arg='' -# lib/cmd.sh +# src/cmd.sh msg_pro_archman_cmd_not_found='Command "%s" not found' msg_pro_archman_cmd_usage='Usage: %s [