summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb')
-rw-r--r--meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb136
1 files changed, 136 insertions, 0 deletions
diff --git a/meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb b/meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb
new file mode 100644
index 0000000000..92cd24c3ae
--- /dev/null
+++ b/meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb
@@ -0,0 +1,136 @@
1SUMMARY = "An open source implementation of the diameter protocol"
2DESCRIPTION = "\
3freeDiameter is an open source Diameter protocol implementation \
4(RFC3588). It provides an extensible platform for deploying a \
5Diameter network for your Authentication, Authorization and \
6Accounting needs."
7
8HOMEPAGE = "http://www.freediameter.net"
9
10DEPENDS = "flex bison cmake-native libgcrypt gnutls libidn lksctp-tools"
11
12fd_pkgname = "freeDiameter"
13
14SRC_URI = "\
15 http://www.freediameter.net/hg/${fd_pkgname}/archive/${PV}.tar.gz;downloadfilename=${fd_pkgname}-${PV}.tar.gz \
16 file://Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch \
17 file://freediameter.service \
18 file://freediameter.init \
19 ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'file://install_test.patch file://run-ptest file://pass-ptest-env.patch', '', d)} \
20 file://freeDiameter.conf \
21 "
22
23SRC_URI[md5sum] = "61b1062aa144b5f12eed514611e6d697"
24SRC_URI[sha256sum] = "bd7f105542e9903e776aa006c6931c1f5d3d477cb59af33a9162422efa477097"
25
26S = "${WORKDIR}/${fd_pkgname}-${PV}"
27
28LICENSE = "BSD"
29LIC_FILES_CHKSUM = "file://LICENSE;md5=892b2ed6ae815488a08416ff7ee74a35"
30
31PTEST_PATH = "${libdir}/${fd_pkgname}/ptest"
32
33inherit cmake pkgconfig update-rc.d ptest systemd
34
35EXTRA_OECMAKE = " \
36 -DDEFAULT_CONF_PATH:PATH=${sysconfdir}/${fd_pkgname} \
37 -DBUILD_DBG_MONITOR:BOOL=ON \
38 -DBUILD_TEST_APP:BOOL=ON \
39 -DBUILD_TESTING:BOOL=ON \
40 -DBUILD_APP_RADGW:BOOL=ON \
41 -DBUILD_APP_REDIRECT:BOOL=ON \
42 -DBUILD_TEST_ACCT:BOOL=ON \
43 -DBUILD_TEST_NETEMUL:BOOL=ON \
44 -DBUILD_TEST_RT_ANY:BOOL=ON \
45 -DINSTALL_LIBRARY_SUFFIX:PATH=${baselib} \
46 -DINSTALL_EXTENSIONS_SUFFIX:PATH=${baselib}/${fd_pkgname} \
47 -DINSTALL_TEST_SUFFIX:PATH=${PTEST_PATH}-tests \
48 -DCMAKE_SKIP_RPATH:BOOL=ON \
49"
50# INSTALL_LIBRARY_SUFFIX is relative to CMAKE_INSTALL_PREFIX
51# specify it on cmd line will fix the SET bug in CMakeList.txt
52
53# -DBUILD_APP_ACCT:BOOL=ON This needs POSTGRESQL support
54
55# -DBUILD_APP_DIAMEAP:BOOL=ON -DBUILD_APP_SIP:BOOL=ON -DBUILD_TEST_SIP:BOOL=ON
56# These need MySQL support
57
58# -DBUILD_DBG_INTERACTIVE:BOOL=ON This needs SWIG support
59
60# -DALL_EXTENSIONS=ON will enable all
61
62FD_KEY ?="${BPN}.key"
63FD_PEM ?= "${BPN}.pem"
64FD_CA ?= "${BPN}.pem"
65FD_DH_PEM ?= "${BPN}-dh.pem"
66FD_HOSTNAME ?= "${MACHINE}"
67FD_REALM ?= "openembedded.org"
68
69do_install_append() {
70 # install the sample configuration files
71 install -d -m 0755 ${D}${sysconfdir}/${fd_pkgname}
72 for i in ${S}/doc/*.conf.sample; do
73 install -m 0644 $i ${D}${sysconfdir}/${fd_pkgname}/
74 done
75 mv ${D}${sysconfdir}/${fd_pkgname}/freediameter.conf.sample \
76 ${D}${sysconfdir}/${fd_pkgname}/freeDiameter.conf.sample
77 install -d ${D}${sysconfdir}/freeDiameter
78 install ${WORKDIR}/freeDiameter.conf ${D}${sysconfdir}/${fd_pkgname}/freeDiameter.conf
79
80 # install daemon init related files
81 install -d -m 0755 ${D}${sysconfdir}/default
82 install -d -m 0755 ${D}${sysconfdir}/init.d
83 install -m 0644 ${S}/contrib/debian/freediameter-daemon.default \
84 ${D}${sysconfdir}/default/${BPN}
85 install -m 0755 ${WORKDIR}/freediameter.init ${D}${sysconfdir}/init.d/${BPN}
86
87 # install for systemd
88 install -d ${D}${systemd_system_unitdir}
89 install -m 0644 ${WORKDIR}/freediameter.service ${D}${systemd_system_unitdir}
90 sed -i -e 's,@BINDIR@,${bindir},g' ${D}${systemd_system_unitdir}/*.service
91
92 cat >> ${D}${sysconfdir}/freeDiameter/freeDiameter.conf <<EOF
93## OE specific ##
94#Identity="${FD_HOSTNAME}";
95Identity = "${FD_HOSTNAME}.${FD_REALM}";
96Realm = "${FD_REALM}";
97Port = 30868;
98SecPort = 30869;
99TLS_Cred = "/etc/freeDiameter/${FD_PEM}" , "/etc/freeDiameter/${FD_KEY}";
100TLS_CA = "/etc/freeDiameter/${FD_CA}";
101TLS_DH_File = "/etc/freeDiameter/${FD_DH_PEM}";
102EOF
103
104 # create self cert
105 openssl req -x509 -config ${STAGING_DIR_NATIVE}/etc/ssl/openssl.cnf -newkey rsa:4096 -sha256 -nodes -out ${D}${sysconfdir}/freeDiameter/${FD_PEM} -keyout ${D}${sysconfdir}/freeDiameter/${FD_KEY} -days 3650 -subj '/CN=${FD_HOSTNAME}.${FD_REALM}'
106 openssl dhparam -out ${D}${sysconfdir}/freeDiameter/${FD_DH_PEM} 1024
107
108}
109
110do_install_ptest() {
111 sed -i "s#\(EXTENSIONS_DIR=\).*\$#\1${libdir}/${fd_pkgname}/#" ${D}${PTEST_PATH}/run-ptest
112 mv ${D}${PTEST_PATH}-tests/* ${D}${PTEST_PATH}/
113 rmdir ${D}${PTEST_PATH}-tests
114 install -m 0644 ${B}/tests/CTestTestfile.cmake ${D}${PTEST_PATH}/
115}
116
117FILES_${PN}-dbg += "${libdir}/${fd_pkgname}/.debug/*"
118
119# include the extensions in main package
120FILES_${PN} += "${libdir}/${fd_pkgname}/*"
121
122RDEPENDS_${PN} = "glib-2.0 gnutls libidn"
123RDEPENDS_${PN} += "openssl openssl-conf openssl-engines"
124RDEPENDS_${PN} += "kernel-module-tipc kernel-module-sctp"
125RDEPENDS_${PN} += "kernel-module-udp-tunnel kernel-module-ipip"
126RDEPENDS_${PN}-ptest = "cmake"
127
128INITSCRIPT_PACKAGES = "${PN}"
129INITSCRIPT_NAME_${PN} = "${BPN}"
130INITSCRIPT_PARAMS$_${PN} = "start 30 . stop 70 0 1 2 3 4 5 6 ."
131
132SYSTEMD_SERVICE_${PN} = "freediameter.service"
133SYSTEMD_AUTO_ENABLE = "disable"
134
135CONFFILES_${PN} = "${sysconfdir}/freediameter.conf"
136