[arch-commits] Commit in pacredir/repos (4 files)
Felix Yan
felixonmars at archlinux.org
Tue Jul 7 17:57:07 UTC 2020
Date: Tuesday, July 7, 2020 @ 17:57:07
Author: felixonmars
Revision: 659921
archrelease: copy trunk to community-staging-x86_64
Added:
pacredir/repos/community-staging-x86_64/
pacredir/repos/community-staging-x86_64/0001-fix-build-with-libmicrohttpd-0.9.71.patch
(from rev 659918, pacredir/trunk/0001-fix-build-with-libmicrohttpd-0.9.71.patch)
pacredir/repos/community-staging-x86_64/PKGBUILD
(from rev 659918, pacredir/trunk/PKGBUILD)
pacredir/repos/community-staging-x86_64/pacredir.install
(from rev 659919, pacredir/trunk/pacredir.install)
------------------------------------------------+
0001-fix-build-with-libmicrohttpd-0.9.71.patch | 51 +++++++++++++++++++++++
PKGBUILD | 39 +++++++++++++++++
pacredir.install | 24 ++++++++++
3 files changed, 114 insertions(+)
Copied: pacredir/repos/community-staging-x86_64/0001-fix-build-with-libmicrohttpd-0.9.71.patch (from rev 659918, pacredir/trunk/0001-fix-build-with-libmicrohttpd-0.9.71.patch)
===================================================================
--- community-staging-x86_64/0001-fix-build-with-libmicrohttpd-0.9.71.patch (rev 0)
+++ community-staging-x86_64/0001-fix-build-with-libmicrohttpd-0.9.71.patch 2020-07-07 17:57:07 UTC (rev 659921)
@@ -0,0 +1,51 @@
+From f5482d8c6463c310a2b1bbab3ab3776155e16f93 Mon Sep 17 00:00:00 2001
+From: Christian Hesse <mail at eworm.de>
+Date: Tue, 7 Jul 2020 11:29:36 +0200
+Subject: [PATCH 1/1] fix build with libmicrohttpd 0.9.71
+
+Signed-off-by: Christian Hesse <mail at eworm.de>
+---
+ pacredir.c | 2 +-
+ pacredir.h | 9 ++++++++-
+ 2 files changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/pacredir.c b/pacredir.c
+index 1f16804..2fa806f 100644
+--- a/pacredir.c
++++ b/pacredir.c
+@@ -343,7 +343,7 @@ static void * get_http_code(void * data) {
+
+ /*** ahc_echo ***
+ * called whenever a http request is received */
+-static int ahc_echo(void * cls,
++static mhd_result ahc_echo(void * cls,
+ struct MHD_Connection * connection,
+ const char * uri,
+ const char * method,
+diff --git a/pacredir.h b/pacredir.h
+index d165ee8..a38eb9f 100644
+--- a/pacredir.h
++++ b/pacredir.h
+@@ -44,6 +44,13 @@
+
+ #define PROGNAME "pacredir"
+
++/* libmicrohttpd compat */
++#if MHD_VERSION >= 0x00097002
++# define mhd_result enum MHD_Result
++#else
++# define mhd_result int
++#endif
++
+ /* hosts */
+ struct hosts {
+ /* host name */
+@@ -130,7 +137,7 @@ static void client_callback(AvahiClient *c,
+ /* get_http_code */
+ static void * get_http_code(void * data);
+ /* ahc_echo */
+-static int ahc_echo(void * cls,
++static mhd_result ahc_echo(void * cls,
+ struct MHD_Connection * connection,
+ const char * uri,
+ const char * method,
Copied: pacredir/repos/community-staging-x86_64/PKGBUILD (from rev 659918, pacredir/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD (rev 0)
+++ community-staging-x86_64/PKGBUILD 2020-07-07 17:57:07 UTC (rev 659921)
@@ -0,0 +1,39 @@
+# Maintainer: Christian Hesse <mail at eworm.de>
+
+pkgname=pacredir
+pkgver=0.4.2
+pkgrel=2
+pkgdesc='redirect pacman requests, assisted by avahi service discovery'
+arch=('x86_64')
+url='https://github.com/eworm-de/pacredir'
+depends=('systemd-libs' 'avahi' 'curl' 'iniparser' 'darkhttpd' 'libmicrohttpd')
+makedepends=('systemd' 'markdown')
+conflicts=('pacserve')
+license=('GPL')
+install=pacredir.install
+backup=('etc/pacredir.conf' 'etc/pacman.d/pacredir')
+validpgpkeys=('BD84DE71F493DF6814B0167254EDC91609BC9183') # Christian Hesse <mail at eworm.de>
+source=("https://www.eworm.de/download/${pkgname}/${pkgname}-${pkgver}.tar.xz"{,.asc}
+ '0001-fix-build-with-libmicrohttpd-0.9.71.patch')
+sha256sums=('e2fb8478cfbca7322bb95f146d0fdb64017306f44af22c29651c05e0103dd0da'
+ 'SKIP'
+ '0d82ebeb5d4520290e0490dc1a71e503d2a8ad36adfe0a8cebf5c5b851676aea')
+
+prepare() {
+ cd ${pkgname}-${pkgver}/
+
+ patch -Np1 < ../0001-fix-build-with-libmicrohttpd-0.9.71.patch
+}
+
+build() {
+ cd ${pkgname}-${pkgver}/
+
+ make
+}
+
+package() {
+ cd ${pkgname}-${pkgver}/
+
+ make DESTDIR="${pkgdir}" install
+}
+
Copied: pacredir/repos/community-staging-x86_64/pacredir.install (from rev 659919, pacredir/trunk/pacredir.install)
===================================================================
--- community-staging-x86_64/pacredir.install (rev 0)
+++ community-staging-x86_64/pacredir.install 2020-07-07 17:57:07 UTC (rev 659921)
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+post_install() {
+ echo " > For instructions visit: https://github.com/eworm-de/pacredir#usage"
+}
+
+pre_upgrade() {
+ # return if old package version greater 0.4...
+ (( $(vercmp $2 '0.4') > 0 )) && return
+
+ # upgrade from pre-0.4 version, pacdbserve.service no longer exists
+ if systemctl is-enabled -q pacdbserve.service; then
+ systemctl disable -q pacdbserve.service
+ fi
+}
+
+post_upgrade() {
+ # return if old package version greater 0.4...
+ (( $(vercmp $2 '0.4') > 0 )) && return
+
+ # upgrade from pre-0.4 version, avahi service names changed
+ echo " > This upgrade from pacredir $2 to pacredir $1 changes avahi service"
+ echo " > names. Make sure to update all your installations for compatibility."
+}
More information about the arch-commits
mailing list