2014-12-02 68 views
0

當我試圖在規則文件中創建一個鏈接時,它不允許我。我該如何做到這一點? 這是我做的。Debian封裝規則

#!/usr/bin/make -f 
icon = $(CURDIR)/frontpage.png 
script = $(CURDIR)/guilotinga.py 
launcher = $(CURDIR)/internation.desktop 

DEST1 = $(CURDIR)/debian/internation/usr/share/internation 
DEST2 = $(CURDIR)/debian/internation/usr/share/applications 

build: build-stamp 

build-stamp: 
    dh_testdir 
    touch build-stamp 

clean: 
    dh_testdir 
    dh_testroot 
    rm -f build-stamp 
    dh_clean 

install: build clean $(icon) $(script) $(launcher) 
    dh_testdir 
    dh_testroot 
    dh_prep 
    dh_installdirs 

    mkdir -m 755 -p $(DEST1) 
    mkdir -m 755 -p $(DEST2) 
    install -m 666 $(icon) $(DEST1) 
    install -m 777 $(script) $(DEST1) 
    install -m 777 $(launcher) $(DEST2) 
    ln -s usr/share/internation/guilotinga.py /usr/bin/internation 
    (That's where I stopped) 

上面的行給出錯誤,說我沒有足夠的權限。我的錯?

binary-indep: build install 
dh_testdir 
dh_testroot 
dh_installchangelogs 
dh_installdocs 
dh_installexamples 
dh_installman 
dh_link 
dh_compress 
dh_fixperms 
dh_installdeb 
dh_gencontrol 
dh_md5sums 
dh_builddeb 

binary-arch: build install 

binary: binary-indep binary-arch 
    .PHONY: build clean binary-indep binary-arch binary install 

回答

0

我假設你想要的是使一個符號鏈接/usr/bin/internation,並有鏈接顯示爲/usr/share/internation/guilotinga.py安裝包時。如果是這樣,你只是將鏈接命令向後。你想

ln -s /usr/bin/internation usr/share/internation/guilotinga.py 

作爲再一記,不過,在Debian軟件包的符號鏈接不應該永遠是絕對的,除非你是一個符號鏈接目錄頂層到另一個(見Debian Policy節10.5)。

對於您的情況,您可能不需要更改任何內容,因爲您在構建腳本中調用dh_link。該工具將自動修復軟件包構建區域中的不兼容符號鏈接(除非您以超古老的debhelper compat模式運行)。

但是,如果你想避免可能造成混淆的讀者(或自己),也許你應該做的

ln -s ../../bin/internation usr/share/internation/guilotinga.py