Debian パッケージ gnuplot でファイル名補完 (2007/08/03)

2005/03/18に書いたものの更新版です.gnuplot 4.2.0-3 から 4.2.0-4 にアップグレードされた際に,configure のオプションが変更され,以前書いたものを修正する必要が生じました.

Debian パッケージの gnuplot は,plot などでファイルを指定するときに,Tab キーでファイル名補完ができません.Debian の gnuplot パッケージでは以下の理由により補完機能が標準でサポートされていません.

% cat /usr/share/doc/gnuplot/README.Debian
.....
libreadline
-----------

Yes, the built in readline of gnuplot is bad. However, libreadline
cannot be used instead because it is licensed under the GPL, whereas
gnuplot has special licenses (patches only). Linking those programs
together is forbidden by the GPL. Please don't file bugs telling me to
use libreadline in gnuplot...
.....

Debian パッケージのソースをダウンロードしてファイル名補完ができるようにパッケージを構築します.

  1. apt-line にソースがダウンロードできるサイトを書き加えます.

    # vi /etc/apt/source.list
    .....
    deb-src http://ftp.jp.debian.org/debian sid main contrib non-free
    .....
    
  2. パッケージとソースリストを更新します.

    # apt-get update
    
  3. ソースファイルをダウンロードします.ダウンロード先のディレクトリに移動します.ここでは,/usr/local/src/debian/gnuplot とします.

    # mkdir -p /usr/local/src/debian/gnuplot
    # cd /usr/local/src/debian/gnuplot
    # apt-get source gnuplot
    
  4. libreadline を利用できるように,debian/rules を修正します.

    # cd gnuplot-4.2.0
    # vi debian/rules
    (次のように修正)
    --with-readline=builtin → --with-readline=gnu
    

    ただし,4.2.0 というのは今回構築したバージョンです.

  5. パッケージを作成します.

    # dpkg-buildpackage -uc -us
    
  6. インストールします.

    # cd ..
    # dpkg -i gnuplot-doc_4.2.0-4_all.deb
    # dpkg -i gnuplot-nox_4.2.0-4_i386.deb
    # dpkg -i gnuplot-x11_4.2.0-4_i386.deb
    # dpkg -i gnuplot_4.2.0-4_all.deb
    
  7. (Optional) Debian パッケージをアップグレードした際に,更新して欲しくない場合は,次のようにして更新されないようにできます.

    # echo gnuplot hold | dpkg --set-selections
    # echo gnuplot-doc hold | dpkg --set-selections
    # echo gnuplot-nox hold | dpkg --set-selections
    # echo gnuplot-x11 hold | dpkg --set-selections
    

    解除したい場合は,次のようにして下さい.

    # echo gnuplot install | dpkg --set-selections
    # echo gnuplot-doc install | dpkg --set-selections
    # echo gnuplot-nox install | dpkg --set-selections
    # echo gnuplot-x11 install | dpkg --set-selections
    

梅原 大祐 / UMEHARA Daisuke umehara@kit.ac.jp
Last modified: 2020/05/01 15:37
Total Access Count