summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile7
-rw-r--r--README.emacs21
-rw-r--r--misc/Makefile7
-rwxr-xr-xmisc/perl_checker-vim3
-rw-r--r--misc/perl_checker.el10
-rw-r--r--misc/perl_checker.vim1
-rw-r--r--perl-MDK-Common.spec11
7 files changed, 55 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index d67250e..4c5a63e 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ RPM ?= $(HOME)/rpm
PREFIX = /usr
BINDIR = $(PREFIX)/bin
VENDORLIB = $(shell eval "`perl -V:installvendorlib`"; echo $$installvendorlib)
-INSTALLVENDORLIB = $(shell echo $(VENDORLIB) | sed 's,/usr,$(PREFIX),')
+INSTALLVENDORLIB = $(DESTDIR)$(VENDORLIB)
PERL_CHECKER_TARGET = native-code
GENERATED = MDK/Common.pm index.html perl_checker.src/perl_checker
@@ -34,8 +34,9 @@ clean:
find -name "*~" | xargs rm -rf
install: clean all
- install -d $(BINDIR) $(INSTALLVENDORLIB)/MDK/Common
- install perl_checker.src/perl_checker $(BINDIR)
+ install -d $(DESTDIR)$(BINDIR) $(INSTALLVENDORLIB)/MDK/Common
+ $(MAKE) -C misc install
+ install perl_checker.src/perl_checker $(DESTDIR)$(BINDIR)
install -m 644 MDK/Common.pm $(INSTALLVENDORLIB)/MDK
install -m 644 MDK/Common/*.pm $(INSTALLVENDORLIB)/MDK/Common
tar c `find perl_checker_fake_packages -name "*.pm"` | tar xC $(INSTALLVENDORLIB)
diff --git a/README.emacs b/README.emacs
new file mode 100644
index 0000000..d3733a2
--- /dev/null
+++ b/README.emacs
@@ -0,0 +1,21 @@
+To use under emacs, simply add the following line to your .emacs,
+then when you visit a perl file, you can use Ctrl-Return to run perl_checker
+on this file
+
+ (global-set-key [(control return)] (lambda () (interactive) (save-some-buffers 1) (compile (concat "perl_checker --restrict-to-files " (buffer-file-name (current-buffer))))))
+
+perl_checker --restrict-to-files scanner.pm > errors.err ; vim -c ':copen 4' -c ':so /usr/share/vim/ftplugin/perl_checker.vim' -q
+
+
+
+/usr/share/vim/ftplugin/perl_checker.vim
+
+" Error formats
+setlocal efm=
+ \%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d:,
+ \%EFile\ \"%f\"\\,\ line\ %l\\,\ character\ %c:%m,
+ \%+EReference\ to\ unbound\ regexp\ name\ %m,
+ \%Eocamlyacc:\ e\ -\ line\ %l\ of\ \"%f\"\\,\ %m,
+ \%Wocamlyacc:\ w\ -\ %m,
+ \%-Zmake%.%#,
+ \%C%m
diff --git a/misc/Makefile b/misc/Makefile
new file mode 100644
index 0000000..70c3def
--- /dev/null
+++ b/misc/Makefile
@@ -0,0 +1,7 @@
+PREFIX = /usr
+DATADIR = $(PREFIX)/share
+
+install:
+ install -D -m 644 perl_checker.vim $(DESTDIR)$(DATADIR)/vim/ftplugin/perl_checker.vim
+ install -D -m 644 perl_checker.el $(DESTDIR)/etc/emacs/site-start.d/perl_checker.el
+ install -D perl_checker-vim $(DESTDIR)$(PREFIX)/bin/perl_checker-vim
diff --git a/misc/perl_checker-vim b/misc/perl_checker-vim
new file mode 100755
index 0000000..a32478b
--- /dev/null
+++ b/misc/perl_checker-vim
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+perl_checker --restrict-to-files "$@" > errors.err && vim -c ':copen 4' -c ':so /usr/share/vim/ftplugin/perl_checker.vim' -q
diff --git a/misc/perl_checker.el b/misc/perl_checker.el
new file mode 100644
index 0000000..135cb99
--- /dev/null
+++ b/misc/perl_checker.el
@@ -0,0 +1,10 @@
+(defun run-perl_checker ()
+ (interactive)
+ (save-some-buffers 1)
+ (compile (concat "perl_checker --restrict-to-files " (buffer-file-name (current-buffer)))))
+
+(let ((hook '(lambda ()
+ (local-set-key [(control return)] 'run-perl_checker)
+ )))
+ (add-hook 'perl-mode-hook hook)
+ (add-hook 'cperl-mode-hook hook))
diff --git a/misc/perl_checker.vim b/misc/perl_checker.vim
new file mode 100644
index 0000000..1b34dc2
--- /dev/null
+++ b/misc/perl_checker.vim
@@ -0,0 +1 @@
+setlocal errorformat=%EFile\ \"%f\"\\,\ line\ %l\\,\ character\ %c-%n,%Z%m
diff --git a/perl-MDK-Common.spec b/perl-MDK-Common.spec
index bff7e9a..5f0518a 100644
--- a/perl-MDK-Common.spec
+++ b/perl-MDK-Common.spec
@@ -2,7 +2,7 @@
# do not change the version here, change in MDK/Common.pm.pl
%define version THEVERSION
-%define release 2mdk
+%define release 3mdk
%ifarch x86_64
%define build_option PERL_CHECKER_TARGET='debug-code BCSUFFIX=""'
@@ -44,7 +44,7 @@ make test %build_option
%install
rm -rf $RPM_BUILD_ROOT
-make install PREFIX="$RPM_BUILD_ROOT/usr" %build_option
+%makeinstall_std %build_option
%clean
rm -rf $RPM_BUILD_ROOT
@@ -59,9 +59,16 @@ rm -rf $RPM_BUILD_ROOT
%doc index.html tutorial.html perl_checker.src/perl_checker.html
%{_bindir}/*
%{perl_vendorlib}/perl_checker_fake_packages
+%{_datadir}/vim/ftplugin/*
+%config(noreplace) %{_sysconfdir}/emacs/site-start.d/*
# MODIFY IN THE CVS: cvs.mandrakesoft.com:/cooker soft/perl-MDK-Common
%changelog
+* Fri Aug 13 2004 Pixel <pixel@mandrakesoft.com> 1.1.18-3mdk
+- use DESTDIR
+- add perl_checker-vim
+- add Ctrl-return in perl and cperl emacs mode
+
* Wed Aug 11 2004 Pixel <pixel@mandrakesoft.com> 1.1.17-2mdk
- various perl_checker enhancements/fixes