Ticket #41762: Portfile-bash-completion.diff

File Portfile-bash-completion.diff, 1.4 KB (added by liberato@…, 11 years ago)
  • Portfile

    old new  
    55PortGroup           github 1.0
    66
    77github.setup        ginatrapani todo.txt-cli 2.9 v
    8 revision            1
     8revision            2
    99name                todotxt
    1010categories          office
    1111license             GPL
     
    2525
    2626build {}
    2727
     28post-patch {
     29    reinplace "s/todo\\.sh/${name}/" ${worksrcpath}/todo_completion
     30}
     31
    2832destroot {
    2933    xinstall -m 755 ${worksrcpath}/todo.sh ${destroot}${prefix}/bin/$name
    3034    xinstall -d -m 755 ${destroot}${prefix}/share/${name}
    3135    xinstall -m 644 ${worksrcpath}/todo.cfg ${destroot}${prefix}/share/${name}/todo.cfg-dist
    3236}
    3337
     38post-destroot {
     39    set completions_path ${destroot}${prefix}/share/bash-completion/completions
     40    xinstall -d ${completions_path}
     41    xinstall -m 644 ${worksrcpath}/todo_completion ${completions_path}/${name}
     42}
     43
    3444patch {
    3545    # default cfg will try to write in $prefix/bin, since this isn't obvious from the config
    3646    # file we help the user avoiding this
    3747    reinplace "s|TODO_DIR=`dirname \"\$0\"`|TODO_DIR=\"\$HOME\"/.todo|" ${worksrcpath}/todo.cfg
    3848}
    3949
     50variant bash_completion {
     51    depends_run-append  path:etc/bash_completion:bash-completion
     52}
     53
    4054notes "Copy the default configuration file from  ${prefix}/etc/todo.cfg-dist \
    4155to  ~/.todo/config  and customize it."