Ignore:
Timestamp:
12/08/14 12:19:58 (6 years ago)
Author:
Jeremy Symon
Message:

Arch package now automatically sets the owner of the web directory to the tomcat user. The functionality is also implemented for the other package managers, but not yet tested.

Location:
main/trunk/package-kits/linux
Files:
1 deleted
18 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/package-kits/linux/distros/arch

    r29536 r29546  
    22
    33SYSTEMLIB:              /usr/lib
     4SYSTEMSHARE:            /usr/share
    45SYSTEMBIN:              /usr/bin
    56SYSTEMJAVA:             @SYSTEMLIB@/jvm/default
    6 GSSRV:                  /srv/gsdl
     7GREENSTONE_HOME:        @SYSTEMSHARE@/greenstone
     8WEB:                    @GREENSTONE_HOME@/web
    79TOMCATLIB:              /usr/share/java/tomcat7
    810TOMCATCONF:             /etc/tomcat7/Catalina/localhost
    9 GSTOOLS:                /opt/greenstone
    10 GLI:                    /opt/gli
     11TOMCAT_USER:            tomcat7
     12GSTOOLS:                @GREENSTONE_HOME@/tools
     13GLI:                    @GREENSTONE_HOME@/gli
    1114
    12 PKG_SVN:                'svn'
    13 PKG_JAVA_JRE:           'java-runtime=7'
    14 PKG_TOMCAT:             'tomcat7' 'tomcat-native'
    15 PKG_JAVA_JDK:           'java-environment=7'
    16 PKG_ANT:                'apache-ant'
    17 PKG_PATCH:              'patch'
    18 PKG_AUTOCONF:           'autoconf'
    19 PKG_GCC:                'gcc'
    20 PKG_MAKE:               'make'
    21 PKG_WVWARE:             'wv'
    22 PKG_PERL:               'perl' 'perl-xml-parser' 'perl-text-iconv'
    23 PKG_IMAGEMAGICK:        'imagemagick'
    24 PKG_RSYNC:              'rsync'
     15PKG_SVN:
     16    svn
     17PKG_JAVA_JRE:
     18    java-runtime=7
     19PKG_TOMCAT:
     20    tomcat7
     21    tomcat-native
     22PKG_JAVA_JDK:
     23    java-environment=7
     24PKG_ANT:
     25    apache-ant
     26PKG_PATCH:
     27    patch
     28PKG_AUTOCONF:
     29    autoconf
     30PKG_GCC:
     31    gcc
     32PKG_MAKE:
     33    make
     34PKG_WVWARE:
     35    wv
     36PKG_PERL:
     37    perl
     38    perl-xml-parser
     39    perl-text-iconv
     40PKG_IMAGEMAGICK:
     41    imagemagick
     42PKG_RSYNC:
     43    rsync
  • main/trunk/package-kits/linux/distros/fedora

    r29536 r29546  
    22
    33SYSTEMLIB:              /usr/lib
     4SYSTEMSHARE:            /usr/share
    45SYSTEMBIN:              /usr/bin
    56SYSTEMJAVA:             /etc/alternatives/java_sdk
    6 GSSRV:                  /srv/gsdl
     7GREENSTONE_HOME:        @SYSTEMSHARE@/greenstone
     8WEB:                    @GREENSTONE_HOME@/web
    79TOMCATLIB:              /usr/share/tomcat/lib
    810TOMCATCONF:             /etc/tomcat/Catalina/localhost
    9 GSTOOLS:                /usr/share/greenstone
    10 GLI:                    /usr/share/gli
     11TOMCAT_USER:            tomcat7
     12GSTOOLS:                @GREENSTONE_HOME@/tools
     13GLI:                    @GREENSTONE_HOME@/gli
    1114
    12 PKG_SVN:                svn,
    13 PKG_JAVA_JRE:           java >= 7,
    14 PKG_TOMCAT:             tomcat >= 7, tomcat-native,
    15 PKG_JAVA_JDK:           java-devel >= 7,
    16 PKG_ANT:                ant,
    17 PKG_PATCH:              patch,
    18 PKG_AUTOCONF:           autoconf,
    19 PKG_GCC:                gcc, gcc-c++,
    20 PKG_MAKE:               make,
    21 PKG_WVWARE:             wv,
    22 PKG_PERL:               perl,
    23 PKG_IMAGEMAGICK:        ImageMagick,
    24 PKG_RSYNC:              rsync,
     15PKG_SVN:
     16    svn
     17PKG_JAVA_JRE:
     18    java >= 7
     19PKG_TOMCAT:
     20    tomcat >= 7
     21    tomcat-native
     22PKG_JAVA_JDK:
     23    java-devel >= 7
     24PKG_ANT:
     25    ant
     26PKG_PATCH:
     27    patch
     28PKG_AUTOCONF:
     29    autoconf
     30PKG_GCC:
     31    gcc
     32    gcc-c++
     33PKG_MAKE:
     34    make
     35PKG_WVWARE:
     36    wv
     37PKG_PERL:
     38    perl
     39PKG_IMAGEMAGICK:
     40    ImageMagick
     41PKG_RSYNC:
     42    rsync
  • main/trunk/package-kits/linux/distros/ubuntu

    r29536 r29546  
    22
    33SYSTEMLIB:              /usr/lib
     4SYSTEMSHARE:            /usr/share
    45SYSTEMBIN:              /usr/bin
    56SYSTEMJAVA:             @SYSTEMLIB@/jvm/default-java
    6 GSSRV:                  /srv/gsdl
     7GREENSTONE_HOME:        @SYSTEMSHARE@/greenstone
     8WEB:                    @GREENSTONE_HOME@/web
    79TOMCATLIB:              /usr/share/tomcat7/lib
    810TOMCATCONF:             /etc/tomcat7/Catalina/localhost
    9 GSTOOLS:                /opt/greenstone
    10 GLI:                    /opt/gli
     11TOMCAT_USER:            tomcat7
     12GSTOOLS:                @GREENSTONE_HOME@/tools
     13GLI:                    @GREENSTONE_HOME@/gli
    1114
    12 PKG_SVN:                subversion,
    13 PKG_JAVA_JRE:           default-jre,
    14 PKG_TOMCAT:             tomcat7,
    15 PKG_JAVA_JDK:           default-jdk,
    16 PKG_ANT:                ant,
    17 PKG_PATCH:              patch,
    18 PKG_AUTOCONF:           autoconf,
    19 PKG_GCC:                gcc, g++,
    20 PKG_MAKE:               make,
    21 PKG_WVWARE:             wv,
    22 PKG_PERL:               perl,
    23 PKG_IMAGEMAGICK:        imagemagick,
    24 PKG_RSYNC:              rsync,
     15PKG_SVN:
     16    subversion
     17PKG_JAVA_JRE:
     18    default-jre
     19PKG_TOMCAT:
     20    tomcat7
     21PKG_JAVA_JDK:
     22    default-jdk
     23PKG_ANT:
     24    ant
     25PKG_PATCH:
     26    patch
     27PKG_AUTOCONF:
     28    autoconf
     29PKG_GCC:
     30    gcc
     31    g++
     32PKG_MAKE:
     33    make
     34PKG_WVWARE:
     35    wv
     36PKG_PERL:
     37    perl
     38PKG_IMAGEMAGICK:
     39    imagemagick
     40PKG_RSYNC:
     41    rsync
  • main/trunk/package-kits/linux/files/greenstone

    r29526 r29546  
    8585if test -z "$GSDL3HOME" ; then
    8686    echo "Setting collections location to the default" >&2
    87     GSDL3HOME=@GSSRV@
     87    GSDL3HOME=@WEB@
    8888fi
    8989export GSDL3HOME
  • main/trunk/package-kits/linux/files/greenstone3.xml

    r29481 r29546  
    1 <Context path="/greenstone3" docBase="/srv/gsdl/" reloadable="true">
     1<Context path="/greenstone3" docBase="@WEB@" reloadable="true">
    22    <Realm className="org.apache.catalina.realm.JDBCRealm"
    33        driverName="org.apache.derby.jdbc.EmbeddedDriver"
    4         connectionURL="jdbc:derby:/srv/gsdl/etc/usersDB"
     4        connectionURL="jdbc:derby:@WEB@/etc/usersDB"
    55        userTable="users" userNameCol="username" userCredCol="password"
    66        userRoleTable="roles" roleNameCol="role"
  • main/trunk/package-kits/linux/global.conf

    r29536 r29546  
    1 PKG_GREENSTONE:         'greenstone'
    2 PKG_GREENSTONE_TOOLS:   'greenstone-tools'
    3 PKG_GREENSTONE_DEMO:    'greenstone-demo'
    4 PKG_GLI:                'greenstone-gli'
     1PKG_GREENSTONE:
     2    greenstone
     3PKG_GREENSTONE_TOOLS:
     4    greenstone-tools
     5PKG_GREENSTONE_DEMO:
     6    greenstone-demo
     7PKG_GLI:
     8    greenstone-gli
  • main/trunk/package-kits/linux/managers/pacman/PKGBUILD

    r29508 r29546  
    1414# replaces=()
    1515# backup=()
    16 # install=''
     16@INSTALL@
    1717source=(@SOURCES@
    1818)
  • main/trunk/package-kits/linux/managers/rpm/@NAME@.spec

    r29526 r29546  
    2525%make_install
    2626
     27@INSTALL@
    2728%files
    2829%doc
  • main/trunk/package-kits/linux/packages/demo

    r29536 r29546  
    2323
    2424FILES:
    25     @GSSRV@/sites/localsite/collect/*
     25    @WEB@/sites/localsite/collect/*
    2626
    2727SOURCES:
  • main/trunk/package-kits/linux/packages/main

    r29536 r29546  
    3131
    3232FILES:
    33     @GSSRV@
     33    @WEB@
    3434    @TOMCATCONF@/*
    3535    @TOMCATLIB@/*
     
    4848    build-core
    4949    main
     50
     51POST_INSTALL:
     52    chown -R @TOMCAT_USER@:@TOMCAT_USER@ @WEB@
     53
     54POST_REMOVE:
     55    echo "To fully remove greenstone, delete /usr/share/greenstone/web"
  • main/trunk/package-kits/linux/perllib/Greenstone/Config.pm

    r29536 r29546  
    44use warnings;
    55use utf8;
     6use Greenstone::Helpers;
    67
    78# Formats an array
     
    3132}
    3233
     34# Reads a config file into the config hashmap
     35sub readconf {
     36    my ($self, $conf) = @_;
     37    $self->{config} = {} unless exists $self->{config};
     38    open CONF, '<', $conf
     39        or die "Failed to open '$conf' for reading: $!";
     40    my $var;
     41    while (my $line = <CONF>) {
     42        if (empty $line or comment $line) {
     43            $var = undef;
     44        } elsif (defined $var and $line =~ /^\s/) {
     45            trim $line;
     46            $self->subst ($line);
     47            escape $line;
     48            push @{$self->{config}->{$var}}, $line;
     49        } else {
     50            ($var, my $val) = trim (split ":", $line, 2);
     51            defined $var and defined $val or die "Invalid variable assignment: '$line'";
     52            if (empty $val) {
     53                $self->{config}->{$var} = [];
     54            } else {
     55                $self->subst ($val);
     56                escape $val;
     57                $self->{config}->{$var} = $val;
     58            }
     59        }
     60    }
     61    close CONF;
     62}
     63
    33641;
  • main/trunk/package-kits/linux/perllib/Greenstone/Package.pm

    r29536 r29546  
    88use Greenstone::Helpers;
    99use base 'Exporter';
    10 require Greenstone::Config::Loader;
    1110
    1211use parent 'Greenstone::Config';
     
    5352
    5453    # Classify ourselves as config and load the config
    55     my $self = bless({}, 'Greenstone::Config::Loader');
     54    my $self = bless({}, 'Greenstone::Config');
    5655
    5756    $self->readconf ("global.conf");
    5857    $self->readconf ($distro_conf);
    59     $self->readconf ($package_conf);
    60 
     58   
    6159    die "Distro '$args{distro}' is invalid (does not specify a manager)"
    6260        unless (exists $self->{config}->{MANAGER});
    6361
    6462    my $class = __PACKAGE__ . '::_' . lc $self->{config}->{MANAGER};
    65     eval "require $class; 1" or die "Package manager '$self->{config}->{MANAGER}' does not exist";
     63    eval "require $class; 1" or die "Package manager '$self->{config}->{MANAGER}' does not exist or did not compile";
    6664
    6765    # Reclassify as our implementation
    6866    bless $self, $class;
     67
     68    $self->readconf ($package_conf);
    6969
    7070    $self->{package} = $args{package};
     
    7575    $self->add_sources;
    7676    $self->add_makefile;
     77    $self->add_install;
    7778    $self->add_package;
    7879}
  • main/trunk/package-kits/linux/perllib/Greenstone/Package/_apt.pm

    r29539 r29546  
    1212}
    1313
     14sub write_function {
     15    my ($self, $name, @lines) = @_;
     16    open OUT, '>', "/tmp/$name";
     17    for my $line (@lines) {
     18        print OUT $line, "\n";
     19    }
     20    close OUT;
     21    $self->add ("/tmp/$name", "$self->{output}/$name");
     22}
     23
     24sub add_install {
     25    my $self = shift;
     26    exists $self->{config}->{PRE_INSTALL} and
     27        $self->write_function ("preinst", @{$self->{config}->{PRE_INSTALL}});
     28    exists $self->{config}->{POST_INSTALL} and
     29        $self->write_function ("postinst", @{$self->{config}->{POST_INSTALL}});
     30    exists $self->{config}->{PRE_REMOVE} and
     31        $self->write_function ("prerm", @{$self->{config}->{PRE_REMOVE}});
     32    exists $self->{config}->{POST_REMOVE} and
     33        $self->write_function ("postrm", @{$self->{config}->{POST_REMOVE}});
     34}
     35
    14361;
  • main/trunk/package-kits/linux/perllib/Greenstone/Package/_pacman.pm

    r29536 r29546  
    3838}
    3939
     40sub write_function {
     41    my ($name, $out, @lines) = @_;
     42    print $out $name, "() {\n";
     43    for my $line (@lines) {
     44        print $out "\t", $line, "\n";
     45    }
     46    print $out "}\n\n";
     47}
     48
     49sub add_install {
     50    my $self = shift;
     51    if (exists $self->{config}->{PRE_INSTALL} or
     52        exists $self->{config}->{POST_INSTALL} or
     53        exists $self->{config}->{PRE_REMOVE} or
     54        exists $self->{config}->{POST_REMOVE}) {
     55        my $name = "$self->{config}->{NAME}.install";
     56        open my $INSTALL, '>', "/tmp/$name";
     57        exists $self->{config}->{PRE_INSTALL} and do {
     58            write_function "pre_install", $INSTALL, @{$self->{config}->{PRE_INSTALL}};
     59            write_function "pre_upgrade", $INSTALL, @{$self->{config}->{PRE_INSTALL}};
     60        };
     61        exists $self->{config}->{POST_INSTALL} and do {
     62            write_function "post_install", $INSTALL, @{$self->{config}->{POST_INSTALL}};
     63            write_function "post_upgrade", $INSTALL, @{$self->{config}->{POST_INSTALL}};
     64        };
     65        exists $self->{config}->{PRE_REMOVE} and
     66            write_function "pre_remove", $INSTALL, @{$self->{config}->{PRE_REMOVE}};
     67        exists $self->{config}->{POST_REMOVE} and
     68            write_function "post_remove", $INSTALL, @{$self->{config}->{POST_REMOVE}};
     69        close $INSTALL;
     70        $self->add ("/tmp/$name", "$self->{output}/$name");
     71        $self->{config}->{INSTALL} = "install=$name";
     72    } else {
     73        $self->{config}->{INSTALL} = "";
     74    }
     75}
     76
    40771;
  • main/trunk/package-kits/linux/perllib/Greenstone/Package/_rpm.pm

    r29539 r29546  
    1212}
    1313
     14sub write_function {
     15    my ($name, @lines) = @_;
     16    my $ret = "";
     17    $ret .= "%" . $name . "\n";
     18    for my $line (@lines) {
     19        $ret .= $line . "\n";
     20    }
     21    $ret .= "\n";
     22    return $ret;
     23}
     24
     25sub add_install {
     26    my $self = shift;
     27    $self->{config}->{INSTALL} = "";
     28    exists $self->{config}->{PRE_INSTALL} and
     29        $self->{config}->{INSTALL} .= write_function "pre", @{$self->{config}->{PRE_INSTALL}};
     30    exists $self->{config}->{POST_INSTALL} and
     31        $self->{config}->{INSTALL} .= write_function "post", @{$self->{config}->{POST_INSTALL}};
     32    exists $self->{config}->{PRE_REMOVE} and
     33        $self->{config}->{INSTALL} .= write_function "preun", @{$self->{config}->{PRE_INSTALL}};
     34    exists $self->{config}->{POST_REMOVE} and
     35        $self->{config}->{INSTALL} .= write_function "postun", @{$self->{config}->{POST_INSTALL}};
     36}
     37
    14381;
  • main/trunk/package-kits/linux/segments/base

    r29512 r29546  
    22systembin  := @SYSTEMBIN@
    33java       := @SYSTEMJAVA@
    4 gssrv      := @GSSRV@
     4web        := @WEB@
    55tomcatlib  := @TOMCATLIB@
    66tomcatconf := @TOMCATCONF@
  • main/trunk/package-kits/linux/segments/demo

    r29508 r29546  
    55
    66install:
    7     install -d $(DESTDIR)/$(gssrv)/sites/localsite
    8     rsync -a --info=STATS --exclude .svn src/ $(DESTDIR)/$(gssrv)/sites/localsite/collect/
     7    install -d $(DESTDIR)/$(web)/sites/localsite
     8    rsync -a --info=STATS --exclude .svn src/ $(DESTDIR)/$(web)/sites/localsite/collect/
  • main/trunk/package-kits/linux/segments/main

    r29508 r29546  
    11install:
    2     install -d $(DESTDIR)/$(gssrv) $(DESTDIR)/$(systemlib) $(DESTDIR)/$(tomcatlib)
     2    install -d $(DESTDIR)/$(web) $(DESTDIR)/$(systemlib) $(DESTDIR)/$(tomcatlib)
    33    install -dm775 $(DESTDIR)/$(tomcatlib)
    44    install -Dm755 src/lib/jni/*.so $(DESTDIR)/$(systemlib)
    5     rsync -a --info=STATS --exclude sites/localsite/collect/ --exclude .svn src/web/ $(DESTDIR)/$(gssrv)/
     5    rsync -a --info=STATS --exclude sites/localsite/collect/ --exclude .svn src/web/ $(DESTDIR)/$(web)/
    66    install -Dm644 greenstone3.xml $(DESTDIR)/$(tomcatconf)/greenstone3.xml
    7     mv $(DESTDIR)/$(gssrv)/WEB-INF/lib/derby.jar $(DESTDIR)/$(tomcatlib)
     7    mv $(DESTDIR)/$(web)/WEB-INF/lib/derby.jar $(DESTDIR)/$(tomcatlib)
Note: See TracChangeset for help on using the changeset viewer.