wok-next view snort-mysql/receipt @ rev 20677

Up libsigsegv (2.12); add libseccomp
author Aleksej Bobylev <al.bobylev@gmail.com>
date Tue May 15 00:56:38 2018 +0300 (2018-05-15)
parents d43bf7aae921
children cd7906120828
line source
1 # SliTaz package receipt v2.
3 PACKAGE="snort-mysql"
4 VERSION="2.9.4"
5 CATEGORY="network"
6 SHORT_DESC="Network intrusion prevention and detection system (IDS/IPS) with \
7 MySQL support"
8 MAINTAINER="pascal.bellard@slitaz.org"
9 LICENSE="GPL2"
10 WEB_SITE="http://www.snort.org/"
12 TARBALL="$PACKAGE-$VERSION.tar.gz"
13 WGET_URL="http://www.snort.org/downloads/1207"
15 BUILD_DEPENDS="pcre-dev libpcap-dev libdaq-dev libdnet-dev zlib-dev \
16 mysql-dev flex"
18 compile_rules() {
19 ./configure \
20 --with-mysql \
21 --enable-dynamicplugin \
22 --enable-perfprofiling \
23 --enable-zlib \
24 --enable-reload \
25 $CONFIGURE_ARGS &&
26 fix libtool &&
27 make &&
28 make DESTDIR=$DESTDIR install
29 }
31 genpkg_rules() {
32 mkdir -p \
33 $fs/usr/lib \
34 $fs/etc/snort/rules \
35 $fs/usr/share/snort/schemas \
36 $fs/var/log/snort
38 cp -a $install/usr/bin $fs/usr
39 cp -a $install/usr/lib/snort_dynamic* $fs/usr/lib
41 cp -a $src/etc/*.conf* $fs/etc/snort
42 cp -a $src/etc/*.map $fs/etc/snort
43 cp -a $src/schemas/create_mysql $fs/usr/share/snort/schemas
45 # Remove unwanted files
46 rm -f $fs/usr/lib/*/*.*a
47 DEPENDS="pcre libdnet libdaq libmysqlclient"
48 }
50 post_install() {
51 local db_name=snort
52 local db_pass=snort
53 local db_schema=/usr/share/snort/create_mysql
55 newline
57 # addgroup snort if needed
58 if ! grep -q snort "$1/etc/group"; then
59 chroot "$1/" /bin/addgroup snort
60 fi
61 # adduser snort if needed
62 if ! grep -q 'snort:' "$1/etc/passwd"; then
63 chroot "$1/" /bin/adduser -s /bin/false -h /dev/null \
64 -g "Snort Daemon user" -H -D -S -G snort snort
65 fi
66 chroot "$1/" chown snort.snort /var/log/snort
68 # Create database
69 if [ -z "$1" ]; then
70 if ( ! mysqladmin -s ping >/dev/null ); then
71 echo 'Starting MySQL server'
72 ( /etc/init.d/mysql start ; status ) || exit
73 sleep 4 #let the mysql daemon start
74 fi
75 if ( ! mysql -u root -Be 'show databases' | grep -q $db_name ); then
76 action 'Create $db_name database'
77 mysql -Be "create database $db_name"
78 status
79 # We suppose that user does not exist.
80 # It may be false.
81 action 'Create user $db_user with password $db_pass'
82 mysql -Be "grant all privileges on glpi.* to $db_user@'localhost' identified by '$db_pass'"
83 status
84 # At last create the database for package
85 action 'Create $db_name database schema.'
86 mysql -u $db_user -p${db_pass} $db_name < $db_schema
87 status
88 fi
89 fi
90 }