Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 1 | DESCRIPTION = "strongSwan is an OpenSource IPsec implementation for the \ |
| 2 | Linux operating system." |
| 3 | SUMMARY = "strongSwan is an OpenSource IPsec implementation" |
| 4 | HOMEPAGE = "http://www.strongswan.org" |
| 5 | SECTION = "net" |
| 6 | LICENSE = "GPLv2" |
| 7 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" |
| 8 | DEPENDS = "gmp openssl flex-native flex bison-native" |
| 9 | |
| 10 | SRC_URI = "http://download.strongswan.org/strongswan-${PV}.tar.bz2 \ |
| 11 | file://fix-funtion-parameter.patch \ |
| 12 | file://0001-memory.h-Include-stdint.h-for-uintptr_t.patch \ |
| 13 | " |
| 14 | |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame^] | 15 | SRC_URI[md5sum] = "5a6b9980cd1ac4fad3c24b55ed960ac9" |
| 16 | SRC_URI[sha256sum] = "d9af70acea5c054952ad1584916c1bf231b064eb6c8a9791dcb6ae90a769990c" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 17 | |
| 18 | UPSTREAM_CHECK_REGEX = "strongswan-(?P<pver>\d+(\.\d+)+)\.tar" |
| 19 | |
| 20 | EXTRA_OECONF = " \ |
| 21 | --without-lib-prefix \ |
| 22 | " |
| 23 | |
| 24 | EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/', '--without-systemdsystemunitdir', d)}" |
| 25 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 26 | PACKAGECONFIG ??= "charon curl gmp openssl stroke sqlite3 \ |
| 27 | ${@bb.utils.filter('DISTRO_FEATURES', 'ldap', d)} \ |
| 28 | " |
| 29 | PACKAGECONFIG[aesni] = "--enable-aesni,--disable-aesni,,${PN}-plugin-aesni" |
| 30 | PACKAGECONFIG[charon] = "--enable-charon,--disable-charon," |
| 31 | PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl,${PN}-plugin-curl" |
| 32 | PACKAGECONFIG[gmp] = "--enable-gmp,--disable-gmp,gmp,${PN}-plugin-gmp" |
| 33 | PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap,openldap,${PN}-plugin-ldap" |
| 34 | PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5,${PN}-plugin-mysql" |
| 35 | PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl,${PN}-plugin-openssl" |
| 36 | PACKAGECONFIG[scep] = "--enable-scepclient,--disable-scepclient," |
| 37 | PACKAGECONFIG[soup] = "--enable-soup,--disable-soup,libsoup-2.4,${PN}-plugin-soup" |
| 38 | PACKAGECONFIG[sqlite3] = "--enable-sqlite,--disable-sqlite,sqlite3,${PN}-plugin-sqlite" |
| 39 | PACKAGECONFIG[stroke] = "--enable-stroke,--disable-stroke,,${PN}-plugin-stroke" |
| 40 | PACKAGECONFIG[swanctl] = "--enable-swanctl,--disable-swanctl,,libgcc" |
| 41 | |
| 42 | # requires swanctl |
| 43 | PACKAGECONFIG[systemd-charon] = "--enable-systemd,--disable-systemd,systemd," |
| 44 | |
| 45 | inherit autotools systemd pkgconfig |
| 46 | |
| 47 | RRECOMMENDS_${PN} = "kernel-module-ipsec" |
| 48 | |
| 49 | FILES_${PN} += "${libdir}/ipsec/lib*${SOLIBS}" |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 50 | FILES_${PN}-dbg += "${bindir}/.debug ${sbindir}/.debug ${libdir}/ipsec/.debug ${libexecdir}/ipsec/.debug" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 51 | FILES_${PN}-dev += "${libdir}/ipsec/lib*${SOLIBSDEV} ${libdir}/ipsec/*.la" |
| 52 | FILES_${PN}-staticdev += "${libdir}/ipsec/*.a" |
| 53 | |
| 54 | CONFFILES_${PN} = "${sysconfdir}/*.conf ${sysconfdir}/ipsec.d/*.conf ${sysconfdir}/strongswan.d/*.conf" |
| 55 | |
| 56 | PACKAGES += "${PN}-plugins" |
| 57 | ALLOW_EMPTY_${PN}-plugins = "1" |
| 58 | |
| 59 | PACKAGES_DYNAMIC += "^${PN}-plugin-.*$" |
| 60 | NOAUTOPACKAGEDEBUG = "1" |
| 61 | |
| 62 | python split_strongswan_plugins () { |
| 63 | sysconfdir = d.expand('${sysconfdir}/strongswan.d/charon') |
| 64 | libdir = d.expand('${libdir}/ipsec/plugins') |
| 65 | dbglibdir = os.path.join(libdir, '.debug') |
| 66 | |
| 67 | def add_plugin_conf(f, pkg, file_regex, output_pattern, modulename): |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 68 | dvar = d.getVar('PKGD') |
| 69 | oldfiles = d.getVar('CONFFILES_' + pkg) |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 70 | newfile = '/' + os.path.relpath(f, dvar) |
| 71 | |
| 72 | if not oldfiles: |
| 73 | d.setVar('CONFFILES_' + pkg, newfile) |
| 74 | else: |
| 75 | d.setVar('CONFFILES_' + pkg, oldfiles + " " + newfile) |
| 76 | |
| 77 | split_packages = do_split_packages(d, libdir, 'libstrongswan-(.*)\.so', '${PN}-plugin-%s', 'strongSwan %s plugin', prepend=True) |
| 78 | do_split_packages(d, sysconfdir, '(.*)\.conf', '${PN}-plugin-%s', 'strongSwan %s plugin', prepend=True, hook=add_plugin_conf) |
| 79 | |
| 80 | split_dbg_packages = do_split_packages(d, dbglibdir, 'libstrongswan-(.*)\.so', '${PN}-plugin-%s-dbg', 'strongSwan %s plugin - Debugging files', prepend=True, extra_depends='${PN}-dbg') |
| 81 | split_dev_packages = do_split_packages(d, libdir, 'libstrongswan-(.*)\.la', '${PN}-plugin-%s-dev', 'strongSwan %s plugin - Development files', prepend=True, extra_depends='${PN}-dev') |
| 82 | split_staticdev_packages = do_split_packages(d, libdir, 'libstrongswan-(.*)\.a', '${PN}-plugin-%s-staticdev', 'strongSwan %s plugin - Development files (Static Libraries)', prepend=True, extra_depends='${PN}-staticdev') |
| 83 | |
| 84 | if split_packages: |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 85 | pn = d.getVar('PN') |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 86 | d.setVar('RRECOMMENDS_' + pn + '-plugins', ' '.join(split_packages)) |
| 87 | d.appendVar('RRECOMMENDS_' + pn + '-dbg', ' ' + ' '.join(split_dbg_packages)) |
| 88 | d.appendVar('RRECOMMENDS_' + pn + '-dev', ' ' + ' '.join(split_dev_packages)) |
| 89 | d.appendVar('RRECOMMENDS_' + pn + '-staticdev', ' ' + ' '.join(split_staticdev_packages)) |
| 90 | } |
| 91 | |
| 92 | PACKAGESPLITFUNCS_prepend = "split_strongswan_plugins " |
| 93 | |
| 94 | # Install some default plugins based on default strongSwan ./configure options |
| 95 | # See https://wiki.strongswan.org/projects/strongswan/wiki/Pluginlist |
| 96 | RDEPENDS_${PN} += "\ |
| 97 | ${PN}-plugin-aes \ |
| 98 | ${PN}-plugin-attr \ |
| 99 | ${PN}-plugin-cmac \ |
| 100 | ${PN}-plugin-constraints \ |
| 101 | ${PN}-plugin-des \ |
| 102 | ${PN}-plugin-dnskey \ |
| 103 | ${PN}-plugin-hmac \ |
| 104 | ${PN}-plugin-kernel-netlink \ |
| 105 | ${PN}-plugin-md5 \ |
| 106 | ${PN}-plugin-nonce \ |
| 107 | ${PN}-plugin-pem \ |
| 108 | ${PN}-plugin-pgp \ |
| 109 | ${PN}-plugin-pkcs1 \ |
| 110 | ${PN}-plugin-pkcs7 \ |
| 111 | ${PN}-plugin-pkcs8 \ |
| 112 | ${PN}-plugin-pkcs12 \ |
| 113 | ${PN}-plugin-pubkey \ |
| 114 | ${PN}-plugin-random \ |
| 115 | ${PN}-plugin-rc2 \ |
| 116 | ${PN}-plugin-resolve \ |
| 117 | ${PN}-plugin-revocation \ |
| 118 | ${PN}-plugin-sha1 \ |
| 119 | ${PN}-plugin-sha2 \ |
| 120 | ${PN}-plugin-socket-default \ |
| 121 | ${PN}-plugin-sshkey \ |
| 122 | ${PN}-plugin-updown \ |
| 123 | ${PN}-plugin-vici \ |
| 124 | ${PN}-plugin-x509 \ |
| 125 | ${PN}-plugin-xauth-generic \ |
| 126 | ${PN}-plugin-xcbc \ |
| 127 | ${PN}-plugin-curve25519 \ |
| 128 | " |
| 129 | |
| 130 | RPROVIDES_${PN} += "${PN}-systemd" |
| 131 | RREPLACES_${PN} += "${PN}-systemd" |
| 132 | RCONFLICTS_${PN} += "${PN}-systemd" |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 133 | SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'swanctl', '${BPN}.service', '', d)} ${BPN}-starter.service" |