1.1 --- a/cfengine/cfengine.spec Mon Sep 17 19:12:11 2012 +0200 1.2 +++ b/cfengine/cfengine.spec Mon Sep 17 19:13:34 2012 +0200 1.3 @@ -74,10 +74,19 @@ 1.4 %{l_shtool} subst \ 1.5 -e 's;\(LIBS=.*\)-ltokyocabinet;\1`%{l_prefix}/bin/pkg-config --libs-only-l tokyocabinet`;' \ 1.6 -e 's;\(LIBS=.*\)-lcrypto;\1`%{l_prefix}/bin/pkg-config --libs-only-l openssl`;' \ 1.7 + -e "s;mandir=.\${datarootdir}/man.;;" \ 1.8 + -e "s;mandir=.\${exec_prefix}/share/man.;;" \ 1.9 configure 1.10 %{l_shtool} subst \ 1.11 -e 's;\(masterfilesdir = \$(projdatadir)\)/CoreBase;\1/cfengine;' \ 1.12 masterfiles/Makefile.in 1.13 + %{l_shtool} subst \ 1.14 + -e 's;\(string *=>\) "/var/cfengine/masterfiles";\1 translatepath("$(sys.workdir)/masterfiles");' \ 1.15 + -e 's;"/usr/local/sbin";"%{l_prefix}/bin";' \ 1.16 + masterfiles/failsafe.cf 1.17 + %{l_shtool} subst \ 1.18 + -e 's;\(/var/cfengine/masterfiles\);%{l_prefix}\1;g' \ 1.19 + src/bootstrap.c 1.20 1.21 %build 1.22 # configure package 1.23 @@ -103,14 +112,30 @@ 1.24 %install 1.25 # install package 1.26 %{l_shtool} mkdir -f -p -m 755 \ 1.27 - $RPM_BUILD_ROOT%{l_prefix}/var/cfengine 1.28 - %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" 1.29 + $RPM_BUILD_ROOT%{l_prefix}/var/cfengine \ 1.30 + $RPM_BUILD_ROOT%{l_prefix}/share/cfengine/corebase 1.31 + %{l_make} %{l_mflags} install DESTDIR="$RPM_BUILD_ROOT" 1.32 + 1.33 + # copy or move files to correct subdirectories 1.34 + mv \ 1.35 + $RPM_BUILD_ROOT%{l_prefix}/share/doc/examples \ 1.36 + $RPM_BUILD_ROOT%{l_prefix}/share/cfengine 1.37 + mv \ 1.38 + $RPM_BUILD_ROOT%{l_prefix}/share/cfengine/*.cf \ 1.39 + $RPM_BUILD_ROOT%{l_prefix}/share/cfengine/corebase/ 1.40 + cp \ 1.41 + $RPM_BUILD_ROOT%{l_prefix}/share/cfengine/corebase/* \ 1.42 + $RPM_BUILD_ROOT%{l_prefix}/var/cfengine/masterfiles/ 1.43 + cp -rp \ 1.44 + $RPM_BUILD_ROOT%{l_prefix}/bin \ 1.45 + $RPM_BUILD_ROOT%{l_prefix}/var/cfengine/ 1.46 1.47 # strip down installation 1.48 rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc >/dev/null 2>&1 || true 1.49 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/lib* >/dev/null 2>&1 || true 1.50 rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir >/dev/null 2>&1 || true 1.51 - strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true 1.52 + strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true 1.53 + strip $RPM_BUILD_ROOT%{l_prefix}/var/cfengine/bin/* >/dev/null 2>&1 || true 1.54 1.55 # install run-command script 1.56 %{l_shtool} mkdir -f -p -m 755 \ 1.57 @@ -127,6 +152,7 @@ 1.58 # determine installation files 1.59 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ 1.60 %{l_files_std} \ 1.61 + '%config %{l_prefix}/var/cfengine/masterfiles/*' \ 1.62 '%config %{l_prefix}/etc/fsl/fsl.cfengine' 1.63 1.64 %files -f files 1.65 @@ -138,4 +164,10 @@ 1.66 if [ ! -f $RPM_INSTALL_PREFIX/var/cfengine/ppkeys/localhost.priv ]; then 1.67 $RPM_INSTALL_PREFIX/bin/cf-key 1.68 fi 1.69 + ( echo "You must choose a policy server (hub) to use and supply the" 1.70 + echo "corresponding IP address while bootstrapping CFEngine for it" 1.71 + echo "to be useful:" 1.72 + echo "" 1.73 + echo " # $RPM_INSTALL_PREFIX/var/cfengine/bin/cf-agent --bootstrap --policy-server <ipddr>" 1.74 + ) | %{l_rpmtool} msg -b -t notice 1.75