Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deb package building #494

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
5e23bb1
fix: Add changelog that seems to have gotten lost so it's possible to…
robsavoye Apr 4, 2024
3cc7208
fix: Fix building deb packages
robsavoye Apr 4, 2024
30ec016
fix: shell commands need a continuation character
robsavoye Apr 23, 2024
4ae230c
fix: Remove extra semi-colon
robsavoye Apr 23, 2024
0305182
fix: Fix declaring the config data structure
robsavoye Apr 25, 2024
8d035a7
fix: Improve the Depends list
robsavoye Apr 25, 2024
8f31e51
fix: Drop libpqxx-7.6 as a Depends
robsavoye Apr 29, 2024
1ea6f94
fix: fix path to docs directory
robsavoye Apr 29, 2024
8f08482
fix: Add suppotr to not sign packages when testing deb building
robsavoye Apr 29, 2024
b3ab7a6
fix: Build unsigned deb packages till HOT has a global signing key
robsavoye Apr 30, 2024
4adac99
fix: Display an error if trying to install deb package and aren't root
robsavoye Apr 30, 2024
95d62ef
fix: Adjust build and install dependencies to work across Debian and …
robsavoye Apr 30, 2024
a68ce39
fix: Don't build doxygen docs for a deb package
robsavoye May 3, 2024
46d8333
fix: Build unsigned deb package
robsavoye May 3, 2024
b93dca8
fix: Genersate shared libraries dependencies
robsavoye May 3, 2024
7bcd432
fix: Adjust runtime library dependencies to be portable
robsavoye May 3, 2024
c55eeb2
fix: Fix merge conflict
robsavoye May 3, 2024
0ca455e
fix: Fix test in postinst for writing the config file
robsavoye May 7, 2024
3a9882e
fix: Use libbz2-dev, and not bzip2 for BuildDepends
robsavoye May 7, 2024
38d32c2
fix: Add libjemallo2 and libgumbo1 to Depends
robsavoye May 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
39 changes: 16 additions & 23 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ DISTCLEANFILES = docs/html docs/latex .lastmod
MAINTAINERCLEANFILES = revno.h .lastmod
ETCDIR = $(subst lib,etc,$(pkglibdir))

SUBDIRS = \
src/validate
SUBDIRS = src/validate

lib_LTLIBRARIES = libunderpass.la
instdir = /tmp
Expand All @@ -50,8 +49,7 @@ BOOST_LIBS = $(BOOST_DATE_TIME_LIB) \
$(BOOST_TIMER_LIB) \
$(BOOST_PYTHON_LIB)

SQL_FILES = \
setup/db/underpass.sql
SQL_FILES = setup/db/underpass.sql

libunderpass_la_SOURCES = \
src/utils/log.cc src/utils/log.hh \
Expand All @@ -71,8 +69,7 @@ libunderpass_la_SOURCES = \
src/utils/geoutil.cc src/utils/geoutil.hh \
src/utils/geo.cc src/utils/geo.hh \
src/utils/yaml.hh src/utils/yaml.cc \
src/data/pq.hh src/data/pq.cc \
setup/db/setupdb.sh
src/data/pq.hh src/data/pq.cc

if JEMALLOC
libunderpass_la_LDFLAGS = -avoid-version -ljemalloc
Expand Down Expand Up @@ -109,29 +106,27 @@ AM_CPPFLAGS = \
# clutter to the output. This should only be enabled when doing performance tuning.
-DTIMING_DEBUG

pkgdata_DATA = $(SQL_FILES) setup/db/setupdb.sh $(PYTHON_UTILS)
pkgdata_DATA = $(SQL_FILES) $(PYTHON_UTILS)

EXTRA_DIST = \
$(SQL_FILES) \
$(PYTHON_UTILS) \
setup/service/underpass.service \
setup/db/setupdb.sh \
src/testsuite \
config/priority.geojson \
config/replicator/planetreplicator.yaml \
doc \
dist/debian \
dist/redhat \
utils


DEJATOOL = libunderpass

if ENABLE_PYTHON
EXT := $(shell python3-config --extension-suffix)
DIR := $(shell python3-config --configdir)
noinst_LTLIBRARIES = underpass.la
underpass_la_SOURCES = src/wrappers/python.cc $(libunderpass_la_SOURCES)
underpass_la_LDFADD = $(BOOST_LIBS) libunderpass.la src/validate/libunderpass.la
underpass_la_LDFLAGS = -module -avoid-version -no-undefined -rpath /usr/lib64/ src/validate/libunderpass.la $(BOOST_LIBS)
underpass_la_LIBADD = $(BOOST_LIBS) libunderpass.la src/validate/libunderpass.la
underpass_la_LDFLAGS = -module -avoid-version -no-undefined -rpath /usr/lib64/ src/validate/libunderpass.la -static $(BOOST_LIBS)
PY_OBJECTS = $(libunderpass_la_OBJECTS:.lo=.o)
# /usr/lib/python3.9/lib-dynload/underpass.cpython-39-x86_64-linux-gnu.so
install-python: underpass.la
Expand All @@ -154,16 +149,14 @@ endif

install-data-hook:
$(MKDIR_P) $(DESTDIR)$(ETCDIR)
cp -rvp $(srcdir)/config/priority.geojson $(DESTDIR)$(ETCDIR)/
cp -rvp $(srcdir)/config/replicator $(DESTDIR)$(ETCDIR)/
cp -rvp $(srcdir)/config/stats $(DESTDIR)$(ETCDIR)/
cp -rvp $(srcdir)/config/default.yaml $(DESTDIR)$(ETCDIR)/
cp -rvp $(srcdir)/setup/service $(DESTDIR)/$(pkglibdir)
$(MKDIR_P) $(DESTDIR)$(pkglibdir)/../system
cp -rvp $(srcdir)/setup/service/underpass.service $(DESTDIR)$(pkglibdir)/../system/

dist-hook: apidoc
@rsync -avr $(srcdir)/config $(DESTDIR)$(ETCDIR)/
@rsync -avr $(srcdir)/setup $(DESTDIR)/$(pkglibdir)
@$(MKDIR_P) $(DESTDIR)$(pkglibdir)/../system
cp -rvu $(srcdir)/setup/service/underpass.service $(DESTDIR)$(pkglibdir)/../system/

dist-hook:
$(MKDIR_P) $(DESTDIR)/$(docdir)
(cd docs && $(DOXYGEN))
cp -rvp docs/html $(DESTDIR)/$(docdir)

if ENABLE_PCH
Expand Down Expand Up @@ -330,7 +323,7 @@ revno.h:
echo "#define BRANCH_NICK \"$${nick}\"" >> revno.h; \
echo "#define COMMIT_ID \"$${comm_id}\"" >> revno.h; \
echo "#define VERSION \"$(VERSION)\"" >> revno.h; \
touch .lastmod;
touch .lastmod; \
fi

.configline: revno.h
Expand Down
5 changes: 5 additions & 0 deletions dist/debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
underpass (0.3) distro; urgency=low

* local package.

-- Rob Savoye (Rollinsville, CO) <rob@senecass.com> Thu, 04 Apr 2024 04:20:00 +0100
53 changes: 25 additions & 28 deletions dist/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -28,46 +28,43 @@ Build-Depends: dpkg-dev (>= 1.13.19),
debhelper (>= 7.0.0),
autoconf, automake, libtool,
autotools-dev,
libboost1.74-all-dev,
libwebkit2gtk-4.0-dev,
libboost-dev (>= 1.69),
libboost-filesystem-dev (>= 1.69),
libboost-date-time-dev (>= 1.69),
libboost-iostreams-dev (>= 1.69),
libboost-thread-dev (>= 1.69),
libboost-locale-dev (>= 1.69),
libboost-log-dev (>= 1.69),
libboost-system-dev (>= 1.69),
libboost-timer-dev (>= 1.69),
libboost-chrono-dev (>= 1.69),
libboost-serialization-dev (>= 1.69),
libboost-python-dev (>= 1.69),
libglibmm-2.4-dev | libglibmm-2.6-dev,
libgdal-dev (>= 3.0),
libgumbo-dev,
libexpat1-dev,
libosmium2-dev,
jemalloc,
libjemalloc-dev,
bzip2,
libbz2-dev,
openssl,
libpqxx-7.6,
libxml++2.6-dev | libxml++-3.0,
libpython3-dev
libpqxx-7.6 | libpqxx-dev,
libxml++2.6-dev | libxml++-3.0-dev,
libpython3-dev,
doxygen

Package: underpass
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends},
libboost-filesystem-dev (>= 1.69),
libboost-program-options-dev (>= 1.69),
libboost-locale-dev (>= 1.69),
libboost-iostreams-dev (>= 1.69),
libgdal28 | libgdal26,
libxml++2.6-dev | libxml++3.0-dev,
libpqxx-7.6,
bzip2,
openssl,
postgis
Description: A daemon for processing OSM replication files.
Depends: ${shlibs:Depends}, ${misc:Depends},
libboost-filesystem1.74.0,
libboost-program-options1.74.0,
libboost-locale1.74.0,
libboost-iostreams1.74.0,
libboost-date-time1.74.0,
libboost-locale1.74.0,
libboost-serialization1.74.0,
libboost-timer1.74.0,
libboost-system1.74.0,
libboost-log1.74.0,
libxml++2.6-2v5,
libjemalloc2,
libgumbo1,
bzip2,
openssl,
postgis,
libgdal26 | libgdal28 | libgdal31 | libgdal32 | libgdal33,
libpqxx-6.4 | libpqxx-7.8t64

# Package: underpass-dbg
# Architecture: any
Expand Down
6 changes: 4 additions & 2 deletions dist/debian/deb.am
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ DEB_BUILD_OPTIONS ?= $(shell echo $DEB_BUILD_OPTIONS)
# the file editing to be done
snapshot-deb:
mv $(distdir) $(PACKAGE)-$(NOW)
cd $(PACKAGE)-$(NOW) ; \
dpkg-buildpackage -rfakeroot -d -b
cd $(PACKAGE)-$(NOW) ; \
$(LN_S) dist/debian .; \
$(LN_S) $(srcdir)/config .; \
dpkg-buildpackage -rfakeroot -d -b -uc -us

.PHONY : deb snapshot-deb
15 changes: 10 additions & 5 deletions dist/debian/postinst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#!/bin/bash
#
# Copyright (c) 2020, 2021, 2023 Humanitarian OpenStreetMap Team
# Copyright (c) 2020, 2021, 2023, 2024 Humanitarian OpenStreetMap Team
#
# This file is part of Underpass.
#
Expand Down Expand Up @@ -33,7 +33,12 @@ prompt()
{
eval $1
echo "Database configuration for ${config['title']} "
echo "# Database configuration for ${config['title']}" >> /etc/default/underpass
if test -w /etc/default/; then
echo "# Database configuration for ${config['title']}" >> /etc/default/underpass
else
echo "ERROR: You don't have write permission to /etc/default/underpass! use sudo"
exit
fi

for i in ${!config[@]}; do
if test x"$i" == x"title" -o x"$i" == x"prefix"; then
Expand Down Expand Up @@ -85,8 +90,8 @@ if [ "$1" = "configure" ]; then
touch /etc/default/underpass
fi

prompt "$(declare -p config)"
declare -A config

# For the Galaxy OSM Stats database
config['title']="Underpass"
config['prefix']="UNDERPASS"
Expand Down
11 changes: 8 additions & 3 deletions dist/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ configure: config-stamp
config-stamp:
dh_testdir
@printf "\n == CONFIGURE ==\n\n"
dh_auto_configure -- CXXFLAGS="-std=c++17 -g -O0" CXX="ccache g++" LDFLAGS="-lbz2"
dh_auto_configure -- CXXFLAGS="-std=c++17 -g" CXX="ccache g++" LDFLAGS="-lbz2"
touch $@

build: build-stamp
build-stamp: configure
dh_testdir
@printf "\n == BUILD ==\n\n"
dh_auto_build -- CXXFLAGS="-std=c++17 -g -O0"
dh_auto_build -- CXXFLAGS="-std=c++17 -g"
touch $@

clean:
Expand All @@ -49,7 +49,9 @@ clean:
install: build
dh_testdir
dh_testroot
dh_installdirs
dh_installdirs
dh_installchangelogs -XChangeLog
dh_installdocs
@printf "\n == INSTALL ==\n\n"
dh_auto_install --destdir=debian/underpass
dh_systemd_enable
Expand All @@ -63,6 +65,9 @@ binary binary-arch: install
dh_testdir
dh_testroot
dh_installdirs
dh_compress
dh_makeshlibs
dh_shlibdeps
dh_installdeb
dh_installdebconf
dh_installchangelogs -XChangeLog
Expand Down
10 changes: 5 additions & 5 deletions src/validate/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ AM_CPPFLAGS = \
-DETCDIR=\"$(ETCDIR)\" \
-DBOOST_LOCALE_HIDE_AUTO_PTR

install-data-hook:
$(MKDIR_P) $(DESTDIR)/$(pkglibdir)
cp -vp .libs/libunderpass.so $(DESTDIR)/$(pkglibdir)
$(MKDIR_P) $(DESTDIR)/$(pkglibdir)/config/validate
cp -rvp $(top_srcdir)/config/validate/*.yaml $(DESTDIR)/$(pkglibdir)/config/validate
# install-data-hook:
# $(MKDIR_P) $(DESTDIR)/$(pkglibdir)
# cp -vp .libs/libunderpass.so $(DESTDIR)/$(pkglibdir)
# $(MKDIR_P) $(DESTDIR)/$(pkglibdir)/config/validate
# cp -rvp $(top_srcdir)/config/validate/*.yaml $(DESTDIR)/$(pkglibdir)/config/validate