blob: 985fcf89c438838fb2fd8c823e07fd2192490f63 [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 Afanasyev73e6dcc2013-02-19 15:58:49 -08007github.setup cawka ccnx ccnx-0.7.1-ucla-1
Alexander Afanasyevb41f8502013-02-14 14:02:57 -08008checksums rmd160 432b7b94ed786e02e97bc66a719ab0ad833c53c0 \
9 sha256 ee351efd2ac2200d5a03b16c342b1450c287af681b4f861f4b57dae2c6f2ed98
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 Afanasyevdb1e1b72013-02-19 15:44:33 -080068configure.cflags -DCCNX_DIR=\\\"${ccnxdir}\\\"
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070069
70build.env-append OPENSSL_CFLAGS=-I${prefix}/include \
71 OPENSSL_LIBS=-L${prefix}/lib \
Alexander Afanasyevd600ea92012-09-24 13:39:43 -070072 INSTALL_BASE=${prefix} \
Alexander Afanasyevb41f8502013-02-14 14:02:57 -080073
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070074
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070075post-destroot {
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070076 # Create a configuration directory, which also a home directory for ${ccnxuser}
Alexander Afanasyevdb1e1b72013-02-19 15:44:33 -080077 xinstall -d -o ${ccnxuser} -g ${ccnxgroup} "${destroot}${ccnxdir}"
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070078
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070079 # Copy a sample ccnd.conf file
Alexander Afanasyevc7660be2012-08-27 15:13:36 -070080 xinstall -o ${ccnxuser} -g ${ccnxgroup} \
81 ${worksrcpath}/csrc/libexec/ccnd.conf.sample \
Alexander Afanasyevdb1e1b72013-02-19 15:44:33 -080082 ${destroot}${ccnxdir}/
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070083
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070084 # Create a sample ccndrc file
Alexander Afanasyevdb1e1b72013-02-19 15:44:33 -080085 system "echo CCNR_GLOBAL_PREFIX=/ndn/keys > \"${destroot}${ccnxdir}/ccndrc.sample\""
86 system "echo CCND_LOG=${prefix}/var/log/ccnd.log >> \"${destroot}${ccnxdir}/ccndrc.sample\""
87 system "echo CCND_DEBUG=16 >> \"${destroot}${ccnxdir}/ccndrc.sample\""
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -070088}
89
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070090post-activate {
91 # 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 -070092 file mkdir "${prefix}/var/log"
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -070093 touch "${prefix}/var/log/ccnd.log"
94 file attributes "${prefix}/var/log/ccnd.log" -owner ${ccnxuser} -group ${ccnxgroup}
Alexander Afanasyevc7660be2012-08-27 15:13:36 -070095
96 # Make sure initial conf files are present and setup correctly
97 foreach f { ccnd.conf ccndrc } {
Alexander Afanasyevdb1e1b72013-02-19 15:44:33 -080098 if {![file exists ${ccnxdir}/${f}]} {
99 file copy ${ccnxdir}/${f}.sample \
100 ${ccnxdir}/${f}
Alexander Afanasyevc7660be2012-08-27 15:13:36 -0700101 }
102 }
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -0700103}
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700104
105startupitem.pidfile none
Alexander Afanasyevdb1e1b72013-02-19 15:44:33 -0800106startupitem.start "su ${ccnxuser} -c \"${prefix}/bin/ccndstart\" && sleep 5 && \"${prefix}/bin/ccnd-autoconfig\""
Alexander Afanasyevc1ec69f2012-08-24 18:10:09 -0700107startupitem.stop "su ${ccnxuser} -c \"${prefix}/bin/ccndstop\""
Alexander Afanasyevdb1e1b72013-02-19 15:44:33 -0800108startupitem.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 -0700109
Alexander Afanasyevdb1e1b72013-02-19 15:44:33 -0800110variant no_autoconf description {Disable automatic detection of local ccnx hub} {
Alexander Afanasyev186dd3a2012-10-03 18:09:36 -0700111 startupitem.start "su ${ccnxuser} -c \"${prefix}/bin/ccndstart\""
Alexander Afanasyevdb1e1b72013-02-19 15:44:33 -0800112 startupitem.restart "su ${ccnxuser} -c \"${prefix}/bin/ccndc -f ${ccnxdir}/ccnd.conf\""
Alexander Afanasyev186dd3a2012-10-03 18:09:36 -0700113}
114
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700115startupitem.create yes
Alexander Afanasyevd9b5aad2012-08-27 14:16:37 -0700116startupitem.name ${name}
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700117
118startupitem.netchange yes
119startupitem.logevents yes
120startupitem.logfile ${prefix}/var/log/ccnx.log
121
122notes "
Alexander Afanasyev22bc0ad2012-12-08 22:44:21 -0800123If you want to run repo, please install and load a separate ccnx-repo package:
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700124
Alexander Afanasyev22bc0ad2012-12-08 22:44:21 -0800125 # port install ccnx-repo
126 # port load ccnx-repo
Alexander Afanasyeveae69362012-08-27 09:49:56 -0700127
Alexander Afanasyevdb1e1b72013-02-19 15:44:33 -0800128You can add the following line into \"${ccnxdir}/ccndrc\" in order to automatically
Alexander Afanasyevb41f8502013-02-14 14:02:57 -0800129start ccnx repo for the /ndn/keys prefix:
130
131 CCNR_GLOBAL_PREFIX=/ndn/keys
132
133For more information and documentation, refer to man pages and
Alexander Afanasyeveae69362012-08-27 09:49:56 -0700134http://www.ccnx.org website.
Alexander Afanasyev9944ebc2012-08-20 18:40:12 -0700135"