Commit Diff


commit - 3297e96b6239ceb8c55f7582c0666eb9e8836def
commit + a58e44b08071a64fd0718a077405e118d9a136d5
blob - 981a29186eea0c1f61680ed8b09cc15f74a8b751
blob + ad15ff18c6d6142ed28fff95bd1b6b99c43f7591
--- .github/ci/before-install.sh
+++ .github/ci/before-install.sh
@@ -14,7 +14,8 @@ if [ "$CIRRUS_OS" = "linux" ]; then
 				zlib1g-dev \
 				git \
 				athena-jot \
-				ed
+				ed \
+				libtls-dev
 fi
 
 if [ "$CIRRUS_OS" = "freebsd" ]; then
@@ -22,7 +23,8 @@ if [ "$CIRRUS_OS" = "freebsd" ]; then
 		automake \
 		pkgconf \
 		git \
-		libevent
+		libevent \
+		libretls
 fi
 
 if [ "$CIRRUS_OS" = "darwin" ]; then
@@ -33,5 +35,6 @@ if [ "$CIRRUS_OS" = "darwin" ]; then
 		ncurses \
 		ossp-uuid \
 		git \
-		libevent
+		libevent \
+		libretls
 fi
blob - ac27927d0a3da092a1f2bc5da1d9bb169b96e203
blob + 69234287e14e76f659bddd697b0f84abf987f92d
--- .gitignore
+++ .gitignore
@@ -34,6 +34,7 @@ gotadmin/gotadmin
 gotctl/gotctl
 gotd/gotd
 gotd/libexec/got-notify-email/got-notify-email
+gotd/libexec/got-notify-http/got-notify-http
 gotd/parse.c
 gotsh/gotsh
 gotwebd/gotwebd
blob - bc3d2f13790b924866926153ccfd13d9c7bf3718
blob + 055c7f00a6fe4fb9cb88a4bedb1f8beb0e3ec875
--- configure.ac
+++ configure.ac
@@ -107,6 +107,7 @@ AC_CHECK_HEADERS([ \
 	sys/socket.h \
 	sys/time.h \
 	sys/tree.h \
+	tls.h \
 	util.h \
 	unistd.h \
 	wchar.h \
@@ -763,11 +764,18 @@ AC_CHECK_DECL(
 	[#include <sys/tree.h>]
 )
 
-if test "x$found_sys_tree_h" = xyes; then
-	AC_DEFINE([HAVE_TREE_H], [1], [sys/tree.h])
-else
-	AC_MSG_NOTICE("Using compat/tree.h")
-fi
+#FIXME: May need OS-wrapping.
+PKG_CHECK_MODULES(
+	LIBTLS,
+	[libtls],
+	[
+		libtls_CFLAGS="$LIBTLS_CFLAGS"
+		libtls_LIBS="$LIBTLS_LIBS"
+		AC_SUBST(libtls_CFLAGS)
+		AC_SUBST(libtls_LIBS)
+	],
+	AC_MSG_ERROR(["*** Couldn't find libtls ***"])
+)
 
 # Look for __progname.
 AC_MSG_CHECKING(for __progname)
@@ -925,6 +933,7 @@ if test "x$enable_gotd" = "xyes"; then
 	AC_CONFIG_FILES([gotd/Makefile])
 	AC_CONFIG_FILES([gotd/libexec/Makefile])
 	AC_CONFIG_FILES([gotd/libexec/got-notify-email/Makefile])
+	AC_CONFIG_FILES([gotd/libexec/got-notify-http/Makefile])
 	AC_CONFIG_FILES([gotsh/Makefile])
 	AC_CONFIG_FILES([gotctl/Makefile])
 fi
blob - fcf76dcce0b056df30725f3bfaac9532cb9320f9
blob + 5401569acff3fdc330f298e369f9dd84f780ea03
--- gotd/libexec/Makefile.am
+++ gotd/libexec/Makefile.am
@@ -1 +1 @@
-SUBDIRS = got-notify-email
+SUBDIRS = got-notify-email got-notify-http
blob - f7c019a6d9614f8bbaac0c5ec29a63e69b94b5ea (mode 644)
blob + /dev/null
--- gotd/libexec/got-notify-http/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-.PATH:${.CURDIR}/../..
-.PATH:${.CURDIR}/../../../lib
-
-.include "../../../got-version.mk"
-
-PROG=	got-notify-http
-SRCS=	got-notify-http.c bufio.c opentemp.c pollfd.c error.c hash.c
-
-CPPFLAGS= -I${.CURDIR}/../../../include -I${.CURDIR}/../../../lib
-
-DPADD=	${LIBTLS}
-LDADD=	-ltls
-
-.include <bsd.prog.mk>
blob - /dev/null
blob + 1a5791453503e173db20aa24ba12a7c2fa6e3fd1 (mode 644)
--- /dev/null
+++ gotd/libexec/got-notify-http/Makefile.am
@@ -0,0 +1,20 @@
+libexec_PROGRAMS = got-notify-http
+
+include $(top_builddir)/Makefile.common
+
+got_notify_http_SOURCES = got-notify-http.c \
+	$(top_srcdir)/lib/bufio.c \
+	$(top_srcdir)/lib/error.c \
+	$(top_srcdir)/lib/hash.c \
+	$(top_srcdir)/lib/opentemp.c \
+	$(top_srcdir)/lib/pollfd.c
+
+got_notify_http_DEPENDENCIES = $(top_builddir)/compat/libopenbsd-compat.a
+
+LDADD = -L$(top_builddir)/compat -lopenbsd-compat
+LDADD += $(zlib_LIBS) $(libbsd_LIBS) $(libutil_LIBS) $(libmd_LIBS) $(libtls_LIBS)
+if HOST_FREEBSD
+LDADD += -lmd
+endif
+
+AM_CPPFLAGS += $(zlib_CFLAGS) $(libbsd_CFLAGS) $(libmd_CFLAGS) $(libtls_CFLAGS)
blob - 2b04222ed9896664bd3fd8b05fc126ae38feb27a
blob + 48b3bbf945c1415462a67b74597cc92769fb4aae
--- gotd/libexec/got-notify-http/got-notify-http.c
+++ gotd/libexec/got-notify-http/got-notify-http.c
@@ -13,6 +13,8 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
+
+#include "got_compat.h"
 
 #include <sys/time.h>
 #include <sys/types.h>
blob - f009715ddfce49aeb0846413c598b3ee30297df7
blob + 6e3f4232a976997113945701e07034e41ffd7c91
--- gotd/session_read.c
+++ gotd/session_read.c
@@ -14,9 +14,10 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#include "got_compat.h"
+
 #include <sys/types.h>
 #include <sys/queue.h>
-#include <sys/tree.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
 #include <sys/uio.h>
@@ -24,8 +25,6 @@
 #include <errno.h>
 #include <event.h>
 #include <limits.h>
-#include <sha1.h>
-#include <sha2.h>
 #include <signal.h>
 #include <stdint.h>
 #include <stdio.h>
blob - a1e0275952fb6d11e96aa854e69d4b5b0126fc1d
blob + 4ec0936c6313d8f8880890fc25b0efa5b1561717
--- gotd/session_write.c
+++ gotd/session_write.c
@@ -17,7 +17,6 @@
 #include "got_compat.h"
 
 #include <sys/types.h>
-#include <sys/queue.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
 #include <sys/uio.h>
blob - 020f1c5b26ce81182b90f2762c14aaf6e1144176
blob + 144bb6edab83dff032ca0613fd3117ae00c88da6
--- lib/bufio.c
+++ lib/bufio.c
@@ -24,6 +24,8 @@
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  * OTHER DEALINGS IN THE SOFTWARE.
  */
+
+#include "got_compat.h"
 
 #include <assert.h>
 #include <errno.h>
@@ -31,8 +33,8 @@
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <string.h>
 #include <tls.h>
+#include <string.h>
 #include <unistd.h>
 
 #include "bufio.h"