+/* $Id$
+
+This file is part of builder
+Copyright © 2006-2009 Mikko Rasa, Mikkosoft Productions
+Distributed under the LGPL
+*/
+
#ifndef INSTALL_H_
#define INSTALL_H_
-#include <msp/core/thread.h>
-#include <msp/path/path.h>
-#include "action.h"
+#include "sourcepackage.h"
+#include "filetarget.h"
-class Install: public Action
+/**
+Represents the installation of a file.
+*/
+class Install: public FileTarget
{
-public:
- Install(const Msp::Path::Path &, const Msp::Path::Path &);
private:
- class Worker: public Msp::Thread
- {
- public:
- Worker(Install &i): install(i), done(false) { launch(); }
- private:
- Install &install;
- bool done;
+ FileTarget &source;
- void main();
- };
+public:
+ Install(Builder &, const SourcePackage &, FileTarget &, const std::string & =std::string());
+ virtual const char *get_type() const { return "Install"; }
+ FileTarget &get_source() const { return source; }
+private:
+ virtual void check_rebuild();
+ virtual Action *create_action();
- Msp::Path::Path src;
- Msp::Path::Path dest;
- Worker worker;
+ static Msp::FS::Path generate_target_path(const FileTarget &i, const std::string &);
};
#endif