Alexander Afanasyev | 0350ac8 | 2012-10-03 17:35:30 -0700 | [diff] [blame] | 1 | # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 |
| 2 | # $Id$ |
| 3 | |
| 4 | PortSystem 1.0 |
| 5 | |
| 6 | name ccnx-repo |
| 7 | homepage http://www.ccnx.org/ |
| 8 | license GPL-2+ LGPL-2.1+ |
| 9 | version 0.6.2 |
| 10 | revision 0 |
| 11 | epoch 0 |
| 12 | distfiles |
| 13 | |
| 14 | categories net ccnx |
| 15 | maintainers ucla.edu:alexander.afanasyev |
| 16 | |
| 17 | description Meta port for repo of ccnx package |
| 18 | |
| 19 | depends_lib-append port:ccnx |
| 20 | |
| 21 | set ccnxuser ccnx |
| 22 | set ccnxgroup ccnx |
| 23 | |
| 24 | use_configure no |
| 25 | |
| 26 | build { } |
| 27 | destroot { |
| 28 | system "echo \"su - ${ccnxuser} -c 'CCNR_DIRECTORY=${prefix}/var/db/ccnx-repo ${prefix}/bin/ccnr'\" > \"${destroot}${prefix}/bin/ccnr-wrapper\"" |
| 29 | file attributes "${destroot}${prefix}/bin/ccnr-wrapper" -permissions 0755 |
| 30 | } |
| 31 | |
| 32 | post-activate { |
| 33 | xinstall -d "${prefix}/var/db" |
| 34 | xinstall -d -o ${ccnxuser} -g ${ccnxgroup} "${prefix}/var/db/ccnx-repo" |
| 35 | |
| 36 | file attributes "${prefix}/var/db/ccnx-repo" -owner ${ccnxuser} -group ${ccnxgroup} |
| 37 | |
| 38 | touch "${prefix}/var/log/ccnx-repo.log" |
| 39 | file attributes "${prefix}/var/log/ccnx-repo.log" -owner ${ccnxuser} -group ${ccnxgroup} |
| 40 | |
| 41 | if {![file exists ${prefix}/var/db/ccnx-repo/config]} { |
| 42 | touch "${prefix}/var/db/ccnx-repo/config" |
| 43 | file attributes "${prefix}/var/db/ccnx-repo/config" -owner ${ccnxuser} -group ${ccnxgroup} |
| 44 | |
| 45 | system "echo CCNR_DEBUG=WARNING >> \"${prefix}/var/db/ccnx-repo/config\"" |
| 46 | system "echo CCNR_DIRECTORY=\"${prefix}/var/db/ccnx-repo\" >> \"${prefix}/var/db/ccnx-repo/config\"" |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | startupitem.executable "${prefix}/bin/ccnr-wrapper" |
| 51 | |
| 52 | startupitem.create yes |
| 53 | startupitem.name ${name} |
| 54 | |
| 55 | startupitem.netchange no |
| 56 | startupitem.logevents yes |
| 57 | startupitem.logfile ${prefix}/var/log/ccnx-repo.log |