minor adjustment to one of the symlinks
[koha.git] / misc / sync_koha_plugin.pl
1 #!/usr/bin/perl -w
2
3 use strict;
4 use Getopt::Long;
5
6 my %opt = ();
7 GetOptions(
8     \%opt,
9     qw/head_dir=s rel_2_2_dir=s help/
10 ) or die "\nHouston, we got a problem\n";
11
12 if (exists $opt{help}) {
13     print <<FIN;
14 Sync the Koha plugin with the appropriate files from HEAD. Assumes
15 that you've set up your Koha install to use CVS symlinked to the
16 normal locations.
17
18 Usage: sync_koha_plugin.pl --head_dir=<cvs head directory>
19                            --rel_2_2_dir=<cvs rel_2_2 directory>
20                         [--help]
21
22 --head_dir: is the directory where your Koha HEAD cvs is checked out.
23
24 --rel_2_2_dir: is the directory where your Koha rel_2_2 cvs is checked
25 out and symlinked to your Koha install directories.
26
27 --help: show this help
28
29 FIN
30
31       exit(0);
32 }
33 # Configurable Variables
34 foreach my $option (qw/head_dir rel_2_2_dir/) {
35   if (not exists $opt{$option}) {
36     die 'option "', $option, '" is mandatory', "\n";
37   }
38
39   if (not -d $opt{$option}) {
40     die '"', $opt{$option}, '" must be an existing directory', "\n";
41   }
42
43   if (not $opt{$option} =~ m{^/}) {
44     die '--', $option, ' must be an absolute path', "\n";
45   }
46 }
47
48 ## Modules
49 system(
50     'cp',
51     $opt{head_dir}.'/C4/Biblio.pm',
52     $opt{rel_2_2_dir}.'/C4/'
53 );
54 system(
55     'cp',
56     $opt{head_dir}.'/C4/Context.pm',
57     $opt{rel_2_2_dir}.'/C4/'
58 );
59 system(
60     'cp',
61     $opt{head_dir}.'/C4/SearchMarc.pm',
62     $opt{rel_2_2_dir}.'/C4/'
63 );
64 system(
65     'cp',
66     $opt{head_dir}.'/C4/Amazon.pm',
67     $opt{rel_2_2_dir}.'/C4/'
68 );
69 system(
70     'cp',
71     $opt{head_dir}.'/C4/Review.pm',
72     $opt{rel_2_2_dir}.'/C4/'
73 );
74 system(
75     'cp',
76     $opt{head_dir}.'/C4/Search.pm',
77     $opt{rel_2_2_dir}.'/C4/'
78 );
79
80 ## Intranet
81 system(
82     'cp',
83     $opt{head_dir}.'/cataloguing/addbiblio.pl',
84     $opt{rel_2_2_dir}.'/acqui.simple/addbiblio.pl'
85 );
86 system(
87     'cp',
88     $opt{head_dir}.'/cataloguing/additem.pl',
89     $opt{rel_2_2_dir}.'/acqui.simple/'
90 );
91 system(
92     'cp',
93     $opt{head_dir}.'/catalogue/detail.pl',
94     $opt{rel_2_2_dir}.'/'
95 );
96 system(
97     'cp',
98     $opt{head_dir}.'/catalogue/MARCdetail.pl',
99     $opt{rel_2_2_dir}.'/'
100 );
101 system(
102     'cp',
103     $opt{head_dir}.'/catalogue/ISBDdetail.pl',
104     $opt{rel_2_2_dir}.'/'
105 );
106
107 # OPAC
108 system(
109     'cp',
110     $opt{head_dir}.'/opac/opac-detail.pl',
111     $opt{rel_2_2_dir}.'/opac/'
112 );
113 system(
114     'cp',
115     $opt{head_dir}.'/opac/opac-MARCdetail.pl',
116     $opt{rel_2_2_dir}.'/opac/'
117 );
118 system(
119     'cp',
120     $opt{head_dir}.'/opac/opac-ISBDdetail.pl',
121     $opt{rel_2_2_dir}.'/opac/'
122 );
123
124 ## Add the symlink necessary due to changes in the dir structure
125 system(
126     'ln',
127     '-s',
128     $opt{rel_2_2_dir}.'/koha-tmpl/intranet-tmpl/npl/en/acqui.simple',
129     $opt{rel_2_2_dir}.'/koha-tmpl/intranet-tmpl/npl/en/cataloguing'
130 );
131
132 print "Finished\n\nRemember, you still need to:
133
134 1. Edit moredetail.tmpl and detail.tmpl to allow for deletions
135 2. symlink your Koha directory's intranet/zebra dir to the zebra dir
136    where the pqf file is
137 3. add  <option value="biblio.title">Title</option> to the detail.tmpl
138    pages to sort by relevance by default
139
140 \n";
141