From 2fcc4fe94e87f08baf6bad8b4578895f29fb5a99 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 28 May 2010 16:29:48 +1200 Subject: [PATCH] Add tools to update debian/control's build dependencies. The canonical list of Perl module dependencies are in C4::Installer::PerlDependencies::PERL_DEPS now. Add a script (debian/list-deps) to turn that into a list of Debian package names. Because that is a slow process, and the output rarely changes, do not do that at build time. Also, doing it at build time would require modifying debian/control in evil ways. Instead, add another tool, debian/update-control, which reads the new file debian/control.in, and adds the output of debian/list-deps to Build-Depends and creates a new debian/control. debian/control.in is the master file. If changes are needed, that should be edited. For performance and convenience reasons, the output is also kept in git, but don't edit debian/control directly, please. Such changes might get lost by the next commit by someone else. Whenever PERL_DEPS changes, debian/update-control should be run as well and the result committed to git. This is not quite as automatic as it might be, but should be good enough. It avoids keeping the list of Perl modules in two places. Note that since it seems impossible to automatically figure out the Debian package version that corresponds to a Perl module version, I have not tried to do that at all. Signed-off-by: Galen Charlton --- C4/Installer/PerlDependencies.pm | 7 ++ debian/control | 128 +++++++++++++++++-------------- debian/control.in | 50 ++++++++++++ debian/list-deps | 49 ++++++++++++ debian/update-control | 11 +++ 5 files changed, 187 insertions(+), 58 deletions(-) create mode 100644 debian/control.in create mode 100755 debian/list-deps create mode 100755 debian/update-control diff --git a/C4/Installer/PerlDependencies.pm b/C4/Installer/PerlDependencies.pm index 8e269c65f1..b77ef8ba2b 100644 --- a/C4/Installer/PerlDependencies.pm +++ b/C4/Installer/PerlDependencies.pm @@ -468,6 +468,13 @@ A module for cataloging Koha Perl dependencies. This module's sole purpose for existence is to provide a single location to catalog all Koha Perl dependencies. New dependencies should be added to the end of the outer hash and follow the key/value pattern used in the other dependencies. +=head2 Debian + +If you change the list of dependencies, and you use Debian, please also +run the debian/update-control script and commit the modifed version of +debian/control into git as well. If you're not running Debian, don't +worry about it. + =head1 AUTHOR Chris Nighswonger diff --git a/debian/control b/debian/control index 779e90e724..8c0aa4ff48 100644 --- a/debian/control +++ b/debian/control @@ -6,64 +6,76 @@ Standards-Version: 3.8.4 # NOTA BENE: Build dependencies end up as runtime dependencies as well. # See debian/rules, the override_dh_gencontrol rules. # There are some exceptions. -Build-Depends: debhelper (>= 7.0.50), gettext, - perl, - libalgorithm-checkdigits-perl, - libauthen-cas-client-perl, - libbiblio-endnotestyle-perl, - libcgi-session-perl, - libcgi-session-serialize-yaml-perl, - libclass-accessor-perl, - libclass-factory-util-perl, - libdbd-sqlite2-perl, - libdbd-mysql-perl, - libdbi-perl, - libdata-ical-perl, - libdate-calc-perl, - libdate-ical-perl, - libdate-manip-perl, - libemail-date-perl, - libgd-gd2-perl, - libgraphics-magick-perl, - libhtml-scrubber-perl, - libhtml-template-pro-perl, - libjson-perl, - liblingua-stem-perl, - liblingua-stem-snowball-perl, - liblist-moreutils-perl, - liblocale-po-perl, - libmarc-charset-perl, - libmarc-crosswalk-dublincore-perl, - libmarc-record-perl, - libmarc-xml-perl, - libmime-lite-perl, - libmail-sendmail-perl, - libnet-ldap-perl, - libnet-z3950-zoom-perl, - libnumber-format-perl, - libpdf-api2-perl, - libpdf-reuse-perl, - libpdf-reuse-barcode-perl, - libpdf-table-perl, - libpoe-perl, - libsms-send-perl, - libschedule-at-perl, - libstorable-perl, - libtext-csv-perl, - libxml-dumper-perl, - libxml-libxml-perl, - libxml-libxslt-perl, - libxml-rss-perl, - libxml-sax-writer-perl, - libxml-simple-perl, - libyaml-syck-perl, - libyaml-perl, - libmodule-install-perl, - libhttp-oai-perl, - libtext-csv-encoded-perl, - libpdf-api2-simple-perl, - libmemoize-memcached-perl, - liblocale-currency-format-perl +Build-Depends: libalgorithm-checkdigits-perl, + libauthen-cas-client-perl, + libbiblio-endnotestyle-perl, + libcgi-pm-perl | perl-modules, + libcgi-session-perl, + libcgi-session-serialize-yaml-perl, + libclass-accessor-perl, + libclass-factory-util-perl, + libdata-ical-perl, + libdate-calc-perl, + libdate-ical-perl, + libdate-manip-perl, + libdatetime-perl, + libdbd-mysql-perl, + libdbd-sqlite2-perl, + libdbi-perl, + libdigest-sha-perl | perl, + libemail-date-perl, + libfile-temp-perl | perl-modules, + libgd-barcode-perl, + libgd-gd2-noxpm-perl | libgd-gd2-perl, + libgraphics-magick-perl, + libhtml-scrubber-perl, + libhtml-template-pro-perl, + libhttp-oai-perl, + libjson-perl, + liblingua-stem-perl, + liblingua-stem-snowball-perl, + liblist-moreutils-perl, + liblocale-currency-format-perl, + liblocale-po-perl, + libmail-sendmail-perl, + libmarc-charset-perl, + libmarc-crosswalk-dublincore-perl, + libmarc-record-perl, + libmarc-xml-perl, + libmemoize-memcached-perl, + libmime-lite-perl, + libnet-ldap-perl, + libnet-z3950-zoom-perl, + libnumber-format-perl, + libpdf-api2-perl, + libpdf-api2-simple-perl, + libpdf-reuse-barcode-perl, + libpdf-reuse-perl, + libpdf-table-perl, + libpoe-perl, + libscalar-list-utils-perl | perl-base, + libschedule-at-perl, + libsms-send-perl, + libtest-harness-perl | perl-modules, + libtest-simple-perl | perl-modules, + libtext-csv-encoded-perl, + libtext-csv-perl, + libtext-csv-xs-perl, + libtext-iconv-perl, + liburi-perl, + libwww-perl, + libxml-dumper-perl, + libxml-libxml-perl, + libxml-libxslt-perl, + libxml-rss-perl, + libxml-sax-perl, + libxml-sax-writer-perl, + libxml-simple-perl, + libyaml-syck-perl, + perl, + perl-base, + perl-modules, + debhelper (>= 7.0.50), gettext Package: koha-common Architecture: all diff --git a/debian/control.in b/debian/control.in new file mode 100644 index 0000000000..2bed47b7e2 --- /dev/null +++ b/debian/control.in @@ -0,0 +1,50 @@ +Source: koha +Maintainer: Lars Wirzenius +Section: web +Priority: optional +Standards-Version: 3.8.4 +# NOTA BENE: Build dependencies end up as runtime dependencies as well. +# See debian/rules, the override_dh_gencontrol rules. +# There are some exceptions. +Build-Depends:__AUTODEPENDS__, + debhelper (>= 7.0.50), gettext + +Package: koha-common +Architecture: all +Depends: ${shlib:Depends}, ${misc:Depends}, ${koha:Depends}, + apache2, + apache2-mpm-itk, + at, + daemon, + idzebra-2.0, + libjs-jquery, + libjs-yui, + mysql-client, + tinymce2, + yaz +Suggests: mysql-server +Homepage: http://koha-community.org/ +Description: integrated (physical) library management system + Koha is an Integrated Library Managment system for real-world libraries + (the kinds with books). + . + This package contains everything needed to run Koha, except the site + specific configuration files. See the package koha for the rest. + +Package: koha +Architecture: all +Depends: ${shlib:Depends}, ${misc:Depends}, + koha-common, + dbconfig-common, + mysql-server +Homepage: http://koha-community.org/ +Description: integrated (physical) library management system + Koha is an Integrated Library Managment system for real-world libraries + (the kinds with books). + . + This package contains site-specific configuration files and sets up + the MySQL database for Koha. For simplicity, the database server is + assumed to run on the same host as Koha. + . + Please see /usr/share/doc/koha/README.Debian for instructions on how to + configure things after installing this package. diff --git a/debian/list-deps b/debian/list-deps new file mode 100755 index 0000000000..e30c54aeb5 --- /dev/null +++ b/debian/list-deps @@ -0,0 +1,49 @@ +#!/usr/bin/perl +# +# Write dependency list from Koha PerlDependencies.pm, in Debian format. +# +# Copyright 2010 Catalyst IT, Ltd +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# 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 . + + +use strict; +use warnings; + +use C4::Installer::PerlDependencies; + +my $deps = $C4::Installer::PerlDependencies::PERL_DEPS; + +my $prefix = "^/usr/((lib|share)/perl5|(lib|share)/perl/[0-9.]+)"; + +foreach my $module (keys %$deps) { + my $ver = $deps->{$module}->{'min_ver'}; + my $subpath = $module; + $subpath =~ s,::,/,g; + my $output = + qx(apt-file -l -x search "$prefix/$subpath.pm\$"); + my @lines = split(/\n/, $output); + if (scalar(@lines) == 1 && $lines[0] ne "") { + my $pkg = $lines[0]; + print "$pkg\n"; + } elsif (scalar(@lines) > 1) { + foreach my $pkg (@lines) { + print " | " if ($pkg ne $lines[0]); + print "$pkg"; + } + print "\n"; + } else { + print "EEEK: unknown package for $module\n"; + } +} diff --git a/debian/update-control b/debian/update-control new file mode 100755 index 0000000000..2f568b7e54 --- /dev/null +++ b/debian/update-control @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +deps="$(debian/list-deps | + sort -u | + sed 's/.*/ &,\\n/' | + tr -d '\n' | + sed 's/,\\n$//')" +sed "s/__AUTODEPENDS__/$deps/" debian/control.in > debian/control + -- 2.39.2