wok-6.x view snort-mysql/receipt @ rev 23656

updated snort, snort-dev and snort-mysql (2.9.4 -> 2.9.16)
author Hans-G?nter Theisgen
date Wed Apr 22 06:38:03 2020 +0100 (2020-04-22)
parents a78610b2eb47
children d2428ad296aa
line source
1 # SliTaz package receipt.
3 PACKAGE="snort-mysql"
4 VERSION="2.9.16"
5 CATEGORY="network"
6 SHORT_DESC="Network intrusion prevention and detection system (IDS/IPS) with MySQL support."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL2"
9 WEB_SITE="https://www.snort.org/"
11 SOURCE="snort"
12 TARBALL="$SOURCE-$VERSION.tar.gz"
13 WGET_URL="${WEB_SITE}downloads/$SOURCE/$TARBALL"
15 DEPENDS="libdaq libdnet libmysqlclient openssl pcre"
16 BUILD_DEPENDS="flex libdaq-dev libdnet-dev libpcap-dev luajit-dev
17 mysql-dev openssl-dev pcre-dev zlib-dev"
19 # Rules to configure and make the package.
20 compile_rules()
21 {
22 ./configure \
23 luajit_LIBS=/usr/lib/libluajit-5.1.so \
24 lujit_CFLAGS=" " \
25 --prefix=/usr \
26 --with-mysql \
27 --enable-dynamicplugin \
28 --disable-openappid \
29 --enable-perfprofiling \
30 --enable-reload \
31 --enable-zlib \
32 $CONFIGURE_ARGS &&
33 make &&
34 make DESTDIR=$DESTDIR install
35 }
37 # Rules to gen a SliTaz package suitable for Tazpkg.
38 genpkg_rules()
39 {
40 mkdir -p \
41 $fs/usr/lib \
42 $fs/etc/snort/rules \
43 $fs/usr/share/snort/schemas \
44 $fs/var/log/snort
46 cp -a $install/usr/bin $fs/usr
47 cp -a $install/usr/lib/snort_dynamic* $fs/usr/lib
49 cp -a $src/etc/*.conf* $fs/etc/snort
50 cp -a $src/etc/*.map $fs/etc/snort
51 cp -a $src/schemas/create_mysql $fs/usr/share/snort/schemas
53 # Remove unwanted files
54 rm -f $fs/usr/lib/*/*.*a
55 }
57 # Post install commands
58 post_install()
59 {
60 local db_name=snort
61 local db_pass=snort
62 local db_schema=/usr/share/snort/create_mysql
64 newline
66 # addgroup snort if needed
67 if ! grep -q snort "$1/etc/group"
68 then
69 action 'Adding group snort...'
70 chroot "$1/" /bin/addgroup snort
71 status
72 fi
74 # adduser snort if needed
75 if ! grep -q 'snort:' "$1/etc/passwd"
76 then
77 action 'Adding user snort...'
78 chroot "$1/" /bin/adduser -s /bin/false -h /dev/null \
79 -g "Snort Daemon user" -H -D -S -G snort snort
80 status
81 fi
82 chroot "$1/" chown snort.snort /var/log/snort
84 # Create database
85 if [ -z "$1" ]
86 then
87 if ( ! mysqladmin -s ping > /dev/null )
88 then
89 echo 'Starting MySQL server'
90 ( /etc/init.d/mysql start ; status ) || exit
91 sleep 4 #let the mysql daemon start
92 fi
93 if ( ! mysql -u root -Be 'show databases' | grep -q $db_name )
94 then
95 action 'Create $db_name database'
96 mysql -Be "create database $db_name"
97 status
98 # We suppose that user does not exist.
99 # It may be false.
100 action 'Create user $db_user with password $db_pass'
101 mysql -Be "grant all privileges on glpi.* to $db_user@'localhost' identified by '$db_pass'"
102 status
103 # At last create the database for package
104 action 'Create $db_name database schema.'
105 mysql -u $db_user -p${db_pass} $db_name < $db_schema
106 status
107 fi
108 fi
109 }