|
|
@@ -37,12 +37,14 @@ Release: 20070127
|
|
|
|
|
|
# list of sources
|
|
|
Source0: http://venge.net/monotone/downloads/monotone-%{version}.tar.gz
|
|
|
+Source1: rc.monotone
|
|
|
+Source3: monotone-setup.sh
|
|
|
|
|
|
# build information
|
|
|
Prefix: %{l_prefix}
|
|
|
BuildRoot: %{l_buildroot}
|
|
|
BuildPreReq: OpenPKG, openpkg >= 20040130, gcc, gcc::with_cxx = yes
|
|
|
-PreReq: OpenPKG, openpkg >= 20040130
|
|
|
+PreReq: OpenPKG, openpkg >= 20040130, apg
|
|
|
BuildPreReq: boost, zlib
|
|
|
PreReq: boost, zlib
|
|
|
AutoReq: no
|
|
|
@@ -68,6 +70,7 @@ AutoReqProv: no
|
|
|
%setup -q
|
|
|
|
|
|
%build
|
|
|
+ # configure program
|
|
|
CC="%{l_cc}" \
|
|
|
CXX="%{l_cxx}" \
|
|
|
CFLAGS="%{l_cflags -O}" \
|
|
|
@@ -80,23 +83,79 @@ AutoReqProv: no
|
|
|
--mandir=%{l_prefix}/man \
|
|
|
--enable-static-boost=%{l_prefix} \
|
|
|
--disable-nls
|
|
|
+
|
|
|
+ # build program
|
|
|
%{l_make} %{l_mflags -O}
|
|
|
|
|
|
%install
|
|
|
+ # install program
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
%{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
|
|
|
+
|
|
|
+ # strip down installation
|
|
|
strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
|
|
|
mv $RPM_BUILD_ROOT%{l_prefix}/share/doc/monotone \
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/share/monotone
|
|
|
rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
|
|
|
rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/locale
|
|
|
rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
|
|
|
+
|
|
|
+ # install setup script
|
|
|
+ %{l_shtool} mkdir -f -p -m 755 \
|
|
|
+ $RPM_BUILD_ROOT%{l_prefix}/sbin
|
|
|
+ %{l_shtool} install -c -m 755 %{l_value -s -a} \
|
|
|
+ -e 's;@l_shtool@;%{l_shtool};g' \
|
|
|
+ %{SOURCE monotone-setup.sh} \
|
|
|
+ $RPM_BUILD_ROOT%{l_prefix}/sbin/monotone-setup
|
|
|
+
|
|
|
+ # 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.monotone} \
|
|
|
+ $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
|
|
|
+
|
|
|
+ # create additional directories for server operation
|
|
|
+ %{l_shtool} mkdir -f -p -m 755 \
|
|
|
+ $RPM_BUILD_ROOT%{l_prefix}/etc/monotone \
|
|
|
+ $RPM_BUILD_ROOT%{l_prefix}/var/monotone
|
|
|
+
|
|
|
+ # determine installation files
|
|
|
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
|
|
|
%{l_files_std} \
|
|
|
- '%doc %{l_prefix}/share/monotone/*'
|
|
|
+ '%config %{l_prefix}/etc/monotone/*' \
|
|
|
+ '%doc %{l_prefix}/share/monotone/*' \
|
|
|
+ '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/monotone'
|
|
|
|
|
|
%files -f files
|
|
|
|
|
|
%clean
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
+%post
|
|
|
+ if [ $1 -eq 1 ]; then
|
|
|
+ # display initial hint
|
|
|
+ ( echo "If you want to use the Monotone daemon for serving"
|
|
|
+ echo "a central permanently available database, run:"
|
|
|
+ echo " $RPM_INSTALL_PREFIX/sbin/monotone-setup install \\ "
|
|
|
+ echo " [<server-mail-address> [<server-password>]]"
|
|
|
+ echo "and put into your $RPM_INSTALL_PREFIX/etc/rc.conf at least:"
|
|
|
+ echo " monotone_daemon=\"yes\""
|
|
|
+ echo " monotone_daemon_host=\"<server-ip-address>\""
|
|
|
+ ) | %{l_rpmtool} msg -b -t notice
|
|
|
+ elif [ $1 -eq 2 ]; then
|
|
|
+ # after upgrade, restart service
|
|
|
+ eval `%{l_rc} monotone status 2>/dev/null`
|
|
|
+ [ ".$monotone_active" = .yes ] && %{l_rc} monotone restart
|
|
|
+ fi
|
|
|
+ exit 0
|
|
|
+
|
|
|
+%preun
|
|
|
+ if [ $1 -eq 0 ]; then
|
|
|
+ # before erase, stop service and remove log files
|
|
|
+ %{l_rc} monotone stop 2>/dev/null
|
|
|
+ $RPM_INSTALL_PREFIX/sbin/monotone-setup uninstall >/dev/null 2>&1 || true
|
|
|
+ rm -f $RPM_INSTALL_PREFIX/var/monotone/monotone.log* >/dev/null 2>&1 || true
|
|
|
+ fi
|
|
|
+ exit 0
|
|
|
+
|