2013-11-21 38 views
0

創建以下bash腳本從git的URL &修訂標籤創建一個.deb軟件包:的混帳URL創建.deb文件從修訂標籤封裝

慶典:https://github.com/GlassGhost/GitDeb

我測試了它/path/to/GitDeb.sh混帳://repo.or.cz/tinycc.git TCC 0.9.26 release_0_9_26

但調用的https://github.com/GlassGhost/GitDeb/blob/d0c24db46244cc34c0cffded57903fddb290d790/GitDeb.sh

fakeroot checkinstall --install=no --pkgname="$PkgName" --pkgversion="$PkgVersion" -y -D make install 

它失敗,出現以下:

Installing with make install... 

========================= Installation results =========================== 
make -C lib native 
make[1]: Entering directory `/home/owner/Documents/GitDeb/tcc/lib' 
make[1]: Nothing to be done for `native'. 
make[1]: Leaving directory `/home/owner/Documents/GitDeb/tcc/lib' 
mkdir -p "/usr/local/bin" 
install -m755 tcc "/usr/local/bin" 
install: cannot create regular file ‘/usr/local/bin/tcc’: Permission denied 
make: *** [install] Error 1 

**** Installation failed. Aborting package creation. 
+0

你的腳本適用於我,我不明白爲什麼你會有這樣的錯誤。請在http://pastebin.com/上粘貼腳本的完整輸出,並在此處分享鏈接。 – janos

+0

@janos我在下面的答案中加入了fstrans,但仍然在該評論中出現錯誤鏈接 – GlassGhost

+1

該錯誤很容易解決,創建目錄'/ usr/local/share/doc'並重新運行腳本。如果您收到其他錯誤,請重新發布。 – janos

回答

3

checkinstall documentation建議使用--fstrans。所以使用這個標誌。

更新:我已經下載了您的repo並在lxc容器中運行您的代碼。只需加上--fstrans就可以讓我通過運行你的命令來創建一個完整的deb。

fakeroot虛假的一些文件操作,但它確實不是允許它啓動的命令來安裝需要權限的東西。這就是爲什麼需要--fstrans

ETA:命令mkdir -p "/usr/local/share/doc/tcc"可能會失敗。這是因爲目錄/usr/local/share/doc不是已經存在checkinstall啓動時。是的,-p意味着創建所有的父母,所以它應該工作,但由於某種原因,--fstrans無法處理它。解決的辦法是運行checkinstall前預先創建/usr/local/share/doc/

sudo mkdir /usr/local/share/doc 

這件事我會做手動試圖建立之前。就像我必須用apt-get手動安裝軟件包,以便構建工作。 (在腳本中添加一個檢查這個目錄的存在對於其他可能運行你的腳本的人會有幫助。)

+0

更新github與--fstrans試用它,現在我得到一個不同的錯誤。 https://gist.github.com/GlassGhost/7628249 – GlassGhost

+0

已更新的答案。 – Louis

+0

我添加了./configure --prefix =/usr,修復了我遇到的新錯誤。 https://github.com/GlassGhost/GitDeb/commit/3367429b83f2fe75e31ff976b5817a9263668aed問題標記爲已解決!!!回顧一下,我應該更多地閱讀checkinstall文檔。不敢相信我花了200代表,但真的;我認爲這是值得的。 – GlassGhost