[488] | 1 | package VineLinux::VSS::Type::Elisp; |
---|
| 2 | |
---|
| 3 | use base qw( VineLinux::VSS::Type ); |
---|
| 4 | |
---|
| 5 | use VineLinux::VSS::Skeleton::Elisp::InitEl; |
---|
| 6 | use VineLinux::VSS::Skeleton::Elisp::Spec; |
---|
| 7 | use VineLinux::VSS::Skeleton::Elisp::InstallSh; |
---|
| 8 | use VineLinux::VSS::Skeleton::Elisp::RemoveSh; |
---|
| 9 | use VineLinux::VSS::Skeleton::Elisp::VineDefaultEl; |
---|
| 10 | |
---|
| 11 | sub generate { |
---|
| 12 | my $class = shift; |
---|
[492] | 13 | my $vss = shift; |
---|
[488] | 14 | |
---|
| 15 | my $filename = ''; |
---|
| 16 | my @skeleton_data; |
---|
| 17 | my $tmpl; |
---|
| 18 | |
---|
[493] | 19 | my $params = $class->_set_params($vss); |
---|
[488] | 20 | |
---|
| 21 | # <package>-init.el |
---|
| 22 | @skeleton_data = <VineLinux::VSS::Skeleton::Elisp::InitEl::DATA>; |
---|
| 23 | $tmpl = HTML::Template->new(arrayref => \@skeleton_data, |
---|
| 24 | die_on_bad_params => 0); |
---|
[493] | 25 | $tmpl->param($params); |
---|
[492] | 26 | $filename = $vss->package_name . '-init.el'; |
---|
[488] | 27 | $class->_generate_file($filename, $tmpl->output); |
---|
| 28 | |
---|
| 29 | |
---|
| 30 | # vine-default-<package>.el |
---|
| 31 | @skeleton_data = <VineLinux::VSS::Skeleton::Elisp::VineDefaultEl::DATA>; |
---|
| 32 | $tmpl = HTML::Template->new(arrayref => \@skeleton_data, |
---|
| 33 | die_on_bad_params => 0); |
---|
[493] | 34 | $tmpl->param($params); |
---|
[492] | 35 | $filename = 'vine-default-' . $vss->package_name . '.el'; |
---|
[488] | 36 | $class->_generate_file($filename, $tmpl->output); |
---|
| 37 | |
---|
| 38 | |
---|
[747] | 39 | # <package>-vl.spec |
---|
[488] | 40 | @skeleton_data = <VineLinux::VSS::Skeleton::Elisp::Spec::DATA>; |
---|
| 41 | $tmpl = HTML::Template->new(arrayref => \@skeleton_data, |
---|
| 42 | die_on_bad_params => 0); |
---|
[493] | 43 | $tmpl->param($params); |
---|
[747] | 44 | $filename = $vss->package_name . '-vl.spec'; |
---|
[488] | 45 | $class->_generate_file($filename, $tmpl->output); |
---|
| 46 | |
---|
| 47 | |
---|
| 48 | # <package>-install.sh |
---|
| 49 | @skeleton_data = <VineLinux::VSS::Skeleton::Elisp::InstallSh::DATA>; |
---|
| 50 | $tmpl = HTML::Template->new(arrayref => \@skeleton_data, |
---|
| 51 | die_on_bad_params => 0); |
---|
[493] | 52 | $tmpl->param($params); |
---|
[492] | 53 | $filename = $vss->package_name . '-install.sh'; |
---|
[488] | 54 | $class->_generate_file($filename, $tmpl->output); |
---|
| 55 | |
---|
| 56 | |
---|
| 57 | # <package>-remove.sh |
---|
| 58 | @skeleton_data = <VineLinux::VSS::Skeleton::Elisp::RemoveSh::DATA>; |
---|
| 59 | $tmpl = HTML::Template->new(arrayref => \@skeleton_data, |
---|
| 60 | die_on_bad_params => 0); |
---|
[493] | 61 | $tmpl->param($params); |
---|
[492] | 62 | $filename = $vss->package_name . '-remove.sh'; |
---|
[488] | 63 | $class->_generate_file($filename, $tmpl->output); |
---|
| 64 | } |
---|
| 65 | |
---|
| 66 | 1; |
---|