Kaynağa Gözat

new package

Ralf S. Engelschall 15 yıl önce
ebeveyn
işleme
95d78589f3
4 değiştirilmiş dosya ile 339 ekleme ve 0 silme
  1. 55 0
      drizzle/drizzle.cnf
  2. 11 0
      drizzle/drizzle.patch
  3. 187 0
      drizzle/drizzle.spec
  4. 86 0
      drizzle/rc.drizzle

+ 55 - 0
drizzle/drizzle.cnf

@@ -0,0 +1,55 @@
+##
+##  my.cnf -- MySQL configuration
+##
+
+[client]
+
+socket                           = @l_prefix@/var/mysql/mysql.sock
+port                             = 3306
+
+[mysqld]
+
+bind-address                     = 127.0.0.1
+port                             = 3306
+#skip-networking
+
+tmpdir                           = @l_prefix@/var/mysql/tmp
+log                              = @l_prefix@/var/mysql/common.log
+#log-bin                         = @l_prefix@/var/mysql/binary.log
+#server-id                       = 1
+
+key_buffer_size                  = 64M
+table_cache                      = 256
+join_buffer_size                 = 1M
+max_connections                  = 1000
+max_connect_errors               = 10
+max_delayed_threads              = 20
+max_heap_table_size              = 16777216
+max_sort_length                  = 1024
+max_user_connections             = 1000
+record_buffer                    = 131072
+sort_buffer                      = 4M
+key_buffer                       = 1M
+tmp_table_size                   = 32M
+query_cache_type                 = 1
+query_cache_limit                = 1M
+query_cache_size                 = 32M
+ft_min_word_len                  = 3
+
+<with_innobase>
+innodb_buffer_pool_size          = 70M
+innodb_additional_mem_pool_size  = 2M
+innodb_log_files_in_group        = 3
+innodb_log_file_size             = 20M
+innodb_log_buffer_size           = 8M
+innodb_lock_wait_timeout         = 50
+
+</with_innobase>
+[mysqld_safe]
+
+datadir                          = @l_prefix@/var/mysql
+socket                           = @l_prefix@/var/mysql/mysql.sock
+pid_file                         = @l_prefix@/var/mysql/mysqld.pid
+user                             = @l_rusr@
+basedir                          = @l_prefix@
+

+ 11 - 0
drizzle/drizzle.patch

@@ -0,0 +1,11 @@
+Index: configure
+--- configure.orig	2010-07-20 17:57:25.000000000 +0200
++++ configure	2010-08-03 10:39:49.000000000 +0200
+@@ -21411,7 +21411,6 @@
+ 
+ 
+ 
+-  ac_cv_warnings_as_errors=yes
+ 
+   # Check whether --enable-profiling was given.
+ if test "${enable_profiling+set}" = set; then :

+ 187 - 0
drizzle/drizzle.spec

@@ -0,0 +1,187 @@
+##
+##  drizzle.spec -- OpenPKG RPM Package Specification
+##  Copyright (c) 2000-2010 OpenPKG Foundation e.V. <http://openpkg.net/>
+##
+##  Permission to use, copy, modify, and distribute this software for
+##  any purpose with or without fee is hereby granted, provided that
+##  the above copyright notice and this permission notice appear in all
+##  copies.
+##
+##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+##  SUCH DAMAGE.
+##
+
+#   package version
+%define       V_drizzle 2010.07.1666
+%define       V_date    2010-07-19
+
+#   package information
+Name:         drizzle
+Summary:      Lightweight SQL Database for Cloud and Web
+URL:          http://drizzle.org/
+Vendor:       ORACLE, Drizzle Team
+Packager:     OpenPKG Foundation e.V.
+Distribution: OpenPKG Community
+Class:        EVAL
+Group:        Database
+License:      GPL
+Version:      %{V_drizzle}
+Release:      20100803
+
+#   package options
+%option       with_ssl      yes
+
+#   list of sources
+Source0:      http://launchpad.net/drizzle/dexter/%{V_date}/+download/drizzle-%{V_drizzle}.tar.gz
+Source1:      rc.drizzle
+Source2:      drizzle.cnf
+Patch0:       drizzle.patch
+
+#   build information
+BuildPreReq:  OpenPKG, openpkg >= 20100101, make, gcc, gcc::with_cxx = yes, perl, bison
+PreReq:       OpenPKG, openpkg >= 20100101
+BuildPreReq:  libdrizzle, protobuf, zlib, libuuid, boost, gettext
+PreReq:       libdrizzle, protobuf, zlib, libuuid, boost, gettext
+%if "%{with_ssl}" == "yes"
+BuildPreReq:  openssl
+PreReq:       openssl
+%endif
+
+%description
+    Drizzle...
+
+%track
+    prog drizzle = {
+        version   = %{V_drizzle}
+        url       = http://launchpad.net/drizzle/+download
+        regex     = drizzle-(__VER__)\.tar\.gz
+    }
+
+%prep
+    %setup -q
+    %patch -p0
+
+%build
+    #   configure source tree
+    CC="%{l_cc}" \
+    CXX="%{l_cxx}" \
+    CFLAGS="%{l_cflags -O}" \
+    CXXFLAGS="%{l_cxxflags -O}" \
+    CPPFLAGS="%{l_cppflags e2fs .}" \
+    LDFLAGS="%{l_ldflags}" \
+    LIBS="-lintl" \
+    ./configure \
+        --prefix=%{l_prefix} \
+        --mandir=%{l_prefix}/man \
+        --infodir=%{l_prefix}/info \
+        --sysconfdir=%{l_prefix}/etc/drizzle \
+        --localstatedir=%{l_prefix}/var/drizzle \
+        --libexecdir=%{l_prefix}/libexec/drizzle \
+        --with-drizzled-user=%{l_musr} \
+        --with-comment="%{l_openpkg_release}" \
+        --enable-shared
+
+    #   build source tree
+    %{l_make} %{l_mflags -O}
+
+%install
+    #   perform standard installation procedure
+    %{l_make} %{l_mflags} install \
+        AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" \
+        DESTDIR=$RPM_BUILD_ROOT
+
+    #   strip installation area
+    rm -f  $RPM_BUILD_ROOT%{l_prefix}/info/dir
+    rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/locale
+    rm -f  $RPM_BUILD_ROOT%{l_prefix}/lib/drizzle/*.a
+    strip $RPM_BUILD_ROOT%{l_prefix}/sbin/drizzled >/dev/null 2>&1 || true
+
+    #   install global configuration
+    %{l_shtool} mkdir -f -p -m 755 \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/drizzle
+    %{l_shtool} install -c -m 644 %{l_value -s -a} \
+        %{SOURCE drizzle.cnf} \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/drizzle/
+
+    #   install run-command script
+    %{l_shtool} mkdir -f -p -m 755 \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
+    %{l_shtool} install -c -m 755 %{l_value -s -a} \
+        %{SOURCE rc.drizzle} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
+
+    #   make sure the database directory exists
+    %{l_shtool} mkdir -f -p -m 755 \
+        $RPM_BUILD_ROOT%{l_prefix}/var/drizzle
+
+    #   directory for temporary tables
+    %{l_shtool} mkdir -f -p -m 700 \
+        $RPM_BUILD_ROOT%{l_prefix}/var/drizzle/tmp
+
+    #   determine the package files
+    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
+        %{l_files_std} \
+        '%config %attr(644,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/drizzle/drizzle.cnf' \
+        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/drizzle' \
+        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/drizzle/tmp'
+
+%files -f files
+
+%clean
+
+%pre
+    #   before upgrade, save status and stop service
+    [ $1 -eq 2 ] || exit 0
+    eval `%{l_rc} drizzle status 2>/dev/null | tee %{l_tmpfile}`
+    %{l_rc} drizzle stop 2>/dev/null
+    exit 0
+
+%post
+    if [ $1 -eq 1 ]; then
+        #   after install, create initial database
+        $RPM_INSTALL_PREFIX/bin/drizzle_install_db \
+            --defaults-file=$RPM_INSTALL_PREFIX/etc/drizzle/my.cnf >/dev/null 2>&1
+        chown -R %{l_rusr}:%{l_rgrp} $RPM_INSTALL_PREFIX/var/drizzle/*
+        ( echo "An initial Drizzle DB was created. The owner of the database"
+          echo "is the DB user 'root'. Its initial password is empty."
+          echo "After starting Drizzle with..."
+          echo ""
+          echo "  \$ $RPM_INSTALL_PREFIX/bin/openpkg rc drizzle start"
+          echo ""
+          echo "...you should change the password as soon as possible with:"
+          echo ""
+          echo "  \$ $RPM_INSTALL_PREFIX/bin/drizzleadmin \\ "
+          echo "    -u root password '<new-password>'"
+          echo ""
+          echo "Additionally, because the Drizzle package includes automated"
+          echo "maintenance procedures that require administrator access to"
+          echo "the database, you must maintain a (plain text) copy of the"
+          echo "administrator account name and password:"
+          echo ""
+          echo "  \$ vi $RPM_INSTALL_PREFIX/etc/drizzle/my.pwd"
+        ) | %{l_rpmtool} msg -b -t notice
+    fi
+    if [ $1 -eq 2 ]; then
+        #   after upgrade, restore status
+        { eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile}; true; } >/dev/null 2>&1
+        [ ".$drizzle_active" = .yes ] && %{l_rc} drizzle start
+    fi
+    exit 0
+
+%preun
+    #   before erase, stop service and remove log files
+    [ $1 -eq 0 ] || exit 0
+    %{l_rc} drizzle stop 2>/dev/null
+    rm -f $RPM_INSTALL_PREFIX/var/drizzle/*.log* >/dev/null 2>&1 || true
+    rm -f $RPM_INSTALL_PREFIX/var/drizzle/*.err* >/dev/null 2>&1 || true
+    exit 0
+

+ 86 - 0
drizzle/rc.drizzle

@@ -0,0 +1,86 @@
+#!@l_prefix@/bin/openpkg rc
+##
+##  rc.drizzle -- Run-Commands
+##
+
+%config
+    drizzle_enable="$openpkg_rc_def"
+    drizzle_pwd_file=@l_prefix@/etc/drizzle/my.pwd
+    drizzle_cnf_file=@l_prefix@/etc/drizzle/my.cnf
+    drizzle_common_prolog="true"
+    drizzle_common_epilog="true"
+    drizzle_common_numfiles="10"
+    drizzle_common_minsize="1M"
+    drizzle_common_complevel="9"
+    drizzle_err_prolog="true"
+    drizzle_err_epilog="true"
+    drizzle_err_numfiles="10"
+    drizzle_err_minsize="1M"
+    drizzle_err_complevel="9"
+
+%common
+    drizzle_pid_file=@l_prefix@/var/drizzle/drizzled.pid
+    drizzle_err_log=@l_prefix@/var/drizzle/drizzled.err
+    drizzle_common_log=@l_prefix@/var/drizzle/common.log
+    drizzle_flush_logs () {
+        HOME=@l_prefix@/etc/drizzle @l_prefix@/bin/drizzleadmin \
+            --defaults-extra-file=${drizzle_pwd_file} \
+            flush-logs
+    }
+
+%status -u @l_susr@ -o
+    drizzle_usable="unknown"
+    drizzle_active="no"
+    HOME=@l_prefix@/etc/drizzle @l_prefix@/bin/drizzleadmin \
+        --defaults-extra-file=${drizzle_pwd_file} \
+        ping >/dev/null 2>&1 && drizzle_active="yes"
+    if [ $drizzle_active = "no" -a -f $drizzle_pid_file ] ; then
+        kill -0 `cat $drizzle_pid_file` && drizzle_active="unknown"
+    fi
+    echo "drizzle_enable=\"$drizzle_enable\""
+    echo "drizzle_usable=\"$drizzle_usable\""
+    echo "drizzle_active=\"$drizzle_active\""
+
+%start -p 400 -u @l_susr@
+    rcService drizzle enable yes || exit 0
+    rcService drizzle active yes && exit 0
+    cd @l_prefix@
+    cmd="@l_prefix@/bin/drizzled_safe"
+    cmd="$cmd --pid-file=$drizzle_pid_file"
+    cmd="$cmd --log-error=$drizzle_err_log"
+    su @l_rusr@ -c "$cmd </dev/null >/dev/null 2>&1 &" </dev/null >/dev/null 2>&1
+
+%stop -p 600 -u @l_susr@
+    rcService drizzle enable yes || exit 0
+    rcService drizzle active no  && exit 0
+    drizzle_flush_logs
+    HOME=@l_prefix@/etc/drizzle @l_prefix@/bin/drizzleadmin \
+        --defaults-extra-file=${drizzle_pwd_file} \
+        shutdown
+
+%restart -p 400 -u @l_susr@
+    rcService drizzle enable yes || exit 0
+    rcService drizzle active no  && exit 0
+    rc drizzle stop start
+
+%daily -u @l_susr@
+    rcService drizzle enable yes || exit 0
+    rcTmp -i
+    hintfile=`rcTmp -f -n hint`
+    shtool rotate -f \
+        -n ${drizzle_common_numfiles} -s ${drizzle_common_minsize} -d \
+        -z ${drizzle_common_complevel} -m 660 -o @l_rusr@ -g @l_rgrp@ \
+        -P "${drizzle_common_prolog}" \
+        -E "${drizzle_common_epilog}; echo 1 >$hintfile" \
+        ${drizzle_common_log}
+    shtool rotate -f \
+        -n ${drizzle_err_numfiles} -s ${drizzle_err_minsize} -d \
+        -z ${drizzle_err_complevel} -m 660 -o @l_rusr@ -g @l_rgrp@ \
+        -P "${drizzle_err_prolog}" \
+        -E "${drizzle_err_epilog}; echo 1 >$hintfile" \
+        ${drizzle_err_log}
+    if [ -s $hintfile ]; then
+        drizzle_flush_logs
+    fi
+    rcTmp -k
+