blob: 44f2d6991ad8cea332a163aa051e372506c2b87a [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+
Alexander Afanasyev5fe1e742013-01-07 12:27:09 -08009version 0.7.0
Alexander Afanasyev0350ac82012-10-03 17:35:30 -070010distfiles
11
12categories net ccnx
13maintainers ucla.edu:alexander.afanasyev
14
15description Meta port for repo of ccnx package
16
17depends_lib-append port:ccnx
18
19set ccnxuser ccnx
20set ccnxgroup ccnx
21
Alexander Afanasyev5fe1e742013-01-07 12:27:09 -080022supported_archs noarch
23use_configure no
Alexander Afanasyev0350ac82012-10-03 17:35:30 -070024
25build { }
26destroot {
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
31post-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
49startupitem.executable "${prefix}/bin/ccnr-wrapper"
50
51startupitem.create yes
52startupitem.name ${name}
53
54startupitem.netchange no
55startupitem.logevents yes
56startupitem.logfile ${prefix}/var/log/ccnx-repo.log