[sisyphus] q: pdfedit, qmake и $(INSTALL_ROOT)../../../../../../

Michael Shigorin =?iso-8859-1?q?mike_=CE=C1_osdn=2Eorg=2Eua?=
Пн Мар 19 01:27:55 MSK 2007


	Здравствуйте.
Возможно, это типичные грабли и кто-то знает простой ответ...

Решил попробовать собрать pdfedit, подсунув adiel@ статью
http://applications.linux.com/print.pl?sid=07/03/09/1810218
и получив положительный отзыв.

Спек пришлось рисовать с нуля, по какому собраны пакеты на
pdfedit.sf.net -- непонятно.  Собирается, но не %install'ится:

=== pdfedit.spec ===
%install
unset QTDIR || : ; . /etc/profile.d/qt3dir.sh ; PATH=$PATH:$QTDIR/bin
export INSTALL_ROOT=%buildroot
mkdir -p %buildroot
%makeinstall
install -pD -m644 %SOURCE1 %buildroot%_desktopdir/%name.desktop

(про необходимость выставления INSTALL_ROOT подсмотрено
в debian/rules, больше нигде будто не водится)


=== src/gui/Makefile ===
install_data: all
        @$(CHK_DIR_EXISTS) "$(INSTALL_ROOT)../../../../../../share/pdfedit/" || $(MKDIR) "$(INSTALL_ROOT)../../../../../../share/pdfedit/"
        -$(INSTALL_FILE) "pdfeditrc" "$(INSTALL_ROOT)../../../../../../share/pdfedit/"
        -$(INSTALL_FILE) "mode.conf" "$(INSTALL_ROOT)../../../../../../share/pdfedit/"
        -$(INSTALL_FILE) "callback.qs" "$(INSTALL_ROOT)../../../../../../share/pdfedit/"
        -$(INSTALL_FILE) "delinearize.qs" "$(INSTALL_ROOT)../../../../../../share/pdfedit/"
        -$(INSTALL_FILE) "dialog_lib.qs" "$(INSTALL_ROOT)../../../../../../share/pdfedit/"
        -$(INSTALL_FILE) "dialogs.qs" "$(INSTALL_ROOT)../../../../../../share/pdfedit/"
        -$(INSTALL_FILE) "init.qs" "$(INSTALL_ROOT)../../../../../../share/pdfedit/"
        -$(INSTALL_FILE) "init_console.qs" "$(INSTALL_ROOT)../../../../../../share/pdfedit/"
        -$(INSTALL_FILE) "menu.qs" "$(INSTALL_ROOT)../../../../../../share/pdfedit/"
        -$(INSTALL_FILE) "page.qs" "$(INSTALL_ROOT)../../../../../../share/pdfedit/"
        -$(INSTALL_FILE) "pdfoperator.qs" "$(INSTALL_ROOT)../../../../../../share/pdfedit/"
        -$(INSTALL_FILE) "test.qs" "$(INSTALL_ROOT)../../../../../../share/pdfedit/"
        -$(INSTALL_FILE) "operator.hint" "$(INSTALL_ROOT)../../../../../../share/pdfedit/"

=>

make[2]: Entering directory `/usr/src/RPM/BUILD/pdfedit-0.2.5/src/gui'
mkdir: cannot create directory `/usr/src/tmp/pdfedit-buildroot../../../../../../share': Permission denied

Вопрос очевиден: откуда бы это?

(пока похоже, что там на редкость кривая система сборки
и src/gui/Makefile порождается в процессе %makeinstall)

-- 
 ---- WBR, Michael Shigorin <mike на altlinux.ru>
  ------ Linux.Kiev http://www.linux.kiev.ua/
----------- следующая часть -----------
Name: pdfedit
Version: 0.2.5
Release: alt1

Summary: Editor for manipulating PDF documents
License: GPL
Group: File tools

Url: http://pdfedit.petricek.net
Source0: %name-%version.tar.bz2
Source1: %name.desktop
Packager: Michael Shigorin <mike на altlinux.org>

# Automatically added by buildreq on Sun Mar 18 2007
BuildRequires: boost-iostreams-devel doxygen gcc-c++ imake libXp-devel libXpm-devel libXt-devel libpaper-devel libqt3-devel t1lib-devel xorg-cf-files

%{?!_desktopdir:%define _desktopdir %_datadir/applications}

%description
Complete editing of pdf documents is made possible with PDFedit.
You can change either raw pdf objects (for advanced users) or use
predefined gui functions. Functions can be easily added as everything
is based on a scripts.

Scripting is used to a great extent in editor and almost anything can
be scripted, it is possible to create own scripts or plugins.

%prep
%setup -q

%build
unset QTDIR || : ; . /etc/profile.d/qt3dir.sh ; PATH=$PATH:$QTDIR/bin
%configure
#make_build
%make

%install
unset QTDIR || : ; . /etc/profile.d/qt3dir.sh ; PATH=$PATH:$QTDIR/bin
mkdir -p %buildroot
export INSTALL_ROOT=%buildroot
# ugly hackaround for b0rken makefile
#find src -name Makefile \
#| xargs sed -i 's,../../../../../..,%prefix,g'
##| xargs sed -i 's,\(\$(INSTALL_ROOT)\)../../../../../..,\1%prefix,g'
sed -i 's,../../../../../..,%prefix,g' src/gui/Makefile
#fgrep ../../../../../.. src/gui/Makefile ||:
%makeinstall
chmod 644 %buildroot%_datadir/%name/icon/hicolor/*
install -pD -m644 %SOURCE1 %buildroot%_desktopdir/%name.desktop

%files
%_bindir/*
%_datadir/%name/
%_desktopdir/*
%doc ChangeLog README

%changelog
* Sun Mar 18 2007 Michael Shigorin <mike на altlinux.org> 0.2.5-alt1
- built for ALT Linux
- desktop file and package description borrowed from Debian
- had to kludge down install due to "directory traversal" attempts
----------- следующая часть -----------
[Desktop Entry]
Encoding=UTF-8
Name=PDF Editor
Comment=PDF Editor
Exec=pdfedit
Icon=/usr/share/pdfedit/icon/pdfedit_logo.png
Type=Application
StartupNotify=false
Terminal=false
Categories=PDFEditor;PDFViewer;Viewer;Graphics;



Подробная информация о списке рассылки Sisyphus