diff --git a/libreoffice.spec b/libreoffice.spec index ec41fb3..37c77ec 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -1277,7 +1277,7 @@ export PRODUCTVERSIONSHORT PRODUCTVERSION # installation -mkdir -p $RPM_BUILD_ROOT/%{instdir} +mkdir -p %{buildroot}%{instdir} if ! make instsetoo_native PKGFORMAT=installed EPM=not-used-but-must-be-set; then echo - ---dump log start--- cat $ WORKDIR/installation/LibreOffice/installed/logging/en-US/log_*_en-US.log @@ -1290,17 +1290,17 @@ if ! make instsetoo_native PKGFORMAT=installed EPM=not-used-but-must-be-set; the echo - ---dump log end -- languagepacks--- exit 1 fi -mkdir -p $RPM_BUILD_ROOT/%{baseinstdir} -mv $WORKDIR/installation/LibreOffice/installed/install/en-US/* $RPM_BUILD_ROOT/%{baseinstdir} +mkdir -p %{buildroot}%{baseinstdir} +mv $WORKDIR/installation/LibreOffice/installed/install/en-US/* %{buildroot}%{baseinstdir} %if %{with langpacks} for langpack in $WORKDIR/installation/LibreOffice_languagepack/installed/install/*; do [ `basename $langpack` = log ] && continue - cp -rp $langpack/* $RPM_BUILD_ROOT/%{baseinstdir} + cp -rp $langpack/* %{buildroot}%{baseinstdir} rm -rf $langpack done %endif -mv $WORKDIR/installation/LibreOffice_SDK/installed/install/en-US/sdk $RPM_BUILD_ROOT/%{sdkinstdir} -chmod -R +w $RPM_BUILD_ROOT/%{baseinstdir} +mv $WORKDIR/installation/LibreOffice_SDK/installed/install/en-US/sdk %{buildroot}%{sdkinstdir} +chmod -R +w %{buildroot}%{baseinstdir} # postprocessing and tweaks @@ -1309,10 +1309,10 @@ chmod -R +w $RPM_BUILD_ROOT/%{baseinstdir} # have no inclination to crawl through mountains of perl code to figure out # where it comes from, I am just going to replace it by a sensible # value here. -sed -i -e '/UserInstallation/s@\$ORIGIN/..@$SYSUSERCONFIG@' $RPM_BUILD_ROOT/%{baseinstdir}/program/bootstraprc +sed -i -e '/UserInstallation/s@\$ORIGIN/..@$SYSUSERCONFIG@' %{buildroot}%{baseinstdir}/program/bootstraprc #configure sdk -pushd $RPM_BUILD_ROOT/%{sdkinstdir} +pushd %{buildroot}%{sdkinstdir} sed -e "s,@OO_SDK_NAME@,sdk," \ -e "s,@OO_SDK_HOME@,%{sdkinstdir}," \ -e "s,@OFFICE_HOME@,%{baseinstdir}," \ @@ -1334,14 +1334,14 @@ pushd $RPM_BUILD_ROOT/%{sdkinstdir} popd #ensure a template dir for each lang -pushd $RPM_BUILD_ROOT/%{baseinstdir}/share/template +pushd %{buildroot}%{baseinstdir}/share/template for I in %{langpack_langs}; do mkdir -p $I done popd #Set some aliases to canonical autocorrect language files for locales with matching languages -pushd $RPM_BUILD_ROOT/%{baseinstdir}/share/autocorr +pushd %{buildroot}%{baseinstdir}/share/autocorr %make_autocorr_aliases -l en-GB en-AG en-AU en-BS en-BW en-BZ en-CA en-DK en-GH en-HK en-IE en-IN en-JM en-NG en-NZ en-SG en-TT %make_autocorr_aliases -l en-US en-PH @@ -1361,43 +1361,43 @@ rm -f acor_[a-df-z]*.dat acor_e[su]*.dat %endif popd #rhbz#484055 make these shared across multiple applications -mkdir -p $RPM_BUILD_ROOT/%{_datadir} -mv -f $RPM_BUILD_ROOT/%{baseinstdir}/share/autocorr $RPM_BUILD_ROOT/%{_datadir}/autocorr -chmod 755 $RPM_BUILD_ROOT/%{_datadir}/autocorr +mkdir -p %{buildroot}%{_datadir} +mv -f %{buildroot}%{baseinstdir}/share/autocorr %{buildroot}%{_datadir}/autocorr +chmod 755 %{buildroot}%{_datadir}/autocorr #remove it in case we didn't build with gcj -rm -f $RPM_BUILD_ROOT/%{baseinstdir}/program/classes/sandbox.jar +rm -f %{buildroot}%{baseinstdir}/program/classes/sandbox.jar #remove dummy .dat files -rm -f $RPM_BUILD_ROOT/%{baseinstdir}/program/root?.dat +rm -f %{buildroot}%{baseinstdir}/program/root?.dat #set standard permissions for rpmlint -find $RPM_BUILD_ROOT/%{baseinstdir} -exec chmod +w {} \; -find $RPM_BUILD_ROOT/%{baseinstdir} -type d -exec chmod 0755 {} \; +find %{buildroot}%{baseinstdir} -exec chmod +w {} \; +find %{buildroot}%{baseinstdir} -type d -exec chmod 0755 {} \; # move python bits into site-packages -mkdir -p $RPM_BUILD_ROOT/%{libo_python_sitearch} -pushd $RPM_BUILD_ROOT/%{libo_python_sitearch} +mkdir -p %{buildroot}%{libo_python_sitearch} +pushd %{buildroot}%{libo_python_sitearch} echo "import sys, os" > uno.py echo "sys.path.append('%{baseinstdir}/program')" >> uno.py echo "os.putenv('URE_BOOTSTRAP', 'vnd.sun.star.pathname:%{baseinstdir}/program/fundamentalrc')" >> uno.py -cat $RPM_BUILD_ROOT/%{baseinstdir}/program/uno.py >> uno.py -rm -f $RPM_BUILD_ROOT/%{baseinstdir}/program/uno.py* -mv -f $RPM_BUILD_ROOT/%{baseinstdir}/program/unohelper.py* . +cat %{buildroot}%{baseinstdir}/program/uno.py >> uno.py +rm -f %{buildroot}%{baseinstdir}/program/uno.py* +mv -f %{buildroot}%{baseinstdir}/program/unohelper.py* . popd # rhbz#477435 package opensymbol separately -pushd $RPM_BUILD_ROOT/%{baseinstdir}/share/fonts/truetype +pushd %{buildroot}%{baseinstdir}/share/fonts/truetype install -d -m 0755 %{buildroot}%{_fontdir} install -p -m 0644 *.ttf %{buildroot}%{_fontdir} popd -rm -rf $RPM_BUILD_ROOT/%{baseinstdir}/share/fonts +rm -rf %{buildroot}%{baseinstdir}/share/fonts #ensure that no sneaky un-prelinkable, un-fpic or non executable shared libs #have snuck through pic=0 executable=0 -for foo in `find $RPM_BUILD_ROOT/%{instdir} -name "*" -exec file {} \;| grep ": ELF" | cut -d: -f 1` ; do +for foo in `find %{buildroot}%{instdir} -name "*" -exec file {} \;| grep ": ELF" | cut -d: -f 1` ; do chmod +wx $foo ls -asl $foo result=`readelf -d $foo | grep TEXTREL` || true @@ -1415,51 +1415,51 @@ if [ $pic == 1 ]; then false; fi if [ $executable == 1 ]; then false; fi #make up some /usr/bin scripts -mkdir -p $RPM_BUILD_ROOT/%{_bindir} +mkdir -p %{buildroot}%{_bindir} -echo \#\!/bin/sh > $RPM_BUILD_ROOT/%{_bindir}/ooffice -echo exec libreoffice \"\$@\" >> $RPM_BUILD_ROOT/%{_bindir}/ooffice -chmod a+x $RPM_BUILD_ROOT/%{_bindir}/ooffice +echo \#\!/bin/sh > %{buildroot}%{_bindir}/ooffice +echo exec libreoffice \"\$@\" >> %{buildroot}%{_bindir}/ooffice +chmod a+x %{buildroot}%{_bindir}/ooffice -echo \#\!/bin/sh > $RPM_BUILD_ROOT/%{_bindir}/ooviewdoc -echo exec libreoffice --view \"\$@\" >> $RPM_BUILD_ROOT/%{_bindir}/ooviewdoc -chmod a+x $RPM_BUILD_ROOT/%{_bindir}/ooviewdoc +echo \#\!/bin/sh > %{buildroot}%{_bindir}/ooviewdoc +echo exec libreoffice --view \"\$@\" >> %{buildroot}%{_bindir}/ooviewdoc +chmod a+x %{buildroot}%{_bindir}/ooviewdoc -echo \#\!/bin/sh > $RPM_BUILD_ROOT/%{_bindir}/oowriter -echo exec libreoffice --writer \"\$@\" >> $RPM_BUILD_ROOT/%{_bindir}/oowriter -chmod a+x $RPM_BUILD_ROOT/%{_bindir}/oowriter +echo \#\!/bin/sh > %{buildroot}%{_bindir}/oowriter +echo exec libreoffice --writer \"\$@\" >> %{buildroot}%{_bindir}/oowriter +chmod a+x %{buildroot}%{_bindir}/oowriter -echo \#\!/bin/sh > $RPM_BUILD_ROOT/%{_bindir}/oocalc -echo exec libreoffice --calc \"\$@\" >> $RPM_BUILD_ROOT/%{_bindir}/oocalc -chmod a+x $RPM_BUILD_ROOT/%{_bindir}/oocalc +echo \#\!/bin/sh > %{buildroot}%{_bindir}/oocalc +echo exec libreoffice --calc \"\$@\" >> %{buildroot}%{_bindir}/oocalc +chmod a+x %{buildroot}%{_bindir}/oocalc -echo \#\!/bin/sh > $RPM_BUILD_ROOT/%{_bindir}/ooimpress -echo exec libreoffice --impress \"\$@\" >> $RPM_BUILD_ROOT/%{_bindir}/ooimpress -chmod a+x $RPM_BUILD_ROOT/%{_bindir}/ooimpress +echo \#\!/bin/sh > %{buildroot}%{_bindir}/ooimpress +echo exec libreoffice --impress \"\$@\" >> %{buildroot}%{_bindir}/ooimpress +chmod a+x %{buildroot}%{_bindir}/ooimpress -echo \#\!/bin/sh > $RPM_BUILD_ROOT/%{_bindir}/oodraw -echo exec libreoffice --draw \"\$@\" >> $RPM_BUILD_ROOT/%{_bindir}/oodraw -chmod a+x $RPM_BUILD_ROOT/%{_bindir}/oodraw +echo \#\!/bin/sh > %{buildroot}%{_bindir}/oodraw +echo exec libreoffice --draw \"\$@\" >> %{buildroot}%{_bindir}/oodraw +chmod a+x %{buildroot}%{_bindir}/oodraw -echo \#\!/bin/sh > $RPM_BUILD_ROOT/%{_bindir}/oomath -echo exec libreoffice --math \"\$@\" >> $RPM_BUILD_ROOT/%{_bindir}/oomath -chmod a+x $RPM_BUILD_ROOT/%{_bindir}/oomath +echo \#\!/bin/sh > %{buildroot}%{_bindir}/oomath +echo exec libreoffice --math \"\$@\" >> %{buildroot}%{_bindir}/oomath +chmod a+x %{buildroot}%{_bindir}/oomath -echo \#\!/bin/sh > $RPM_BUILD_ROOT/%{_bindir}/oobase -echo exec libreoffice --base \"\$@\" >> $RPM_BUILD_ROOT/%{_bindir}/oobase -chmod a+x $RPM_BUILD_ROOT/%{_bindir}/oobase +echo \#\!/bin/sh > %{buildroot}%{_bindir}/oobase +echo exec libreoffice --base \"\$@\" >> %{buildroot}%{_bindir}/oobase +chmod a+x %{buildroot}%{_bindir}/oobase -cp -f %{SOURCE4} $RPM_BUILD_ROOT/%{_bindir}/unopkg -sed -i -e "s/LAUNCHER/unopkg/g" $RPM_BUILD_ROOT/%{_bindir}/unopkg -sed -i -e "s/BRAND/libreoffice/g" $RPM_BUILD_ROOT/%{_bindir}/unopkg -chmod a+x $RPM_BUILD_ROOT/%{_bindir}/unopkg +cp -f %{SOURCE4} %{buildroot}%{_bindir}/unopkg +sed -i -e "s/LAUNCHER/unopkg/g" %{buildroot}%{_bindir}/unopkg +sed -i -e "s/BRAND/libreoffice/g" %{buildroot}%{_bindir}/unopkg +chmod a+x %{buildroot}%{_bindir}/unopkg -cp -f %{SOURCE4} $RPM_BUILD_ROOT/%{_bindir}/libreoffice -sed -i -e "s/LAUNCHER/soffice/g" $RPM_BUILD_ROOT/%{_bindir}/libreoffice -sed -i -e "s/BRAND/libreoffice/g" $RPM_BUILD_ROOT/%{_bindir}/libreoffice -chmod a+x $RPM_BUILD_ROOT/%{_bindir}/libreoffice +cp -f %{SOURCE4} %{buildroot}%{_bindir}/libreoffice +sed -i -e "s/LAUNCHER/soffice/g" %{buildroot}%{_bindir}/libreoffice +sed -i -e "s/BRAND/libreoffice/g" %{buildroot}%{_bindir}/libreoffice +chmod a+x %{buildroot}%{_bindir}/libreoffice -pushd $RPM_BUILD_ROOT/%{_bindir} +pushd %{buildroot}%{_bindir} # rhbz#499474 provide a /usr/bin/soffice for .recently-used.xbel ln -s %{baseinstdir}/program/soffice soffice # rhbz#499474 provide a /usr/bin/openoffice.org for backwards compat @@ -1474,7 +1474,7 @@ popd # TO-DO, remember to remove the "echo" lines # and removal of printeradmin.desktop # for LibreOffice 4.1 where this is upstreamed -pushd $RPM_BUILD_ROOT/%{baseinstdir}/share/xdg/ +pushd %{buildroot}%{baseinstdir}/share/xdg/ chmod u+w *.desktop rm -rf printeradmin.desktop ICONVERSION=`echo $PRODUCTVERSION | sed -e 's/\.//'` @@ -1492,11 +1492,11 @@ done # rhbz#156677 / rhbz#186515 do not show math and startcenter sed -i -e /NoDisplay/s/false/true/ math.desktop startcenter.desktop # relocate the .desktop and icon files -mkdir -p $RPM_BUILD_ROOT/%{_datadir}/applications +mkdir -p %{buildroot}%{_datadir}/applications for app in base calc draw impress math startcenter writer xsltfilter; do sed -i -e 's/\${UNIXBASISROOTNAME}/%{name}/' $app.desktop desktop-file-validate $app.desktop - cp -p $app.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/libreoffice-$app.desktop + cp -p $app.desktop %{buildroot}%{_datadir}/applications/libreoffice-$app.desktop done popd @@ -1507,45 +1507,45 @@ rm -rf icons/gnome applications application-registry #relocate the rest of them # rhbz#901346 512x512 icons are not used by anything for icon in `find icons -path '*/512x512' -prune -o -type f -print`; do - mkdir -p $RPM_BUILD_ROOT/%{_datadir}/`dirname $icon` - cp -p $icon $RPM_BUILD_ROOT/%{_datadir}/`echo $icon | sed -e s@libreoffice$ICONVERSION-@libreoffice-@ | sed -e s@libreoffice$PRODUCTVERSION-@libreoffice-@` + mkdir -p %{buildroot}%{_datadir}/`dirname $icon` + cp -p $icon %{buildroot}%{_datadir}/`echo $icon | sed -e s@libreoffice$ICONVERSION-@libreoffice-@ | sed -e s@libreoffice$PRODUCTVERSION-@libreoffice-@` done -mkdir -p $RPM_BUILD_ROOT/%{_datadir}/mime-info -cp -p mime-info/libreoffice$PRODUCTVERSION.keys $RPM_BUILD_ROOT/%{_datadir}/mime-info/libreoffice.keys -cp -p mime-info/libreoffice$PRODUCTVERSION.mime $RPM_BUILD_ROOT/%{_datadir}/mime-info/libreoffice.mime +mkdir -p %{buildroot}%{_datadir}/mime-info +cp -p mime-info/libreoffice$PRODUCTVERSION.keys %{buildroot}%{_datadir}/mime-info/libreoffice.keys +cp -p mime-info/libreoffice$PRODUCTVERSION.mime %{buildroot}%{_datadir}/mime-info/libreoffice.mime #add our mime-types, e.g. for .oxt extensions -mkdir -p $RPM_BUILD_ROOT/%{_datadir}/mime/packages -cp -p mime/packages/libreoffice$PRODUCTVERSION.xml $RPM_BUILD_ROOT/%{_datadir}/mime/packages/libreoffice.xml +mkdir -p %{buildroot}%{_datadir}/mime/packages +cp -p mime/packages/libreoffice$PRODUCTVERSION.xml %{buildroot}%{_datadir}/mime/packages/libreoffice.xml popd -rm -rf $RPM_BUILD_ROOT/%{baseinstdir}/readmes -rm -rf $RPM_BUILD_ROOT/%{baseinstdir}/licenses +rm -rf %{buildroot}%{baseinstdir}/readmes +rm -rf %{buildroot}%{baseinstdir}/licenses -mkdir -p $RPM_BUILD_ROOT/%{baseinstdir}/share/psprint/driver -cp -p psprint_config/configuration/ppds/SGENPRT.PS $RPM_BUILD_ROOT/%{baseinstdir}/share/psprint/driver/SGENPRT.PS +mkdir -p %{buildroot}%{baseinstdir}/share/psprint/driver +cp -p psprint_config/configuration/ppds/SGENPRT.PS %{buildroot}%{baseinstdir}/share/psprint/driver/SGENPRT.PS # rhbz#452385 to auto have postgres in classpath if subsequently installed -sed -i -e "s#URE_MORE_JAVA_CLASSPATH_URLS.*#& file:///usr/share/java/postgresql-jdbc.jar#" $RPM_BUILD_ROOT/%{baseinstdir}/program/fundamentalrc +sed -i -e "s#URE_MORE_JAVA_CLASSPATH_URLS.*#& file:///usr/share/java/postgresql-jdbc.jar#" %{buildroot}%{baseinstdir}/program/fundamentalrc # move glade catalog to system glade dir -mkdir -p $RPM_BUILD_ROOT/%{_datadir}/glade3/catalogs -mv $RPM_BUILD_ROOT/%{baseinstdir}/share/glade/libreoffice-catalog.xml $RPM_BUILD_ROOT/%{_datadir}/glade3/catalogs +mkdir -p %{buildroot}%{_datadir}/glade3/catalogs +mv %{buildroot}%{baseinstdir}/share/glade/libreoffice-catalog.xml %{buildroot}%{_datadir}/glade3/catalogs %if 0%{?fedora} # rhbz#1049543 install appdata -mkdir -p $RPM_BUILD_ROOT/%{_datadir}/appdata -cp -p sysui/desktop/appstream-appdata/*.appdata.xml $RPM_BUILD_ROOT/%{_datadir}/appdata +mkdir -p %{buildroot}%{_datadir}/appdata +cp -p sysui/desktop/appstream-appdata/*.appdata.xml %{buildroot}%{_datadir}/appdata %endif # install man pages -install -m 0755 -d $RPM_BUILD_ROOT/%{_mandir}/man1 -install -m 0644 -p sysui/desktop/man/*.1 $RPM_BUILD_ROOT/%{_mandir}/man1 +install -m 0755 -d %{buildroot}%{_mandir}/man1 +install -m 0644 -p sysui/desktop/man/*.1 %{buildroot}%{_mandir}/man1 for app in oobase oocalc oodraw ooffice ooimpress oomath ooviewdoc oowriter openoffice.org soffice; do echo '.so man1/libreoffice.1' > $app.1 - install -m 0644 -p $app.1 $RPM_BUILD_ROOT/%{_mandir}/man1 + install -m 0644 -p $app.1 %{buildroot}%{_mandir}/man1 done -export DESTDIR=$RPM_BUILD_ROOT +export DESTDIR=%{buildroot} make cmd cmd="install-gdb-printers -a %{_datadir}/gdb/auto-load%{baseinstdir} -c -i %{baseinstdir} -p %{_datadir}/libreoffice/gdb" @@ -1553,14 +1553,14 @@ make cmd cmd="install-gdb-printers -a %{_datadir}/gdb/auto-load%{baseinstdir} -c unset WITH_LANG # work around flawed accessibility check export JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY="1" -export OOO_TEST_SOFFICE=path:$RPM_BUILD_ROOT/%{baseinstdir}/program/soffice +export OOO_TEST_SOFFICE=path:%{buildroot}%{baseinstdir}/program/soffice %if 0%{?rhel} && 0%{?rhel} < 7 timeout 2h make smoketest.subsequentcheck %else timeout -k 2m 2h make smoketest.subsequentcheck %endif # we don't need this anymore -rm -f $RPM_BUILD_ROOT/%{baseinstdir}/program/classes/smoketest.jar +rm -f %{buildroot}%{baseinstdir}/program/classes/smoketest.jar %files