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

Conversation

eLvErDe
Copy link

@eLvErDe eLvErDe commented Jul 18, 2018

Hi,

Here is the required files to generate proper Debian or Ubuntu (or derivated) package.
It has been validated on Debian Stretch (current stable) but should be backportable to earlier EOL version like Debian Jessie or Ubuntu Xenial. Anything newer is of course supported.

Refs #33
Fixes #52

Best regards, Adam.

Copy link
Contributor

@horgh horgh left a comment

Choose a reason for hiding this comment

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

Thanks for your efforts! Sorry for the delayed reply.

One thing I should mention is it's unlikely we're going to want this in our master branch as that would likely impact packaging by Debian/Ubuntu (should that ever happen). It's possible we'd accept it in a separate branch, which I can understand is less attractive.

I commented on a few minor things. Beyond that, how were you building this? When I try, I see a bunch of errors: https://gist.github.com/horgh/a1f9b0d22a155782c11db3ff599547d8 Presumably I'm doing something strange. I took the tarball and gave it the appropriate name, then used debuild -us -uc.

-----------------------------------

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.

@@ -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.

@@ -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 😄.

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

Base automatically changed from master to main January 20, 2021 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add debian packaging files
5 participants