Changeset 29611 for main


Ignore:
Timestamp:
2014-12-12T17:11:12+13:00 (9 years ago)
Author:
Jeremy Symon
Message:

Changes to get RPM working. May have broken Pacman and APT, since I had to change the way it is done.

Location:
main/trunk/package-kits/linux
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/package-kits/linux/global.conf

    r29595 r29611  
    11MAINTAINER_NAME:        Greenstone Team
    22MAINTAINER_EMAIL:       [email protected]
     3
     4GREENSTONE:             greenstone
     5NATIVE:                 native
     6TOOLS:                  tools
     7
    38PKG_GREENSTONE:
    4     greenstone
     9    %GREENSTONE%
    510PKG_GREENSTONE_NATIVE:
    6     greenstone-native
     11    %GREENSTONE%-%NATIVE%
    712PKG_GREENSTONE_TOOLS:
    8     greenstone-tools
     13    %GREENSTONE%-%TOOLS%
    914PKG_GREENSTONE_DEMO:
    10     greenstone-demo
     15    %GREENSTONE%-demo
    1116PKG_GLI:
    12     greenstone-gli
     17    %GREENSTONE%-gli
  • main/trunk/package-kits/linux/packages/greenstone

    r29607 r29611  
    11SVN_LOCATION:           http://svn.greenstone.org/main/trunk/greenstone3
    2 NAME:                   greenstone
     2NAME:                   %PKG_GREENSTONE%
    33VERSION:                3.06
    44RELEASE:                1
     
    66LICENSE_SHORT:          GPL-2
    77LICENSE:               
     8DESCRIPTION_SHORT:      'Greenstone Digital Library'
     9DESCRIPTION:            'Greenstone is a suite of software for building and distributing digital library collections'
     10ARCHITECTURE:           %ARCH_ANY%
    811SOURCES:
    912    build.properties
     
    3639    %PKG_RSYNC%
    3740
     41DEPENDS:
     42    %PKG_GREENSTONE_NATIVE%
     43    %PKG_GREENSTONE_TOOLS%
     44    %PKG_JAVA_JRE%
     45    %PKG_TOMCAT%
     46    %PKG_WGET%
     47
     48OPTDEPENDS:
     49    %PKG_GREENSTONE_DEMO%
     50
     51PROVIDES:
     52
     53POST_INSTALL:
     54    chown -R %TOMCAT_USER%:%TOMCAT_USER% %WEB%
     55
     56POST_REMOVE:
     57    echo "To fully remove greenstone, delete /usr/share/greenstone/web"
     58
     59FILES:
     60    %WEB%
     61    %TOMCATCONF%/*
     62    %TOMCATLIB%/*
     63
    3864SUB_PACKAGES:
    3965    NATIVE
    4066    TOOLS
    41     MAIN
    4267
    43 NATIVE_NAME:                    %PKG_GREENSTONE_NATIVE%
     68NATIVE_NAME:                    %NATIVE%
    4469NATIVE_DESCRIPTION_SHORT:       'Native libraries for Greenstone'
    4570NATIVE_DESCRIPTION:             'Architecture-dependent binary files required by the core Greenstone package'
     
    5681
    5782
    58 TOOLS_NAME:                     %PKG_GREENSTONE_TOOLS%
     83TOOLS_NAME:                     %TOOLS%
    5984TOOLS_DESCRIPTION_SHORT:        'Tools for building Greenstone collections'
    6085TOOLS_DESCRIPTION:              %TOOLS_DESCRIPTION_SHORT%
     
    76101    %GREENSTONE_HOME%/gs2build
    77102    %BUILD_BIN_DIR%
    78 
    79 
    80 MAIN_NAME:                      %PKG_GREENSTONE%
    81 MAIN_DESCRIPTION_SHORT:         'Greenstone Digital Library'
    82 MAIN_DESCRIPTION:               'Greenstone is a suite of software for building and distributing digital library collections'
    83 MAIN_ARCHITECTURE:              %ARCH_ANY%
    84 
    85 MAIN_DEPENDS:
    86     %PKG_GREENSTONE_NATIVE%
    87     %PKG_GREENSTONE_TOOLS%
    88     %PKG_JAVA_JRE%
    89     %PKG_TOMCAT%
    90     %PKG_WGET%
    91 
    92 MAIN_OPTDEPENDS:
    93     %PKG_GREENSTONE_DEMO%
    94 
    95 MAIN_PROVIDES:
    96 
    97 MAIN_FILES:
    98     %WEB%
    99     %TOMCATCONF%/*
    100     %TOMCATLIB%/*
    101 
    102 MAIN_POST_INSTALL:
    103     chown -R %TOMCAT_USER%:%TOMCAT_USER% %WEB%
    104 
    105 MAIN_POST_REMOVE:
    106     echo "To fully remove greenstone, delete /usr/share/greenstone/web"
  • main/trunk/package-kits/linux/perllib/Greenstone/Package/_apt.pm

    r29607 r29611  
    5858}
    5959
     60# Adds a definition for files included in a subpackage
     61sub add_package_files {
     62    my $self = shift;
     63    my $file = "$self->{output}/debian/$self->{config}->{NAME}.install";
     64    print "    - $file\n";
     65    open my $INSTALL, '>', $file;
     66    for my $line (@{$self->{config}->{FILES}}) {
     67        print $INSTALL $line, "\n";
     68    }
     69    close $INSTALL;
     70}
     71
    6072# Handles the apt-specific package generation
    6173sub add_package_impl {
     
    7890    }
    7991    if (defined $packages) {
     92        my @names;
     93        # add main package
     94        push @names, $self->{config}->{NAME};
     95        $self->add_install ($self->{config}->{NAME});
     96        $self->add_package_section ($CONTROL);
     97        $self->add_package_files;
     98
    8099        my $config = $self->{config};
    81         my @names;
     100        # add subpackages
    82101        for my $package (@{$packages}) {
    83102            push @names, $package->{NAME};
     
    86105            $self->add_install ($package->{NAME});
    87106            $self->add_package_section ($CONTROL);
    88             my $install = "$self->{output}/debian/$self->{config}->{NAME}.install";
    89             open my $INSTALL, '>', $install;
    90             for my $line (@{$self->{config}->{FILES}}) {
    91                 print $INSTALL $line, "\n";
    92             }
    93             close $INSTALL;
     107            $self->add_package_files;
    94108        }
    95109        $self->{config} = $config;
  • main/trunk/package-kits/linux/perllib/Greenstone/Package/_pacman.pm

    r29607 r29611  
    7878sub add_package_impl {
    7979    my ($self, $packages) = @_;
     80    $self->{config}->{NAMES} = $self->{config}->{NAME};
    8081    if (defined $packages) {
    81         $self->{config}->{NAME} = '';
    8282        for my $package (@{$packages}) {
    83             $self->{config}->{NAME} .= " $package->{NAME}";
     83            $self->{config}->{NAMES} .= " $package->{NAME}";
    8484        }
    8585    }
     
    8989    for my $line (
    9090        '# Maintainer: %MAINTAINER_NAME% <%MAINTAINER_EMAIL%>',
    91         'pkgname=(%NAME%)',
     91        'pkgname=(%NAMES%)',
    9292        'pkgver=%VERSION%',
    9393        'pkgrel=%RELEASE%',
    9494        'url=%HOMEPAGE%',
    9595        'license=%LICENSE_SHORT%',
    96         'arch=(' . (defined $self->{config}->{ARCH} ? '%ARCH%' : 'any') . ')',
     96        'arch=(%ARCHITECTURE%)',
    9797        'makedepends=(',
    9898        '%MAKEDEPENDS%',
     
    114114    }
    115115    if (defined $packages) {
     116        # main package
     117        $self->write_function ("package_$self->{config}->{NAME}", $PKGBUILD,
     118            $self->add_install,
     119            'DESTDIR=${pkgdir} make install'
     120        );
    116121        my $config = $self->{config};
     122        # subpackages
    117123        for my $package (@{$packages}) {
    118124            $self->{config} = $package;
    119125            $self->write_function ("package_$package->{NAME}", $PKGBUILD,
    120126                'pkgdesc=%DESCRIPTION%',
    121                 'arch=(\'%ARCHITECTURE%\')',
     127                'arch=(%ARCHITECTURE%)',
    122128                'depends=(',
    123129                '%DEPENDS%',
  • main/trunk/package-kits/linux/perllib/Greenstone/Package/_rpm.pm

    r29607 r29611  
    2222sub write_function {
    2323    my ($name, @lines) = @_;
    24     my $ret = "";
     24    my $ret = "\n";
    2525    $ret .= "%" . $name . "\n";
    2626    for my $line (@lines) {
    2727        $ret .= $line . "\n";
    2828    }
    29     $ret .= "\n";
    3029    return $ret;
    3130}
    3231
    3332sub add_install {
    34     my $self = shift;
     33    my ($self, $package) = shift;
     34    my $suffix = (defined $package ? " $package" : "");
    3535    my $ret = '';
    3636    exists $self->{config}->{PRE_INSTALL} and
    37         $ret .= write_function "pre", @{$self->{config}->{PRE_INSTALL}};
     37        $ret .= write_function "pre$suffix", @{$self->{config}->{PRE_INSTALL}};
    3838    exists $self->{config}->{POST_INSTALL} and
    39         $ret .= write_function "post", @{$self->{config}->{POST_INSTALL}};
     39        $ret .= write_function "post$suffix", @{$self->{config}->{POST_INSTALL}};
    4040    exists $self->{config}->{PRE_REMOVE} and
    41         $ret .= write_function "preun", @{$self->{config}->{PRE_INSTALL}};
     41        $ret .= write_function "preun$suffix", @{$self->{config}->{PRE_INSTALL}};
    4242    exists $self->{config}->{POST_REMOVE} and
    43         $ret .= write_function "postun", @{$self->{config}->{POST_INSTALL}};
     43        $ret .= write_function "postun$suffix", @{$self->{config}->{POST_INSTALL}};
    4444    return $ret;
    4545}
     
    5050    print "    - $file\n";
    5151    open my $SPEC, '>', $file;
    52     for my $line (
    53         'Name:          %NAME%',
    54         'Version:       %VERSION%',
    55         'Release:       %RELEASE%',
    56         'License:       %LICENSE_SHORT%',
    57         'URL:           %HOMEPAGE%',
    58         'Source0:       %NAME%',
    59         'AutoReqProv:   no',
    60         'BuildRequires: %MAKEDEPENDS%',
    61         '',
    62         '%prep',
    63         'cp -pr %SOURCE0 .',
    64         '',
    65         '%build',
    66         'cd %NAME%',
    67         'make %{?_smp_mflags}',
    68         '',
    69         '%install',
    70         'cd %NAME%',
    71         '%make_install',
    72         '',
    73         '%changelog',
    74         ''
    75     ) {
    76         my $copy = $line;
    77         $self->subst ($copy);
    78         print $SPEC $copy, "\n";
     52    {
     53        my @optional;
     54        scalar(@{$self->{config}->{DEPENDS}}) gt 0 and
     55            push @optional, 'Requires:  %DEPENDS%';
     56        for my $line (
     57            'Name:          %NAME%',
     58            'Version:       %VERSION%',
     59            'Release:       %RELEASE%',
     60            'License:       %LICENSE_SHORT%',
     61            'URL:           %HOMEPAGE%',
     62            'Source0:       %NAME%',
     63            'AutoReqProv:   no',
     64            'BuildRequires: %MAKEDEPENDS%',
     65            @optional,
     66            'Summary:       %DESCRIPTION_SHORT%',
     67            '',
     68            '%description',
     69            '%DESCRIPTION%',
     70            '',
     71            '%prep',
     72            'cp -pr %SOURCE0 .',
     73            '',
     74            '%build',
     75            'cd %NAME%',
     76            'make %{?_smp_mflags}',
     77            '',
     78            '%install',
     79            'cd %NAME%',
     80            '%make_install',
     81            $self->add_install,
     82            '%files',
     83            '%FILES%',
     84            '',
     85            ''
     86        ) {
     87            my $copy = $line;
     88            $self->subst ($copy);
     89            print $SPEC $copy, "\n";
     90        }
    7991    }
    8092    if (defined $packages) {
     
    8294        for my $package (@{$packages}) {
    8395            $self->{config} = $package;
     96            my @optional;
     97            scalar(@{$package->{DEPENDS}}) gt 0 and
     98                push @optional, 'Requires:  %DEPENDS%';
    8499            for my $line (
    85100                '%package %NAME%',
    86                 '%requires',
    87                 '%DEPENDS%',
    88                 '%description',
     101                'Summary:   %DESCRIPTION_SHORT%',
     102                'AutoReqProv:   no',
     103                @optional,
     104                '',
     105                '%description %NAME%',
    89106                '%DESCRIPTION%',
    90                 $self->add_install,
    91                 '%files',
     107                $self->add_install ($package->{NAME}),
     108                '%files %NAME%',
    92109                '%FILES%',
    93110                '',
     
    100117        }
    101118        $self->{config} = $config;
    102     } else {
    103         for my $line (
    104             '%requires',
    105             '%DEPENDS%',
    106             '%description',
    107             '%DESCRIPTION%',
    108             $self->add_install,
    109             '%files',
    110             '%FILES%'
    111         ) {
    112             my $copy = $line;
    113             $self->subst ($copy);
    114             print $SPEC $copy, "\n";
    115         }
    116119    }
     120    print $SPEC '%changelog', "\n";
    117121    close $SPEC;
    118122}
Note: See TracChangeset for help on using the changeset viewer.