wok-current diff snort-mysql/receipt @ rev 19594
Up: zlib (1.2.9)
author | Alexander Medvedev <devl547@gmail.com> |
---|---|
date | Sun Jan 01 17:10:55 2017 +0000 (2017-01-01) |
parents | 9e01bc6321ea |
children | a78610b2eb47 |
line diff
1.1 --- a/snort-mysql/receipt Sun Dec 20 15:13:45 2015 +0100 1.2 +++ b/snort-mysql/receipt Sun Jan 01 17:10:55 2017 +0000 1.3 @@ -10,7 +10,8 @@ 1.4 WEB_SITE="http://www.snort.org/" 1.5 WGET_URL="http://www.snort.org/downloads/1207" 1.6 DEPENDS="pcre libdnet libdaq libmysqlclient" 1.7 -BUILD_DEPENDS="pcre-dev libpcap-dev libdaq-dev libdnet-dev wget zlib-dev mysql-dev flex" 1.8 +BUILD_DEPENDS="pcre-dev libpcap-dev libdaq-dev libdnet-dev wget zlib-dev \ 1.9 +mysql-dev flex" 1.10 1.11 # Rules to configure and make the package. 1.12 compile_rules() 1.13 @@ -30,23 +31,23 @@ 1.14 # Rules to gen a SliTaz package suitable for Tazpkg. 1.15 genpkg_rules() 1.16 { 1.17 - mkdir -p $fs/usr/lib \ 1.18 + mkdir -p \ 1.19 + $fs/usr/lib \ 1.20 $fs/etc/snort/rules \ 1.21 $fs/usr/share/snort/schemas \ 1.22 - $fs/var/log/snort 1.23 - 1.24 + $fs/var/log/snort 1.25 + 1.26 cp -a $install/usr/bin $fs/usr 1.27 cp -a $install/usr/lib/snort_dynamic* $fs/usr/lib 1.28 - 1.29 + 1.30 cp -a $src/etc/*.conf* $fs/etc/snort 1.31 cp -a $src/etc/*.map $fs/etc/snort 1.32 cp -a $src/schemas/create_mysql $fs/usr/share/snort/schemas 1.33 - 1.34 + 1.35 # Remove unwanted files 1.36 rm -f $fs/usr/lib/*/*.*a 1.37 } 1.38 1.39 - 1.40 # Post install commands 1.41 post_install() 1.42 { 1.43 @@ -54,43 +55,43 @@ 1.44 local db_pass=snort 1.45 local db_schema=/usr/share/snort/create_mysql 1.46 1.47 - echo "Processing post install commands..." 1.48 + newline 1.49 1.50 # addgroup snort if needed 1.51 - if ! grep -q snort "$1/etc/group"; then 1.52 - echo -n "Adding group Snort..." 1.53 - chroot "$1/" /bin/addgroup snort 1.54 - status 1.55 - fi 1.56 - # adduser snort if needed 1.57 - if ! grep -q 'snort:' "$1/etc/passwd"; then 1.58 - echo -n "Adding user Snort..." 1.59 - chroot "$1/" /bin/adduser -s /bin/false -h /dev/null \ 1.60 - -g "Snort Daemon user" -H -D -S -G snort snort 1.61 - status 1.62 - fi 1.63 + if ! grep -q snort "$1/etc/group"; then 1.64 + action 'Adding group snort...' 1.65 + chroot "$1/" /bin/addgroup snort 1.66 + status 1.67 + fi 1.68 + # adduser snort if needed 1.69 + if ! grep -q 'snort:' "$1/etc/passwd"; then 1.70 + action 'Adding user snort...' 1.71 + chroot "$1/" /bin/adduser -s /bin/false -h /dev/null \ 1.72 + -g "Snort Daemon user" -H -D -S -G snort snort 1.73 + status 1.74 + fi 1.75 chroot "$1/" chown snort.snort /var/log/snort 1.76 1.77 # Create database 1.78 - if [ -z "$1" ]; then 1.79 - if ( ! mysqladmin -s ping > /dev/null ); then 1.80 - echo "Starting MySQL server" 1.81 - ( /etc/init.d/mysql start ; status ) || exit 1.82 - sleep 4 #let the mysql daemon start 1.83 - fi 1.84 - if ( ! mysql -u root -Be 'show databases' | grep -q $db_name ); then 1.85 - echo -n "Create $db_name database" 1.86 - mysql -Be "create database $db_name" ; 1.87 - # We suppose that user does not exist. 1.88 - # It may be false. 1.89 - echo -n "Create user $db_user with password $db_pass" 1.90 - mysql -Be "grant all privileges on glpi.* to $db_user@'localhost' 1.91 - identified by '$db_pass'" ; status 1.92 - # At last create the database for package 1.93 - echo -n "Create $db_name database schema." 1.94 - mysql -u $db_user -p${db_pass} $db_name < $db_schema ; status 1.95 - 1.96 - fi 1.97 - 1.98 - fi 1.99 + if [ -z "$1" ]; then 1.100 + if ( ! mysqladmin -s ping > /dev/null ); then 1.101 + echo 'Starting MySQL server' 1.102 + ( /etc/init.d/mysql start ; status ) || exit 1.103 + sleep 4 #let the mysql daemon start 1.104 + fi 1.105 + if ( ! mysql -u root -Be 'show databases' | grep -q $db_name ); then 1.106 + action 'Create $db_name database' 1.107 + mysql -Be "create database $db_name" 1.108 + status 1.109 + # We suppose that user does not exist. 1.110 + # It may be false. 1.111 + action 'Create user $db_user with password $db_pass' 1.112 + mysql -Be "grant all privileges on glpi.* to $db_user@'localhost' identified by '$db_pass'" 1.113 + status 1.114 + # At last create the database for package 1.115 + action 'Create $db_name database schema.' 1.116 + mysql -u $db_user -p${db_pass} $db_name < $db_schema 1.117 + status 1.118 + fi 1.119 + fi 1.120 }