blob: 7154f7650014b3c432ac0df523991b05b8f916c7 [file] [log] [blame]
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -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
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -07004PortSystem 1.0
Alexander Afanasyevd600ea92012-09-24 13:39:43 -07005PortGroup github 1.0
Alexander Afanasyevb41f8502013-02-14 14:02:57 -08006
Alexander Afanasyev9e3a1642013-02-24 10:57:53 -08007github.setup named-data ccnx ccnx-0.7.1-ucla-1
8checksums rmd160 0835f02b8ff649bc3b435b3f03c4c747566bd34a \
9 sha256 1c2ee8a065fd162881a20a359c00f2b4a7185c1e69d2b3f1b5815c623b7ab62b
Alexander Afanasyevd600ea92012-09-24 13:39:43 -070010
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070011name ccnx
12homepage http://www.ccnx.org/
13license GPL-2+ LGPL-2.1+
Alexander Afanasyev73e6dcc2013-02-19 15:58:49 -080014version 0.7.1.ucla.1
Alexander Afanasyev8e850282012-08-23 10:04:58 -070015
Alexander Afanasyevdcb61ae2013-02-18 09:22:45 -080016categories net
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070017platforms darwin
18maintainers ucla.edu:alexander.afanasyev
Alexander Afanasyevb41f8502013-02-14 14:02:57 -080019
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070020description ProjectCCNx implementation of Content Centric Networking (CCN) / \
21 Named Data Networking (NDN) architecture
Alexander Afanasyevb41f8502013-02-14 14:02:57 -080022
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070023long_description Project CCNx(r) exists to develop, promote, and evaluate a new \
24 approach to communication architecture we call content-centric \
25 networking. We seek to carry out this mission by creating and \
26 publishing open protocol specifications and an open source \
27 software reference implementation of those protocols. We provide \
28 support for a community of people interested in experimentation, \
29 research, and building applications with this technology, all \
Alexander Afanasyevb41f8502013-02-14 14:02:57 -080030 contributing to its evolution.
31
Alexander Afanasyevd600ea92012-09-24 13:39:43 -070032use_parallel_build no
Alexander Afanasyevb41f8502013-02-14 14:02:57 -080033
Alexander Afanasyev9291faa2012-08-27 15:00:11 -070034depends_lib-append port:openssl \
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070035 port:expat \
36 port:libpcap \
Alexander Afanasyevd600ea92012-09-24 13:39:43 -070037 port:libxml2 \
38 port:asciidoc
Alexander Afanasyevb41f8502013-02-14 14:02:57 -080039
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070040set ccnxuser ccnx
41set ccnxgroup ccnx
42set ccnxdir ${prefix}/etc/ccnx
Alexander Afanasyevb41f8502013-02-14 14:02:57 -080043
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070044add_users ${ccnxuser} shell=/bin/sh group=${ccnxgroup} \
45 home=${ccnxdir} \
46 realname=CCNx\ Account
Alexander Afanasyevb41f8502013-02-14 14:02:57 -080047
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070048default_variants +java +apps
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070049
50variant java description {Enable Java API build} {
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070051 configure.env-delete BUILD_JAVA=false
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070052}
53
54variant apps requires java description {Enable build of reference applications} {
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070055 configure.env-delete BUILD_APPS=false
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070056}
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -070057
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070058post-patch {
Alexander Afanasyevdb1e1b72013-02-19 15:44:33 -080059 reinplace "s|\$HOME/.ccnx/|${ccnxdir}/|g" ${worksrcpath}/csrc/util/ccndstart.sh
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -070060}
61
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070062configure.env-append OPENSSL_CFLAGS=-I${prefix}/include \
63 OPENSSL_LIBS=-L${prefix}/lib \
64 INSTALL_BASE=${prefix} \
65 BUILD_JAVA=false \
66 BUILD_APPS=false \
67
Alexander Afanasyevdf59d202013-02-19 16:02:42 -080068configure.cflags -DCCNX_DIR=\\\"${ccnxdir}\\\" \
69 -O2
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070070
71build.env-append OPENSSL_CFLAGS=-I${prefix}/include \
72 OPENSSL_LIBS=-L${prefix}/lib \
Alexander Afanasyevd600ea92012-09-24 13:39:43 -070073 INSTALL_BASE=${prefix} \
Alexander Afanasyevb41f8502013-02-14 14:02:57 -080074
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070075
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070076post-destroot {
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070077 # Create a configuration directory, which also a home directory for ${ccnxuser}
Alexander Afanasyevdb1e1b72013-02-19 15:44:33 -080078 xinstall -d -o ${ccnxuser} -g ${ccnxgroup} "${destroot}${ccnxdir}"
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070079
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070080 # Copy a sample ccnd.conf file
Alexander Afanasyevc7660be2012-08-27 15:13:36 -070081 xinstall -o ${ccnxuser} -g ${ccnxgroup} \
82 ${worksrcpath}/csrc/libexec/ccnd.conf.sample \
Alexander Afanasyevdb1e1b72013-02-19 15:44:33 -080083 ${destroot}${ccnxdir}/
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070084
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070085 # Create a sample ccndrc file
Alexander Afanasyevdb1e1b72013-02-19 15:44:33 -080086 system "echo CCNR_GLOBAL_PREFIX=/ndn/keys > \"${destroot}${ccnxdir}/ccndrc.sample\""
87 system "echo CCND_LOG=${prefix}/var/log/ccnd.log >> \"${destroot}${ccnxdir}/ccndrc.sample\""
88 system "echo CCND_DEBUG=16 >> \"${destroot}${ccnxdir}/ccndrc.sample\""
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070089}
90
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070091post-activate {
92 # log file needs to be owned by ${ccnxuser}, otherwise ccnd will not be able to write to it
Alexander Afanasyevd600ea92012-09-24 13:39:43 -070093 file mkdir "${prefix}/var/log"
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070094 touch "${prefix}/var/log/ccnd.log"
95 file attributes "${prefix}/var/log/ccnd.log" -owner ${ccnxuser} -group ${ccnxgroup}
Alexander Afanasyevdc05deb2013-02-19 18:05:24 -080096 file mkdir "${prefix}/var/run/ccnd"
97 file attributes "${prefix}/var/run/ccnd" -owner ${ccnxuser} -group ${ccnxgroup}
Alexander Afanasyevc7660be2012-08-27 15:13:36 -070098
99 # Make sure initial conf files are present and setup correctly
100 foreach f { ccnd.conf ccndrc } {
Alexander Afanasyevdb1e1b72013-02-19 15:44:33 -0800101 if {![file exists ${ccnxdir}/${f}]} {
102 file copy ${ccnxdir}/${f}.sample \
103 ${ccnxdir}/${f}
Alexander Afanasyevc7660be2012-08-27 15:13:36 -0700104 }
105 }
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -0700106}
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700107
108startupitem.pidfile none
Alexander Afanasyevdc05deb2013-02-19 18:05:24 -0800109startupitem.start "su ${ccnxuser} -c \"${prefix}/bin/ccndstart\" && sleep 5 && su ${ccnxuser} -c \"${prefix}/bin/ccnd-autoconfig -d ${prefix}/var/run/ccnd/autoconfig.pid &\""
110startupitem.stop "su ${ccnxuser} -c \"kill `cat ${prefix}/var/run/ccnd/autoconfig.pid`\" ; su ${ccnxuser} -c \"${prefix}/bin/ccndstop\""
Alexander Afanasyevdb1e1b72013-02-19 15:44:33 -0800111startupitem.restart "su ${ccnxuser} -c \"${prefix}/bin/ccndc -f ${ccnxdir}/ccnd.conf\" && su ${ccnxuser} -c \"${prefix}/bin/ccnd-autoconfig\""
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700112
Alexander Afanasyevdb1e1b72013-02-19 15:44:33 -0800113variant no_autoconf description {Disable automatic detection of local ccnx hub} {
Alexander Afanasyev186dd3a2012-10-03 18:09:36 -0700114 startupitem.start "su ${ccnxuser} -c \"${prefix}/bin/ccndstart\""
Alexander Afanasyevdb1e1b72013-02-19 15:44:33 -0800115 startupitem.restart "su ${ccnxuser} -c \"${prefix}/bin/ccndc -f ${ccnxdir}/ccnd.conf\""
Alexander Afanasyev186dd3a2012-10-03 18:09:36 -0700116}
117
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700118startupitem.create yes
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -0700119startupitem.name ${name}
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700120
121startupitem.netchange yes
122startupitem.logevents yes
123startupitem.logfile ${prefix}/var/log/ccnx.log
124
125notes "
Alexander Afanasyev22bc0ad2012-12-08 22:44:21 -0800126If you want to run repo, please install and load a separate ccnx-repo package:
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700127
Alexander Afanasyev22bc0ad2012-12-08 22:44:21 -0800128 # port install ccnx-repo
129 # port load ccnx-repo
Alexander Afanasyeveae69362012-08-27 09:49:56 -0700130
Alexander Afanasyevdb1e1b72013-02-19 15:44:33 -0800131You can add the following line into \"${ccnxdir}/ccndrc\" in order to automatically
Alexander Afanasyevb41f8502013-02-14 14:02:57 -0800132start ccnx repo for the /ndn/keys prefix:
133
134 CCNR_GLOBAL_PREFIX=/ndn/keys
135
136For more information and documentation, refer to man pages and
Alexander Afanasyeveae69362012-08-27 09:49:56 -0700137http://www.ccnx.org website.
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700138"