summaryrefslogtreecommitdiff
path: root/perl_dmod/Cstore/Makefile.PL
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-08-18 13:33:43 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-08-18 13:33:43 -0700
commit14df7aa3c937ed8907bd7e9b2657526233691803 (patch)
tree77e876ba2739e7fe396e93b8fd908df845d60d51 /perl_dmod/Cstore/Makefile.PL
parentabc2986d38f4b6f7a7ccc0fd3fb10e4f21652209 (diff)
parent3594ffa9f1c62d5f73d12b35f81a862c762b5d44 (diff)
downloadvyatta-cfg-14df7aa3c937ed8907bd7e9b2657526233691803.tar.gz
vyatta-cfg-14df7aa3c937ed8907bd7e9b2657526233691803.zip
Merge branch 'mendocino' of suva.vyatta.com:/git/vyatta-cfg into mendocino
Diffstat (limited to 'perl_dmod/Cstore/Makefile.PL')
-rw-r--r--perl_dmod/Cstore/Makefile.PL88
1 files changed, 88 insertions, 0 deletions
diff --git a/perl_dmod/Cstore/Makefile.PL b/perl_dmod/Cstore/Makefile.PL
new file mode 100644
index 0000000..d3968f7
--- /dev/null
+++ b/perl_dmod/Cstore/Makefile.PL
@@ -0,0 +1,88 @@
+# Copyright (C) 2010 Vyatta, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# 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 MY;
+
+use 5.010000;
+use ExtUtils::MakeMaker;
+
+my $PMOD_DIR = '$(SITEPREFIX)/share/perl5';
+
+sub constants{
+ my $self = shift;
+ my $orig_txt = $self->SUPER::constants(@_);
+ $orig_txt =~ s#= \$\(SITEPREFIX\)/(lib|share)/.*#= $PMOD_DIR#g;
+ return $orig_txt;
+}
+
+sub c_o {
+ my $self = shift;
+ my $orig_txt = $self->SUPER::c_o(@_);
+ $orig_txt =~ s/\.c(\s)/.cpp$1/g;
+ return $orig_txt;
+}
+
+sub xs_c {
+ my $self = shift;
+ my $orig_txt = $self->SUPER::xs_c(@_);
+ $orig_txt =~ s/\.c(\s)/.cpp$1/g;
+ return $orig_txt;
+}
+
+sub xs_o {
+ my $self = shift;
+ my $orig_txt = $self->SUPER::xs_o(@_);
+ $orig_txt =~ s/\.c(\s)/.cpp$1/g;
+ return $orig_txt;
+}
+
+sub install {
+ my $self = shift;
+ my $orig_txt = $self->SUPER::install(@_);
+ $orig_txt =~ s/pure_install doc_install/pure_install/g;
+ $orig_txt =~ s/\$\(INST_MAN3DIR\) .*/undef undef/g;
+ return $orig_txt;
+}
+
+sub clean {
+ my $self = shift;
+ my $orig_txt = $self->SUPER::clean(@_);
+ $orig_txt =~ s/Cstore\.c\s/Cstore.cpp /g;
+ return $orig_txt;
+}
+
+sub dynamic_lib {
+ my $self = shift;
+ my $orig_txt = $self->SUPER::dynamic_lib(@_);
+ $orig_txt =~ s/(\s)LD_RUN_PATH=\S+\s+/$1/g;
+ return $orig_txt;
+}
+
+WriteMakefile(
+ NAME => 'Cstore',
+ VERSION_FROM => 'lib/Cstore.pm',
+ PREREQ_PM => {},
+ ($] >= 5.005 ?
+ (ABSTRACT_FROM => 'lib/Cstore.pm',
+ AUTHOR => 'Vyatta <eng@vyatta.com>') : ()),
+ # note: MM will convert LIBS to absolute path in Makefile.
+ # => regenerate Makefile every time
+ LIBS => ['-L../../src/.libs -lvyatta-cfg'],
+ DEFINE => '',
+ INC => '-I../../src',
+ CC => 'g++',
+ PREFIX => '/opt/vyatta',
+ INSTALLDIRS => 'site',
+);
+