corrected init script name for apache2
[koha.git] / misc / sync_koha_plugin.pl
blobb683533b2219d1b3034a8040d67ec86c9c7e8875
1 #!/usr/bin/perl -w
3 use strict;
4 use C4::Context;
5 use Getopt::Long;
7 my %opt = ();
8 GetOptions(
9 \%opt,
10 qw/head_dir=s rel_2_2_dir=s help/
11 ) or die "\nHouston, we got a problem\n";
13 if (exists $opt{help}) {
14 print <<FIN;
15 Sync the Koha plugin with the appropriate files from HEAD. Assumes
16 that you've set up your Koha install to use CVS symlinked to the
17 normal locations.
19 Usage: sync_koha_plugin.pl --head_dir=<cvs head directory>
20 --rel_2_2_dir=<cvs rel_2_2 directory>
21 [--help]
23 --head_dir: is the directory where your Koha HEAD cvs is checked out.
25 --rel_2_2_dir: is the directory where your Koha rel_2_2 cvs is checked
26 out and symlinked to your Koha install directories.
28 --help: show this help
30 FIN
32 exit(0);
34 # Configurable Variables
35 foreach my $option (qw/head_dir rel_2_2_dir/) {
36 if (not exists $opt{$option}) {
37 die 'option "', $option, '" is mandatory', "\n";
40 if (not -d $opt{$option}) {
41 die '"', $opt{$option}, '" must be an existing directory', "\n";
44 if (not $opt{$option} =~ m{^/}) {
45 die '--', $option, ' must be an absolute path', "\n";
49 ## Modules
50 system(
51 'cp',
52 $opt{head_dir}.'/C4/Biblio.pm',
53 $opt{rel_2_2_dir}.'/C4/'
55 system(
56 'cp',
57 $opt{head_dir}.'/C4/Context.pm',
58 $opt{rel_2_2_dir}.'/C4/'
60 system(
61 'cp',
62 $opt{head_dir}.'/C4/SearchMarc.pm',
63 $opt{rel_2_2_dir}.'/C4/'
65 system(
66 'cp',
67 $opt{head_dir}.'/C4/Log.pm',
68 $opt{rel_2_2_dir}.'/C4/'
71 system(
72 'cp',
73 $opt{head_dir}.'/C4/Review.pm',
74 $opt{rel_2_2_dir}.'/C4/'
76 system(
77 'cp',
78 $opt{head_dir}.'/misc/plugin/Search.pm',
79 $opt{rel_2_2_dir}.'/C4/'
82 ## Intranet
83 system(
84 'cp',
85 $opt{head_dir}.'/cataloguing/addbiblio.pl',
86 $opt{rel_2_2_dir}.'/acqui.simple/addbiblio.pl'
88 system(
89 'cp',
90 $opt{head_dir}.'/cataloguing/additem.pl',
91 $opt{rel_2_2_dir}.'/acqui.simple/'
93 system(
94 'cp',
95 $opt{head_dir}.'/catalogue/detail.pl',
96 $opt{rel_2_2_dir}.'/'
98 system(
99 'cp',
100 $opt{head_dir}.'/catalogue/MARCdetail.pl',
101 $opt{rel_2_2_dir}.'/'
103 system(
104 'cp',
105 $opt{head_dir}.'/catalogue/ISBDdetail.pl',
106 $opt{rel_2_2_dir}.'/'
109 # OPAC
110 system(
111 'cp',
112 $opt{head_dir}.'/opac/opac-detail.pl',
113 $opt{rel_2_2_dir}.'/opac/'
115 system(
116 'cp',
117 $opt{head_dir}.'/opac/opac-MARCdetail.pl',
118 $opt{rel_2_2_dir}.'/opac/'
120 system(
121 'cp',
122 $opt{head_dir}.'/opac/opac-ISBDdetail.pl',
123 $opt{rel_2_2_dir}.'/opac/'
126 ## Add the symlink necessary due to changes in the dir structure
127 system(
128 'ln',
129 '-s',
130 $opt{rel_2_2_dir}.'/koha-tmpl/intranet-tmpl/npl/en/acqui.simple',
131 $opt{rel_2_2_dir}.'/koha-tmpl/intranet-tmpl/npl/en/cataloguing'
134 ## Add the 'record.abs' symlink
135 system(
136 'ln',
137 '-s',
138 $opt{head_dir}.'/misc/zebra/usmarc/collection.abs',
139 $opt{head_dir}.'/misc/zebra/usmarc/record.abs'
142 ## Create symlink from intranet/zebra to head zebra directory
143 system(
144 'ln',
145 '-s',
146 $opt{head_dir}.'/misc/zebra/usmarc',
147 C4::Context->config("intranetdir").'/zebra'
150 print "Finished\n\nRemember, you still need to:
152 1. Edit moredetail.tmpl and detail.tmpl to allow for deletions
154 2. add <option value=''>Relevance</option> to the search
155 pages to sort by relevance by default
157 \n";