cfengine/cfengine.spec

changeset 692
67831a9de168
parent 563
e39a632d12f7
equal deleted inserted replaced
1:80102c9d76a1 2:7f09a99ef5fa
72 %prep 72 %prep
73 %setup -q 73 %setup -q
74 %{l_shtool} subst \ 74 %{l_shtool} subst \
75 -e 's;\(LIBS=.*\)-ltokyocabinet;\1`%{l_prefix}/bin/pkg-config --libs-only-l tokyocabinet`;' \ 75 -e 's;\(LIBS=.*\)-ltokyocabinet;\1`%{l_prefix}/bin/pkg-config --libs-only-l tokyocabinet`;' \
76 -e 's;\(LIBS=.*\)-lcrypto;\1`%{l_prefix}/bin/pkg-config --libs-only-l openssl`;' \ 76 -e 's;\(LIBS=.*\)-lcrypto;\1`%{l_prefix}/bin/pkg-config --libs-only-l openssl`;' \
77 -e "s;mandir=.\${datarootdir}/man.;;" \
78 -e "s;mandir=.\${exec_prefix}/share/man.;;" \
77 configure 79 configure
78 %{l_shtool} subst \ 80 %{l_shtool} subst \
79 -e 's;\(masterfilesdir = \$(projdatadir)\)/CoreBase;\1/cfengine;' \ 81 -e 's;\(masterfilesdir = \$(projdatadir)\)/CoreBase;\1/cfengine;' \
80 masterfiles/Makefile.in 82 masterfiles/Makefile.in
83 %{l_shtool} subst \
84 -e 's;\(string *=>\) "/var/cfengine/masterfiles";\1 translatepath("$(sys.workdir)/masterfiles");' \
85 -e 's;"/usr/local/sbin";"%{l_prefix}/bin";' \
86 masterfiles/failsafe.cf
87 %{l_shtool} subst \
88 -e 's;\(/var/cfengine/masterfiles\);%{l_prefix}\1;g' \
89 src/bootstrap.c
81 90
82 %build 91 %build
83 # configure package 92 # configure package
84 CC="%{l_cc}" \ 93 CC="%{l_cc}" \
85 CFLAGS="%{l_cflags -O}" \ 94 CFLAGS="%{l_cflags -O}" \
101 %{l_make} %{l_mflags -O} 110 %{l_make} %{l_mflags -O}
102 111
103 %install 112 %install
104 # install package 113 # install package
105 %{l_shtool} mkdir -f -p -m 755 \ 114 %{l_shtool} mkdir -f -p -m 755 \
106 $RPM_BUILD_ROOT%{l_prefix}/var/cfengine 115 $RPM_BUILD_ROOT%{l_prefix}/var/cfengine \
107 %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" 116 $RPM_BUILD_ROOT%{l_prefix}/share/cfengine/corebase
117 %{l_make} %{l_mflags} install DESTDIR="$RPM_BUILD_ROOT"
118
119 # copy or move files to correct subdirectories
120 mv \
121 $RPM_BUILD_ROOT%{l_prefix}/share/doc/examples \
122 $RPM_BUILD_ROOT%{l_prefix}/share/cfengine
123 mv \
124 $RPM_BUILD_ROOT%{l_prefix}/share/cfengine/*.cf \
125 $RPM_BUILD_ROOT%{l_prefix}/share/cfengine/corebase/
126 cp \
127 $RPM_BUILD_ROOT%{l_prefix}/share/cfengine/corebase/* \
128 $RPM_BUILD_ROOT%{l_prefix}/var/cfengine/masterfiles/
129 cp -rp \
130 $RPM_BUILD_ROOT%{l_prefix}/bin \
131 $RPM_BUILD_ROOT%{l_prefix}/var/cfengine/
108 132
109 # strip down installation 133 # strip down installation
110 rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc >/dev/null 2>&1 || true 134 rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc >/dev/null 2>&1 || true
111 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/lib* >/dev/null 2>&1 || true 135 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/lib* >/dev/null 2>&1 || true
112 rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir >/dev/null 2>&1 || true 136 rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir >/dev/null 2>&1 || true
113 strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true 137 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
138 strip $RPM_BUILD_ROOT%{l_prefix}/var/cfengine/bin/* >/dev/null 2>&1 || true
114 139
115 # install run-command script 140 # install run-command script
116 %{l_shtool} mkdir -f -p -m 755 \ 141 %{l_shtool} mkdir -f -p -m 755 \
117 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d 142 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
118 %{l_shtool} install -c -m 755 %{l_value -s -a} \ 143 %{l_shtool} install -c -m 755 %{l_value -s -a} \
125 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/ 150 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
126 151
127 # determine installation files 152 # determine installation files
128 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ 153 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
129 %{l_files_std} \ 154 %{l_files_std} \
155 '%config %{l_prefix}/var/cfengine/masterfiles/*' \
130 '%config %{l_prefix}/etc/fsl/fsl.cfengine' 156 '%config %{l_prefix}/etc/fsl/fsl.cfengine'
131 157
132 %files -f files 158 %files -f files
133 159
134 %clean 160 %clean
136 %post 162 %post
137 # generate a public/private key pair for localhost 163 # generate a public/private key pair for localhost
138 if [ ! -f $RPM_INSTALL_PREFIX/var/cfengine/ppkeys/localhost.priv ]; then 164 if [ ! -f $RPM_INSTALL_PREFIX/var/cfengine/ppkeys/localhost.priv ]; then
139 $RPM_INSTALL_PREFIX/bin/cf-key 165 $RPM_INSTALL_PREFIX/bin/cf-key
140 fi 166 fi
167 ( echo "You must choose a policy server (hub) to use and supply the"
168 echo "corresponding IP address while bootstrapping CFEngine for it"
169 echo "to be useful:"
170 echo ""
171 echo " # $RPM_INSTALL_PREFIX/var/cfengine/bin/cf-agent --bootstrap --policy-server <ipddr>"
172 ) | %{l_rpmtool} msg -b -t notice
141 173

mercurial