|
|
@@ -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
|
|
|
+
|