From: Stefan Sperling Subject: -portable: build and install gotadmin To: gameoftrees@openbsd.org Date: Sun, 19 Sep 2021 18:36:05 +0200 This installs gotadmin in the -portable version. Tested on Ubuntu 20.04. ok? diff --git a/.gitignore b/.gitignore index c7b0475d..46c63ad1 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ configure core etc/ got/got +gotadmin/gotadmin lib/.dirstamp libexec/got-fetch-pack/got-fetch-pack libexec/got-index-pack/got-index-pack diff --git a/Makefile.am b/Makefile.am index 0d93efe9..b8c13f98 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = compat libexec got tog +SUBDIRS = compat libexec got tog gotadmin #dist_EXTRA_got_SOURCES = compat/*.[ch] diff --git a/configure.ac b/configure.ac index d46408ad..4fb5a289 100644 --- a/configure.ac +++ b/configure.ac @@ -394,6 +394,7 @@ AC_CONFIG_FILES([Makefile libexec/got-read-pack/Makefile libexec/got-read-tag/Makefile got/Makefile + gotadmin/Makefile tog/Makefile]) AC_OUTPUT diff --git a/gotadmin/Makefile b/gotadmin/Makefile deleted file mode 100644 index fa31072b..00000000 --- a/gotadmin/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -.PATH:${.CURDIR}/../lib - -.include "../got-version.mk" - -PROG= gotadmin -SRCS= gotadmin.c \ - deflate.c delta.c delta_cache.c deltify.c error.c gotconfig.c \ - inflate.c lockfile.c object.c object_cache.c object_create.c \ - object_idset.c object_parse.c opentemp.c pack.c pack_create.c \ - path.c privsep.c reference.c repository.c repository_admin.c \ - sha1.c -MAN = ${PROG}.1 - -CPPFLAGS = -I${.CURDIR}/../include -I${.CURDIR}/../lib - -.if defined(PROFILE) -LDADD = -lutil_p -lz_p -lc_p -.else -LDADD = -lutil -lz -.endif -DPADD = ${LIBZ} ${LIBUTIL} - -.if ${GOT_RELEASE} != "Yes" -NOMAN = Yes -.endif - -realinstall: - ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} \ - -m ${BINMODE} ${PROG} ${BINDIR}/${PROG} - -dist: - mkdir ../got-${GOT_VERSION}/${PROG} - cp ${SRCS} ${MAN} ../got-${GOT_VERSION}/${PROG} - -.include diff --git a/gotadmin/Makefile.am b/gotadmin/Makefile.am new file mode 100644 index 00000000..867526de --- /dev/null +++ b/gotadmin/Makefile.am @@ -0,0 +1,40 @@ +bin_PROGRAMS = gotadmin + +gotadmin_SOURCES = gotadmin.c \ + $(top_srcdir)/lib/deflate.c \ + $(top_srcdir)/lib/delta.c \ + $(top_srcdir)/lib/delta_cache.c \ + $(top_srcdir)/lib/deltify.c \ + $(top_srcdir)/lib/error.c \ + $(top_srcdir)/lib/gotconfig.c \ + $(top_srcdir)/lib/inflate.c \ + $(top_srcdir)/lib/lockfile.c \ + $(top_srcdir)/lib/object.c \ + $(top_srcdir)/lib/object_cache.c \ + $(top_srcdir)/lib/object_create.c \ + $(top_srcdir)/lib/object_idset.c \ + $(top_srcdir)/lib/object_parse.c \ + $(top_srcdir)/lib/opentemp.c \ + $(top_srcdir)/lib/pack.c \ + $(top_srcdir)/lib/pack_create.c \ + $(top_srcdir)/lib/path.c \ + $(top_srcdir)/lib/privsep.c \ + $(top_srcdir)/lib/reference.c \ + $(top_srcdir)/lib/repository.c \ + $(top_srcdir)/lib/repository_admin.c \ + $(top_srcdir)/lib/sha1.c + +gotadmin_DEPENDENCIES = $(top_builddir)/compat/libopenbsd-compat.a + +man1_MANS = gotadmin.1 + +AM_CPPFLAGS += -DGOT_VERSION='"@VERSION@"' \ + -DGOT_VERSION_NUMBER='"@VERSION@"' \ + -DGOT_LIBEXECDIR="${bindir}" \ + -I$(top_srcdir) \ + -I$(top_srcdir)/compat \ + -I$(top_srcdir)/lib \ + -I$(top_srcdir)/include \ + -I. + +LDADD = -L$(top_builddir)/compat -lopenbsd-compat diff --git a/gotadmin/gotadmin.c b/gotadmin/gotadmin.c index a6398ccb..2cd34eb4 100644 --- a/gotadmin/gotadmin.c +++ b/gotadmin/gotadmin.c @@ -14,7 +14,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include #include #include @@ -29,7 +28,8 @@ #include #include #include -#include + +#include "got_compat.h" #include "got_version.h" #include "got_error.h"