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

Debian/Ubuntu packaging #58

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions debian/README.Debian
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
libapache2-mod-maxminddb for Debian
-----------------------------------

This package requires non-free MaxMind database files.
Some of them can be dowloaded for free using geoipupdate package.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a small typo here.

They will be installed in /var/lib/GeoIP folder.

More information at: https://dev.maxmind.com/geoip/geoip2/geolite2/

-- Adam Cecile <[email protected]> Wed, 18 Jul 2018 21:12:01 +0200
3 changes: 3 additions & 0 deletions debian/apache2
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mod src/.libs/mod_maxminddb.so
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this line? From the docs it sounds like we need to only list .so if we don't install it otherwise (which I think we would?) https://manpages.debian.org/unstable/apache2-dev/dh_apache2.1.en.html

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am by no means an expert, just toyed around with building this.
Standards-Version: 4.5.1
if I left out the lines in debian/apache2 they did not make their way into the final deb. Though maybe there are more switches to enable auto foo.

mod debian/maxminddb.load
mod debian/maxminddb.conf
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mod-maxminddb (1.1.0-1) unstable; urgency=medium

* Initial release.

-- Adam Cecile <[email protected]> Wed, 18 Jul 2018 21:12:01 +0200
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
14 changes: 14 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Source: mod-maxminddb
Section: httpd
Priority: optional
Maintainer: Adam Cecile <[email protected]>
Build-Depends: debhelper (>= 9), dh-apache2, apache2-dev, libmaxminddb-dev
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems incomplete, because after installing these packages a build attempt still fails for me with:

% fakeroot debian/rules binary
dh binary --with apache2
   dh_update_autotools_config
   dh_auto_configure
        perl -I. Makefile.PL INSTALLDIRS=vendor "OPTIMIZE=-g -O2 -fdebug-prefix-map=/home/joy/mod_maxminddb=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2" "LD=x86_64-linux-gnu-gcc -g -O2 -fdebug-prefix-map=/home/joy/mod_maxminddb=. -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro"
Can't locate Apache/TestMM.pm in @INC (you may need to install the Apache::TestMM module) (@INC contains: ../blib/lib lib . /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.28.1 /usr/local/share/perl/5.28.1 /usr/lib/x86_64-linux-gnu/perl5/5.28 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.28 /usr/share/perl/5.28 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at Makefile.PL line 7.
BEGIN failed--compilation aborted at Makefile.PL line 7.
dh_auto_configure: perl -I. Makefile.PL INSTALLDIRS=vendor "OPTIMIZE=-g -O2 -fdebug-prefix-map=/home/joy/mod_maxminddb=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2" "LD=x86_64-linux-gnu-gcc -g -O2 -fdebug-prefix-map=/home/joy/mod_maxminddb=. -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro" returned exit code 2
make: *** [debian/rules:6: binary] Error 2

So it looks like libapache2-mod-perl2 is also required...?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And, in turn, this test stuff seems to croak later as well, like this:

% debian/rules build
dh build --with apache2
   dh_update_autotools_config
   dh_auto_configure
        perl -I. Makefile.PL INSTALLDIRS=vendor "OPTIMIZE=-g -O2 -fdebug-prefix-map=/home/joy/mod_maxminddb=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2" "LD=x86_64-linux-gnu-gcc -g -O2 -fdebug-prefix-map=/home/joy/mod_maxminddb=. -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro"
[   info] generating script t/TEST
Generating a Unix-style Makefile
Writing Makefile for Apache::Test_mod_maxminddb
Writing MYMETA.yml and MYMETA.json
   dh_auto_build
        make -j1
make[1]: Entering directory '/home/joy/mod_maxminddb'
cp lib/Apache/TestModMaxMindDB.pm blib/lib/Apache/TestModMaxMindDB.pm
make[1]: Leaving directory '/home/joy/mod_maxminddb'
   dh_auto_test
        make -j1 test TEST_VERBOSE=1
make[1]: Entering directory '/home/joy/mod_maxminddb'
"/usr/bin/perl" -Iblib/arch -Iblib/lib \
t/TEST  -clean
APACHE_TEST_APXS= APACHE_TEST_GROUP= APACHE_TEST_HTTPD= APACHE_TEST_PORT= APACHE_TEST_USER= \
"/usr/bin/perl" -Iblib/arch -Iblib/lib \
t/TEST  -bugreport -verbose=1
apache2: Could not open configuration file /etc/apache2/httpd.conf: No such file or directory
/usr/sbin/apache2  -d /home/joy/mod_maxminddb/t -f /home/joy/mod_maxminddb/t/conf/httpd.conf -D APACHE2 -D APACHE2_4 -D PERL_USEITHREADS
using Apache/2.4.38

waiting 60 seconds for server to start: .AH00534: apache2: Configuration error: No MPM loaded.
[  error]
server has died with status 255 (t/logs/error_log wasn't created, start the server in the debug mode)
Terminated
make[1]: *** [Makefile:810: run_tests] Error 143
make[1]: Leaving directory '/home/joy/mod_maxminddb'
dh_auto_test: make -j1 test TEST_VERBOSE=1 returned exit code 2
make: *** [debian/rules:6: build] Error 2

Copy link

@cztk cztk Feb 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dpkg-buildpackage -us -uc
../libapache2-mod-maxmind-cpx-1.2.0/debian/control
Build-Depends: debhelper (>= 10),
apache2-dev,
dh-apache2,
libapr1-dev,
libmaxminddb-dev
Depends: apache2, libmaxminddb, libapr1

builds just fine, perl module is just needed if you want to run tests. though would probably not use mod_perl but some cgi script as its more common to have this enabled for testing without loading in more modules.

edit: I did a ./bootstrap first tho

Standards-Version: 4.1.3
Homepage: https://github.com/maxmind/mod_maxminddb/

Package: libapache2-mod-maxminddb
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Recommends: geoipupdate
Description: Query MaxMind DB (geo-localisation) files
Query MaxMind DB files to perform actions based on geo-localisation.
27 changes: 27 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: mod-maxminddb
Source: https://github.com/maxmind/mod_maxminddb/releases

Files: *
Copyright: 2013-2014 MaxMind, Inc.
License: Apache-2.0

Files: debian/*
Copyright: 2018 Adam Cecile <[email protected]>
License: Apache-2.0

License: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
.
https://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
.
On Debian systems, the complete text of the Apache version 2.0 license
can be found in "/usr/share/common-licenses/Apache-2.0".
1 change: 1 addition & 0 deletions debian/docs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
README.md
14 changes: 14 additions & 0 deletions debian/maxminddb.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<IfModule mod_maxminddb.c>
# For performance reasons, it's not recommended to turn GeoIP on serverwide,
# but rather only in <Location> or <Directory> blocks where it's actually
# needed.
#
# See configuration examples in:
# /usr/share/doc/libapache2-mod-maxminddb/README.md.gz
#
# Please also take a few seconds reading
# /usr/share/doc/libapache2-mod-maxminddb/README.Debian
# to understand how to get MaxMind database files
#
MaxMindDBEnable Off
</IfModule>
1 change: 1 addition & 0 deletions debian/maxminddb.load
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
LoadModule maxminddb_module /usr/lib/apache2/modules/mod_maxminddb.so
16 changes: 16 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/make -f

DESTDIR := debian/libapache2-mod-maxminddb

%:
dh $@ --with apache2

override_dh_auto_install:

override_dh_installdocs:
dh_installdocs
sed -i 's!/usr/local/share/GeoIP/!/var/lib/GeoIP/!g' \
$(DESTDIR)/usr/share/doc/libapache2-mod-maxminddb/README.md

dh_installchangelogs:
dh_installchangelogs Changes.md
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
4 changes: 4 additions & 0 deletions debian/watch
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version=4
opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%mod_maxminddb-$1.tar.gz%" \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is certainly a mouthful. What's the benefit in having the watch file in this situation? I looked at the uscan docs for a bit and I'm still not sure 😄.

https://github.com/maxmind/mod_maxminddb/tags \
(?:.*?/)?v?(\d[\d.]*)\.tar\.gz debian uupdate