View | Details | Raw Unified | Return to bug 40901
Collapse All | Expand All

(-)a/debian/control.in (-24 / +16 lines)
Lines 16-41 Build-Depends:__AUTODEPENDS__, Link Here
16
16
17
Package: koha-common
17
Package: koha-common
18
Architecture: all
18
Architecture: all
19
Depends: ${misc:Depends}, ${koha:Depends},
19
Depends: ${misc:Depends},
20
 koha-core,
21
 koha-systemd | koha-sysv,
20
 apache2,
22
 apache2,
21
 apache2-mpm-itk | libapache2-mpm-itk,
23
 apache2-mpm-itk | libapache2-mpm-itk,
22
 at,
23
 cron-daemon,
24
 daemon,
25
 debconf,
26
 idzebra-2.0,
24
 idzebra-2.0,
27
 koha-l10n,
28
 memcached,
25
 memcached,
29
 mysql-client | virtual-mysql-client,
26
 rabbitmq-server
30
 perl-doc,
31
 pwgen,
32
 rabbitmq-server,
33
 sudo,
34
 fonts-dejavu | ttf-dejavu,
35
 unzip,
36
 weasyprint,
37
 xmlstarlet,
38
 yaz
39
Suggests: mysql-server | virtual-mysql-server,
27
Suggests: mysql-server | virtual-mysql-server,
40
 letsencrypt,
28
 letsencrypt,
41
Homepage: http://koha-community.org/
29
Homepage: http://koha-community.org/
Lines 43-50 Description: integrated (physical) library management system Link Here
43
 Koha is an Integrated Library Management system for real-world libraries
31
 Koha is an Integrated Library Management system for real-world libraries
44
 (the kinds with books).
32
 (the kinds with books).
45
 .
33
 .
46
 This package contains everything needed to run Koha, except the site
34
 This metapackage installs the complete Koha system with all dependencies.
47
 specific configuration files. See the package koha for the rest.
35
 On systemd-based systems, it will use native systemd units (koha-systemd).
36
 On other systems or containers, it will use SysV init scripts (koha-sysv).
48
37
49
Package: koha
38
Package: koha
50
Architecture: all
39
Architecture: all
Lines 108-121 Description: integrated (physical) library management system Link Here
108
 Koha is an Integrated Library Management system for real-world libraries
97
 Koha is an Integrated Library Management system for real-world libraries
109
 (the kinds with books).
98
 (the kinds with books).
110
 .
99
 .
111
 This package provides a version of Koha identical to that of koha-full,
100
 This package provides the core Koha application files, scripts, and
112
 but without third-party systems such as MariaDB, RabbitMQ, et cetera.
101
 configuration without any init system. It requires either koha-sysv or
102
 koha-systemd to manage services.
113
 .
103
 .
114
 This package is EXPERIMENTAL and not recommended for production use.
104
 Most users should install koha-common instead, which will automatically
105
 select the appropriate init system.
115
Depends: ${misc:Depends}, ${koha:Depends},
106
Depends: ${misc:Depends}, ${koha:Depends},
116
 at,
107
 at,
117
 cron-daemon,
108
 cron-daemon,
118
 daemon,
119
 debconf,
109
 debconf,
120
 koha-l10n,
110
 koha-l10n,
121
 mysql-client | virtual-mysql-client,
111
 mysql-client | virtual-mysql-client,
Lines 150-156 Description: integrated (physical) library management system Link Here
150
140
151
Package: koha-systemd
141
Package: koha-systemd
152
Architecture: all
142
Architecture: all
153
Depends: ${misc:Depends}, systemd, koha-common
143
Depends: ${misc:Depends}, systemd, koha-core
144
Provides: koha-init
145
Conflicts: koha-sysv
154
Description: systemd units for Koha ILS
146
Description: systemd units for Koha ILS
155
 Koha is an Integrated Library Management system for real-world libraries
147
 Koha is an Integrated Library Management system for real-world libraries
156
 (the kinds with books).
148
 (the kinds with books).
Lines 165-171 Description: systemd units for Koha ILS Link Here
165
157
166
Package: koha-sysv
158
Package: koha-sysv
167
Architecture: all
159
Architecture: all
168
Depends: ${misc:Depends}, daemon, koha-common
160
Depends: ${misc:Depends}, daemon, koha-core
169
Provides: koha-init
161
Provides: koha-init
170
Conflicts: koha-systemd
162
Conflicts: koha-systemd
171
Description: SysV init scripts for Koha ILS
163
Description: SysV init scripts for Koha ILS
(-)a/debian/koha-common.install (-40 lines)
Lines 1-40 Link Here
1
debian/tmp/usr/*                            usr
2
debian/tmp/etc/koha/zebradb/[!z]*
3
debian/tmp/etc/koha/z3950
4
debian/templates/* etc/koha
5
debian/koha-post-install-setup              usr/sbin
6
debian/unavailable.html                     usr/share/koha/intranet/htdocs
7
debian/unavailable.html                     usr/share/koha/opac/htdocs
8
debian/templates/*                          etc/koha
9
debian/scripts/koha-functions.sh            usr/share/koha/bin
10
debian/scripts/koha-create                  usr/sbin
11
debian/scripts/koha-create-dirs             usr/sbin
12
debian/scripts/koha-disable                 usr/sbin
13
debian/scripts/koha-dump                    usr/sbin
14
debian/scripts/koha-dump-defaults           usr/sbin
15
debian/scripts/koha-elasticsearch           usr/sbin
16
debian/scripts/koha-email-disable           usr/sbin
17
debian/scripts/koha-email-enable            usr/sbin
18
debian/scripts/koha-enable                  usr/sbin
19
debian/scripts/koha-es-indexer              usr/sbin
20
debian/scripts/koha-foreach                 usr/sbin
21
debian/scripts/koha-indexer                 usr/sbin
22
debian/scripts/koha-list                    usr/sbin
23
debian/scripts/koha-mysql                   usr/sbin
24
debian/scripts/koha-passwd                  usr/sbin
25
debian/scripts/koha-plack                   usr/sbin
26
debian/scripts/koha-rebuild-zebra           usr/sbin
27
debian/scripts/koha-remove                  usr/sbin
28
debian/scripts/koha-reset-passwd            usr/sbin
29
debian/scripts/koha-restore                 usr/sbin
30
debian/scripts/koha-run-backups             usr/sbin
31
debian/scripts/koha-shell                   usr/sbin
32
debian/scripts/koha-sip                     usr/sbin
33
debian/scripts/koha-sitemap                 usr/sbin
34
debian/scripts/koha-translate               usr/sbin
35
debian/scripts/koha-upgrade-schema          usr/sbin
36
debian/scripts/koha-upgrade-to-3.4          usr/sbin
37
debian/scripts/koha-worker                  usr/sbin
38
debian/scripts/koha-z3950-responder         usr/sbin
39
debian/scripts/koha-zebra                   usr/sbin
40
debian/tmp_docbook/*.8                      usr/share/man/man8
(-)a/debian/koha-common.postinst (-296 lines)
Lines 2-302 Link Here
2
2
3
set -e
3
set -e
4
4
5
# Default to "yes"
6
AUTOMATIC_TRANSLATIONS_UPDATE="yes"
7
8
. /usr/share/debconf/confmodule
9
10
# Read configuration variable file if it is present
11
CONFIG=/etc/koha/koha-common.conf
12
if [ -r $CONFIG ]; then
13
    . $CONFIG
14
fi
15
16
conf=/etc/mysql/koha-common.cnf
17
if [ ! -e "$conf" ] && [ ! -L "$conf" ]; then
18
    ln -s debian.cnf "$conf"
19
fi
20
21
#DEBHELPER#
5
#DEBHELPER#
22
6
23
koha-upgrade-schema $(koha-list)
24
25
# Generate a config file if one doesn't exist already
26
if [ ! -e $CONFIG ]; then
27
    cat <<EOF >$CONFIG
28
## Automatic template translation update
29
#
30
# This variable controls whether template translations should
31
# be updated automatically on koha-common package upgrades.
32
# Options: 'yes' (default)
33
#          'no'
34
# Note: if you choose 'no' then you will have to issue
35
#  $ koha-translate --update <lang_code>
36
#
37
AUTOMATIC_TRANSLATIONS_UPDATE="yes"
38
EOF
39
fi
40
41
# Substitute the values from debconf into the file.
42
db_get koha-common/automatically-update-translations
43
UPDATE="$RET"
44
if [ "$UPDATE" = "false" ]; then
45
    UPDATE="no"
46
else
47
    UPDATE="yes"
48
fi
49
# In case they were removed/commented out, we add it in.
50
grep -Eq '^ *AUTOMATIC_TRANSLATIONS_UPDATE=' $CONFIG ||
51
    echo "AUTOMATIC_TRANSLATIONS_UPDATE=" >>$CONFIG
52
53
sed -e "s/^ *AUTOMATIC_TRANSLATIONS_UPDATE=.*/AUTOMATIC_TRANSLATIONS_UPDATE=\"$UPDATE\"/" <$CONFIG >$CONFIG.tmp
54
mv -f $CONFIG.tmp $CONFIG
55
56
if [ "$AUTOMATIC_TRANSLATIONS_UPDATE" = "yes" ]; then
57
    for lang in $(koha-translate --list | grep -v -x "en"); do
58
        if koha-translate --update $lang; then
59
            echo "Updated the $lang translations."
60
        else
61
            cat <<EOF >&2
62
ERROR: an error was found when updating '$lang' translations. Please manually
63
run 'koha-translate --update $lang'. Run man koha-translate for more options.
64
EOF
65
        fi
66
    done
67
else
68
    # no auto-update, check update needed and warn if needed
69
    if koha-translate --list | grep -v -q -x "en"; then
70
        # translations installed, update needed
71
        cat <<EOF >&2
72
Warning: template translations are not set to be automatically updated.
73
Please manually run 'koha-translate --update lang_code' to update them.
74
75
You can run 'koha-translate --list' to get a list of the installed translations codes.
76
EOF
77
    fi
78
fi
79
80
# Check if we need to rename the Apache vhost files
81
RENAME_APACHE_FILES="no"
82
for vhost in $(koha-list); do
83
    if [ -f "/etc/apache2/sites-available/$vhost" ] &&
84
        [ ! -f "/etc/apache2/sites-available/$vhost.conf" ]; then
85
        RENAME_APACHE_FILES="yes"
86
        break # at least one, trigger renaming
87
    fi
88
done
89
90
if [ "$RENAME_APACHE_FILES" = "yes" ]; then
91
    # If the user agreed we now rename their Apache files
92
    db_get koha-common/rename-apache-vhost-files
93
    if [ "$RET" = "false" ]; then
94
        # We're not renaming the files, just print a warning
95
        cat <<EOF >&2
96
Warning: you have chosen not to migrate your Apache virtual hosts files to the
97
Apache 2.4 naming schema. You can do it manually by running this for each
98
Koha instance:
99
100
    $ sudo a2dissite instance
101
    $ sudo mv /etc/apache2/sites-available/instance \
102
              /etc/apache2/sites-available/instance.conf
103
    $ sudo a2ensite instance
104
EOF
105
    else
106
        # We have to rename the Apache files
107
        for site in $(koha-list); do
108
            ENABLE_VHOST="yes"
109
            if [ -f "/etc/apache2/sites-available/$site" ] &&
110
                [ ! -f "/etc/apache2/sites-available/$site.conf" ]; then
111
                if [ ! -f "/etc/apache2/sites-enabled/$site" ]; then
112
                    ENABLE_VHOST="no"
113
                fi
114
                a2dissite $site >/dev/null 2>&1 || true
115
                rm -f "/etc/apache2/sites-enabled/$site"
116
                # Rename the vhost definition files
117
                mv "/etc/apache2/sites-available/$site" \
118
                    "/etc/apache2/sites-available/$site.conf"
119
120
                if [ "$ENABLE_VHOST" = "yes" ]; then
121
                    if ! {
122
                        a2ensite "$site" >/dev/null 2>&1 ||
123
                            a2ensite "${site}.conf" >/dev/null 2>&1
124
                    }; then
125
                        echo "Warning: problem enabling $site in Apache" >&2
126
                    fi
127
                fi
128
            fi
129
        done
130
    fi
131
fi
132
133
log4perl_component() {
134
    local config=$1
135
    local component=$2
136
137
    if grep -q "log4perl.logger.$component" $config; then
138
        return 0
139
    else
140
        return 1
141
    fi
142
}
143
144
# Take care of the instance's log4perl.conf file
145
for site in $(koha-list); do
146
    log4perl_config="/etc/koha/sites/$site/log4perl.conf"
147
    if ! log4perl_component $log4perl_config "z3950"; then
148
        cat <<EOF >>$log4perl_config
149
log4perl.logger.z3950 = WARN, Z3950
150
log4perl.appender.Z3950=Log::Log4perl::Appender::File
151
log4perl.appender.Z3950.filename=/var/log/koha/$site/z3950-error.log
152
log4perl.appender.Z3950.mode=append
153
log4perl.appender.Z3950.layout=PatternLayout
154
log4perl.appender.Z3950.layout.ConversionPattern=[%d] [%p] %m %l%n
155
log4perl.appender.Z3950.utf8=1
156
157
EOF
158
    fi
159
160
    if ! log4perl_component $log4perl_config "api"; then
161
        cat <<EOF >>$log4perl_config
162
log4perl.logger.api = WARN, API
163
log4perl.appender.API=Log::Log4perl::Appender::File
164
log4perl.appender.API.filename=/var/log/koha/$site/api-error.log
165
log4perl.appender.API.mode=append
166
log4perl.appender.API.layout=PatternLayout
167
log4perl.appender.API.layout.ConversionPattern=[%d] [%p] %m %l%n
168
log4perl.appender.API.utf8=1
169
170
EOF
171
    fi
172
done
173
174
for site in $(koha-list); do
175
    log4perl_config="/etc/koha/sites/$site/log4perl.conf"
176
    if ! log4perl_component $log4perl_config "sip"; then
177
        cat <<EOF >>$log4perl_config
178
log4perl.logger.sip = DEBUG, SIP
179
log4perl.appender.SIP=Log::Log4perl::Appender::File
180
log4perl.appender.SIP.filename=/var/log/koha/$site/sip-output.log
181
log4perl.appender.SIP.mode=append
182
log4perl.appender.SIP.layout=PatternLayout
183
log4perl.appender.SIP.layout.ConversionPattern=[%d] [%P] [%p] %X{accountid}@%X{peeraddr}: %m %l%n
184
log4perl.appender.SIP.utf8=1
185
186
EOF
187
    fi
188
done
189
190
for site in $(koha-list); do
191
    log4perl_config="/etc/koha/sites/$site/log4perl.conf"
192
    if ! log4perl_component $log4perl_config "plack-opac"; then
193
        cat <<EOF >>$log4perl_config
194
log4perl.logger.plack-opac = WARN, PLACKOPAC
195
log4perl.appender.PLACKOPAC=Log::Log4perl::Appender::File
196
log4perl.appender.PLACKOPAC.filename=/var/log/koha/$site/plack-opac-error.log
197
log4perl.appender.PLACKOPAC.mode=append
198
log4perl.appender.PLACKOPAC.layout=PatternLayout
199
log4perl.appender.PLACKOPAC.layout.ConversionPattern=[%d] [%p] %m%n
200
log4perl.appender.PLACKOPAC.utf8=1
201
202
EOF
203
    fi
204
done
205
206
for site in $(koha-list); do
207
    log4perl_config="/etc/koha/sites/$site/log4perl.conf"
208
    if ! log4perl_component $log4perl_config "plack-api"; then
209
        cat <<EOF >>$log4perl_config
210
log4perl.logger.plack-api = WARN, PLACKAPI
211
log4perl.appender.PLACKAPI=Log::Log4perl::Appender::File
212
log4perl.appender.PLACKAPI.filename=/var/log/koha/$site/plack-api-error.log
213
log4perl.appender.PLACKAPI.mode=append
214
log4perl.appender.PLACKAPI.layout=PatternLayout
215
log4perl.appender.PLACKAPI.layout.ConversionPattern=[%d] [%p] %m%n
216
log4perl.appender.PLACKAPI.utf8=1
217
218
EOF
219
    fi
220
done
221
222
for site in $(koha-list); do
223
    log4perl_config="/etc/koha/sites/$site/log4perl.conf"
224
    if ! log4perl_component $log4perl_config "plack-intranet"; then
225
        cat <<EOF >>$log4perl_config
226
log4perl.logger.plack-intranet = WARN, PLACKINTRANET
227
log4perl.appender.PLACKINTRANET=Log::Log4perl::Appender::File
228
log4perl.appender.PLACKINTRANET.filename=/var/log/koha/$site/plack-intranet-error.log
229
log4perl.appender.PLACKINTRANET.mode=append
230
log4perl.appender.PLACKINTRANET.layout=PatternLayout
231
log4perl.appender.PLACKINTRANET.layout.ConversionPattern=[%d] [%p] %m%n
232
log4perl.appender.PLACKINTRANET.utf8=1
233
234
EOF
235
    fi
236
done
237
238
for site in $(koha-list); do
239
    log4perl_config="/etc/koha/sites/$site/log4perl.conf"
240
    if ! log4perl_component $log4perl_config "worker"; then
241
        cat <<EOF >>$log4perl_config
242
log4perl.logger.worker = WARN, WORKER
243
log4perl.appender.WORKER=Log::Log4perl::Appender::Screen
244
log4perl.appender.WORKER.stderr=1
245
log4perl.appender.WORKER.layout=PatternLayout
246
log4perl.appender.WORKER.layout.ConversionPattern=[%d] [%p] %m %l%n
247
log4perl.appender.WORKER.utf8=1
248
249
EOF
250
    fi
251
done
252
253
for site in $(koha-list); do
254
    log4perl_config="/etc/koha/sites/$site/log4perl.conf"
255
    if ! log4perl_component $log4perl_config "edi"; then
256
        cat <<EOF >>$log4perl_config
257
log4perl.logger.edi = TRACE, EDI
258
log4perl.appender.EDI=Log::Log4perl::Appender::File
259
log4perl.appender.EDI.filename=/var/log/koha/$site/editrace.log
260
log4perl.appender.EDI.mode=append
261
log4perl.appender.EDI.layout=PatternLayout
262
log4perl.appender.EDI.layout.ConversionPattern=[%d] [%P] [%p] %X{accountid}@%X{peeraddr}: %m %l%n
263
log4perl.appender.EDI.utf8=1
264
265
EOF
266
    fi
267
done
268
269
for site in $(koha-list); do
270
    kohaconfig="/etc/koha/sites/$site/koha-conf.xml"
271
    logdir="$(xmlstarlet sel -t -v 'yazgfs/config/logdir' $kohaconfig)"
272
    if [ "$logdir" != "" ] && [ "$logdir" != "0" ]; then
273
        chown -R $site-koha:$site-koha $logdir
274
    else
275
        chown -R $site-koha:$site-koha /var/log/koha/$site
276
    fi
277
done
278
279
# Bug 14106 - fix the modulePath of existing koha instances so that it'll
280
# continue to work. This will only patch the files if the exact original string
281
# that we're fixing them from is there, so we just run it every time. Maybe
282
# in many years time we can get rid of this, when no one will be running
283
# Koha < 3.20.
284
for zfile in $(find /etc/koha/sites -name zebra-authorities-dom.cfg -or -name zebra-biblios-dom.cfg); do
285
    perl -p -i -e 's{^modulePath: /usr/lib/idzebra-2.0/modules$}{modulePath: /usr/lib/idzebra-2.0/modules:/usr/lib/x86_64-linux-gnu/idzebra-2.0/modules:/usr/lib/i386-linux-gnu/idzebra-2.0/modules:/usr/lib/aarch64-linux-gnu/idzebra-2.0/modules:/usr/lib/arm-linux-gnueabi/idzebra-2.0/modules:/usr/lib/arm-linux-gnueabihf/idzebra-2.0/modules:/usr/lib/mips-linux-gnu/idzebra-2.0/modules:/usr/lib/mipsel-linux-gnu/idzebra-2.0/modules:/usr/lib/powerpc-linux-gnu/idzebra-2.0/modules:/usr/lib/powerpc64le-linux-gnu/idzebra-2.0/modules:/usr/lib/s390x-linux-gnu/idzebra-2.0/modules}' $zfile
286
done
287
288
db_stop
289
290
rabbitmq-plugins enable rabbitmq_stomp
291
service rabbitmq-server restart
292
293
# Bug 35242: Force memcache restart after koha install/upgrade
294
service memcached restart
295
296
# Bug 18250: Correct startup order of koha-common and memcached
297
# Since the init script has been updated, we can force the order in rc.d
298
# by disabling and enabling again.
299
update-rc.d koha-common disable
300
update-rc.d koha-common enable
301
302
exit 0
7
exit 0
303
- 

Return to bug 40901