From 7c664f129fd131ee97bc6331efaaedf7b2d4af7c Mon Sep 17 00:00:00 2001 From: Olivier Bilodeau Date: Wed, 12 Sep 2012 15:31:15 -0400 Subject: [PATCH 1/9] generating gettext .mo files at build step on debian packaging Could be related to #1465 but unsure at this point. http://packetfence.org/bugs/view.php?id=1465 --- addons/packages/packetfence.spec | 1 + debian/control | 2 +- debian/rules | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/addons/packages/packetfence.spec b/addons/packages/packetfence.spec index 3080dbe2902b..66af23fef534 100644 --- a/addons/packages/packetfence.spec +++ b/addons/packages/packetfence.spec @@ -222,6 +222,7 @@ server. mv pfcmd_pregrammar.pm lib/pf/pfcmd/ # generate translations +# TODO this is duplicated in debian/rules, we should aim to consolidate in a 'make' style step for TRANSLATION in de en es fr he_IL it nl pt_BR; do /usr/bin/msgfmt conf/locale/$TRANSLATION/LC_MESSAGES/packetfence.po mv packetfence.mo conf/locale/$TRANSLATION/LC_MESSAGES/ diff --git a/debian/control b/debian/control index 1948ed4b3926..5c03e886ea1e 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: packetfence Section: main/net Priority: optional Maintainer: Durand fabrice -Build-Depends: debhelper (>= 7.0.50~) +Build-Depends: debhelper (>= 7.0.50~), gettext Standards-Version: 3.8.4 Vcs-Git: git://github.com/inverse-inc/packetfence.git Vcs-browser: https://github.com/inverse-inc/packetfence/ diff --git a/debian/rules b/debian/rules index 1836bf2dbbb3..979d1d02e192 100755 --- a/debian/rules +++ b/debian/rules @@ -54,6 +54,12 @@ install: build for i in `find * -path 't*' ! -type d`; do \ $(INSTALL) $$i $(CURDIR)/debian/packetfence-test$(PREFIX)/$(NAME)/$$i; \ done + # generate translations + # TODO this is duplicated in our RPM spec, we should aim to consolidate in a 'make' style step + for TRANSLATION in de en es fr he_IL it nl pt_BR; do + /usr/bin/msgfmt conf/locale/$TRANSLATION/LC_MESSAGES/packetfence.po \ + --output-file conf/locale/$TRANSLATION/LC_MESSAGES/packetfence.mo + done # Install empty directories not in our tarball since the git move install -d -m0700 $(CURDIR)/debian/packetfence$(PREFIX)/$(NAME)/addons install -d -m0700 $(CURDIR)/debian/packetfence$(PREFIX)/$(NAME)/conf/users From 02a830a6bfe7b390f167d8656658069d109a8c96 Mon Sep 17 00:00:00 2001 From: Olivier Bilodeau Date: Wed, 12 Sep 2012 15:37:01 -0400 Subject: [PATCH 2/9] compiling grammar at build stage - Just like RHEL - Why wasting client-side CPU cycles? --- debian/control | 2 +- debian/packetfence.postinst | 6 +----- debian/rules | 3 +++ 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/debian/control b/debian/control index 5c03e886ea1e..8633c5d8e1ab 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: packetfence Section: main/net Priority: optional Maintainer: Durand fabrice -Build-Depends: debhelper (>= 7.0.50~), gettext +Build-Depends: debhelper (>= 7.0.50~), gettext, libparse-recdescent-perl Standards-Version: 3.8.4 Vcs-Git: git://github.com/inverse-inc/packetfence.git Vcs-browser: https://github.com/inverse-inc/packetfence/ diff --git a/debian/packetfence.postinst b/debian/packetfence.postinst index 04f8cc1e53d3..4b5ac99b14d9 100644 --- a/debian/packetfence.postinst +++ b/debian/packetfence.postinst @@ -22,11 +22,7 @@ case "$1" in configure) export PACKETFENCE=/usr/local/pf export PERL5LIB=/usr/local/pf/lib - - # compile grammar - perl -w -e "use strict; use warnings; use Parse::RecDescent; use lib \"./lib\"; use pf::pfcmd::pfcmd; Parse::RecDescent->Precompile(\$grammar, \"pfcmd_pregrammar\");" - mv pfcmd_pregrammar.pm $PACKETFENCE/lib/pf/pfcmd/ - + # link to latest SQL schema if [ ! -e "$PACKETFENCE/db/pf-schema.sql" ]; then cd $PACKETFENCE/db diff --git a/debian/rules b/debian/rules index 979d1d02e192..f8c0145c9ed7 100755 --- a/debian/rules +++ b/debian/rules @@ -60,6 +60,9 @@ install: build /usr/bin/msgfmt conf/locale/$TRANSLATION/LC_MESSAGES/packetfence.po \ --output-file conf/locale/$TRANSLATION/LC_MESSAGES/packetfence.mo done + # precompile grammar + perl -w -e 'use strict; use warnings; use Parse::RecDescent; use lib "./lib"; use pf::pfcmd::pfcmd; Parse::RecDescent->Precompile($grammar, "pfcmd_pregrammar");' + mv pfcmd_pregrammar.pm $(CURDIR)/debian/packetfence$(PREFIX)/$(NAME)/lib/pf/pfcmd/ # Install empty directories not in our tarball since the git move install -d -m0700 $(CURDIR)/debian/packetfence$(PREFIX)/$(NAME)/addons install -d -m0700 $(CURDIR)/debian/packetfence$(PREFIX)/$(NAME)/conf/users From 7d53327bd79342d1ff57ed619e45f2fe1760618b Mon Sep 17 00:00:00 2001 From: Olivier Bilodeau Date: Wed, 12 Sep 2012 15:54:50 -0400 Subject: [PATCH 3/9] dependency cleanup - there were a LOT of duplicated entries - also tried to quickly organize / document things but it's not complete yet --- debian/control | 61 ++++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/debian/control b/debian/control index 8633c5d8e1ab..4a46f54dc39e 100644 --- a/debian/control +++ b/debian/control @@ -12,45 +12,44 @@ Package: packetfence Architecture: all Pre-Depends: freeradius, freeradius-ldap, freeradius-postgresql, freeradius-mysql, freeradius-krb5 -Depends: ${misc:Depends}, apache2, apache2.2-common, apache2-utils, - openssl, openssl-blacklist, openssl-blacklist-extra, php-log, snort, - mysql-server, libapache2-mod-proxy-html, libapache2-mod-php5, php-pear, - php5-mysql, php5-gd, perl-suid, make, +Depends: ${misc:Depends}, vlan, make, + openssl, openssl-blacklist, openssl-blacklist-extra, snort, + mysql-server, + snmp, snmptrapfmt, +# apache related + apache2, apache2.2-common, apache2-utils, libapache2-mod-proxy-html, + apache2-mpm-prefork, +# php web admin + libapache2-mod-php5, php-pear, php5-mysql, php5-gd, make, php-log, # process management procps, -# perl stuff - libapache-htpasswd-perl, libbit-vector-perl, libtext-csv-perl, +# perl basic components + perl-suid, liblist-moreutils-perl, libwww-perl, libtry-tiny-perl +# perl uncategorized modules + libapache-htpasswd-perl, libbit-vector-perl, libtext-csv-perl, libcgi-session-serialize-yaml-perl, libtimedate-perl, libapache-dbi-perl, libdbd-mysql-perl, libfile-tail-perl, libnetwork-ipv4addr-perl, - libiptables-parse-perl, libiptables-chainmgr-perl, liblist-moreutils-perl, - liblocale-gettext-perl, liblog-log4perl-perl, iptables, - liblwp-useragent-determined-perl, libnet-mac-vendor-perl, libnet-mac-perl, - libnet-netmask-perl, libnet-pcap-perl, libnet-snmp-perl, libsnmp-perl, - libnet-telnet-cisco-perl, libparse-recdescent-perl, - libregexp-common-email-address-perl, libregexp-common-time-perl, - libperl-critic-perl, libreadonly-xs-perl, libhtml-template-perl, - libterm-readkey-perl, libtest-perl-critic-perl, libtest-pod-perl, - libtest-pod-coverage-perl, apache2-mpm-prefork, libthread-pool-simple-perl, - libuniversal-require-perl, libuniversal-exports-perl, libnet-rawip-perl, - libwww-perl, libapache-htpasswd-perl, libbit-vector-perl, + libiptables-parse-perl, libiptables-chainmgr-perl, iptables, + liblwp-useragent-determined-perl, libnet-mac-vendor-perl, libnet-mac-perl, + libnet-netmask-perl, libnet-pcap-perl, libnet-snmp-perl, libsnmp-perl, + libnet-telnet-cisco-perl, libparse-recdescent-perl, + libregexp-common-email-address-perl, libregexp-common-time-perl, + libperl-critic-perl, libreadonly-xs-perl, libhtml-template-perl, + libterm-readkey-perl, libtest-perl-critic-perl, libtest-pod-perl, + libtest-pod-coverage-perl, libthread-pool-simple-perl, + libuniversal-require-perl, libuniversal-exports-perl, libnet-rawip-perl, libcgi-session-perl, libconfig-inifiles-perl, - libdatetime-format-dateparse-perl, libdbi-perl, libdbd-mysql-perl, - libfile-tail-perl, libnetwork-ipv4addr-perl, libiptables-parse-perl, - libiptables-chainmgr-perl, liblist-moreutils-perl, liblocale-gettext-perl, - liblog-log4perl-perl, libnet-mac-perl, libnet-mac-vendor-perl, - libnet-netmask-perl, libnet-pcap-perl, libnet-snmp-perl, - libnet-telnet-perl, libparse-recdescent-perl, libregexp-common-perl, - libreadonly-perl, libtemplate-perl, libterm-readkey-perl, - libtest-perl-critic-perl, libtest-pod-perl, libtest-pod-coverage-perl, - libuniversal-require-perl, libthread-serialize-perl, libload-perl, - libtry-tiny-perl, snmp, snmptrapfmt, libmime-lite-perl, + libdatetime-format-dateparse-perl, libdbi-perl, + libnet-telnet-perl, libregexp-common-perl, + libreadonly-perl, libtemplate-perl, libterm-readkey-perl, + libuniversal-require-perl, libthread-serialize-perl, libnet-ldap-perl, libcrypt-generatepassword-perl, perl-doc, dhcp3-server, bind9, librrds-perl, libnetpacket-perl (>= 1.3), libcache-cache-perl, libcarp-perl, libiptables-libiptc-perl, libload-perl, libmime-lite-tt-perl, libnet-appliance-session-perl, libnet-cli-interact-perl, libnet-interface-perl, libnet-radius-perl, libparse-nessus-nbe-perl, libphp-session-perl, libtest-mockdbi-perl, - gettext, vlan, libsoap-lite-perl, libnet-frame-perl, libthread-pool-perl, + libsoap-lite-perl, libnet-frame-perl, libthread-pool-perl, libnet-nessus-xmlrpc-perl (>= 0.4), # FIXME track what requires the conveyor stuff and identify it. If we can, get rid of it. libthread-conveyor-monitored-perl, libthread-conveyor-perl, libthread-tie-perl, @@ -65,7 +64,11 @@ Depends: ${misc:Depends}, apache2, apache2.2-common, apache2-utils, # catalyst-server libcatalyst-engine-http-prefork-perl, # packaging workaround (we don't require it but something in catalyst seem to do) - libmodule-install-perl + libmodule-install-perl, +# i18n + liblocale-gettext-perl, +# logging framework + liblog-log4perl-perl Description: PacketFence network registration / worm mitigation system PacketFence is an open source network access control (NAC) system. It can be used to effectively secure networks, from small to very large From da68547fc1867aca3bebc09b00ec310f7119086a Mon Sep 17 00:00:00 2001 From: Olivier Bilodeau Date: Wed, 12 Sep 2012 15:58:46 -0400 Subject: [PATCH 4/9] added modules that might be used by the captive portal It's user controlled. If a user would have enabled radius auth he would have seen failures because the module is not installed. --- debian/control | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 4a46f54dc39e..79583d67adb2 100644 --- a/debian/control +++ b/debian/control @@ -68,7 +68,9 @@ Depends: ${misc:Depends}, vlan, make, # i18n liblocale-gettext-perl, # logging framework - liblog-log4perl-perl + liblog-log4perl-perl, +# used by Captive Portal authentication modules + libauthen-radius-perl, libauthen-krb5-simple-perl Description: PacketFence network registration / worm mitigation system PacketFence is an open source network access control (NAC) system. It can be used to effectively secure networks, from small to very large From 0462b6043fbf915c94fee20c5ed881f11958ecc9 Mon Sep 17 00:00:00 2001 From: Olivier Bilodeau Date: Wed, 12 Sep 2012 15:59:43 -0400 Subject: [PATCH 5/9] removed all modules that were already pulled by packetfence since we already depend on packetfence --- debian/control | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/debian/control b/debian/control index 79583d67adb2..3cf63f7fd9af 100644 --- a/debian/control +++ b/debian/control @@ -101,11 +101,9 @@ Description: Files needed for sending snort alerts to packetfence Package: packetfence-test Architecture: all -Depends: packetfence, libauthen-radius-perl, libauthen-krb5-simple-perl, libtest-mockmodule-perl, - libtext-csv-perl, libtest-nowarnings-perl, libjson-perl,libtest-mockobject-perl, -# FIXME track what requires the conveyor stuff and identify it. If we can, get rid of it. - libthread-pool-perl, libthread-conveyor-perl, libthread-tie-perl, liberror-perl, - libtest-exception-perl, libnetpacket-perl (>= 1.3) +Depends: packetfence, libtest-mockmodule-perl, + libtest-nowarnings-perl, libtest-mockobject-perl, + libtest-exception-perl Description: Test suite for packetfence The PacketFence package contains a suite of test for validate packetfence installation. From ee29dc6977ee1ba4e351fa92f2ef19fb71b01d1b Mon Sep 17 00:00:00 2001 From: Olivier Bilodeau Date: Wed, 12 Sep 2012 16:01:02 -0400 Subject: [PATCH 6/9] added TODO task on Pre-Depend --- debian/control | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/control b/debian/control index 3cf63f7fd9af..82ef4ed9eed1 100644 --- a/debian/control +++ b/debian/control @@ -10,6 +10,7 @@ Homepage: http://www.packetfence.org/ Package: packetfence Architecture: all +# TODO: We can probably move these in Depends since 3.5.0 (managed RADIUS feature) Pre-Depends: freeradius, freeradius-ldap, freeradius-postgresql, freeradius-mysql, freeradius-krb5 Depends: ${misc:Depends}, vlan, make, From 086e120fd1adf402d7390f5aebce3ecd8a4a2532 Mon Sep 17 00:00:00 2001 From: Olivier Bilodeau Date: Wed, 12 Sep 2012 16:05:14 -0400 Subject: [PATCH 7/9] Pin the version of libnet-appliance-session-perl to 1.36 Will avoid problems if debian ever ships a more recent version and we haven't yet updated to the new API. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 82ef4ed9eed1..9bcc1fb3c23b 100644 --- a/debian/control +++ b/debian/control @@ -47,7 +47,7 @@ Depends: ${misc:Depends}, vlan, make, libnet-ldap-perl, libcrypt-generatepassword-perl, perl-doc, dhcp3-server, bind9, librrds-perl, libnetpacket-perl (>= 1.3), libcache-cache-perl, libcarp-perl, libiptables-libiptc-perl, libload-perl, libmime-lite-tt-perl, - libnet-appliance-session-perl, libnet-cli-interact-perl, + libnet-appliance-session-perl (= 1.36), libnet-cli-interact-perl, libnet-interface-perl, libnet-radius-perl, libparse-nessus-nbe-perl, libphp-session-perl, libtest-mockdbi-perl, libsoap-lite-perl, libnet-frame-perl, libthread-pool-perl, From 0718933936011b1d32ed21c4ad01dd62eff26cf8 Mon Sep 17 00:00:00 2001 From: Olivier Bilodeau Date: Tue, 18 Sep 2012 11:53:34 -0400 Subject: [PATCH 8/9] missing comma --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 9bcc1fb3c23b..a8673f2146bf 100644 --- a/debian/control +++ b/debian/control @@ -25,7 +25,7 @@ Depends: ${misc:Depends}, vlan, make, # process management procps, # perl basic components - perl-suid, liblist-moreutils-perl, libwww-perl, libtry-tiny-perl + perl-suid, liblist-moreutils-perl, libwww-perl, libtry-tiny-perl, # perl uncategorized modules libapache-htpasswd-perl, libbit-vector-perl, libtext-csv-perl, libcgi-session-serialize-yaml-perl, libtimedate-perl, libapache-dbi-perl, From bf433ea5df5068c725ba2a6b39adeac18ddc70cb Mon Sep 17 00:00:00 2001 From: Olivier Bilodeau Date: Tue, 18 Sep 2012 11:57:01 -0400 Subject: [PATCH 9/9] fixed Net::Appliance::Session pinned version and added a comment about why it's pinned --- debian/control | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/control b/debian/control index a8673f2146bf..9bc3af0993e0 100644 --- a/debian/control +++ b/debian/control @@ -47,7 +47,11 @@ Depends: ${misc:Depends}, vlan, make, libnet-ldap-perl, libcrypt-generatepassword-perl, perl-doc, dhcp3-server, bind9, librrds-perl, libnetpacket-perl (>= 1.3), libcache-cache-perl, libcarp-perl, libiptables-libiptc-perl, libload-perl, libmime-lite-tt-perl, - libnet-appliance-session-perl (= 1.36), libnet-cli-interact-perl, +# hard-coded to specific version because v3 broke the API and we haven't ported to it yet +# see #1313: Port our Net-Appliance-Session to the version 3 API +# http://packetfence.org/bugs/view.php?id=1313 + libnet-appliance-session-perl (= 2.111080), + libnet-cli-interact-perl, libnet-interface-perl, libnet-radius-perl, libparse-nessus-nbe-perl, libphp-session-perl, libtest-mockdbi-perl, libsoap-lite-perl, libnet-frame-perl, libthread-pool-perl,