--- deliantra/Deliantra-Client/Makefile.PL 2006/04/12 20:06:36 1.16 +++ deliantra/Deliantra-Client/Makefile.PL 2007/12/26 21:03:21 1.97 @@ -1,35 +1,110 @@ use ExtUtils::MakeMaker; +sub manifest_resources { + open my $manifest, "MANIFEST" or die "Couldn't open MANIFEST: $!"; + map { chomp; $_ } grep /^resources\//, <$manifest> +} + print <, qx; + $LIBS = join " ", qx, "-lSDL_image -lSDL_mixer", qx, "-lGL"; + + $INC =~ s/\n/ /g for $INC, $LIBS; +} WriteMakefile( dist => { - PREOP => 'pod2text CFClient.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', + PREOP => 'pod2text bin/deliantra | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', COMPRESS => 'gzip -9v', SUFFIX => '.gz', }, - NAME => "CFClient", - INC => '-I/usr/include/SDL -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2', - LIBS => ["-lSDL -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 -lfreetype -lz"], - EXE_FILES => [qw(bin/pclient)], - VERSION_FROM => "CFClient.pm", + NAME => "Deliantra::Client", + INC => $INC, + LIBS => [$LIBS], + EXE_FILES => [qw(bin/deliantra)], + VERSION_FROM => "DC.pm", + PREREQ_PM => { + BDB => 1.4, + Deliantra => 1.13, + Time::HiRes => 0, + EV => 1.72, + AnyEvent => 2.6, + Compress::LZF => 1.6, + Pod::POM => 0.15, + LWP => 0, + JSON::XS => 2.01, + }, + depend => { + "Client.o" => 'glfunc.h pangoopengl.h pango-font.c pango-fontmap.c pango-render.c texcache.c rendercache.c', + }, + clean => { FILES => 'docwiki.pst' }, PM => { - 'CFClient.pm' => '$(INST_LIBDIR)/CFClient.pm', - 'CFClient/UI.pm' => '$(INST_LIBDIR)/CFClient/UI.pm', - 'resources/uifont.ttf' => '$(INST_LIBDIR)/CFClient/resources/uifont.ttf', - 'resources/uifontb.ttf' => '$(INST_LIBDIR)/CFClient/resources/uifontb.ttf', - 'resources/uifonti.ttf' => '$(INST_LIBDIR)/CFClient/resources/uifonti.ttf', - 'resources/uifontbi.ttf' => '$(INST_LIBDIR)/CFClient/resources/uifontbi.ttf', - 'resources/d1_bg.png' => '$(INST_LIBDIR)/CFClient/resources/d1_bg.png', - 'resources/d1_border_top.png' => '$(INST_LIBDIR)/CFClient/resources/d1_border_top.png', - 'resources/d1_border_bottom.png' => '$(INST_LIBDIR)/CFClient/resources/d1_border_bottom.png', - 'resources/d1_border_left.png' => '$(INST_LIBDIR)/CFClient/resources/d1_border_left.png', - 'resources/d1_border_right.png' => '$(INST_LIBDIR)/CFClient/resources/d1_border_right.png', - 'resources/b1_button_active.png' => '$(INST_LIBDIR)/CFClient/resources/b1_button_active.png', + 'DC.pm' => '$(INST_LIBDIR)/Client/private/DC.pm', + 'DC/Protocol.pm' => '$(INST_LIBDIR)/Client/private/DC/Protocol.pm', + 'DC/OpenGL.pm' => '$(INST_LIBDIR)/Client/private/DC/OpenGL.pm', + 'DC/Texture.pm' => '$(INST_LIBDIR)/Client/private/DC/Texture.pm', + 'DC/DB.pm' => '$(INST_LIBDIR)/Client/private/DC/DB.pm', + 'DC/UI.pm' => '$(INST_LIBDIR)/Client/private/DC/UI.pm', + 'DC/UI/Canvas.pm' => '$(INST_LIBDIR)/Client/private/DC/UI/Canvas.pm', + 'DC/UI/Dockable.pm' => '$(INST_LIBDIR)/Client/private/DC/UI/Dockable.pm', + 'DC/UI/Inventory.pm' => '$(INST_LIBDIR)/Client/private/DC/UI/Inventory.pm', + 'DC/UI/SpellList.pm' => '$(INST_LIBDIR)/Client/private/DC/UI/SpellList.pm', + 'DC/UI/Canvas.pm' => '$(INST_LIBDIR)/Client/private/DC/UI/Canvas.pm', + 'DC/UI/ChatView.pm' => '$(INST_LIBDIR)/Client/private/DC/UI/ChatView.pm', + 'DC/UI/MessageWindow.pm' => '$(INST_LIBDIR)/Client/private/DC/UI/MessageWindow.pm', + 'DC/Item.pm' => '$(INST_LIBDIR)/Client/private/DC/Item.pm', + 'DC/Pod.pm' => '$(INST_LIBDIR)/Client/private/DC/Pod.pm', + 'DC/MapWidget.pm' => '$(INST_LIBDIR)/Client/private/DC/MapWidget.pm', + 'DC/Macro.pm' => '$(INST_LIBDIR)/Client/private/DC/Macro.pm', + 'docwiki.pst' => '$(INST_LIBDIR)/Client/private/resources/docwiki.pst', + (map +($_ => "\$(INST_LIBDIR)/Client/private/$_"), manifest_resources), } ); + +sub MY::postamble { + my $self = shift; + + # try to add MANIFEST to CONFIGDEP + s/^CONFIGDEP = /CONFIGDEP = MANIFEST /m + for @{ $self->{RESULT} }; + + my $pods = join " ", ; + + <