$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install git cmake build-essential
libgcrypt11-dev libjson0-dev libcurl4-openssl-dev
libexpat1-dev libboost-filesystem-dev
libboost-program-options-dev binutils-dev
libboost-test-dev libqt4-dev libyajl-dev
ソースをダウンロード
$ cd
$ git clone git://github.com/Grive/grive
ソースを一部修正
$ cp -p
/home/pi/grive/libgrive/src/drive/State.cc
/home/pi/grive/libgrive/src/drive/State.cc.org
$ vi /home/pi/grive/libgrive/src/drive/State.cc
赤字の部分を修正します。
void State::Write( const fs::path& filename ) const
{
Json last_sync
;
last_sync.Add(
"sec", Json(m_last_sync.Sec() ) );
last_sync.Add(
"nsec", Json(m_last_sync.NanoSec() ) );
Json result ;
result.Add(
"last_sync", last_sync ) ;
result.Add(
"change_stamp", Json(m_cstamp) ) ;
std::ofstream
fs( filename.string().c_str() ) ;
fs <<
result ;
}
↓
void State::Write( const fs::path& filename ) const
{
Json last_sync
;
last_sync.Add(
"sec", Json((boost::uint64_t)m_last_sync.Sec()
) );
last_sync.Add(
"nsec", Json((boost::uint64_t)m_last_sync.NanoSec()
) );
Json result ;
result.Add(
"last_sync", last_sync ) ;
result.Add(
"change_stamp", Json((boost::uint64_t)m_cstamp)
) ;
std::ofstream
fs( filename.string().c_str() ) ;
fs <<
result ;
}
コンパイル
$ cd ./grive
$ cmake . → 最後はスペース+ピリオドです
$ make → 30分ぐらい掛かります
同期フォルダーの作成とセットアップ
$ mkdir ~/google_drive
$ cp ./grive/grive ~/google_drive
$ cd ~/google_drive
$ ./grive -a
Please go to this URL and get an authentication code:
https://accounts.google.com/o/oauth2/auth?scope=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
上のURLをコピーしてブラウザーで開いて画面右下のAcceptボタンを押すと以下の表示となる。
Please copy this code, switch to your application and
paste it there:
XXXXXXXXXXXXXXXXXXXXXXXXXXXX
上記のコードをコピーしてrapberryにペーストする。
-----------------------
Please input the authentication code here:
XXXXXXXXXXXXXXXXXXXXXXXXXXXX
Reading local directories
Synchronizing folders
Reading remote server file list
Synchronizing files
sync "./grive" doesn't exist in server, uploading
Finished!
|