[Pkg-voip-commits] [dahdi-tools] 232/285: automake: xpp: man-pages and perl-scripts
tzafrir at debian.org
tzafrir at debian.org
Thu Jul 7 19:19:03 UTC 2016
This is an automated email from the git hooks/post-receive script.
tzafrir pushed a commit to branch master
in repository dahdi-tools.
commit b054abb7e98b33f8a4f7ac83d364799fe253611a
Author: Oron Peled <oron.peled at xorcom.com>
Date: Mon May 18 15:25:03 2015 +0000
automake: xpp: man-pages and perl-scripts
* Now man-pages and perl-script are handled by xpp/Makefile.am
* Removed from xpp/Makefile.legacy
* Detect perl and set perllibdir in configure.ac
* Handle modules in their own xpp/perl_modules/Makefile.am
* Enclose perl-related stuff in conditional
* Updates for "make dist"
Signed-off-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
---
.gitignore | 1 +
build_tools/make_dist | 2 ++
configure.ac | 11 ++++++++++
xpp/Makefile.am | 44 +++++++++++++++++++++++++++++++++++--
xpp/Makefile.legacy | 52 +-------------------------------------------
xpp/perl_modules/Makefile.am | 24 ++++++++++++++++++++
6 files changed, 81 insertions(+), 53 deletions(-)
diff --git a/.gitignore b/.gitignore
index 1249c51..87d854e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -51,6 +51,7 @@ timertest
tonezone.lo
tonezones.txt
version.c
+xpp/*.check
xpp/.depend
xpp/.octasic.depend
xpp/.perlcheck
diff --git a/build_tools/make_dist b/build_tools/make_dist
index 8261c24..e1e580c 100755
--- a/build_tools/make_dist
+++ b/build_tools/make_dist
@@ -28,10 +28,12 @@ extra_dist='
Makefile
xpp/Makefile
xpp/oct612x/Makefile
+ xpp/perl_modules/Makefile
ppp/Makefile.in
Makefile.in
xpp/Makefile.in
xpp/oct612x/Makefile.in
+ xpp/perl_modules/Makefile.in
auxdir/compile
auxdir/config.guess
auxdir/config.sub
diff --git a/configure.ac b/configure.ac
index cc935dd..1557888 100644
--- a/configure.ac
+++ b/configure.ac
@@ -86,6 +86,16 @@ AC_SUBST(DOWNLOAD)
AC_LANG(C)
+AC_PATH_PROG([PERL], [perl])
+if test "$PERL" = ''; then
+ AC_MSG_ERROR(perl is mandatory)
+fi
+AC_MSG_CHECKING(for perl libdir)
+eval `"$PERL" -V:sitelib`
+AC_SUBST([perllibdir], [`echo "$sitelib"`])
+AC_MSG_RESULT([$perllibdir])
+AM_CONDITIONAL([PERL], [test "$perllibdir" != ''])
+
AC_ARG_ENABLE(dev-mode,
[ --enable-dev-mode Turn on developer mode],
[case "${enableval}" in
@@ -247,6 +257,7 @@ AC_CONFIG_FILES([
ppp/Makefile
xpp/Makefile
xpp/oct612x/Makefile
+ xpp/perl_modules/Makefile
])
AC_OUTPUT
diff --git a/xpp/Makefile.am b/xpp/Makefile.am
index c456fad..7d060d5 100644
--- a/xpp/Makefile.am
+++ b/xpp/Makefile.am
@@ -4,7 +4,7 @@ LEGACY_MAKE = \
top_srcdir=$(top_srcdir) \
srcdir=$(srcdir)
-all-local:
+all-local: $(perl_checks)
$(LEGACY_MAKE) all
clean-local:
@@ -21,6 +21,44 @@ SUBDIRS =
GLOBAL_CFLAGS = -I$(srcdir) -I$(srcdir)/xtalk
+if PERL
+SUBDIRS += perl_modules
+
+%.8: %
+ @if file "$^" | cut -d: -f2 | grep -q perl; then \
+ if pod2man --section 8 $^ > $@; then \
+ echo " GEN $@"; \
+ else \
+ rm -f "$@"; \
+ fi \
+ fi
+
+%.check: %
+ @echo " CHECK $^"; \
+ if ! perl -I./perl_modules -c $^ 2>/dev/null; then \
+ perl -I./perl_modules -c $^; \
+ fi
+ @touch $@
+
+perl_scripts = \
+ dahdi_registration \
+ xpp_sync \
+ lsdahdi \
+ xpp_blink \
+ dahdi_genconf \
+ dahdi_hardware \
+ twinstar \
+ #
+
+perl_checks = $(perl_scripts:%=%.check)
+perl_mans = $(perl_scripts:%=%.8)
+
+endif
+
+dist_sbin_SCRIPTS = $(perl_scripts)
+man_MANS = $(perl_mans)
+CLEANFILES = $(perl_checks) $(perl_mans)
+
if PBX_USB
SUBDIRS += oct612x
@@ -65,9 +103,11 @@ astribank_allow_CFLAGS = $(GLOBAL_CFLAGS)
astribank_allow_LDFLAGS = $(USB_LIB)
astribank_allow_LDADD = libastribank.la
-man_MANS = \
+man_pages = \
astribank_tool.8 \
astribank_hexload.8 \
astribank_allow.8 \
astribank_is_starting.8
+
+man_MANS += $(man_pages)
endif
diff --git a/xpp/Makefile.legacy b/xpp/Makefile.legacy
index 9f37f0b..3d49b09 100644
--- a/xpp/Makefile.legacy
+++ b/xpp/Makefile.legacy
@@ -19,75 +19,25 @@ INSTALL_DATA = $(INSTALL) -m 644
# In 1.4 those are provided by autoconf through makeopts
prefix ?= /usr
datadir ?= $(prefix)/share
-mandir ?= $(datadir)/man
sysconfdir ?= $(prefix)/etc
udevrulesdir ?= $(sysconfdir)/udev/rules.d
INSTALL ?= install
INSTALL_DATA = $(INSTALL) -m 644
-SBINDIR = $(prefix)/sbin
DATADIR = $(datadir)/dahdi
-MANDIR = $(mandir)/man8
-PERLLIBDIR := $(shell eval `perl -V:sitelib`; echo "$$sitelib")
-PERL_DIRS := $(shell cd perl_modules; find * -name '[A-Z]*' -type d| xargs)
-PERL_MODS_PAT := *.pm $(PERL_DIRS:%=%/*.pm)
-PERL_MODS := $(shell cd perl_modules; echo $(PERL_MODS_PAT))
# Variables that should be defined above, but need sane defaults:
# FIXME: Are those values really sane?
HOSTCC ?= $(CC)
-%.8: %
- pod2man --section 8 $^ > $@ || $(RM) $@
-PERL_SCRIPTS = \
- dahdi_registration \
- xpp_sync \
- lsdahdi \
- xpp_blink \
- dahdi_genconf \
- dahdi_hardware \
- twinstar \
- #
-
-PERL_MANS = $(PERL_SCRIPTS:%=%.8)
-
-TARGETS = .perlcheck
-
-ifneq (,$(PERLLIBDIR))
-PROG_INSTALL += $(PERL_SCRIPTS)
-TARGETS += $(PERL_MANS)
-endif
-
-all: $(TARGETS)
-
-docs: $(PERL_MANS)
+all:
install: all
- $(INSTALL) -d $(DESTDIR)$(SBINDIR)
- $(INSTALL) $(PROG_INSTALL) $(DESTDIR)$(SBINDIR)/
$(INSTALL) -d $(DESTDIR)$(DATADIR)
$(INSTALL) xpp_fxloader astribank_hook $(DESTDIR)$(DATADIR)/
$(INSTALL) waitfor_xpds $(DESTDIR)$(DATADIR)/
$(INSTALL) -d $(DESTDIR)$(udevrulesdir)
$(INSTALL_DATA) xpp.rules $(DESTDIR)$(udevrulesdir)/
- $(INSTALL) -d $(DESTDIR)$(MANDIR)
- $(INSTALL_DATA) $(PERL_MANS) $(DESTDIR)$(MANDIR)/
-ifneq (,$(PERLLIBDIR))
- $(INSTALL) -d $(DESTDIR)$(PERLLIBDIR)
- for i in $(PERL_DIRS); \
- do \
- $(INSTALL) -d "$(DESTDIR)$(PERLLIBDIR)/$$i"; \
- done
- for i in $(PERL_MODS); \
- do \
- $(INSTALL_DATA) "perl_modules/$$i" "$(DESTDIR)$(PERLLIBDIR)/$$i"; \
- done
-endif
-
-.perlcheck: $(PERL_SCRIPTS)
- for i in $^; do perl -I./perl_modules -c $$i || exit 1; done
- touch $@
clean:
- $(RM) $(TARGETS)
diff --git a/xpp/perl_modules/Makefile.am b/xpp/perl_modules/Makefile.am
new file mode 100644
index 0000000..b9a0520
--- /dev/null
+++ b/xpp/perl_modules/Makefile.am
@@ -0,0 +1,24 @@
+nobase_perllib_DATA = \
+ Dahdi.pm \
+ Dahdi/Hardware.pm \
+ Dahdi/Xpp/Line.pm \
+ Dahdi/Xpp/Xbus.pm \
+ Dahdi/Xpp/Xpd.pm \
+ Dahdi/Xpp/Mpp.pm \
+ Dahdi/Span.pm \
+ Dahdi/Utils.pm \
+ Dahdi/Chans.pm \
+ Dahdi/Xpp.pm \
+ Dahdi/Config/Params.pm \
+ Dahdi/Config/Gen/Xpporder.pm \
+ Dahdi/Config/Gen/Spantypes.pm \
+ Dahdi/Config/Gen/Modules.pm \
+ Dahdi/Config/Gen/Users.pm \
+ Dahdi/Config/Gen/Freepbxdb.pm \
+ Dahdi/Config/Gen/Unicall.pm \
+ Dahdi/Config/Gen/Chandahdi.pm \
+ Dahdi/Config/Gen/Assignedspans.pm \
+ Dahdi/Config/Gen/System.pm \
+ Dahdi/Config/Gen.pm \
+ Dahdi/Hardware/USB.pm \
+ Dahdi/Hardware/PCI.pm
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/dahdi-tools.git
More information about the Pkg-voip-commits
mailing list