Changeset 24


Ignore:
Timestamp:
11/23/10 15:53:42 (14 years ago)
Author:
nanardon
Message:
  • add make rpm target
Location:
server/trunk/web
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • server/trunk/web/Makefile.PL

    r1 r24  
    1616requires 'Moose'; 
    1717requires 'namespace::autoclean'; 
     18requires 'Catalyst::Plugin::Authentication' => '0'; 
     19requires 'Catalyst::Plugin::Session' => '0'; 
     20requires 'Catalyst::Plugin::Session::Store::DBI' => '0'; 
     21requires 'Catalyst::Plugin::Session::State::Cookie' => '0'; 
     22requires 'Catalyst::Plugin::Prototype' => '0'; 
     23requires 'Catalyst::View::TT' => '0'; 
     24requires 'DBD::Pg'; 
    1825requires 'Config::General'; # This should reflect the config file format you've chosen 
    1926                 # See Catalyst::Plugin::ConfigLoader for supported formats 
     
    2229 
    2330install_script glob('script/*.pl'); 
    24 auto_install; 
    25 WriteAll; 
     31 
     32WriteMakefile( 
     33    macro => {  
     34        DESTRPMDIR => '$(shell pwd)', 
     35    }, 
     36); 
     37 
     38package MY; 
     39 
     40sub postamble { 
     41    <<EOF; 
     42# .PHONY .= svnmanifest 
     43 
     44svnmanifest: 
     45\tsvn ls -R| grep -v "/\$\$"  > MANIFEST 
     46 
     47ChangeLog: 
     48\tsvn log > ChangeLog 
     49 
     50\$(DISTNAME).spec: \$(DISTNAME).spec.in Makefile 
     51\tsed -e 's/\@VERSION@/\$(VERSION)/' < \$< > \$@ 
     52 
     53rpm: \$(DISTVNAME).tar.gz \$(DISTNAME).spec 
     54\tmkdir \$(DESTRPMDIR)/noarch || : 
     55\trpmbuild -ba --clean\\ 
     56\t --define "_sourcedir `pwd`" \\ 
     57\t --define "_specdir `pwd`" \\ 
     58\t --define "_srcrpmdir \$(DESTRPMDIR)" \\ 
     59\t --define "_rpmdir \$(DESTRPMDIR)" \\ 
     60\t \$(DISTNAME).spec 
     61 
     62svnrpm: \$(DISTVNAME).tar.gz \$(DISTNAME).spec 
     63\tmkdir \$(DESTRPMDIR)/noarch || : 
     64\trpmbuild -ba --clean\\ 
     65\t --define "_sourcedir `pwd`" \\ 
     66\t --define "_specdir `pwd`" \\ 
     67\t --define "_srcrpmdir \$(DESTRPMDIR)" \\ 
     68\t --define "_rpmdir \$(DESTRPMDIR)" \\ 
     69\t --define "svnrelease `LC_ALL=C svn info | grep '^Revision:' | sed 's/Revision: //'`" \\ 
     70\t \$(DISTNAME).spec 
     71 
     72EOF 
     73} 
  • server/trunk/web/lib/Sophie/Base.pm

    r18 r24  
    1919   my ($self) = @_; 
    2020   require Config::General; 
    21    my $cg = Config::General->new("$Bin/../sophie.conf"); 
    22    my $config = { $cg->getall() }; 
     21   my $config; 
     22   foreach my $file ('sophie.conf', "$Bin/../sophie.conf") { 
     23       -f $file or next; 
     24        my $cg = Config::General->new($file); 
     25        $config = { $cg->getall() }; 
     26    } 
     27    $config or die "No config found"; 
    2328 
    2429   DBI->connect_cached( 
  • server/trunk/web/lib/Sophie/Controller/Rpms.pm

    r16 r24  
    22use Moose; 
    33use namespace::autoclean; 
     4use Encode::Guess; 
     5use Encode; 
    46 
    57BEGIN {extends 'Catalyst::Controller'; } 
     
    124126} 
    125127 
     128sub changelog : XMLRPCLocal { 
     129    my ($self, $c, $pkgid) = @_; 
     130 
     131    my @ch; 
     132    foreach ($c->model('Base')->resultset('RpmsChangelog')->search({}, 
     133            {  
     134                bind => [ $pkgid ], 
     135                order_by => [ 'time::int desc' ], 
     136            }, 
     137        )->all) { 
     138        my $chentry; 
     139        my $enc = guess_encoding($_->get_column('text'), qw/latin1/); 
     140        $chentry->{text} = $enc && ref $enc 
     141            ? encode('utf8', $_->get_column('text')) 
     142            : $_->get_column('text'); 
     143        $enc = guess_encoding($_->get_column('name'), qw/latin1/); 
     144        $chentry->{name} = $enc && ref $enc 
     145            ? encode('utf8', $_->get_column('name')) 
     146            : $_->get_column('name'); 
     147        $chentry->{time} = $_->get_column('time'); 
     148        push(@ch, $chentry); 
     149    } 
     150 
     151    $c->stash->{xmlrpc}{changelog} = \@ch; 
     152} 
     153 
    126154 
    127155sub rpms : Chained : PathPart { 
Note: See TracChangeset for help on using the changeset viewer.