diff options
author | P. J. McDermott <pjm@nac.net> | 2013-06-15 16:57:02 (EDT) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2013-06-15 16:57:02 (EDT) |
commit | 443f79077d349db5aa14169a6c5ccf1e4bcd4cf1 (patch) | |
tree | 01924a3db679391b6d0494fa869de890028f2eea | |
parent | a5bba3e6fc970d6ea91d9679dbeb0c90fcf60b65 (diff) | |
parent | 56cc8c00ddebce8c0ccb3cd907ff5a66e7be226b (diff) |
Merge branch 'feature/build-system-improvements'.
-rw-r--r-- | INSTALL | 9 | ||||
-rw-r--r-- | Makefile.in | 301 | ||||
-rwxr-xr-x | configure | 52 | ||||
-rw-r--r-- | lib/Makefile.in | 80 | ||||
-rw-r--r-- | lib/load.sh | 4 | ||||
-rw-r--r-- | lib/local.mk | 28 | ||||
-rw-r--r-- | lib/metadata/Makefile.in | 75 | ||||
-rw-r--r-- | lib/metadata/local.mk | 20 | ||||
-rw-r--r-- | lib/package/Makefile.in | 68 | ||||
-rw-r--r-- | lib/package/local.mk | 20 | ||||
-rw-r--r-- | locale/Makefile.in | 73 | ||||
-rw-r--r-- | locale/local.mk | 22 | ||||
-rw-r--r-- | man/Makefile.in | 116 | ||||
-rw-r--r-- | man/local.mk | 54 | ||||
-rw-r--r-- | src/Makefile.in | 83 | ||||
-rw-r--r-- | src/local.mk | 29 | ||||
-rw-r--r-- | src/ob-applypatches.sh | 2 | ||||
-rw-r--r-- | src/ob-buildenv.sh | 2 | ||||
-rw-r--r-- | src/ob-buildopk.sh | 2 | ||||
-rw-r--r-- | src/ob-checkbuilddeps.sh | 2 | ||||
-rw-r--r-- | src/ob-gencontrol.sh | 2 | ||||
-rw-r--r-- | src/ob-installdocs.sh | 2 | ||||
-rw-r--r-- | src/ob-installplatconf.sh | 2 | ||||
-rw-r--r-- | src/ob-unpacksource.sh | 2 | ||||
-rw-r--r-- | src/opkbuild.sh | 2 | ||||
-rw-r--r-- | tests/Makefile.in | 64 | ||||
-rw-r--r-- | tests/local.mk | 22 |
27 files changed, 464 insertions, 674 deletions
@@ -40,11 +40,4 @@ running `make DESTDIR=dest install`. Separate Build Directory ======================== -You can call the `configure` script from any directory on your system, and it -will detect the location of the package source directory. It is recommended -that you create a directory outside of the package source directory and build -and install the package from there as follows: - - $ ../path/to/package/configure - $ make - # make install +Building opkbuild from outside the source directory is currently unsupported. diff --git a/Makefile.in b/Makefile.in index b7a53a2..70b584a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -2,7 +2,7 @@ # Makefile.in # Input Makefile for configure. # -# Copyright (C) 2012 Patrick "P. J." McDermott +# 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 @@ -19,102 +19,255 @@ 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@ +man3dir = @man3dir@ +localedir = @localedir@ sysconfdir = @sysconfdir@ -libopkbuild = @libopkbuild@ -metadata = @metadata@ -opkhelper_3_0 = @opkhelper_3_0@ DESTDIR = / sh = @sh@ +opkhelper_3_0 = @opkhelper_3_0@ + +metadata = @metadata@ + +pkglibpackagedir = $(pkglibdir)/package +pkglibmetadatadir = $(pkglibdir)/metadata -MACROS = \ - 'DESTDIR=$(DESTDIR)' \ - 'prefix=$(prefix)' \ - 'bindir=$(bindir)' \ - 'libdir=$(libdir)' \ - 'datadir=$(datadir)' \ - 'mandir=$(mandir)' \ - 'sysconfdir=$(sysconfdir)' \ - 'libopkbuild=$(libopkbuild)' \ - 'metadata=$(metadata)' \ - 'opkhelper_3_0=$(opkhelper_3_0)' +include $(srcdir)/src/local.mk +include $(srcdir)/lib/local.mk +include $(srcdir)/lib/package/local.mk +include $(srcdir)/lib/metadata/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) +pkglibpackage = $(pkglibpackage_srcs:.sh=.sm) +pkglibmetadata = $(pkglibmetadata_srcs:.sh=.sm) +man1 = $(man1_srcs:.1in=.1) +man3 = $(man3_srcs:.3in=.3) +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 \ + lib/package/local.mk \ + lib/metadata/local.mk \ + man/local.mk \ + locale/local.mk \ + tests/local.mk \ + $(bin_srcs) \ + $(pkglib_srcs) \ + $(pkglibpackage_srcs) \ + $(pkglibmetadata_srcs) \ + $(man1_srcs) \ + $(man3_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&@@DATADIR@@&$(datadir)&;\ + s&@@LOCALEDIR@@&$(localedir)&;\ + s&@@SYSCONFDIR@@&$(sysconfdir)&;\ + s&@@SH@@&$(sh)&;\ + s&@@METADATA@@&$(metadata)&;\ + s&@@OPKHELPER_3_0@@&$(opkhelper_3_0)&; .SUFFIXES: +.SUFFIXES: .sh .sm .1in .1 .3in .3 .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 .3in.3: + @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-pkglibpackage all-pkglibmetadata +all-bin: $(bin) +all-pkglib: $(pkglib) +all-pkglibpackage: $(pkglibpackage) +all-pkglibmetadata: $(pkglibmetadata) +all-data: all-man1 all-man3 all-locale +all-man1: $(man1) +all-man3: $(man3) +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-pkglibpackage clean-pkglibmetadata +clean-bin: + @files='$(bin)'; $(clean_cmds) +clean-pkglib: + @files='$(pkglib)'; $(clean_cmds) +clean-pkglibpackage: + @files='$(pkglibpackage)'; $(clean_cmds) +clean-pkglibmetadata: + @files='$(pkglibmetadata)'; $(clean_cmds) +clean-data: clean-man1 clean-man3 clean-locale +clean-man1: + @files='$(man1)'; $(clean_cmds) +clean-man3: + @files='$(man3)'; $(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-pkglibpackage \ + install-pkglibmetadata +install-bin: + @files='$(bin)'; dir='$(bindir)'; mode='755'; $(install_cmds) +install-pkglib: + @files='$(pkglib)'; dir='$(pkglibdir)'; mode='644'; $(install_cmds) +install-pkglibpackage: + @files='$(pkglibpackage)'; dir='$(pkglibpackagedir)'; \ + mode='644'; $(install_cmds) +install-pkglibmetadata: + @files='$(pkglibmetadata)'; dir='$(pkglibmetadatadir)'; \ + mode='644'; $(install_cmds) +install-data: all-data install-man1 install-man3 install-locale +install-man1: + @files='$(man1)'; dir='$(man1dir)'; mode='644'; $(install_cmds) +install-man3: + @files='$(man3)'; dir='$(man3dir)'; 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 -all: - @printf 'Making executable files...\n' - @cd src && $(MAKE) $(MACROS) all - @printf 'Making library files...\n' - @cd lib && $(MAKE) $(MACROS) all - @cd lib/package && $(MAKE) $(MACROS) all - @cd lib/metadata && $(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/package && $(MAKE) $(MACROS) clean - @cd lib/metadata && $(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 libary files...\n' - @cd lib && $(MAKE) $(MACROS) install - @cd lib/package && $(MAKE) $(MACROS) install - @cd lib/metadata && $(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/package && $(MAKE) $(MACROS) uninstall - @cd lib/metadata && $(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-pkglibpackage uninstall-pkglibmetadata \ + uninstall-pkglib +uninstall-bin: + @files='$(bin)'; dir='$(bindir)'; $(uninstall_cmds) +uninstall-pkglib: + @files='$(pkglib)'; dir='$(pkglibdir)'; $(uninstall_cmds) + @rmdir '$(DESTDIR)/$(pkglibdir)' +uninstall-pkglibpackage: + @files='$(pkglibpackage)'; dir='$(pkglibpackagedir)'; \ + $(uninstall_cmds) + @rmdir '$(DESTDIR)/$(pkglibpackagedir)' +uninstall-pkglibmetadata: + @files='$(pkglibmetadata)'; dir='$(pkglibmetadatadir)'; \ + $(uninstall_cmds) + @rmdir '$(DESTDIR)/$(pkglibmetadatadir)' +uninstall-data: uninstall-man1 uninstall-man3 uninstall-locale +uninstall-man1: + @files='$(man1)'; dir='$(man1dir)'; $(uninstall_cmds) +uninstall-man3: + @files='$(man3)'; dir='$(man3dir)'; $(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 - @printf 'Running tests...\n' - @cd tests && $(MAKE) $(MACROS) test + @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)' - @cp -pR $(distfiles) '$(distdir)' - @cd src && $(MAKE) '../$(distdir)/src' - @cd lib && $(MAKE) '../$(distdir)/lib' - @cd lib/package && $(MAKE) '../../$(distdir)/lib/package' - @cd lib/metadata && $(MAKE) '../../$(distdir)/lib/metadata' - @cd locale && $(MAKE) '../$(distdir)/locale' - @cd man && $(MAKE) '../$(distdir)/man' - @cd tests && $(MAKE) '../$(distdir)/tests' + @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' @@ -4,7 +4,7 @@ # configure # Configuration script to generate Makefile. # -# Copyright (C) 2012 Patrick "P. J." McDermott +# 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 @@ -22,16 +22,19 @@ package_name='opkbuild' package_version='3.0.0-alpha4' package_description='OPK Build System' +package_library='libopkbuild.1' srcdir="$(cd "${0%/*}" && pwd)" prefix='/usr/local' -bindir='$(prefix)/bin' -libdir='$(prefix)/share' -datadir='$(prefix)/share' -mandir='$(datadir)/man' -localedir='$(datadir)/locale' +bindir='${prefix}/bin' +libdir='${prefix}/share' +pkglibdir='${libdir}/${package_library}' +datadir='${prefix}/share' +mandir='${datadir}/man' +man1dir='${mandir}/man1' +man3dir='${mandir}/man3' +localedir='${datadir}/locale' sysconfdir='/etc' -libopkbuild='$(libdir)/libopkbuild.1' metadata='proteanos' quiet='false' @@ -50,8 +53,11 @@ srcdir prefix bindir libdir +pkglibdir datadir mandir +man1dir +man3dir localedir sysconfdir ' @@ -68,8 +74,8 @@ subst_vars=" package_name package_version package_description +package_library ${long_opts_with_args} -libopkbuild ${features} " @@ -153,10 +159,16 @@ 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 + --man3dir=MAN1DIR install section 3 manual pages in MAN3DIR + default: MANDIR/man3 --localedir=LOCALEDIR install locales in LOCALEDIR default: DATADIR/locale --sysconfdir=SYSCONFDIR install system configuration in SYSCONFDIR @@ -182,7 +194,7 @@ print_version() ${package_name} ${package_version} configure Not generated by GNU Autoconf -Copyright (C) 2011-2012 Patrick "P. J." McDermott +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. @@ -283,7 +295,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 @@ -300,26 +313,24 @@ find_dep_lib() ${quiet} || printf 'checking for %s... ' "${_dep}" - IFS=':' - - for _element in ${libdir}:${PATH}; do - unset IFS + for _element in $(eval echo "${libdir}") ${PATH}; do : ${_element=-.} - if [ -f "${_element}/${_dep}" -a -x "${_element}/${_dep}" ]; then + 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 - unset IFS - ${quiet} || printf 'not found\n' return 1 } write_makefiles() { + mkdir -p src lib lib/package lib/metadata locale man tests + # Make a script to edit input makefiles. _sed_script='' for _var in ${subst_vars}; do @@ -327,10 +338,7 @@ write_makefiles() _sed_script="${_sed_script}s&@${_var}@&$(eval echo \$\{"${_var}"\})&g;" done - for _dir in . src lib lib/package lib/metadata locale man tests; 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 system configuration for testing. # TODO: Remove when no longer used. diff --git a/lib/Makefile.in b/lib/Makefile.in deleted file mode 100644 index 12cddc5..0000000 --- a/lib/Makefile.in +++ /dev/null @@ -1,80 +0,0 @@ -# opkbuild -# 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@ -libopkbuild = @libopkbuild@ -metadata = @metadata@ - -sed_script = s&@@PACKAGE_NAME@@&$(package_name)&;\ - s&@@PACKAGE_VERSION@@&$(package_version)&;\ - s&@@LOCALEDIR@@&$(localedir)&;\ - s&@@LIBOPKBUILD@@&$(libopkbuild)&;\ - s&@@METADATA@@&$(metadata)&; - -.SUFFIXES: -.SUFFIXES: .sh .sm - -SRCS = load.sh common.sh \ - locale.sh output.sh \ - package.sh \ - metadata.sh \ - control.sh changelog.sh \ - deps.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)/$(libopkbuild)' - @for obj in $(OBJS); do \ - printf ' INSTALL lib/%s\n' "$${obj}"; \ - cp "$${obj}" "$(DESTDIR)/$(libopkbuild)/$${obj}"; \ - chmod 644 "$(DESTDIR)/$(libopkbuild)/$${obj}"; \ - done - -uninstall: - @for obj in $(OBJS); do \ - printf ' RM %s\n' "$${obj}"; \ - rm -f "$(DESTDIR)/$(libopkbuild)/$${obj}"; \ - done - @rmdir '$(DESTDIR)/$(libopkbuild)' 2>/dev/null || true - -$(distdir): - @mkdir -p '$(distdir)' - @cp -pR $(distfiles) '$(distdir)' diff --git a/lib/load.sh b/lib/load.sh index 9a425c1..ac38dbc 100644 --- a/lib/load.sh +++ b/lib/load.sh @@ -22,7 +22,7 @@ _OB_LOAD_SM='true' # The "common" module is used by this and all other modules. # We have to manually load the "common" module so we can use it in ob_use. -. '@@LIBOPKBUILD@@/common.sm' +. '@@PKGLIBDIR@@/common.sm' ob_use() { @@ -35,7 +35,7 @@ ob_use() return ${?} fi - _obu_module='@@LIBOPKBUILD@@'"/${_obu_module}.sm" + _obu_module='@@PKGLIBDIR@@'"/${_obu_module}.sm" if [ -r "${_obu_module}" ]; then . "${_obu_module}" else diff --git a/lib/local.mk b/lib/local.mk new file mode 100644 index 0000000..d0d5cbd --- /dev/null +++ b/lib/local.mk @@ -0,0 +1,28 @@ +# opkbuild +# 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/locale.sh \ + lib/output.sh \ + lib/package.sh \ + lib/metadata.sh \ + lib/control.sh \ + lib/changelog.sh \ + lib/deps.sh diff --git a/lib/metadata/Makefile.in b/lib/metadata/Makefile.in deleted file mode 100644 index 28c4d48..0000000 --- a/lib/metadata/Makefile.in +++ /dev/null @@ -1,75 +0,0 @@ -# opkbuild -# 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@ -sysconfdir = @sysconfdir@ -opkhelper_3_0 = @opkhelper_3_0@ - -sed_script = s&@@PACKAGE_NAME@@&$(package_name)&;\ - s&@@PACKAGE_VERSION@@&$(package_version)&;\ - s&@@LIBDIR@@&$(libdir)&;\ - s&@@DATADIR@@&$(datadir)&;\ - s&@@SYSCONFDIR@@&$(sysconfdir)&;\ - s&@@OPKHELPER_3_0@@&$(opkhelper_3_0)&; - -.SUFFIXES: -.SUFFIXES: .sh .sm - -SRCS = proteanos.sh -OBJS = $(SRCS:.sh=.sm) - -distdir = ../../$(package_name)-$(package_version)/lib/metadata -distfiles = Makefile.in $(SRCS) - -all: $(OBJS) - -$(OBJS): - @printf ' SED lib/metadata/%s\n' '$@' - @sed '$(sed_script)' '$(srcdir)/lib/metadata/$*.sh' >'$@' - -clean: - @for obj in $(OBJS); do \ - printf ' RM lib/metadata/%s\n' "$${obj}"; \ - rm -f "$${obj}"; \ - done - -install: all - @mkdir -p '$(DESTDIR)/$(libopkbuild)/metadata' - @for obj in $(OBJS); do \ - printf ' INSTALL lib/metadata/%s\n' "$${obj}"; \ - cp "$${obj}" "$(DESTDIR)/$(libopkbuild)/metadata/$${obj}"; \ - chmod 644 "$(DESTDIR)/$(libopkbuild)/metadata/$${obj}"; \ - done - -uninstall: - @for obj in $(OBJS); do \ - printf ' RM %s\n' "$${obj}"; \ - rm -f "$(DESTDIR)/$(libopkbuild)/metadata/$${obj}"; \ - done - @rmdir '$(DESTDIR)/$(libopkbuild)/metadata' 2>/dev/null || true - -$(distdir): - @mkdir -p '$(distdir)' - @cp -pR $(distfiles) '$(distdir)' diff --git a/lib/metadata/local.mk b/lib/metadata/local.mk new file mode 100644 index 0000000..9c32560 --- /dev/null +++ b/lib/metadata/local.mk @@ -0,0 +1,20 @@ +# opkbuild +# lib/metadata/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/>. + +pkglibmetadata_srcs = \ + lib/metadata/proteanos.sh diff --git a/lib/package/Makefile.in b/lib/package/Makefile.in deleted file mode 100644 index c28c412..0000000 --- a/lib/package/Makefile.in +++ /dev/null @@ -1,68 +0,0 @@ -# opkbuild -# 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@ - -sed_script = s&@@PACKAGE_NAME@@&$(package_name)&;\ - s&@@PACKAGE_VERSION@@&$(package_version)&; - -.SUFFIXES: -.SUFFIXES: .sh .sm - -SRCS = 2.sh -OBJS = $(SRCS:.sh=.sm) - -distdir = ../../$(package_name)-$(package_version)/lib/package -distfiles = Makefile.in $(SRCS) - -all: $(OBJS) - -$(OBJS): - @printf ' SED lib/package/%s\n' '$@' - @sed '$(sed_script)' '$(srcdir)/lib/package/$*.sh' >'$@' - -clean: - @for obj in $(OBJS); do \ - printf ' RM lib/package/%s\n' "$${obj}"; \ - rm -f "$${obj}"; \ - done - -install: all - @mkdir -p '$(DESTDIR)/$(libopkbuild)/package' - @for obj in $(OBJS); do \ - printf ' INSTALL lib/package/%s\n' "$${obj}"; \ - cp "$${obj}" "$(DESTDIR)/$(libopkbuild)/package/$${obj}"; \ - chmod 644 "$(DESTDIR)/$(libopkbuild)/package/$${obj}"; \ - done - -uninstall: - @for obj in $(OBJS); do \ - printf ' RM %s\n' "$${obj}"; \ - rm -f "$(DESTDIR)/$(libopkbuild)/package/$${obj}"; \ - done - @rmdir '$(DESTDIR)/$(libopkbuild)/package' 2>/dev/null || true - -$(distdir): - @mkdir -p '$(distdir)' - @cp -pR $(distfiles) '$(distdir)' diff --git a/lib/package/local.mk b/lib/package/local.mk new file mode 100644 index 0000000..6839f77 --- /dev/null +++ b/lib/package/local.mk @@ -0,0 +1,20 @@ +# opkbuild +# lib/package/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/>. + +pkglibpackage_srcs = \ + lib/package/2.sh diff --git a/locale/Makefile.in b/locale/Makefile.in deleted file mode 100644 index 71cfc2c..0000000 --- a/locale/Makefile.in +++ /dev/null @@ -1,73 +0,0 @@ -# opkbuild -# 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_MID/libopkbuild_1.sh en_US/libopkbuild_1.sh \ - en_US/opkbuild.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..7f75252 --- /dev/null +++ b/locale/local.mk @@ -0,0 +1,22 @@ +# opkbuild +# 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_MID/libopkbuild_1.sh \ + locale/en_US/libopkbuild_1.sh \ + locale/en_US/opkbuild.sh diff --git a/man/Makefile.in b/man/Makefile.in deleted file mode 100644 index d17aba1..0000000 --- a/man/Makefile.in +++ /dev/null @@ -1,116 +0,0 @@ -# opkbuild -# 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_1 = opkbuild.1.in \ -# ob-checkbuilddeps.1.in \ -# ob-buildenv.1.in \ -# ob-unpacksource.1.in \ -# ob-applypatches.1.in \ -# ob-installplatconf.1.in \ -# ob-installdocs.1.in \ -# ob-gencontrol.1.in \ -# ob-buildopk.1.in \ -# ob-genchanges.1.in -#SRCS_3 = ob_get_text_domain.3.in \ -# ob_set_text_domain.3.in \ -# ob_get_msg.3.in \ -# ob_error.3.in \ -# ob_warn.3.in \ -# ob_info.3.in \ -# ob_init_package.3.in \ -# ob_parse_package_metadata.3.in \ -# ob_get_binary_packages.3.in \ -# ob_get_source_parameter.3.in \ -# ob_get_binary_parameter.3.in \ -# ob_summarize_package_arch.3.in \ -# ob_summarize_package_plat.3.in \ -# ob_parse_control.3.in \ -# ob_parse_changelog.3.in \ -# ob_validate_source_package_name.3.in \ -# ob_validate_binary_package_name.3.in \ -# ob_parse_version.3.in \ -# ob_reduce_build_deps.3.in \ -# ob_reduce_runinst_deps.3.in \ -# ob_get_system_arch.3.in \ -# ob_match_arch.3.in \ -# ob_get_system_plat.3.in \ -# ob_match_plat.3.in -SRCS = $(SRCS_1) $(SRCS_3) -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..0a397bd --- /dev/null +++ b/man/local.mk @@ -0,0 +1,54 @@ +# opkbuild +# 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 = \ +# opkbuild.1in \ +# ob-checkbuilddeps.1in \ +# ob-buildenv.1in \ +# ob-unpacksource.1in \ +# ob-applypatches.1in \ +# ob-installplatconf.1in \ +# ob-installdocs.1in \ +# ob-gencontrol.1in \ +# ob-buildopk.1in \ +# ob-genchanges.1in +#man3_srcs = \ +# ob_get_text_domain.3in \ +# ob_set_text_domain.3in \ +# ob_get_msg.3in \ +# ob_error.3in \ +# ob_warn.3in \ +# ob_info.3in \ +# ob_init_package.3in \ +# ob_parse_package_metadata.3in \ +# ob_get_binary_packages.3in \ +# ob_get_source_parameter.3in \ +# ob_get_binary_parameter.3in \ +# ob_summarize_package_arch.3in \ +# ob_summarize_package_plat.3in \ +# ob_parse_control.3in \ +# ob_parse_changelog.3in \ +# ob_validate_source_package_name.3in \ +# ob_validate_binary_package_name.3in \ +# ob_parse_version.3in \ +# ob_reduce_build_deps.3in \ +# ob_reduce_runinst_deps.3in \ +# ob_get_system_arch.3in \ +# ob_match_arch.3in \ +# ob_get_system_plat.3in \ +# ob_match_plat.3in diff --git a/src/Makefile.in b/src/Makefile.in deleted file mode 100644 index 21c1451..0000000 --- a/src/Makefile.in +++ /dev/null @@ -1,83 +0,0 @@ -# opkbuild -# 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@ -libopkbuild = @libopkbuild@ - -sh = @sh@ - -sed_script = s&@@PACKAGE_NAME@@&$(package_name)&;\ - s&@@PACKAGE_VERSION@@&$(package_version)&;\ - s&@@BINDIR@@&$(bindir)&;\ - s&@@LIBOPKBUILD@@&$(libopkbuild)&;\ - s&@@SH@@&$(sh)&; - -.SUFFIXES: -.SUFFIXES: .sh - -SRCS = opkbuild.sh \ - ob-checkbuilddeps.sh \ - ob-buildenv.sh \ - ob-unpacksource.sh \ - ob-applypatches.sh \ - ob-installplatconf.sh \ - ob-installdocs.sh \ - ob-gencontrol.sh \ - ob-buildopk.sh \ -# ob-genchanges.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..06eeb4b --- /dev/null +++ b/src/local.mk @@ -0,0 +1,29 @@ +# opkbuild +# 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/opkbuild.sh \ + src/ob-checkbuilddeps.sh \ + src/ob-buildenv.sh \ + src/ob-unpacksource.sh \ + src/ob-applypatches.sh \ + src/ob-installplatconf.sh \ + src/ob-installdocs.sh \ + src/ob-gencontrol.sh \ + src/ob-buildopk.sh \ +# src/ob-genchanges.sh diff --git a/src/ob-applypatches.sh b/src/ob-applypatches.sh index 66f41da..a522238 100644 --- a/src/ob-applypatches.sh +++ b/src/ob-applypatches.sh @@ -19,7 +19,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/>. -. '@@LIBOPKBUILD@@/load.sm' +. '@@PKGLIBDIR@@/load.sm' ob_use locale ob_use output diff --git a/src/ob-buildenv.sh b/src/ob-buildenv.sh index 1cfa66c..e02c19a 100644 --- a/src/ob-buildenv.sh +++ b/src/ob-buildenv.sh @@ -19,7 +19,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/>. -. '@@LIBOPKBUILD@@/load.sm' +. '@@PKGLIBDIR@@/load.sm' ob_use locale ob_use output diff --git a/src/ob-buildopk.sh b/src/ob-buildopk.sh index 4f947f8..264e532 100644 --- a/src/ob-buildopk.sh +++ b/src/ob-buildopk.sh @@ -19,7 +19,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/>. -. '@@LIBOPKBUILD@@/load.sm' +. '@@PKGLIBDIR@@/load.sm' ob_use locale ob_use output diff --git a/src/ob-checkbuilddeps.sh b/src/ob-checkbuilddeps.sh index 1c39067..be7b875 100644 --- a/src/ob-checkbuilddeps.sh +++ b/src/ob-checkbuilddeps.sh @@ -19,7 +19,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/>. -. '@@LIBOPKBUILD@@/load.sm' +. '@@PKGLIBDIR@@/load.sm' ob_use locale ob_use output diff --git a/src/ob-gencontrol.sh b/src/ob-gencontrol.sh index 16eec5d..542117d 100644 --- a/src/ob-gencontrol.sh +++ b/src/ob-gencontrol.sh @@ -19,7 +19,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/>. -. '@@LIBOPKBUILD@@/load.sm' +. '@@PKGLIBDIR@@/load.sm' ob_use locale ob_use output diff --git a/src/ob-installdocs.sh b/src/ob-installdocs.sh index d415909..5cd49a9 100644 --- a/src/ob-installdocs.sh +++ b/src/ob-installdocs.sh @@ -19,7 +19,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/>. -. '@@LIBOPKBUILD@@/load.sm' +. '@@PKGLIBDIR@@/load.sm' ob_use locale ob_use output diff --git a/src/ob-installplatconf.sh b/src/ob-installplatconf.sh index 9458f91..5a29442 100644 --- a/src/ob-installplatconf.sh +++ b/src/ob-installplatconf.sh @@ -19,7 +19,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/>. -. '@@LIBOPKBUILD@@/load.sm' +. '@@PKGLIBDIR@@/load.sm' ob_use locale ob_use output diff --git a/src/ob-unpacksource.sh b/src/ob-unpacksource.sh index 78ed4e0..07c8d48 100644 --- a/src/ob-unpacksource.sh +++ b/src/ob-unpacksource.sh @@ -19,7 +19,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/>. -. '@@LIBOPKBUILD@@/load.sm' +. '@@PKGLIBDIR@@/load.sm' ob_use locale ob_use output diff --git a/src/opkbuild.sh b/src/opkbuild.sh index c6f6fc7..a3ad831 100644 --- a/src/opkbuild.sh +++ b/src/opkbuild.sh @@ -19,7 +19,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/>. -. '@@LIBOPKBUILD@@/load.sm' +. '@@PKGLIBDIR@@/load.sm' ob_use locale ob_use output diff --git a/tests/Makefile.in b/tests/Makefile.in deleted file mode 100644 index f9ab9a0..0000000 --- a/tests/Makefile.in +++ /dev/null @@ -1,64 +0,0 @@ -# opkbuild -# 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@ - -SH = @sh@ - -.SUFFIXES: - -TESTS = ob_match_arch ob_parse_dep ob_reduce_deps - -distdir = ../$(package_name)-$(package_version)/tests -distfiles = Makefile.in common.sh - -test: - @all=0; failed=0; \ - for test in $(TESTS); do \ - out="$$($(SH) "$${test}.sh" 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)' - @cp -pR $(distfiles) '$(distdir)' - @for test in $(TESTS); do \ - cp -p "$${test}.sh" "$${test}.rc" '$(distdir)'; \ - done diff --git a/tests/local.mk b/tests/local.mk new file mode 100644 index 0000000..9a3bb8e --- /dev/null +++ b/tests/local.mk @@ -0,0 +1,22 @@ +# opkbuild +# tests/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/>. + +tests = \ + tests/ob_match_arch.sh \ + tests/ob_parse_dep.sh \ + tests/ob_reduce_deps.sh |