Changeset 29595 for main/trunk/package-kits
- Timestamp:
- 2014-12-11T18:45:10+13:00 (9 years ago)
- Location:
- main/trunk/package-kits/linux
- Files:
-
- 1 added
- 6 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/package-kits/linux/global.conf
r29583 r29595 1 MAINTAINER_NAME: Greenstone Team 2 MAINTAINER_EMAIL: [email protected] 1 3 PKG_GREENSTONE: 2 4 greenstone -
main/trunk/package-kits/linux/perllib/Greenstone/Package.pm
r29583 r29595 8 8 use File::Copy 'cp'; 9 9 use POSIX 'uname'; 10 use Storable 'dclone'; 10 11 use Greenstone::Helpers; 11 12 use base 'Exporter'; … … 127 128 sub add_package { 128 129 my $self = shift; 130 131 # Add the (relatively) static files 129 132 $self->add ("managers/$self->{config}->{MANAGER}", $self->{output}); 133 134 if (exists $self->{config}->{SUB_PACKAGES}) { 135 my $packages = []; 136 for my $subpackage (sort @{$self->{config}->{SUB_PACKAGES}}) { 137 my $config = {}; 138 for my $key (keys %{$self->{config}}) { 139 if ($key =~ /^${subpackage}_(.*)$/) { 140 # print "setting '$1' to '$key' = '$self->{config}->{$key}'\n"; 141 $config->{$1} = $self->{config}->{$key}; 142 } 143 } 144 # hashdump $self->{config}; 145 push @{$packages}, $config; 146 } 147 $self->add_package_impl ($packages); 148 } else { 149 $self->add_package_impl; 150 } 130 151 } 131 152 -
main/trunk/package-kits/linux/perllib/Greenstone/Package/_apt.pm
r29550 r29595 35 35 } 36 36 37 sub add_package_section { 38 my ($self, $out) = @_; 39 for my $line ( 40 'Package: %NAME%', 41 'Architecture: %ARCHITECTURE%', 42 'Homepage: %HOMEPAGE%', 43 'Depends:', 44 '%DEPENDS', 45 'Description: %DESCRIPTION_SHORT', 46 ' %DESCRIPTION' 47 ) { 48 my $copy = $line; 49 $self->subst ($copy); 50 print $out $copy, "\n"; 51 } 52 } 53 54 sub add_package_impl { 55 my ($self, $packages) = @_; 56 $self->add_install; 57 open my $CONTROL, '>', "/tmp/gspkg.control"; 58 for my $line ( 59 'Source: %NAME%', 60 'Section: java', 61 'Priority: optional', 62 'Maintainer: %MAINTAINER_NAME% <%MAINTAINER_EMAIL%>', 63 'BuildDepends:', 64 '%MAKEDEPENDS%', 65 ) { 66 my $copy = $line; 67 $self->subst ($copy); 68 print $CONTROL $copy, "\n"; 69 } 70 if (defined $packages) { 71 my $config = $self->{config}; 72 for my $package (@{$packages}) { 73 $package->{HOMEPAGE} = $config->{HOMEPAGE}; 74 $self->{config} = $package; 75 $self->add_package_section ($CONTROL); 76 } 77 $self->{config} = $config; 78 } else { 79 $self->add_package_section ($CONTROL); 80 } 81 close $CONTROL; 82 $self->add ("/tmp/gspkg.control", "$self->{output}/debian/control"); 83 } 84 37 85 1; -
main/trunk/package-kits/linux/perllib/Greenstone/Package/_pacman.pm
r29546 r29595 39 39 40 40 sub write_function { 41 my ($ name, $out, @lines) = @_;41 my ($self, $name, $out, @lines) = @_; 42 42 print $out $name, "() {\n"; 43 43 for my $line (@lines) { 44 $self->subst ($line); 44 45 print $out "\t", $line, "\n"; 45 46 } … … 54 55 exists $self->{config}->{POST_REMOVE}) { 55 56 my $name = "$self->{config}->{NAME}.install"; 56 open my $INSTALL, '>', "/tmp/ $name";57 open my $INSTALL, '>', "/tmp/gspkg.$name"; 57 58 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}};59 $self->write_function ("pre_install", $INSTALL, @{$self->{config}->{PRE_INSTALL}}); 60 $self->write_function ("pre_upgrade", $INSTALL, @{$self->{config}->{PRE_INSTALL}}); 60 61 }; 61 62 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}};63 $self->write_function ("post_install", $INSTALL, @{$self->{config}->{POST_INSTALL}}); 64 $self->write_function ("post_upgrade", $INSTALL, @{$self->{config}->{POST_INSTALL}}); 64 65 }; 65 66 exists $self->{config}->{PRE_REMOVE} and 66 write_function "pre_remove", $INSTALL, @{$self->{config}->{PRE_REMOVE}};67 $self->write_function ("pre_remove", $INSTALL, @{$self->{config}->{PRE_REMOVE}}); 67 68 exists $self->{config}->{POST_REMOVE} and 68 write_function "post_remove", $INSTALL, @{$self->{config}->{POST_REMOVE}};69 $self->write_function ("post_remove", $INSTALL, @{$self->{config}->{POST_REMOVE}}); 69 70 close $INSTALL; 70 $self->add ("/tmp/ $name", "$self->{output}/$name");71 $self->{config}->{INSTALL} ="install=$name";71 $self->add ("/tmp/gspkg.$name", "$self->{output}/$name"); 72 return "install=$name"; 72 73 } else { 73 $self->{config}->{INSTALL} ="";74 return ""; 74 75 } 75 76 } 76 77 78 sub add_package_impl { 79 my ($self, $packages) = @_; 80 if (defined $packages) { 81 $self->{config}->{NAME} = ''; 82 for my $package (@{$packages}) { 83 $self->{config}->{NAME} .= " $package->{NAME}"; 84 } 85 } 86 open my $PKGBUILD, '>', "/tmp/gspkg.PKGBUILD"; 87 for my $line ( 88 '# Maintainer: %MAINTAINER_NAME% <%MAINTAINER_EMAIL%>', 89 'pkgname=(%NAME%)', 90 'pkgver=%VERSION%', 91 'pkgrel=%RELEASE%', 92 'url=%HOMEPAGE%', 93 'license=%LICENSE_SHORT%', 94 'arch=(any)', 95 'makedepends=(', 96 '%MAKEDEPENDS%', 97 ')', 98 'source=(', 99 '%SOURCES%', 100 ')', 101 'md5sums=(', 102 '%SOURCE_SUMS%', 103 ')', 104 'build() {', 105 ' cd ${srcdir}', 106 ' make build', 107 '}' 108 ) { 109 my $copy = $line; 110 $self->subst ($copy); 111 print $PKGBUILD $copy, "\n"; 112 } 113 if (defined $packages) { 114 my $config = $self->{config}; 115 for my $package (@{$packages}) { 116 $self->{config} = $package; 117 $self->write_function ("package_$package->{NAME}", $PKGBUILD, 118 'pkgdesc=%DESCRIPTION%', 119 'arch=(\'%ARCHITECTURE%\')', 120 'depends=(', 121 '%DEPENDS%', 122 ')', 123 'optdepends=(', 124 '%OPTDEPENDS%', 125 ')', 126 'provides=(', 127 '%PROVIDES%', 128 ')', 129 $self->add_install, 130 'DESTDIR=${pkgdir} make install_%NAME%', 131 ); 132 } 133 $self->{config} = $config; 134 } else { 135 print $PKGBUILD $self->add_install, "\n"; 136 $self->write_function ('package', $PKGBUILD, 'DESTDIR=${pkgdir} make install'); 137 } 138 close $PKGBUILD; 139 $self->add ("/tmp/gspkg.PKGBUILD", "$self->{output}/PKGBUILD"); 140 } 141 77 142 1; -
main/trunk/package-kits/linux/perllib/Greenstone/Package/_rpm.pm
r29559 r29595 33 33 sub add_install { 34 34 my $self = shift; 35 $self->{config}->{INSTALL} = "";35 my $ret = ''; 36 36 exists $self->{config}->{PRE_INSTALL} and 37 $ self->{config}->{INSTALL}.= write_function "pre", @{$self->{config}->{PRE_INSTALL}};37 $ret .= write_function "pre", @{$self->{config}->{PRE_INSTALL}}; 38 38 exists $self->{config}->{POST_INSTALL} and 39 $ self->{config}->{INSTALL}.= write_function "post", @{$self->{config}->{POST_INSTALL}};39 $ret .= write_function "post", @{$self->{config}->{POST_INSTALL}}; 40 40 exists $self->{config}->{PRE_REMOVE} and 41 $ self->{config}->{INSTALL}.= write_function "preun", @{$self->{config}->{PRE_INSTALL}};41 $ret .= write_function "preun", @{$self->{config}->{PRE_INSTALL}}; 42 42 exists $self->{config}->{POST_REMOVE} and 43 $self->{config}->{INSTALL} .= write_function "postun", @{$self->{config}->{POST_INSTALL}}; 43 $ret .= write_function "postun", @{$self->{config}->{POST_INSTALL}}; 44 return $ret; 45 } 46 47 sub add_package_impl { 48 my ($self, $packages) = @_; 49 open my $SPEC, '>', '/tmp/gspkg.spec'; 50 for my $line ( 51 'Name: %NAME%', 52 'Version: %VERSION%', 53 'Release: %RELEASE%', 54 'License: %LICENSE_SHORT%', 55 'URL: %HOMEPAGE%', 56 'Source0: %NAME%', 57 'AutoReqProv: no', 58 'BuildRequires: %MAKEDEPENDS%', 59 '', 60 '%prep', 61 'cp -pr %SOURCE0 .', 62 '', 63 '%build', 64 'cd %NAME%', 65 'make %{?_smp_mflags}', 66 '', 67 '%install', 68 'cd %NAME%', 69 '%make_install', 70 '', 71 '%changelog', 72 '' 73 ) { 74 my $copy = $line; 75 $self->subst ($copy); 76 print $SPEC $copy, "\n"; 77 } 78 if (defined $packages) { 79 my $config = $self->{config}; 80 for my $package (@{$packages}) { 81 $self->{config} = $package; 82 for my $line ( 83 '%package %NAME%', 84 '%requires', 85 '%DEPENDS%', 86 '%description', 87 '%DESCRIPTION%', 88 $self->add_install, 89 '%files', 90 '%FILES%' 91 ) { 92 my $copy = $line; 93 $self->subst ($copy); 94 print $SPEC $copy, "\n"; 95 } 96 } 97 $self->{config} = $config; 98 } else { 99 for my $line ( 100 '%requires', 101 '%DEPENDS%', 102 '%description', 103 '%DESCRIPTION%', 104 $self->add_install, 105 '%files', 106 '%FILES%' 107 ) { 108 my $copy = $line; 109 $self->subst ($copy); 110 print $SPEC $copy, "\n"; 111 } 112 } 113 close $SPEC; 114 $self->add ("/tmp/gspkg.spec", "$self->{output}/$self->{config}->{NAME}.spec"); 44 115 } 45 116 -
main/trunk/package-kits/linux/segments/base
r29577 r29595 12 12 all: build 13 13 14 .PHONY: all svn clean cleanall install 14 .PHONY: all svn clean cleanall install install_greenstone install_greenstone-native install_greenstone-tools -
main/trunk/package-kits/linux/segments/main
r29583 r29595 1 install :1 install_greenstone: 2 2 install -d $(DESTDIR)/$(web) 3 3 install -dm775 $(DESTDIR)/$(tomcatlib) -
main/trunk/package-kits/linux/segments/native
r29583 r29595 1 install :1 install_greenstone-native: 2 2 install -d $(DESTDIR)/$(systemlib) 3 3 install -Dm755 src/lib/jni/*.so $(DESTDIR)/$(systemlib) -
main/trunk/package-kits/linux/segments/tools
r29508 r29595 1 install :1 install_greenstone-tools: 2 2 install -d $(DESTDIR)/$(gstools) 3 3 rsync -a --info=STATS --exclude build-src --exclude common-src --exclude collect/demo --exclude .svn src/gs2build $(DESTDIR)/$(gstools)/
Note:
See TracChangeset
for help on using the changeset viewer.