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+ |
Alexander Afanasyev | 5fe1e74 | 2013-01-07 12:27:09 -0800 | [diff] [blame^] | 9 | version 0.7.0 |
Alexander Afanasyev | 0350ac8 | 2012-10-03 17:35:30 -0700 | [diff] [blame] | 10 | distfiles |
| 11 | |
| 12 | categories net ccnx |
| 13 | maintainers ucla.edu:alexander.afanasyev |
| 14 | |
| 15 | description Meta port for repo of ccnx package |
| 16 | |
| 17 | depends_lib-append port:ccnx |
| 18 | |
| 19 | set ccnxuser ccnx |
| 20 | set ccnxgroup ccnx |
| 21 | |
Alexander Afanasyev | 5fe1e74 | 2013-01-07 12:27:09 -0800 | [diff] [blame^] | 22 | supported_archs noarch |
| 23 | use_configure no |
Alexander Afanasyev | 0350ac8 | 2012-10-03 17:35:30 -0700 | [diff] [blame] | 24 | |
| 25 | build { } |
| 26 | destroot { |
| 27 | system "echo \"su - ${ccnxuser} -c 'CCNR_DIRECTORY=${prefix}/var/db/ccnx-repo ${prefix}/bin/ccnr'\" > \"${destroot}${prefix}/bin/ccnr-wrapper\"" |
| 28 | file attributes "${destroot}${prefix}/bin/ccnr-wrapper" -permissions 0755 |
| 29 | } |
| 30 | |
| 31 | post-activate { |
| 32 | xinstall -d "${prefix}/var/db" |
| 33 | xinstall -d -o ${ccnxuser} -g ${ccnxgroup} "${prefix}/var/db/ccnx-repo" |
| 34 | |
| 35 | file attributes "${prefix}/var/db/ccnx-repo" -owner ${ccnxuser} -group ${ccnxgroup} |
| 36 | |
| 37 | touch "${prefix}/var/log/ccnx-repo.log" |
| 38 | file attributes "${prefix}/var/log/ccnx-repo.log" -owner ${ccnxuser} -group ${ccnxgroup} |
| 39 | |
| 40 | if {![file exists ${prefix}/var/db/ccnx-repo/config]} { |
| 41 | touch "${prefix}/var/db/ccnx-repo/config" |
| 42 | file attributes "${prefix}/var/db/ccnx-repo/config" -owner ${ccnxuser} -group ${ccnxgroup} |
| 43 | |
| 44 | system "echo CCNR_DEBUG=WARNING >> \"${prefix}/var/db/ccnx-repo/config\"" |
| 45 | system "echo CCNR_DIRECTORY=\"${prefix}/var/db/ccnx-repo\" >> \"${prefix}/var/db/ccnx-repo/config\"" |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | startupitem.executable "${prefix}/bin/ccnr-wrapper" |
| 50 | |
| 51 | startupitem.create yes |
| 52 | startupitem.name ${name} |
| 53 | |
| 54 | startupitem.netchange no |
| 55 | startupitem.logevents yes |
| 56 | startupitem.logfile ${prefix}/var/log/ccnx-repo.log |