Posttrans hack needs to be conditional, and copy from installed locations, not build...
authorScott Cantor <cantor.2@osu.edu>
Wed, 24 Jun 2009 02:11:42 +0000 (02:11 +0000)
committerScott Cantor <cantor.2@osu.edu>
Wed, 24 Jun 2009 02:11:42 +0000 (02:11 +0000)
shibboleth.spec.in

index 69a32df..dde375d 100644 (file)
@@ -164,10 +164,12 @@ sh ./keygen.sh -b
 %posttrans
 # ugly hack if init script got removed during %postun by upgraded (buggy/2.1) package
 %if "%{_vendor}" == "redhat"
-       if [ ! -f %{_initrddir}/shibd ] ; then
-               %{__cp} -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/shibd-%{_vendor} $RPM_BUILD_ROOT%{_initrddir}/shibd
-               %{__chmod} 755 $RPM_BUILD_ROOT%{_initrddir}/shibd
-       fi
+    if [ ! -f %{_initrddir}/shibd ] ; then
+        if [ -f %{_sysconfdir}/%{name}/shibd-%{_vendor} ] ; then
+            %{__cp} -p %{_sysconfdir}/%{name}/shibd-%{_vendor} %{_initrddir}/shibd
+            %{__chmod} 755 %{_initrddir}/shibd
+        fi
+    fi
 %endif
 
 %files -f rpm.filelist