blob: 9da8efe0b302ab507869d0142bd4e1edd391a8a2 [file] [log] [blame]
Alexander Afanasyev0350ac82012-10-03 17:35:30 -07001# -*- 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
4PortSystem 1.0
5
6name ccnx-repo
7homepage http://www.ccnx.org/
8license GPL-2+ LGPL-2.1+
9version 0.6.2
10revision 0
11epoch 0
12distfiles
13
14categories net ccnx
15maintainers ucla.edu:alexander.afanasyev
16
17description Meta port for repo of ccnx package
18
19depends_lib-append port:ccnx
20
21set ccnxuser ccnx
22set ccnxgroup ccnx
23
24use_configure no
25
26build { }
27destroot {
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
32post-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
50startupitem.executable "${prefix}/bin/ccnr-wrapper"
51
52startupitem.create yes
53startupitem.name ${name}
54
55startupitem.netchange no
56startupitem.logevents yes
57startupitem.logfile ${prefix}/var/log/ccnx-repo.log