use inc::Module::Install;

name 'LATMOS-Accounts-Web';
all_from 'lib/LATMOS/Accounts/Web.pm';

#requires 'Catalyst' => '5.7015';
requires 'Catalyst::Plugin::ConfigLoader';
requires 'Catalyst::Plugin::Static::Simple';
requires 'Catalyst::Action::RenderView';
requires 'YAML'; # This should reflect the config file format you've chosen
                 # See Catalyst::Plugin::ConfigLoader for supported formats
requires 'Catalyst::Plugin::Authentication' => '0';
requires 'Catalyst::Plugin::Session' => '0';
requires 'Catalyst::Plugin::Session::Store::FastMmap' => '0';
requires 'Catalyst::Plugin::Session::State::Cookie' => '0';
requires 'Catalyst::Plugin::Prototype' => '0';
requires 'Catalyst::View::TT' => '0';
requires 'LATMOS::Accounts' => '0';
catalyst;

install_script glob('script/*.pl');
#auto_install;
WriteMakefile(
    macro => { 
        DESTRPMDIR => '$(shell pwd)',
    },
);

package MY;

sub postamble {
    <<EOF;
# .PHONY .= svnmanifest

svnmanifest:
\tsvn ls -R| grep -v "/\$\$"  > MANIFEST

ChangeLog:
\tsvn log > ChangeLog

latmos-accounts-web.spec: latmos-accounts-web.spec.in Makefile
\tsed -e 's/\@VERSION@/\$(VERSION)/' < \$< > \$@

rpm: \$(DISTVNAME).tar.gz latmos-accounts-web.spec
\tmkdir \$(DESTRPMDIR)/noarch || :
\trpmbuild -ba --clean\\
\t --define "_sourcedir `pwd`" \\
\t --define "_specdir `pwd`" \\
\t --define "_srcrpmdir \$(DESTRPMDIR)" \\
\t --define "_rpmdir \$(DESTRPMDIR)" \\
\t latmos-accounts-web.spec

svnrpm: \$(DISTVNAME).tar.gz latmos-accounts-web.spec
\tmkdir \$(DESTRPMDIR)/noarch || :
\trpmbuild -ba --clean\\
\t --define "_sourcedir `pwd`" \\
\t --define "_specdir `pwd`" \\
\t --define "_srcrpmdir \$(DESTRPMDIR)" \\
\t --define "_rpmdir \$(DESTRPMDIR)" \\
\t --define "svnrelease `LC_ALL=C svn info | grep '^Revision:' | sed 's/Revision: //'`" \\
\t latmos-accounts-web.spec

EOF
}
