diff options
author | Willem Mulder | 2020-07-22 17:42:57 +0200 |
---|---|---|
committer | Willem Mulder | 2020-07-22 17:45:07 +0200 |
commit | 92ebdc5a61bba3602a58f617e6ae058c141be855 (patch) | |
tree | 3c1446111d5a7504d8d3b707704584f5e524285f | |
parent | d7ced5016344da22ab285d179477c88287317a82 (diff) | |
download | aur-92ebdc5a61bba3602a58f617e6ae058c141be855.tar.gz |
Rework package to modern standards
- Replace rc.d/conf.d with systemd service
- Use pkgver/prepare/build/package instead of only build
- Use proper package versioning
This commit also includes a patch to make mip6d compile against
OpenSSL >= 1.1
-rw-r--r-- | .SRCINFO | 27 | ||||
-rw-r--r-- | PKGBUILD | 73 | ||||
-rw-r--r-- | mip6d.confd | 5 | ||||
-rw-r--r-- | mip6d.init | 68 | ||||
-rw-r--r-- | mip6d.install | 4 | ||||
-rw-r--r-- | mip6d.service | 12 | ||||
-rw-r--r-- | openssl-1.1.patch | 59 |
7 files changed, 131 insertions, 117 deletions
@@ -1,22 +1,29 @@ pkgbase = mip6d-umip.org-git pkgdesc = UMIP userland with NEPL and MCoA patches for Mobile IPv6/NEMO operation with multihoming - pkgver = 20100219 + pkgver = 2.0.2.umip.0.4.r139.7d67209 pkgrel = 1 url = http://www.umip.org + install = mip6d.install arch = i686 arch = x86_64 - license = GPL - license = custom + license = GPL2 + makedepends = git makedepends = indent - depends = kernel26-mipl + depends = openssl optdepends = radvd: to act as a NEMO Mobile Router advertising a MNP on the mobile link + optdepends = strongswan: to secure communication between the HA and MN provides = mip6d - backup = etc/mip6d/mip6d.conf - backup = etc/conf.d/mip6d.conf - source = mip6d.init - source = mip6d.confd - md5sums = 6995ae716fc0f66040ee528c291f08df - md5sums = efbe23915c7dcf018ce70bcf72d18be7 + provides = mip6d-umip.org + conflicts = mip6d + conflicts = mip6d-umip.org + source = mip6d::git+https://github.com/jlanza/umip.git + source = mip6d.install + source = mip6d.service + source = openssl-1.1.patch + sha384sums = SKIP + sha384sums = 457e7f5730bdb938e538e97806741cba3a0db80a1172f0240c77ddb6e4053bbe0d64dc5921313487786e4667445c6d68 + sha384sums = dff32c8ebef69d7c44bd86ae081c24f5b48ed40113487438493e3e7da94a92a48ffa71d984ecc5b75334a3c9a56b44ec + sha384sums = c32ee86b68a9403aecc0c735867608d21c40060541768860e84f875e7ff007fb96ff842e5da2d9bbaf2309df1032102c pkgname = mip6d-umip.org-git @@ -1,52 +1,57 @@ +# Maintainer: Willem Mulder <14mRh4X0r@gmail.com> # Contributor: Olivier Mehani <shtrom-aur@ssji.net> +_pkgname=mip6d pkgname=mip6d-umip.org-git -_umipname=mipv6-daemon-umip -pkgver=20100219 +pkgver=2.0.2.umip.0.4.r139.7d67209 pkgrel=1 pkgdesc="UMIP userland with NEPL and MCoA patches for Mobile IPv6/NEMO operation with multihoming" arch=(i686 x86_64) url="http://www.umip.org" -license=('GPL' 'custom') -depends=('kernel26-mipl') -makedepends=(indent) -provides=(mip6d) -optdepends=('radvd: to act as a NEMO Mobile Router advertising a MNP on the mobile link') -backup=(etc/mip6d/mip6d.conf etc/conf.d/mip6d.conf) -source=(mip6d.init - mip6d.confd) -md5sums=('6995ae716fc0f66040ee528c291f08df' - 'efbe23915c7dcf018ce70bcf72d18be7') - -_gitroot="http://umip.org/git/umip.git/" -_gitname="umip" +license=('GPL2') +depends=(openssl) +optdepends=('radvd: to act as a NEMO Mobile Router advertising a MNP on the mobile link' + 'strongswan: to secure communication between the HA and MN') +makedepends=(git indent) +provides=(mip6d mip6d-umip.org) +conflicts=(mip6d mip6d-umip.org) +install=mip6d.install +source=(${_pkgname}::git+https://github.com/jlanza/umip.git + mip6d.install + mip6d.service + openssl-1.1.patch) +sha384sums=('SKIP' + '457e7f5730bdb938e538e97806741cba3a0db80a1172f0240c77ddb6e4053bbe0d64dc5921313487786e4667445c6d68' + 'dff32c8ebef69d7c44bd86ae081c24f5b48ed40113487438493e3e7da94a92a48ffa71d984ecc5b75334a3c9a56b44ec' + 'c32ee86b68a9403aecc0c735867608d21c40060541768860e84f875e7ff007fb96ff842e5da2d9bbaf2309df1032102c') + +pkgver() { + cd "$_pkgname" + printf "%s.r%s.%s" "$(sed -rn '/^AC_INIT/s/.*\[(.*)-umip-(.*)\].*/\1.umip.\2/p' configure.ac)" \ + "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} -build() { - cd "$srcdir" - msg "Connecting to GIT server...." +prepare() { + cd "$_pkgname" - if [ -d "${srcdir}/${_gitname}" ] ; then - cd ${_gitname} && git pull --rebase - else - git clone ${_gitroot} - cd ${_gitname} - fi + patch -p1 -i ../openssl-1.1.patch +} +build() { + cd "$_pkgname" + autoreconf --install + ./configure --prefix=/usr --sbindir=/usr/bin --enable-vt + make +} - autoreconf -i - ./configure --prefix=/usr --enable-vt - make CFLAGS=-DNULL=0 || return 1 +package() { + cd "$_pkgname" make DESTDIR="$pkgdir/" install for file in extras/example-*.conf; do - install -D -m 0644 $file $pkgdir/etc/mip6d/${file/extras\/example/mip6d} + install -D -m 0644 $file $pkgdir/usr/share/doc/$_pkgname/${file#extras/} done - install -m 0644 $pkgdir/etc/mip6d/mip6d-mn.conf $pkgdir/etc/mip6d/mip6d.conf - - install -D -m 0755 $srcdir/mip6d.init $pkgdir/etc/rc.d/mip6d - install -D -m 0644 $srcdir/mip6d.confd $pkgdir/etc/conf.d/mip6d.conf - install -d $pkgdir/usr/share/licenses/${pkgname} - install -m 0644 COPYING* licenses/*.txt $pkgdir/usr/share/licenses/${pkgname} + install -D -m 0644 $srcdir/mip6d.service $pkgdir/usr/lib/systemd/system/mip6d.service } # vim:set ts=2 sw=2 et: diff --git a/mip6d.confd b/mip6d.confd deleted file mode 100644 index 8b196908459c..000000000000 --- a/mip6d.confd +++ /dev/null @@ -1,5 +0,0 @@ -# If >0, mip6d doesn't detach from the terminal -DEBUG_LEVEL=0 - -# Default location of configuration file -MIP6D_ARGS="-c /etc/mip6d/mip6d.conf" diff --git a/mip6d.init b/mip6d.init deleted file mode 100644 index 7c62f6e55a8d..000000000000 --- a/mip6d.init +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash - -daemon_name=mip6d - -. /etc/rc.conf -. /etc/rc.d/functions -. /etc/conf.d/$daemon_name.conf - -get_pid() { - pidof -o %PPID $daemon_name -} - -case "$1" in - start) - stat_busy "Starting $daemon_name daemon" - - PID=$(get_pid) - if [ -z "$PID" ]; then - [ -f /var/run/$daemon_name.pid ] && rm -f /var/run/$daemon_name.pid - # RUN - $daemon_name -d $DEBUG_LEVEL $MIP6D_ARGS - # - if [ $? -gt 0 ]; then - stat_fail - exit 1 - else - echo $(get_pid) > /var/run/$daemon_name.pid - add_daemon $daemon_name - stat_done - fi - else - stat_fail - exit 1 - fi - ;; - - stop) - stat_busy "Stopping $daemon_name daemon" - PID=$(get_pid) - # KILL - [ ! -z "$PID" ] && kill $PID &> /dev/null - # - if [ $? -gt 0 ]; then - stat_fail - exit 1 - else - rm -f /var/run/$daemon_name.pid &> /dev/null - rm_daemon $daemon_name - stat_done - fi - ;; - - restart) - $0 stop - sleep 3 - $0 start - ;; - - status) - stat_busy "Checking $daemon_name status"; - ck_status $daemon_name - ;; - - *) - echo "usage: $0 {start|stop|restart|status}" -esac - -exit 0 diff --git a/mip6d.install b/mip6d.install new file mode 100644 index 000000000000..559b3c910ed0 --- /dev/null +++ b/mip6d.install @@ -0,0 +1,4 @@ +post_install() { + echo "You still need to create a configuration file for mip6d at /etc/mip6d.conf" + echo "Example configurations can be found in /usr/share/doc/mip6d." +} diff --git a/mip6d.service b/mip6d.service new file mode 100644 index 000000000000..037c7a13e489 --- /dev/null +++ b/mip6d.service @@ -0,0 +1,12 @@ +[Unit] +Description=MIPL Mobile IPv6 for Linux +Wants=ipsec.service +After=ipsec.service +AssertPathExists=/etc/mip6d.conf + +[Service] +Type=forking +ExecStart=/usr/bin/mip6d -c /etc/mip6d.conf + +[Install] +WantedBy=default.target diff --git a/openssl-1.1.patch b/openssl-1.1.patch new file mode 100644 index 000000000000..3319be7f870b --- /dev/null +++ b/openssl-1.1.patch @@ -0,0 +1,59 @@ +diff --git a/src/keygen.c b/src/keygen.c +index e434a38..83f04f2 100644 +--- a/src/keygen.c ++++ b/src/keygen.c +@@ -172,15 +172,14 @@ static void build_kgen_token(struct in6_addr *addr, uint8_t *nonce, + uint8_t tmp[20]; + #ifdef HAVE_LIBCRYPTO + unsigned int len = 20; +- HMAC_CTX ctx; +- +- HMAC_CTX_init(&ctx); +- HMAC_Init_ex(&ctx, key_cn, sizeof(key_cn), EVP_sha1(), NULL); +- HMAC_Update(&ctx, (unsigned char *)addr, sizeof(*addr)); +- HMAC_Update(&ctx, nonce, NONCE_LENGTH); +- HMAC_Update(&ctx, &id, sizeof(id)); +- HMAC_Final(&ctx, tmp, &len); +- HMAC_CTX_cleanup(&ctx); ++ HMAC_CTX *ctx = HMAC_CTX_new(); ++ ++ HMAC_Init_ex(ctx, key_cn, sizeof(key_cn), EVP_sha1(), NULL); ++ HMAC_Update(ctx, (unsigned char *)addr, sizeof(*addr)); ++ HMAC_Update(ctx, nonce, NONCE_LENGTH); ++ HMAC_Update(ctx, &id, sizeof(id)); ++ HMAC_Final(ctx, tmp, &len); ++ HMAC_CTX_free(ctx); + #else + HMAC_SHA1_CTX ctx; + +diff --git a/src/mh.c b/src/mh.c +index 60e345e..98f784a 100644 +--- a/src/mh.c ++++ b/src/mh.c +@@ -518,19 +518,18 @@ static int calculate_auth_data(const struct iovec *iov, int iovlen, + + #ifdef HAVE_LIBCRYPTO + unsigned int len = HMAC_SHA1_HASH_LEN; +- HMAC_CTX ctx; ++ HMAC_CTX *ctx = HMAC_CTX_new(); + const EVP_MD *evp_md = EVP_sha1(); + +- HMAC_CTX_init(&ctx); +- HMAC_Init_ex(&ctx, key, HMAC_SHA1_KEY_SIZE, evp_md, NULL); ++ HMAC_Init_ex(ctx, key, HMAC_SHA1_KEY_SIZE, evp_md, NULL); + +- HMAC_Update(&ctx, (uint8_t *)coa, sizeof(*coa)); +- HMAC_Update(&ctx, (uint8_t *)cn, sizeof(*coa)); ++ HMAC_Update(ctx, (uint8_t *)coa, sizeof(*coa)); ++ HMAC_Update(ctx, (uint8_t *)cn, sizeof(*coa)); + for (i = 0; i < iovlen; i++) { +- HMAC_Update(&ctx, (uint8_t *)iov[i].iov_base, iov[i].iov_len); ++ HMAC_Update(ctx, (uint8_t *)iov[i].iov_base, iov[i].iov_len); + } +- HMAC_Final(&ctx, buf, &len); +- HMAC_CTX_cleanup(&ctx); ++ HMAC_Final(ctx, buf, &len); ++ HMAC_CTX_free(ctx); + #else + HMAC_SHA1_CTX ctx; + |